Hi Leon, Jason, > -----Original Message----- > From: Leon Romanovsky <leon@xxxxxxxxxx> > Sent: Tuesday, December 18, 2018 6:29 AM > To: Doug Ledford <dledford@xxxxxxxxxx>; Jason Gunthorpe > <jgg@xxxxxxxxxxxx> > Cc: Leon Romanovsky <leonro@xxxxxxxxxxxx>; RDMA mailing list <linux- > rdma@xxxxxxxxxxxxxxx>; Parav Pandit <parav@xxxxxxxxxxxx> > Subject: [PATCH rdma-next 1/7] RDMA: Rename port_callback to port_init > > From: Parav Pandit <parav@xxxxxxxxxxxx> > > Most provider routines are callback routines which ib core invokes. > _callback suffix doesn't convey information about when such callback is > invoked. Therefore, rename port_callback to port_init. > > Additionally, store the port_init function pointer to ib_device, so that it can > be checked in subsequent patch when binding rdma device to net > namespace. Currently devices which exposes their own port specific files > cannot be bind to net namespace. Once infrastructure is built to init and > uninit the ports, this limitation will be removed. > > Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > --- > drivers/infiniband/core/core_priv.h | 4 +--- > drivers/infiniband/core/device.c | 6 ++---- > drivers/infiniband/core/sysfs.c | 6 ++---- > drivers/infiniband/hw/bnxt_re/main.c | 2 +- > drivers/infiniband/hw/cxgb3/iwch_provider.c | 2 +- > drivers/infiniband/hw/cxgb4/provider.c | 2 +- > drivers/infiniband/hw/hfi1/verbs.c | 2 +- > drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- > drivers/infiniband/hw/i40iw/i40iw_verbs.c | 2 +- > drivers/infiniband/hw/mlx4/main.c | 2 +- > drivers/infiniband/hw/mlx5/main.c | 2 +- > drivers/infiniband/hw/mthca/mthca_provider.c | 2 +- > drivers/infiniband/hw/nes/nes_verbs.c | 2 +- > drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- > drivers/infiniband/hw/qedr/main.c | 2 +- > drivers/infiniband/hw/qib/qib_verbs.c | 2 +- > drivers/infiniband/hw/usnic/usnic_ib_main.c | 2 +- > drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +- > drivers/infiniband/sw/rdmavt/vt.c | 5 ++--- > drivers/infiniband/sw/rxe/rxe_verbs.c | 2 +- > include/rdma/ib_verbs.h | 9 ++++++--- > include/rdma/rdma_vt.h | 3 --- > 22 files changed, 29 insertions(+), 36 deletions(-) > > diff --git a/drivers/infiniband/core/core_priv.h > b/drivers/infiniband/core/core_priv.h > index ef2cea6de0b6..f2da31de62c9 100644 > --- a/drivers/infiniband/core/core_priv.h > +++ b/drivers/infiniband/core/core_priv.h > @@ -61,9 +61,7 @@ extern struct rw_semaphore ib_lists_rwsem; > > extern ushort ib_devices_shared_netns; > > -int ib_device_register_sysfs(struct ib_device *device, > - int (*port_callback)(struct ib_device *, > - u8, struct kobject *)); > +int ib_device_register_sysfs(struct ib_device *device); > void ib_device_unregister_sysfs(struct ib_device *device); int > ib_device_rename(struct ib_device *ibdev, const char *name); > > diff --git a/drivers/infiniband/core/device.c > b/drivers/infiniband/core/device.c > index 68934bf14f76..6d8f3d87633c 100644 > --- a/drivers/infiniband/core/device.c > +++ b/drivers/infiniband/core/device.c > @@ -630,9 +630,7 @@ static int setup_device(struct ib_device *device) > * callback for each device that is added. @device must be allocated > * with ib_alloc_device(). > */ > -int ib_register_device(struct ib_device *device, const char *name, > - int (*port_callback)(struct ib_device *, u8, > - struct kobject *)) > +int ib_register_device(struct ib_device *device, const char *name) > { > int ret; > struct ib_client *client; > @@ -669,7 +667,7 @@ int ib_register_device(struct ib_device *device, const > char *name, > goto dev_cleanup; > } > > - ret = ib_device_register_sysfs(device, port_callback); > + ret = ib_device_register_sysfs(device); > if (ret) { > dev_warn(&device->dev, > "Couldn't register device with driver model\n"); diff - Below hunk is missing. I guess it happened during rebase time when Kamals ops series got merged first. diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 4c5c372..5aed07c 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -1379,6 +1379,7 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops) SET_DEVICE_OP(dev_ops, set_vf_guid); SET_DEVICE_OP(dev_ops, set_vf_link_state); SET_DEVICE_OP(dev_ops, unmap_fmr); + SET_DEVICE_OP(dev_ops, init_port); } It should be, after renaming it. + SET_DEVICE_OP(dev_ops, port_init);