[openib-general] Immediate data question
dotanb at dev.mellanox.co.il
Mon Feb 5 23:56:04 PST 2007
Tang, Changqing wrote:
> If I only want to send/recv 4 bytes with immediate data:
> On sender side:
> opcode = IBV_WR_SEND_WITH_IMM;
> imm_data = my_4_bytes_data;
> Do I still need to specify sg_list and num_sge ?
If the data that is being sent is only the immediate data, so no MR
should be registered in this side.
The SR will look like this:
sr.opcode = IBV_WR_SEND_WITH_IMM;
sr.imm_data = my_4_bytes_data;
sr.num_sge = 0;
> On receiver side, because the immediate data is inside the completion
> structure, do I need to post a receive for above message ?
> If I need to post a receive, do I need to specify sg_list and num_sge
> for the receive ?
In the receiver side you must post RR (because SEND opcode consumes a RR).
If you are using UD QP, you must add s/g list with 40 bytes (of
If you are not using UD QP, the s/g list in this side can be empty
(num_sge = 0) and the data that was sent will be
provided to you in wc.imm_data.
> I looked the spec but did not find useful information.
> The reason I ask is that at some point, I can not(or hard) to provide
> registered memory only for 4 bytes data.
I think that you can avoid registering those 4 bytes ...
Hope this helped you
More information about the general