mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhenwei pi <pizhenwei@bytedance.com>
To: zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhenwei pi <pizhenwei@bytedance.com>
Subject: [PATCH] RDMA/rxe: Fix port state on associating netdev successfully
Date: Wed,  3 Jan 2024 10:01:33 +0800	[thread overview]
Message-ID: <20240103020133.664928-1-pizhenwei@bytedance.com> (raw)

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


             reply	other threads:[~2024-01-03  2:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03  2:01 zhenwei pi [this message]
2024-01-03  6:47 ` Zhu Yanjun
2024-01-03  7:15   ` zhenwei pi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240103020133.664928-1-pizhenwei@bytedance.com \
    --to=pizhenwei@bytedance.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®