Skip to contentSkip to conversation

{cxgb3, cxgb4, i40iw} Report phys_state

PATCH In review Kamal Heib 2 participants 8 messages Jul 22, 2019 – Jul 28, 2019

Subsystems (2)
lore
Share & tools
lore

Kamal Heib

author
#0 lore raw

cover {cxgb3, cxgb4, i40iw} Report phys_state

This series includes three patches that add the support for reporting physical state for the cxgb3, cxgb4, and i40iw drivers via sysfs.

Kamal Heib (3):
RDMA/cxgb3: Report phys_state in query_port
RDMA/cxgb4: Report phys_state in query_port
RDMA/i40iw: Report phys_state in query_port

 drivers/infiniband/hw/cxgb3/iwch_provider.c | 16 +++++++++++-----
 drivers/infiniband/hw/cxgb4/provider.c      | 16 +++++++++++-----
 drivers/infiniband/hw/i40iw/i40iw_verbs.c   |  7 +++++--
 3 files changed, 27 insertions(+), 12 deletions(-)
Signature · 1 line
2.20.1
author
#1 lore raw

PATCH 1/3 RDMA/cxgb3: Report phys_state in query_port

Add support for reporting physical state when calling query_port() via the sysfs interface.

---
 drivers/infiniband/hw/cxgb3/iwch_provider.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/infiniband/hw/cxgb3/iwch_provider.c +11 -5
