diff mbox series

[for-rc] iw_cxgb4: report correct port speed/width

Message ID 1572001022-4533-1-git-send-email-bharat@chelsio.com (mailing list archive)
State Mainlined
Commit 5212c3fda2225af66a6a83afd9eb0a6f0c80b99c
Delegated to: Jason Gunthorpe
Headers show
Series [for-rc] iw_cxgb4: report correct port speed/width | expand

Commit Message

Potnuri Bharat Teja Oct. 25, 2019, 10:57 a.m. UTC
query speed/width from corresponding netdev.

Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
---
 drivers/infiniband/hw/cxgb4/provider.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Jason Gunthorpe Oct. 28, 2019, 5:12 p.m. UTC | #1
On Fri, Oct 25, 2019 at 04:27:02PM +0530, Potnuri Bharat Teja wrote:
> query speed/width from corresponding netdev.
> 
> Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
> ---
>  drivers/infiniband/hw/cxgb4/provider.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

This is not a -rc quality patch, so I took it to for-next

Thanks,
Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index d373ac0fe2cb..ba83d942997c 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -305,7 +305,10 @@  static int c4iw_query_device(struct ib_device *ibdev, struct ib_device_attr *pro
 static int c4iw_query_port(struct ib_device *ibdev, u8 port,
 			   struct ib_port_attr *props)
 {
+	int ret = 0;
 	pr_debug("ibdev %p\n", ibdev);
+	ret = ib_get_eth_speed(ibdev, port, &props->active_speed,
+			       &props->active_width);
 
 	props->port_cap_flags =
 	    IB_PORT_CM_SUP |
@@ -315,11 +318,9 @@  static int c4iw_query_port(struct ib_device *ibdev, u8 port,
 	    IB_PORT_VENDOR_CLASS_SUP | IB_PORT_BOOT_MGMT_SUP;
 	props->gid_tbl_len = 1;
 	props->pkey_tbl_len = 1;
-	props->active_width = 2;
-	props->active_speed = IB_SPEED_DDR;
 	props->max_msg_sz = -1;
 
-	return 0;
+	return ret;
 }
 
 static ssize_t hw_rev_show(struct device *dev,