public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/rxe: Fix port state on associating netdev successfully
@ 2024-01-03  2:01 zhenwei pi
  2024-01-03  6:47 ` Zhu Yanjun
  0 siblings, 1 reply; 3+ messages in thread
From: zhenwei pi @ 2024-01-03  2:01 UTC (permalink / raw)
  To: zyjzyj2000, jgg, leon; +Cc: linux-rdma, linux-kernel, zhenwei pi

Originally, after adding a RXE device successfully, the RXE device
gets ready, it still reports 'PORT_DOWN' state. Set the state to
*IB_PORT_ACTIVE* once it becomes ready to access.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
 drivers/infiniband/sw/rxe/rxe_net.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index cd59666158b1..eafcb2351a7b 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -524,6 +524,7 @@ int rxe_net_add(const char *ibdev_name, struct net_device *ndev)
 {
 	int err;
 	struct rxe_dev *rxe = NULL;
+	struct rxe_port *port;
 
 	rxe = ib_alloc_device(rxe_dev, ib_dev);
 	if (!rxe)
@@ -537,6 +538,11 @@ int rxe_net_add(const char *ibdev_name, struct net_device *ndev)
 		return err;
 	}
 
+	if (netif_running(ndev) && netif_carrier_ok(ndev)) {
+		port = &rxe->port;
+		port->attr.state = IB_PORT_ACTIVE;
+	}
+
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-03  7:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-03  2:01 [PATCH] RDMA/rxe: Fix port state on associating netdev successfully zhenwei pi
2024-01-03  6:47 ` Zhu Yanjun
2024-01-03  7:15   ` zhenwei pi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox