[lustre-devel] [PATCH 03/42] lnet: router_discover - handle large addrs in ping

James Simmons <[email protected]>
Newsgroups org.lustre.lists.lustre-devel
Message-ID <[email protected]>
From: Mr NeilBrown <[email protected]>

lnet_router_discover_ping_reply() now considers the large
nids in the ping message.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: 2d916eec68e8a7d35 ("LU-10391 lnet: router_discover - handle large addrs in ping")
Signed-off-by: Mr NeilBrown <[email protected]>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/44631
Reviewed-by: Frank Sehr <[email protected]>
Reviewed-by: James Simmons <[email protected]>
Reviewed-by: Chris Horn <[email protected]>
Reviewed-by: Oleg Drokin <[email protected]>
Signed-off-by: James Simmons <[email protected]>
---
 net/lnet/lnet/router.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/lnet/lnet/router.c b/net/lnet/lnet/router.c
index 358c3f1fcb1c..88a5b69e1f2e 100644
--- a/net/lnet/lnet/router.c
+++ b/net/lnet/lnet/router.c
@@ -388,12 +388,13 @@ lnet_router_discovery_ping_reply(struct lnet_peer *lp,
 				 struct lnet_ping_buffer *pbuf)
 __must_hold(&the_lnet.ln_api_mutex)
 {
+	struct lnet_ping_iter piter;
 	struct lnet_peer_net *llpn;
 	struct lnet_route *route;
+	struct lnet_nid nid;
 	bool single_hop = false;
 	bool net_up = false;
-	u32 net;
-	int i;
+	u32 *stp;
 
 	if (pbuf->pb_info.pi_features & LNET_PING_FEAT_RTE_DISABLED) {
 		CERROR("Peer %s is being used as a gateway but routing feature is not turned on\n",
@@ -427,13 +428,12 @@ __must_hold(&the_lnet.ln_api_mutex)
 
 		single_hop = false;
 		net_up = false;
-		for (i = 1; i < pbuf->pb_info.pi_nnis; i++) {
-			net = LNET_NIDNET(pbuf->pb_info.pi_ni[i].ns_nid);
-
-			if (route->lr_net == net) {
+		for (stp = ping_iter_first(&piter, pbuf, &nid);
+		     stp;
+		     stp = ping_iter_next(&piter, &nid)) {
+			if (route->lr_net == LNET_NID_NET(&nid)) {
 				single_hop = true;
-				if (pbuf->pb_info.pi_ni[i].ns_status ==
-				    LNET_NI_STATUS_UP) {
+				if (*stp == LNET_NI_STATUS_UP) {
 					net_up = true;
 					break;
 				}
-- 
2.27.0

_______________________________________________
lustre-devel mailing list
[email protected]
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.