[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240103020133.664928-1-pizhenwei@bytedance.com>
Date: Wed, 3 Jan 2024 10:01:33 +0800
From: zhenwei pi <pizhenwei@...edance.com>
To: zyjzyj2000@...il.com,
jgg@...pe.ca,
leon@...nel.org
Cc: linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org,
zhenwei pi <pizhenwei@...edance.com>
Subject: [PATCH] RDMA/rxe: Fix port state on associating netdev successfully
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@...edance.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
Powered by blists - more mailing lists