* [PATCH for-next 1/3] RDMA/cxgb3: Report phys_state in query_port
2019-07-22 7:05 [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state Kamal Heib
@ 2019-07-22 7:05 ` Kamal Heib
2019-07-22 7:05 ` [PATCH for-next 2/3] RDMA/cxgb4: " Kamal Heib
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Kamal Heib @ 2019-07-22 7:05 UTC (permalink / raw)
To: linux-rdma
Cc: Doug Ledford, Jason Gunthorpe, Potnuri Bharat Teja, Faisal Latif,
Shiraz Saleem, Kamal Heib
Add support for reporting physical state when calling query_port() via
the sysfs interface.
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
drivers/infiniband/hw/cxgb3/iwch_provider.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index e775c1a1a450..7b0b7bfc570a 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -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 =
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH for-next 2/3] RDMA/cxgb4: Report phys_state in query_port
2019-07-22 7:05 [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state Kamal Heib
2019-07-22 7:05 ` [PATCH for-next 1/3] RDMA/cxgb3: Report phys_state in query_port Kamal Heib
@ 2019-07-22 7:05 ` Kamal Heib
2019-07-22 7:05 ` [PATCH for-next 3/3] RDMA/i40iw: " Kamal Heib
2019-07-22 13:43 ` [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state Jason Gunthorpe
3 siblings, 0 replies; 8+ messages in thread
From: Kamal Heib @ 2019-07-22 7:05 UTC (permalink / raw)
To: linux-rdma
Cc: Doug Ledford, Jason Gunthorpe, Potnuri Bharat Teja, Faisal Latif,
Shiraz Saleem, Kamal Heib
Add support for reporting physical state when calling query_port() via
the sysfs interface.
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
drivers/infiniband/hw/cxgb4/provider.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index 5e59c5708729..d38c242a1693 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -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 =
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH for-next 3/3] RDMA/i40iw: Report phys_state in query_port
2019-07-22 7:05 [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state Kamal Heib
2019-07-22 7:05 ` [PATCH for-next 1/3] RDMA/cxgb3: Report phys_state in query_port Kamal Heib
2019-07-22 7:05 ` [PATCH for-next 2/3] RDMA/cxgb4: " Kamal Heib
@ 2019-07-22 7:05 ` Kamal Heib
2019-07-22 13:43 ` [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state Jason Gunthorpe
3 siblings, 0 replies; 8+ messages in thread
From: Kamal Heib @ 2019-07-22 7:05 UTC (permalink / raw)
To: linux-rdma
Cc: Doug Ledford, Jason Gunthorpe, Potnuri Bharat Teja, Faisal Latif,
Shiraz Saleem, Kamal Heib
Add support for reporting physical state when calling query_port() via
the sysfs interface.
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
drivers/infiniband/hw/i40iw/i40iw_verbs.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
index d169a8031375..c678b05bb829 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -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;
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state
2019-07-22 7:05 [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state Kamal Heib
` (2 preceding siblings ...)
2019-07-22 7:05 ` [PATCH for-next 3/3] RDMA/i40iw: " Kamal Heib
@ 2019-07-22 13:43 ` Jason Gunthorpe
2019-07-25 8:37 ` Kamal Heib
3 siblings, 1 reply; 8+ messages in thread
From: Jason Gunthorpe @ 2019-07-22 13:43 UTC (permalink / raw)
To: Kamal Heib
Cc: linux-rdma, Doug Ledford, Potnuri Bharat Teja, Faisal Latif,
Shiraz Saleem
On Mon, Jul 22, 2019 at 10:05:47AM +0300, Kamal Heib wrote:
> 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(-)
Lets not have this generic iwapr code open coded please.
The core code already knows what the netdev is for the iWarp device.
Jason
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state
2019-07-22 13:43 ` [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state Jason Gunthorpe
@ 2019-07-25 8:37 ` Kamal Heib
2019-07-25 18:47 ` Jason Gunthorpe
0 siblings, 1 reply; 8+ messages in thread
From: Kamal Heib @ 2019-07-25 8:37 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: linux-rdma, Doug Ledford, Potnuri Bharat Teja, Faisal Latif,
Shiraz Saleem
On Mon, Jul 22, 2019 at 10:43:27AM -0300, Jason Gunthorpe wrote:
> On Mon, Jul 22, 2019 at 10:05:47AM +0300, Kamal Heib wrote:
> > 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(-)
>
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state
2019-07-25 8:37 ` Kamal Heib
@ 2019-07-25 18:47 ` Jason Gunthorpe
2019-07-28 9:22 ` Kamal Heib
0 siblings, 1 reply; 8+ messages in thread
From: Jason Gunthorpe @ 2019-07-25 18:47 UTC (permalink / raw)
To: Kamal Heib
Cc: linux-rdma, Doug Ledford, Potnuri Bharat Teja, Faisal Latif,
Shiraz Saleem
On Thu, Jul 25, 2019 at 11:37:37AM +0300, Kamal Heib wrote:
> On Mon, Jul 22, 2019 at 10:43:27AM -0300, Jason Gunthorpe wrote:
> > On Mon, Jul 22, 2019 at 10:05:47AM +0300, Kamal Heib wrote:
> > > 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(-)
> >
> > 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?
Implement this in the core code if the port type is iwarp
Jason
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH for-next 0/3] {cxgb3, cxgb4, i40iw} Report phys_state
2019-07-25 18:47 ` Jason Gunthorpe
@ 2019-07-28 9:22 ` Kamal Heib
0 siblings, 0 replies; 8+ messages in thread
From: Kamal Heib @ 2019-07-28 9:22 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: linux-rdma, Doug Ledford, Potnuri Bharat Teja, Faisal Latif,
Shiraz Saleem
On Thu, Jul 25, 2019 at 03:47:44PM -0300, Jason Gunthorpe wrote:
> On Thu, Jul 25, 2019 at 11:37:37AM +0300, Kamal Heib wrote:
> > On Mon, Jul 22, 2019 at 10:43:27AM -0300, Jason Gunthorpe wrote:
> > > On Mon, Jul 22, 2019 at 10:05:47AM +0300, Kamal Heib wrote:
> > > > 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(-)
> > >
> > > 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?
>
> Implement this in the core code if the port type is iwarp
OK, I'll give it a try.
>
> Jason
^ permalink raw reply [flat|nested] 8+ messages in thread