RDMA/mana_ib: Use ib_get_eth_speed for reporting port speed
Subsystems (2)
PATCH 1/1 RDMA/mana_ib: Use ib_get_eth_speed for reporting port speed
From: Shiraz Saleem <[email protected]>
Replace hardcoded IB_WIDTH_4X/IB_SPEED_EDR with ib_get_eth_speed() to report the actual link speed in mana_ib_query_port().
--- drivers/infiniband/hw/mana/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/hw/mana/main.c +1 -2
@@ -633,8 +633,7 @@ int mana_ib_query_port(struct ib_device *ibdev, u32 port, props->phys_state =IB_PORT_PHYS_STATE_DISABLED ; } - props->active_width =IB_WIDTH_4X ; - props->active_speed =IB_SPEED_EDR ; +ib_get_eth_speed (ibdev, port, &props->active_speed, &props->active_width); props->pkey_tbl_len =1 ;if (mana_ib_is_rnic (dev)) { props->gid_tbl_len =16 ;
Signature · 1 line
2.43.0
Quoted 18 lines
From: Shiraz Saleem <[email protected]>
Replace hardcoded IB_WIDTH_4X/IB_SPEED_EDR with
ib_get_eth_speed()to report the actual link speed inmana_ib_query_port().Fixes 4bda1d5332ec ("RDMA/mana_ib: Implement port parameters")Signed-off-by Shiraz Saleem <[email protected]>Signed-off-by Konstantin Taranov <[email protected]>--- drivers/infiniband/hw/mana/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/infiniband/hw/mana/main.c +0
-0
drivers/infiniband/hw/mana/main.c int mana_ib_query_port(struct ib_device *ibdev, u32 · line 638
Quoted 8 lines
drivers/infiniband/hw/mana/main.c +2
-2@@ -633,8 +633,7 @@ int mana_ib_query_port(struct ib_device *ibdev, u32 port, props->phys_state =IB_PORT_PHYS_STATE_DISABLED ; } - props->active_width =IB_WIDTH_4X ; - props->active_speed =IB_SPEED_EDR ; +ib_get_eth_speed (ibdev, port, &props->active_speed, +&props->active_width);
Should it check the return value, use default values as fallback?
Something like:
ret = ib_get_eth_speed(ibdev, port, &props->active_speed, &props->active_width);
if (ret) {
props->active_width = IB_WIDTH_4X;
props->active_speed = IB_SPEED_EDR;
}Quoted 22 lines · Long Li
Quoted 22 lines
From: Shiraz Saleem <[email protected]>
Replace hardcoded IB_WIDTH_4X/IB_SPEED_EDR with
ib_get_eth_speed()to report the actual link speed inmana_ib_query_port().Fixes 4bda1d5332ec ("RDMA/mana_ib: Implement port parameters")Signed-off-by Shiraz Saleem <[email protected]>Signed-off-by Konstantin Taranov <[email protected]>--- drivers/infiniband/hw/mana/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/infiniband/hw/mana/main.c +0
-0@@ -633,8 +633,7 @@ int mana_ib_query_port(struct ib_device *ibdev, u32 port, props->phys_state =IB_PORT_PHYS_STATE_DISABLED ; }
Quoted 6 lines
drivers/infiniband/hw/mana/main.c int mana_ib_query_port(struct ib_device *ibdev, u32 port,
Quoted 4 lines
drivers/infiniband/hw/mana/main.c +2
-2- props->active_width =IB_WIDTH_4X ; - props->active_speed =IB_SPEED_EDR ; +ib_get_eth_speed (ibdev, port, &props->active_speed, +&props->active_width);Should it check the return value, use default values as fallback?
Should it perform the check? Maybe.
Should it fall back to default values? No. A failure at this stage indicates that the driver is fundamentally broken. This is why many drivers do not bother checking the return value here.
Thanks
Quoted 9 lines
Something like:
ret = ib_get_eth_speed(ibdev, port, &props->active_speed, &props->active_width); if (ret) { props->active_width = IB_WIDTH_4X; props->active_speed = IB_SPEED_EDR; }
Konstantin Taranov
maintainerQuoted 31 lines · Long Li
Quoted 3 lines
Quoted 3 lines
From: Shiraz Saleem <[email protected]>
Replace hardcoded IB_WIDTH_4X/IB_SPEED_EDR with
ib_get_eth_speed()Quoted 19 lines
Quoted 19 lines
to report the actual link speed in
mana_ib_query_port().Fixes 4bda1d5332ec ("RDMA/mana_ib: Implement port parameters")Signed-off-by Shiraz Saleem <[email protected]>Signed-off-by Konstantin Taranov <[email protected]>--- drivers/infiniband/hw/mana/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/infiniband/hw/mana/main.c +0
-0@@ -633,8 +633,7 @@ int mana_ib_query_port(struct ib_device *ibdev,u32 port, props->phys_state = IB_PORT_PHYS_STATE_DISABLED; }Quoted 6 lines
drivers/infiniband/hw/mana/main.c int mana_ib_query_port(struct ib_device *ibdev, u32 port,
Quoted 4 lines
drivers/infiniband/hw/mana/main.c +2
-2- props->active_width =IB_WIDTH_4X ; - props->active_speed =IB_SPEED_EDR ; +ib_get_eth_speed (ibdev, port, &props->active_speed, +&props->active_width);Should it check the return value, use default values as fallback?
Quoted 5 lines
Should it perform the check? Maybe.
Should it fall back to default values? No. A failure at this stage indicates that the driver is fundamentally broken. This is why many drivers do not bother checking the return value here.
That is my understanding as well. Leon, can it be accepted as is or should I send a v2?
Thanks
Quoted 13 lines
Thanks
Quoted 10 lines
Something like:
ret = ib_get_eth_speed(ibdev, port, &props->active_speed, &props- active_width); if (ret) { props->active_width = IB_WIDTH_4X; props->active_speed = IB_SPEED_EDR; }
Quoted 11 lines · Konstantin Taranov
From: Shiraz Saleem <[email protected]>
Replace hardcoded IB_WIDTH_4X/IB_SPEED_EDR with
ib_get_eth_speed()to report the actual link speed inmana_ib_query_port().Fixes 4bda1d5332ec ("RDMA/mana_ib: Implement port parameters")Signed-off-by Shiraz Saleem <[email protected]>Signed-off-by Konstantin Taranov <[email protected]>--- drivers/infiniband/hw/mana/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Applied to for-next thanks
Jason