index e775c1a1a450..7b0b7bfc570a 100644
@@ -1004,18 +1004,24 @@ static int iwch_query_port(struct ib_device *ibdev,
 	props->max_mtu = IB_MTU_4096;
 	props->active_mtu = ib_mtu_int_to_enum(netdev->mtu);
 
-	if (!netif_carrier_ok(netdev))
+	if (!netif_carrier_ok(netdev)) {
 		props->state = IB_PORT_DOWN;
-	else {
+		props->phys_state = 3;
+	} else {
 		inetdev = in_dev_get(netdev);
 		if (inetdev) {
-			if (inetdev->ifa_list)
+			if (inetdev->ifa_list) {
 				props->state = IB_PORT_ACTIVE;
-			else
+				props->phys_state = 5;
+			} else {
 				props->state = IB_PORT_INIT;
+				props->phys_state = 4;
+			}
 			in_dev_put(inetdev);
-		} else
+		} else {
 			props->state = IB_PORT_INIT;
+			props->phys_state = 4;
+		}
 	}
 
 	props->port_cap_flags =
Signature · 1 line
2.20.1
author
#2 lore raw

PATCH 2/3 RDMA/cxgb4: Report phys_state in query_port

In reply to Kamal Heib

Add support for reporting physical state when calling query_port() via the sysfs interface.

---
 drivers/infiniband/hw/cxgb4/provider.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/infiniband/hw/cxgb4/provider.c +11 -5
index 5e59c5708729..d38c242a1693 100644
@@ -317,18 +317,24 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port,
 	props->max_mtu = IB_MTU_4096;
 	props->active_mtu = ib_mtu_int_to_enum(netdev->mtu);
 
-	if (!netif_carrier_ok(netdev))
+	if (!netif_carrier_ok(netdev)) {
 		props->state = IB_PORT_DOWN;
-	else {
+		props->phys_state = 3;
+	} else {
 		inetdev = in_dev_get(netdev);
 		if (inetdev) {
-			if (inetdev->ifa_list)
+			if (inetdev->ifa_list) {
 				props->state = IB_PORT_ACTIVE;
-			else
+				props->phys_state = 5;
+			} else {
 				props->state = IB_PORT_INIT;
+				props->phys_state = 4;
+			}
 			in_dev_put(inetdev);
-		} else
+		} else {
 			props->state = IB_PORT_INIT;
+			props->phys_state = 4;
+		}
 	}
 
 	props->port_cap_flags =
Signature · 1 line
2.20.1
author
#3 lore raw

PATCH 3/3 RDMA/i40iw: Report phys_state in query_port

In reply to Kamal Heib

Add support for reporting physical state when calling query_port() via the sysfs interface.

---
 drivers/infiniband/hw/i40iw/i40iw_verbs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/infiniband/hw/i40iw/i40iw_verbs.c +5 -2
index d169a8031375..c678b05bb829 100644
@@ -105,10 +105,13 @@ static int i40iw_query_port(struct ib_device *ibdev,
 	props->active_mtu = ib_mtu_int_to_enum(netdev->mtu);
 
 	props->lid = 1;
-	if (netif_carrier_ok(iwdev->netdev))
+	if (netif_carrier_ok(iwdev->netdev)) {
 		props->state = IB_PORT_ACTIVE;
-	else
+		props->phys_state = 5;
+	} else {
 		props->state = IB_PORT_DOWN;
+		props->phys_state = 3;
+	}
 	props->port_cap_flags = IB_PORT_CM_SUP | IB_PORT_REINIT_SUP |
 		IB_PORT_VENDOR_CLASS_SUP | IB_PORT_BOOT_MGMT_SUP;
 	props->gid_tbl_len = 1;
Signature · 1 line
2.20.1
#4 lore raw
In reply to Kamal Heib
Quoted 8 lines · Kamal Heib

This series includes three patches that add the support for reporting physical state for the cxgb3, cxgb4, and i40iw drivers via sysfs.

Kamal Heib (3):
RDMA/cxgb3: Report phys_state in query_port
RDMA/cxgb4: Report phys_state in query_port
RDMA/i40iw: Report phys_state in query_port

Quoted 4 lines
 drivers/infiniband/hw/cxgb3/iwch_provider.c | 16 +++++++++++-----
 drivers/infiniband/hw/cxgb4/provider.c      | 16 +++++++++++-----
 drivers/infiniband/hw/i40iw/i40iw_verbs.c   |  7 +++++--
 3 files changed, 27 insertions(+), 12 deletions(-)

Lets not have this generic iwapr code open coded please.

The core code already knows what the netdev is for the iWarp device.

Jason

author
#5 lore raw
Quoted 14 lines · Jason Gunthorpe
Quoted 8 lines · Kamal Heib

This series includes three patches that add the support for reporting physical state for the cxgb3, cxgb4, and i40iw drivers via sysfs.

Kamal Heib (3):
RDMA/cxgb3: Report phys_state in query_port
RDMA/cxgb4: Report phys_state in query_port
RDMA/i40iw: Report phys_state in query_port

Quoted 4 lines
 drivers/infiniband/hw/cxgb3/iwch_provider.c | 16 +++++++++++-----
 drivers/infiniband/hw/cxgb4/provider.c      | 16 +++++++++++-----
 drivers/infiniband/hw/i40iw/i40iw_verbs.c   |  7 +++++--
 3 files changed, 27 insertions(+), 12 deletions(-)
Quoted 5 lines

Lets not have this generic iwapr code open coded please.

The core code already knows what the netdev is for the iWarp device.

Jason

I'm not sure if I truly understand what you are trying to say here.

Could you please add more info?

Thanks,
Kamal

#6 lore raw
Quoted 17 lines · Kamal Heib
Quoted 16 lines · Jason Gunthorpe
Quoted 8 lines · Kamal Heib

This series includes three patches that add the support for reporting physical state for the cxgb3, cxgb4, and i40iw drivers via sysfs.

Kamal Heib (3):
RDMA/cxgb3: Report phys_state in query_port
RDMA/cxgb4: Report phys_state in query_port
RDMA/i40iw: Report phys_state in query_port

Quoted 4 lines
 drivers/infiniband/hw/cxgb3/iwch_provider.c | 16 +++++++++++-----
 drivers/infiniband/hw/cxgb4/provider.c      | 16 +++++++++++-----
 drivers/infiniband/hw/i40iw/i40iw_verbs.c   |  7 +++++--
 3 files changed, 27 insertions(+), 12 deletions(-)

Lets not have this generic iwapr code open coded please.

Quoted 7 lines
Quoted 3 lines

The core code already knows what the netdev is for the iWarp device.

Jason

I'm not sure if I truly understand what you are trying to say here.

Could you please add more info?

Implement this in the core code if the port type is iwarp

Jason

author
#7 lore raw
Quoted 20 lines · Jason Gunthorpe
Quoted 19 lines · Kamal Heib
Quoted 18 lines · Jason Gunthorpe
Quoted 8 lines · Kamal Heib

This series includes three patches that add the support for reporting physical state for the cxgb3, cxgb4, and i40iw drivers via sysfs.

Kamal Heib (3):
RDMA/cxgb3: Report phys_state in query_port
RDMA/cxgb4: Report phys_state in query_port
RDMA/i40iw: Report phys_state in query_port

Quoted 4 lines
 drivers/infiniband/hw/cxgb3/iwch_provider.c | 16 +++++++++++-----
 drivers/infiniband/hw/cxgb4/provider.c      | 16 +++++++++++-----
 drivers/infiniband/hw/i40iw/i40iw_verbs.c   |  7 +++++--
 3 files changed, 27 insertions(+), 12 deletions(-)

Lets not have this generic iwapr code open coded please.

The core code already knows what the netdev is for the iWarp device.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Jason

I'm not sure if I truly understand what you are trying to say here.

Could you please add more info?

Implement this in the core code if the port type is iwarp

OK, I'll give it a try.

Quoted 2 lines

Jason