RDMA: Get rid of iw_cm_verbs

Integrate iw_cm_verbs data members into ib_device_ops and ib_device
structs, this is done to achieve the following:

1) Avoid memory related bugs durring error unwind
2) Make the code more cleaner
3) Reduce code duplication

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Kamal Heib
2019-04-29 14:59:06 +03:00
committed by Jason Gunthorpe
parent eb15c78b05
commit dd05cb828d
9 changed files with 98 additions and 140 deletions

View File

@@ -2221,8 +2221,6 @@ struct ib_cache {
struct ib_event_handler event_handler;
};
struct iw_cm_verbs;
struct ib_port_immutable {
int pkey_tbl_len;
int gid_tbl_len;
@@ -2304,6 +2302,8 @@ struct ib_counters_read_attr {
};
struct uverbs_attr_bundle;
struct iw_cm_id;
struct iw_cm_conn_param;
#define INIT_RDMA_OBJ_SIZE(ib_struct, drv_struct, member) \
.size_##ib_struct = \
@@ -2581,6 +2581,19 @@ struct ib_device_ops {
*/
void (*dealloc_driver)(struct ib_device *dev);
/* iWarp CM callbacks */
void (*iw_add_ref)(struct ib_qp *qp);
void (*iw_rem_ref)(struct ib_qp *qp);
struct ib_qp *(*iw_get_qp)(struct ib_device *device, int qpn);
int (*iw_connect)(struct iw_cm_id *cm_id,
struct iw_cm_conn_param *conn_param);
int (*iw_accept)(struct iw_cm_id *cm_id,
struct iw_cm_conn_param *conn_param);
int (*iw_reject)(struct iw_cm_id *cm_id, const void *pdata,
u8 pdata_len);
int (*iw_create_listen)(struct iw_cm_id *cm_id, int backlog);
int (*iw_destroy_listen)(struct iw_cm_id *cm_id);
DECLARE_RDMA_OBJ_SIZE(ib_ah);
DECLARE_RDMA_OBJ_SIZE(ib_pd);
DECLARE_RDMA_OBJ_SIZE(ib_srq);
@@ -2621,8 +2634,6 @@ struct ib_device {
int num_comp_vectors;
struct iw_cm_verbs *iwcm;
struct module *owner;
union {
struct device dev;
@@ -2675,6 +2686,10 @@ struct ib_device {
struct mutex compat_devs_mutex;
/* Maintains compat devices for each net namespace */
struct xarray compat_devs;
/* Used by iWarp CM */
char iw_ifname[IFNAMSIZ];
u32 iw_driver_flags;
};
struct ib_client {