@@ -35,7 +35,12 @@ struct ibv_sge *sg_list; /* Pointer to the s/g array */
int num_sge; /* Size of the s/g array */
enum ibv_wr_opcode opcode; /* Operation type */
int send_flags; /* Flags of the WR properties */
-uint32_t imm_data; /* Immediate data (in network byte order) */
+union {
+.in +8
+__be32 imm_data; /* Immediate data (in network byte order) */
+uint32_t invalidate_rkey; /* Remote rkey to invalidate */
+.in -8
+};
union {
.in +8
struct {
@@ -941,7 +941,13 @@ struct ibv_send_wr {
int num_sge;
enum ibv_wr_opcode opcode;
int send_flags;
- __be32 imm_data;
+ /* When opcode is *_WITH_IMM: Immediate data in network byte order.
+ * When opcode is *_INV: Stores the rkey to invalidate
+ */
+ union {
+ __be32 imm_data;
+ uint32_t invalidate_rkey;
+ };
union {
struct {
uint64_t remote_addr;
This follows the scheme of used in the wc by introducing a transparent union in ibv_send_wr to indicate the invalidate_rkey is in host endian. Fixes: 32186550 ("verbs: Add be annotations to public headers") Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> --- libibverbs/man/ibv_post_send.3 | 7 ++++++- libibverbs/verbs.h | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-)