1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-16 00:00:02 +01:00

Added extra check for inline mode. Closes

The actual maximum size for inline mode is now returned to the user and
there is a check that inline_mode is either 0 or 1. Furthermore, this
commit includes a minor improvement in ib_write()
This commit is contained in:
Dennis Potter 2018-07-14 15:20:24 +02:00
parent 1d6ee5aec8
commit 95e2a7c20b

View file

@ -116,6 +116,9 @@ static void ib_build_ibv(struct node *n)
debug(LOG_IB | 3, "Created Queue Pair with %i receive and %i send elements",
ib->qp_init.cap.max_recv_wr, ib->qp_init.cap.max_send_wr);
if (ib->conn.inline_mode)
info("Maximum inline size is set to %i byte", ib->qp_init.cap.max_inline_data);
// Allocate memory
ib->mem.p_recv.state = STATE_DESTROYED;
ib->mem.p_recv.queue.state = STATE_DESTROYED;
@ -409,6 +412,10 @@ int ib_check(struct node *n)
if (ib->qp_init.cap.max_inline_data != 0)
warn("You changed the default value of max_inline_data. This might influence the maximum number of outstanding Work Requests in the Queue Pair and can be a reason for the Queue Pair creation to fail");
// Check if inline mode is set to a valid value
if (ib->conn.inline_mode != 0 && ib->conn.inline_mode != 1)
error("inline_mode has to be set to either 0 or 1! %i is not a valid value", ib->conn.inline_mode);
info("Finished check of node %s", node_name(n));
return 0;
@ -765,7 +772,7 @@ int ib_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rele
// Check if data can be send inline
int send_inline = (sge[sent].length < ib->qp_init.cap.max_inline_data) ?
(ib->conn.inline_mode > 0) : 0;
ib->conn.inline_mode : 0;
debug(LOG_IB | 10, "Sample will be send inline [0/1]: %i", send_inline);
@ -773,12 +780,6 @@ int ib_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rele
wr[sent].wr_id = send_inline ? 0 : (uintptr_t) smps[sent]; // This way the sample can be release in WC
wr[sent].sg_list = &sge[sent];
wr[sent].num_sge = 1;
if (sent == (cnt-1)) {
debug(LOG_IB | 10, "Prepared %i send Work Requests", (sent+1));
wr[sent].next = NULL;
}
else
wr[sent].next = &wr[sent+1];
wr[sent].send_flags = IBV_SEND_SIGNALED | (send_inline << 3);
@ -786,6 +787,9 @@ int ib_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rele
wr[sent].opcode = IBV_WR_SEND_WITH_IMM;
}
debug(LOG_IB | 10, "Prepared %i send Work Requests", cnt);
wr[cnt-1].next = NULL;
// Send linked list of Work Requests
ret = ibv_post_send(ib->ctx.id->qp, wr, &bad_wr);
debug(LOG_IB | 4, "Posted send Work Requests");