[openib-general] PATCH creation of ib_verbs.c file
Sean Hefty
mshefty at ichips.intel.com
Tue Aug 31 08:45:58 PDT 2004
On Tue, 31 Aug 2004 07:39:17 -0400
Hal Rosenstock <halr at voltaire.com> wrote:
> For all the functions moved to ib_verbs.c, can (just) their definitions
> be added back in to ib_verbs.h ?
Here's a patch to include all definitions in ib_verbs.h. I also renamed ib_free_fmr to ib_dealloc_fmr based on comments from Roland.
- Sean
Index: ib_verbs.h
===================================================================
--- ib_verbs.h (revision 700)
+++ ib_verbs.h (working copy)
@@ -708,7 +708,7 @@
struct ib_phys_buf *phys_buf_array,
int num_phys_buf);
int (*unmap_fmr)(struct ib_fmr **fmr_array, int fmr_cnt);
- int (*free_fmr)(struct ib_fmr *fmr);
+ int (*dealloc_fmr)(struct ib_fmr *fmr);
int (*attach_mcast)(struct ib_qp *qp, union ib_gid *gid,
u16 lid);
int (*detach_mcast)(struct ib_qp *qp, union ib_gid *gid,
@@ -780,6 +780,13 @@
port_modify);
}
+struct ib_pd *ib_alloc_pd(struct ib_device *device);
+
+int ib_dealloc_pd(struct ib_pd *pd);
+
+struct ib_ah *ib_create_ah(struct ib_pd *pd,
+ struct ib_ah_attr *ah_attr);
+
static inline int ib_modify_ah(struct ib_ah *ah,
struct ib_ah_attr *ah_attr)
{
@@ -792,6 +799,12 @@
return ah->device->query_ah(ah, ah_attr);
}
+int ib_destroy_ah(struct ib_ah *ah);
+
+struct ib_qp *ib_create_qp(struct ib_pd *pd,
+ struct ib_qp_init_attr *qp_init_attr,
+ struct ib_qp_cap *qp_cap);
+
static inline int ib_modify_qp(struct ib_qp *qp,
struct ib_qp_attr *qp_attr,
int qp_attr_mask,
@@ -808,6 +821,12 @@
return qp->device->query_qp(qp, qp_attr, qp_attr_mask, qp_init_attr);
}
+int ib_destroy_qp(struct ib_qp *qp);
+
+struct ib_srq *ib_create_srq(struct ib_pd *pd,
+ void *srq_context,
+ struct ib_srq_attr *srq_attr);
+
static inline int ib_query_srq(struct ib_srq *srq,
struct ib_srq_attr *srq_attr)
{
@@ -829,18 +848,45 @@
return srq->device->post_srq(srq, recv_wr, bad_recv_wr);
}
+int ib_destroy_srq(struct ib_srq *srq);
+
+struct ib_cq *ib_create_cq(struct ib_device *device,
+ ib_comp_handler comp_handler,
+ void *cq_context,
+ int cqe);
+
static inline int ib_resize_cq(struct ib_cq *cq,
int cqe)
{
return cq->device->resize_cq(cq, cqe);
}
+int ib_destroy_cq(struct ib_cq *cq);
+
+struct ib_mr *ib_reg_phys_mr(struct ib_pd *pd,
+ struct ib_phys_buf *phys_buf_array,
+ int num_phys_buf,
+ int mr_access_flags,
+ u64 *iova_start);
+
static inline int ib_query_mr(struct ib_mr *mr,
struct ib_mr_attr *mr_attr)
{
return mr->device->query_mr(mr, mr_attr);
}
+int ib_dereg_mr(struct ib_mr *mr);
+
+int ib_rereg_phys_mr(struct ib_mr *mr,
+ int mr_rereg_mask,
+ struct ib_pd *pd,
+ struct ib_phys_buf *phys_buf_array,
+ int num_phys_buf,
+ int mr_access_flags,
+ u64 *iova_start);
+
+struct ib_mw *ib_alloc_mw(struct ib_pd *pd);
+
static inline int ib_bind_mw(struct ib_qp *qp,
struct ib_mw *mw,
struct ib_mw_bind *mw_bind)
@@ -848,6 +894,12 @@
return mw->device->bind_mw(qp, mw, mw_bind);
}
+int ib_dealloc_mw(struct ib_mw *mw);
+
+struct ib_fmr *ib_alloc_fmr(struct ib_pd *pd,
+ int mr_access_flags,
+ struct ib_fmr_attr *fmr_attr);
+
static inline int ib_map_fmr(struct ib_fmr *fmr,
void *addr,
u64 size)
@@ -862,6 +914,8 @@
return fmr_array[0]->device->unmap_fmr(fmr_array, fmr_cnt);
}
+int ib_dealloc_fmr(struct ib_fmr *fmr);
+
static inline int ib_attach_mcast(struct ib_qp *qp,
union ib_gid *gid,
u16 lid)
Index: ib_verbs.c
===================================================================
--- ib_verbs.c (revision 700)
+++ ib_verbs.c (working copy)
@@ -322,17 +322,17 @@
}
EXPORT_SYMBOL(ib_alloc_fmr);
-int ib_free_fmr(struct ib_fmr *fmr)
+int ib_dealloc_fmr(struct ib_fmr *fmr)
{
struct ib_pd *pd;
int ret;
pd = fmr->pd;
- ret = fmr->device->free_fmr(fmr);
+ ret = fmr->device->dealloc_fmr(fmr);
if (!ret)
atomic_dec(&pd->usecnt);
return ret;
}
-EXPORT_SYMBOL(ib_free_fmr);
+EXPORT_SYMBOL(ib_dealloc_fmr);
More information about the general
mailing list