Skip to content

Commit b60b9c0

Browse files
rpearsonhpe-designjgunthorpe
authored andcommitted
RDMA/core: Added missing WR and WC opcodes
Add work completion opcodes to a new ib_uverbs_wc_opcode enum in ib_user_verbs.h. This plays the same role as ib_uverbs_wr_opcode documenting the opcodes in the user space API. Assigned the IB_WC_XXX opcodes in ib_verbs.h to the IB_UVERBS_WC_XXX where they are defined. This follows the same pattern as the IB_WR_XXX opcodes. This fixes an incorrect value for LSO that had crept in but is not currently being used. Added a missing IB_WR_BIND_MW opcode in ib_verbs.h. Link: https://lore.kernel.org/r/20200903224039.437391-2-rpearson@hpe.com Signed-off-by: Bob Pearson <rpearson@hpe.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 1d4299e commit b60b9c0

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

‎include/rdma/ib_verbs.h‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -952,13 +952,14 @@ enum ib_wc_status {
952952
const char *__attribute_const__ ib_wc_status_msg(enum ib_wc_status status);
953953

954954
enum ib_wc_opcode {
955-
IB_WC_SEND,
956-
IB_WC_RDMA_WRITE,
957-
IB_WC_RDMA_READ,
958-
IB_WC_COMP_SWAP,
959-
IB_WC_FETCH_ADD,
960-
IB_WC_LSO,
961-
IB_WC_LOCAL_INV,
955+
IB_WC_SEND = IB_UVERBS_WC_SEND,
956+
IB_WC_RDMA_WRITE = IB_UVERBS_WC_RDMA_WRITE,
957+
IB_WC_RDMA_READ = IB_UVERBS_WC_RDMA_READ,
958+
IB_WC_COMP_SWAP = IB_UVERBS_WC_COMP_SWAP,
959+
IB_WC_FETCH_ADD = IB_UVERBS_WC_FETCH_ADD,
960+
IB_WC_BIND_MW = IB_UVERBS_WC_BIND_MW,
961+
IB_WC_LOCAL_INV = IB_UVERBS_WC_LOCAL_INV,
962+
IB_WC_LSO = IB_UVERBS_WC_TSO,
962963
IB_WC_REG_MR,
963964
IB_WC_MASKED_COMP_SWAP,
964965
IB_WC_MASKED_FETCH_ADD,
@@ -1291,6 +1292,7 @@ enum ib_wr_opcode {
12911292
IB_WR_RDMA_READ = IB_UVERBS_WR_RDMA_READ,
12921293
IB_WR_ATOMIC_CMP_AND_SWP = IB_UVERBS_WR_ATOMIC_CMP_AND_SWP,
12931294
IB_WR_ATOMIC_FETCH_AND_ADD = IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD,
1295+
IB_WR_BIND_MW = IB_UVERBS_WR_BIND_MW,
12941296
IB_WR_LSO = IB_UVERBS_WR_TSO,
12951297
IB_WR_SEND_WITH_INV = IB_UVERBS_WR_SEND_WITH_INV,
12961298
IB_WR_RDMA_READ_WITH_INV = IB_UVERBS_WR_RDMA_READ_WITH_INV,

‎include/uapi/rdma/ib_user_verbs.h‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,17 @@ struct ib_uverbs_poll_cq {
457457
__u32 ne;
458458
};
459459

460+
enum ib_uverbs_wc_opcode {
461+
IB_UVERBS_WC_SEND = 0,
462+
IB_UVERBS_WC_RDMA_WRITE = 1,
463+
IB_UVERBS_WC_RDMA_READ = 2,
464+
IB_UVERBS_WC_COMP_SWAP = 3,
465+
IB_UVERBS_WC_FETCH_ADD = 4,
466+
IB_UVERBS_WC_BIND_MW = 5,
467+
IB_UVERBS_WC_LOCAL_INV = 6,
468+
IB_UVERBS_WC_TSO = 7,
469+
};
470+
460471
struct ib_uverbs_wc {
461472
__aligned_u64 wr_id;
462473
__u32 status;

0 commit comments

Comments
 (0)