RDMA/iRDMA: Cleanups and improvements
Subsystems (2)
cover RDMA/iRDMA: Cleanups and improvements
This series includes a few cleanup patches for the iRDMA driver.
Kamal Heib (3):
RDMA/iRDMA: Return void from irdma_init_iw_device() RDMA/iRDMA: Return void from irdma_init_rdma_device() RDMA/iRDMA: Move iw device ops initialization
drivers/infiniband/hw/irdma/verbs.c | 35 +++++++++++------------------ 1 file changed, 13 insertions(+), 22 deletions(-)
Signature · 1 line
2.40.1
PATCH 1/3 RDMA/iRDMA: Return void from irdma_init_iw_device()
The return value from irdma_init_iw_device() is always 0 - change it to be void.
--- drivers/infiniband/hw/irdma/verbs.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/infiniband/hw/irdma/verbs.c +2 -7
@@ -4515,7 +4515,7 @@ static void irdma_init_roce_device(struct irdma_device *iwdev)* irdma_init_iw_device - initialization of iwarp rdma device * @iwdev: irdma device */ -static int irdma_init_iw_device (struct irdma_device *iwdev) +static void irdma_init_iw_device (struct irdma_device *iwdev) {struct net_device *netdev = iwdev->netdev;
@@ -4533,8 +4533,6 @@ static int irdma_init_iw_device(struct irdma_device *iwdev)memcpy (iwdev->ibdev.iw_ifname, netdev->name,sizeof (iwdev->ibdev.iw_ifname));ib_set_device_ops (&iwdev->ibdev, &irdma_iw_dev_ops); - -return 0 ; }/**
@@ -4544,14 +4542,11 @@ static int irdma_init_iw_device(struct irdma_device *iwdev)static int irdma_init_rdma_device (struct irdma_device *iwdev) {struct pci_dev *pcidev = iwdev->rf->pcidev; -int ret;if (iwdev->roce_mode) {irdma_init_roce_device (iwdev); }else { - ret =irdma_init_iw_device (iwdev); -if (ret) -return ret; +irdma_init_iw_device (iwdev); } iwdev->ibdev.phys_port_cnt =1 ; iwdev->ibdev.num_comp_vectors = iwdev->rf->ceqs_count;
Signature · 1 line
2.40.1
PATCH 2/3 RDMA/iRDMA: Return void from irdma_init_rdma_device()
The return value from irdma_init_rdma_device() is always 0 - change it to be void.
--- drivers/infiniband/hw/irdma/verbs.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/infiniband/hw/irdma/verbs.c +2 -6
@@ -4539,7 +4539,7 @@ static void irdma_init_iw_device(struct irdma_device *iwdev)* irdma_init_rdma_device - initialization of rdma device * @iwdev: irdma device */ -static int irdma_init_rdma_device (struct irdma_device *iwdev) +static void irdma_init_rdma_device (struct irdma_device *iwdev) {struct pci_dev *pcidev = iwdev->rf->pcidev;
@@ -4552,8 +4552,6 @@ static int irdma_init_rdma_device(struct irdma_device *iwdev) iwdev->ibdev.num_comp_vectors = iwdev->rf->ceqs_count; iwdev->ibdev.dev.parent = &pcidev->dev;ib_set_device_ops (&iwdev->ibdev, &irdma_dev_ops); - -return 0 ; }/**
@@ -4591,9 +4589,7 @@ int irdma_ib_register_device(struct irdma_device *iwdev) {int ret; - ret =irdma_init_rdma_device (iwdev); -if (ret) -return ret; +irdma_init_rdma_device (iwdev); ret =ib_device_set_netdev (&iwdev->ibdev, iwdev->netdev,1 );if (ret)
Signature · 1 line
2.40.1
PATCH 3/3 RDMA/iRDMA: Move iw device ops initialization
Move the initialization of the iw device ops to be under the declaration of the irdma_iw_dev_ops.
--- drivers/infiniband/hw/irdma/verbs.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/infiniband/hw/irdma/verbs.c +9 -9
@@ -4450,8 +4450,16 @@ static const struct ib_device_ops irdma_roce_dev_ops = { };static const struct ib_device_ops irdma_iw_dev_ops = { - .modify_qp = irdma_modify_qp, .get_port_immutable = irdma_iw_port_immutable, + .iw_accept = irdma_accept, + .iw_add_ref = irdma_qp_add_ref, + .iw_connect = irdma_connect, + .iw_create_listen = irdma_create_listen, + .iw_destroy_listen = irdma_destroy_listen, + .iw_get_qp = irdma_get_qp, + .iw_reject = irdma_reject, + .iw_rem_ref = irdma_qp_rem_ref, + .modify_qp = irdma_modify_qp, .query_gid = irdma_query_gid, };
@@ -4522,14 +4530,6 @@ static void irdma_init_iw_device(struct irdma_device *iwdev) iwdev->ibdev.node_type =RDMA_NODE_RNIC ;addrconf_addr_eui48 ((u8 *)&iwdev->ibdev.node_guid, netdev->dev_addr); - iwdev->ibdev.ops.iw_add_ref = irdma_qp_add_ref; - iwdev->ibdev.ops.iw_rem_ref = irdma_qp_rem_ref; - iwdev->ibdev.ops.iw_get_qp = irdma_get_qp; - iwdev->ibdev.ops.iw_connect = irdma_connect; - iwdev->ibdev.ops.iw_accept = irdma_accept; - iwdev->ibdev.ops.iw_reject = irdma_reject; - iwdev->ibdev.ops.iw_create_listen = irdma_create_listen; - iwdev->ibdev.ops.iw_destroy_listen = irdma_destroy_listen;memcpy (iwdev->ibdev.iw_ifname, netdev->name,sizeof (iwdev->ibdev.iw_ifname));ib_set_device_ops (&iwdev->ibdev, &irdma_iw_dev_ops);
Signature · 1 line
2.40.1
RE: [PATCH 1/3] RDMA/iRDMA: Return void from irdma_init_iw_device()
In reply to Kamal HeibQuoted 36 lines
Subject: [PATCH 1/3] RDMA/iRDMA: Return void from
irdma_init_iw_device()The return value from
irdma_init_iw_device()is always 0 - change it to be void.Signed-off-by Kamal Heib <[email protected]>--- drivers/infiniband/hw/irdma/verbs.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/infiniband/hw/irdma/verbs.c +1
-3@@ -4515,7 +4515,7 @@ static void irdma_init_roce_device(struct irdma_device*iwdev) * irdma_init_iw_device - initialization of iwarp rdma device * @iwdev: irdma device */ -static int irdma_init_iw_device (struct irdma_device *iwdev) +static void irdma_init_iw_device (struct irdma_device *iwdev) {struct net_device *netdev = iwdev->netdev;@@ -4533,8 +4533,6 @@ static int irdma_init_iw_device(struct irdma_device *iwdev)memcpy (iwdev->ibdev.iw_ifname, netdev->name,sizeof (iwdev->ibdev.iw_ifname));ib_set_device_ops (&iwdev->ibdev, &irdma_iw_dev_ops); - -return 0 ; }/**
drivers/infiniband/hw/irdma/verbs.c +0
-0@@ -4544,14 +4542,11 @@ static int irdma_init_iw_device(struct irdma_device *iwdev) static int irdma_init_rdma_device(struct irdma_device *iwdev) {struct pci_dev *pcidev = iwdev->rf->pcidev;
drivers/infiniband/hw/irdma/verbs.c static int irdma_init_iw_device(struct irdma_device · line 4549
Quoted 10 lines
drivers/infiniband/hw/irdma/verbs.c +1
-4-int ret;if (iwdev->roce_mode) {irdma_init_roce_device (iwdev); }else { - ret =irdma_init_iw_device (iwdev); -if (ret) -return ret; +irdma_init_iw_device (iwdev); }
checkpatch doesn't complain here? This becomes a single statement if/else now. No {} required.
Quoted 4 lines
drivers/infiniband/hw/irdma/verbs.c +0
-1iwdev->ibdev.phys_port_cnt =1 ; iwdev->ibdev.num_comp_vectors = iwdev->rf->ceqs_count; --2.40.1
Re: [PATCH 1/3] RDMA/iRDMA: Return void from irdma_init_iw_device()
Quoted 38 lines · Shiraz
Quoted 38 lines
Subject: [PATCH 1/3] RDMA/iRDMA: Return void from
irdma_init_iw_device()The return value from
irdma_init_iw_device()is always 0 - change it to be void.Signed-off-by Kamal Heib <[email protected]>--- drivers/infiniband/hw/irdma/verbs.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/infiniband/hw/irdma/verbs.c +1
-3@@ -4515,7 +4515,7 @@ static void irdma_init_roce_device(struct irdma_device*iwdev) * irdma_init_iw_device - initialization of iwarp rdma device * @iwdev: irdma device */ -static int irdma_init_iw_device (struct irdma_device *iwdev) +static void irdma_init_iw_device (struct irdma_device *iwdev) {struct net_device *netdev = iwdev->netdev;@@ -4533,8 +4533,6 @@ static int irdma_init_iw_device(struct irdma_device *iwdev)memcpy (iwdev->ibdev.iw_ifname, netdev->name,sizeof (iwdev->ibdev.iw_ifname));ib_set_device_ops (&iwdev->ibdev, &irdma_iw_dev_ops); - -return 0 ; }/**
drivers/infiniband/hw/irdma/verbs.c +0
-1@@ -4544,14 +4542,11 @@ static int irdma_init_iw_device(struct irdma_device *iwdev) static int irdma_init_rdma_device(struct irdma_device *iwdev) {struct pci_dev *pcidev = iwdev->rf->pcidev; -int ret;
Quoted 11 lines
drivers/infiniband/hw/irdma/verbs.c static int irdma_init_iw_device(struct irdma_device *iwdev) · line 4550
Quoted 8 lines
drivers/infiniband/hw/irdma/verbs.c +1
-3if (iwdev->roce_mode) {irdma_init_roce_device (iwdev); }else { - ret =irdma_init_iw_device (iwdev); -if (ret) -return ret; +irdma_init_iw_device (iwdev); }checkpatch doesn't complain here? This becomes a single statement if/else now. No {} required.
It complains when running it over the file, fixed in v2.
Thanks,
Kamal
Quoted 5 lines
Quoted 4 lines
drivers/infiniband/hw/irdma/verbs.c +0
-1iwdev->ibdev.phys_port_cnt =1 ; iwdev->ibdev.num_comp_vectors = iwdev->rf->ceqs_count; --2.40.1
Quoted 4 lines
Subject: [PATCH 0/3] RDMA/iRDMA: Cleanups and improvements
This series includes a few cleanup patches for the iRDMA driver.
Quoted 8 lines
Kamal Heib (3):
RDMA/iRDMA: Return void fromirdma_init_iw_device()RDMA/iRDMA: Return void fromirdma_init_rdma_device()RDMA/iRDMA: Move iw device ops initializationdrivers/infiniband/hw/irdma/verbs.c | 35 +++++++++++------------------ 1 file changed, 13 insertions(+), 22 deletions(-)
Thanks! some minor nits.
RDMA/iRDMA --> RDMA/irdma in subject line for the patches.
Quoted 9 lines · Shiraz
Quoted 9 lines
Subject: [PATCH 0/3] RDMA/iRDMA: Cleanups and improvements
This series includes a few cleanup patches for the iRDMA driver.
Kamal Heib (3):
RDMA/iRDMA: Return void fromirdma_init_iw_device()RDMA/iRDMA: Return void fromirdma_init_rdma_device()RDMA/iRDMA: Move iw device ops initialization
Quoted 8 lines
Quoted 3 lines
drivers/infiniband/hw/irdma/verbs.c | 35 +++++++++++------------------ 1 file changed, 13 insertions(+), 22 deletions(-)Thanks! some minor nits.
RDMA/iRDMA --> RDMA/irdma in subject line for the patches.
Thank you, The subject is fixed in v2.
Quoted 2 lines
Reviewed-by Shiraz Saleem <[email protected]>