Skip to content

Commit 0134f16

Browse files
Jack Morgensteinrolandd
Jack Morgenstein
authored andcommitted
IB/core: Add reserved values to enums for low-level driver use
Continue the approach taken by commit d2b5706 ("IB/core: Reserve bits in enum ib_qp_create_flags for low-level driver use") and add reserved entries to the ib_qp_type and ib_wr_opcode enums. Low-level drivers can then define macros to use these reserved values, giving proper names to the macros for readability. Also add a range of reserved flags to enum ib_send_flags. The mlx5 IB driver uses the new additions. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <roland@purestorage.com>
1 parent fedaf4f commit 0134f16

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

include/rdma/ib_verbs.h

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,21 @@ enum ib_qp_type {
610610
IB_QPT_RAW_PACKET = 8,
611611
IB_QPT_XRC_INI = 9,
612612
IB_QPT_XRC_TGT,
613-
IB_QPT_MAX
613+
IB_QPT_MAX,
614+
/* Reserve a range for qp types internal to the low level driver.
615+
* These qp types will not be visible at the IB core layer, so the
616+
* IB_QPT_MAX usages should not be affected in the core layer
617+
*/
618+
IB_QPT_RESERVED1 = 0x1000,
619+
IB_QPT_RESERVED2,
620+
IB_QPT_RESERVED3,
621+
IB_QPT_RESERVED4,
622+
IB_QPT_RESERVED5,
623+
IB_QPT_RESERVED6,
624+
IB_QPT_RESERVED7,
625+
IB_QPT_RESERVED8,
626+
IB_QPT_RESERVED9,
627+
IB_QPT_RESERVED10,
614628
};
615629

616630
enum ib_qp_create_flags {
@@ -766,14 +780,31 @@ enum ib_wr_opcode {
766780
IB_WR_MASKED_ATOMIC_CMP_AND_SWP,
767781
IB_WR_MASKED_ATOMIC_FETCH_AND_ADD,
768782
IB_WR_BIND_MW,
783+
/* reserve values for low level drivers' internal use.
784+
* These values will not be used at all in the ib core layer.
785+
*/
786+
IB_WR_RESERVED1 = 0xf0,
787+
IB_WR_RESERVED2,
788+
IB_WR_RESERVED3,
789+
IB_WR_RESERVED4,
790+
IB_WR_RESERVED5,
791+
IB_WR_RESERVED6,
792+
IB_WR_RESERVED7,
793+
IB_WR_RESERVED8,
794+
IB_WR_RESERVED9,
795+
IB_WR_RESERVED10,
769796
};
770797

771798
enum ib_send_flags {
772799
IB_SEND_FENCE = 1,
773800
IB_SEND_SIGNALED = (1<<1),
774801
IB_SEND_SOLICITED = (1<<2),
775802
IB_SEND_INLINE = (1<<3),
776-
IB_SEND_IP_CSUM = (1<<4)
803+
IB_SEND_IP_CSUM = (1<<4),
804+
805+
/* reserve bits 26-31 for low level drivers' internal use */
806+
IB_SEND_RESERVED_START = (1 << 26),
807+
IB_SEND_RESERVED_END = (1 << 31),
777808
};
778809

779810
struct ib_sge {

0 commit comments

Comments
 (0)