]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
libibverbs: Support older providers that do not support extensions
authorSean Hefty <sean.hefty@intel.com>
Wed, 12 Sep 2012 18:32:27 +0000 (11:32 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 12 Sep 2012 18:32:27 +0000 (11:32 -0700)
Provide a compatibility layer for providers that do not support
extended structures.  Since the providers may have been built
against an older verbs header, we need to map between the larger
structured exported by verbs and the smaller ones allocated by
the provider.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
include/infiniband/verbs.h

index a2577d87ddc9a86973367675f546ffc8eb6e836e..40bb4e66734c3a55e43a846ed69a59ddfc368d0d 100644 (file)
@@ -307,9 +307,14 @@ enum ibv_access_flags {
        IBV_ACCESS_MW_BIND              = (1<<4)
 };
 
+enum ibv_pd_mask {
+       IBV_PD_RESERVED                 = 1 << 0
+};
+
 struct ibv_pd {
        struct ibv_context     *context;
        uint32_t                handle;
+       uint32_t                comp_mask;
 };
 
 enum ibv_rereg_mr_flags {
@@ -319,6 +324,10 @@ enum ibv_rereg_mr_flags {
        IBV_REREG_MR_KEEP_VALID         = (1 << 3)
 };
 
+enum ibv_mr_mask {
+       IBV_MR_RESERVED                 = 1 << 0
+};
+
 struct ibv_mr {
        struct ibv_context     *context;
        struct ibv_pd          *pd;
@@ -327,6 +336,7 @@ struct ibv_mr {
        uint32_t                handle;
        uint32_t                lkey;
        uint32_t                rkey;
+       uint32_t                comp_mask;
 };
 
 enum ibv_mw_type {
@@ -334,10 +344,15 @@ enum ibv_mw_type {
        IBV_MW_TYPE_2                   = 2
 };
 
+enum ibv_mw_mask {
+       IBV_MW_RESERVED                 = 1 << 0
+};
+
 struct ibv_mw {
        struct ibv_context     *context;
        struct ibv_pd          *pd;
        uint32_t                rkey;
+       uint32_t                comp_mask;
 };
 
 struct ibv_global_route {
@@ -568,6 +583,10 @@ struct ibv_mw_bind {
        int                     mw_access_flags;
 };
 
+enum ibv_srq_mask {
+       IBV_SRQ_RESERVED                = 1 << 0
+};
+
 struct ibv_srq {
        struct ibv_context     *context;
        void                   *srq_context;
@@ -577,6 +596,12 @@ struct ibv_srq {
        pthread_mutex_t         mutex;
        pthread_cond_t          cond;
        uint32_t                events_completed;
+
+       uint32_t                comp_mask;
+};
+
+enum ibv_qp_mask {
+       IBV_QP_RESERVED                 = 1 << 0
 };
 
 struct ibv_qp {
@@ -594,12 +619,24 @@ struct ibv_qp {
        pthread_mutex_t         mutex;
        pthread_cond_t          cond;
        uint32_t                events_completed;
+
+       uint32_t                comp_mask;
+};
+
+enum ibv_comp_channel_mask {
+       IBV_COMP_CHANNEL_RESERVED       = 1 << 0
 };
 
 struct ibv_comp_channel {
        struct ibv_context     *context;
        int                     fd;
        int                     refcnt;
+
+       uint32_t                comp_mask;
+};
+
+enum ibv_cq_mask {
+       IBV_CQ_RESERVED                 = 1 << 0
 };
 
 struct ibv_cq {
@@ -613,12 +650,20 @@ struct ibv_cq {
        pthread_cond_t          cond;
        uint32_t                comp_events_completed;
        uint32_t                async_events_completed;
+
+       uint32_t                comp_mask;
+};
+
+enum ibv_ah_mask {
+       IBV_AH_RESERVED                 = 1 << 0
 };
 
 struct ibv_ah {
        struct ibv_context     *context;
        struct ibv_pd          *pd;
        uint32_t                handle;
+
+       uint32_t                comp_mask;
 };
 
 struct ibv_device;