From 219cb73ead74c17930d0ed536f081463486a0ee3 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Thu, 15 Sep 2022 15:32:05 +1000 Subject: [PATCH] LU-13641 socklnd: remove remnants of tcp bonding ->ksnp_n_passive_ips is now always zero, so remove it and all uses of it. ->ksnp_passive_ips is gone too, as is ksocknal_ip2iface(). Lustre-change: https://review.whamcloud.com/48568 Lustre-commit: 3630e1eaf9db562a1de707762cd649db815459c8 Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: I5de6d027c545087c961673d8704f68c4f3dd5076 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51325 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Frank Sehr Reviewed-by: Cyril Bordage Reviewed-by: Andreas Dilger --- lnet/klnds/socklnd/socklnd.c | 71 ++++---------------------------------------- lnet/klnds/socklnd/socklnd.h | 2 -- 2 files changed, 6 insertions(+), 67 deletions(-) diff --git a/lnet/klnds/socklnd/socklnd.c b/lnet/klnds/socklnd/socklnd.c index 50098bb..3f222c2 100644 --- a/lnet/klnds/socklnd/socklnd.c +++ b/lnet/klnds/socklnd/socklnd.c @@ -45,20 +45,6 @@ static const struct lnet_lnd the_ksocklnd; struct ksock_nal_data ksocknal_data; static struct ksock_interface * -ksocknal_ip2iface(struct lnet_ni *ni, __u32 ip) -{ - struct ksock_net *net = ni->ni_data; - struct ksock_interface *iface; - - iface = &net->ksnn_interface; - - if (iface->ksni_ipaddr == ip) - return iface; - - return NULL; -} - -static struct ksock_interface * ksocknal_index2iface(struct lnet_ni *ni, int index) { struct ksock_net *net = ni->ni_data; @@ -253,26 +239,6 @@ ksocknal_find_peer(struct lnet_ni *ni, struct lnet_process_id id) static void ksocknal_unlink_peer_locked(struct ksock_peer_ni *peer_ni) { - int i; - __u32 ip; - struct ksock_interface *iface; - - for (i = 0; i < peer_ni->ksnp_n_passive_ips; i++) { - LASSERT(i < LNET_INTERFACES_NUM); - ip = peer_ni->ksnp_passive_ips[i]; - - iface = ksocknal_ip2iface(peer_ni->ksnp_ni, ip); - /* - * All IPs in peer_ni->ksnp_passive_ips[] come from the - * interface list, therefore the call must succeed. - */ - LASSERT(iface != NULL); - - CDEBUG(D_NET, "peer_ni=%p iface=%p ksni_nroutes=%d\n", - peer_ni, iface, iface->ksni_nroutes); - iface->ksni_npeers--; - } - LASSERT(list_empty(&peer_ni->ksnp_conns)); LASSERT(peer_ni->ksnp_conn_cb == NULL); LASSERT(!peer_ni->ksnp_closing); @@ -336,7 +302,6 @@ ksocknal_get_peer_info(struct lnet_ni *ni, int index, struct ksock_peer_ni *peer_ni; struct ksock_conn_cb *conn_cb; int i; - int j; int rc = -ENOENT; read_lock(&ksocknal_data.ksnd_global_lock); @@ -345,12 +310,11 @@ ksocknal_get_peer_info(struct lnet_ni *ni, int index, if (peer_ni->ksnp_ni != ni) continue; + if (index-- > 0) + continue; - if (peer_ni->ksnp_n_passive_ips == 0 && - peer_ni->ksnp_conn_cb == NULL) { - if (index-- > 0) - continue; - + conn_cb = peer_ni->ksnp_conn_cb; + if (conn_cb == NULL) { *id = peer_ni->ksnp_id; *myip = 0; *peer_ip = 0; @@ -358,31 +322,9 @@ ksocknal_get_peer_info(struct lnet_ni *ni, int index, *conn_count = 0; *share_count = 0; rc = 0; - goto out; - } - - for (j = 0; j < peer_ni->ksnp_n_passive_ips; j++) { - if (index-- > 0) - continue; - + } else { *id = peer_ni->ksnp_id; - *myip = peer_ni->ksnp_passive_ips[j]; - *peer_ip = 0; - *port = 0; - *conn_count = 0; - *share_count = 0; - rc = 0; - goto out; - } - - if (peer_ni->ksnp_conn_cb) { - if (index-- > 0) - continue; - ksocknal_dump_peer_debug_info(peer_ni); - conn_cb = peer_ni->ksnp_conn_cb; - - *id = peer_ni->ksnp_id; rc = choose_ipv4_src(myip, conn_cb->ksnr_myiface, conn_cb->ksnr_ipaddr, ni->ni_net_ns); @@ -390,10 +332,9 @@ ksocknal_get_peer_info(struct lnet_ni *ni, int index, *port = conn_cb->ksnr_port; *conn_count = conn_cb->ksnr_conn_count; *share_count = 1; - goto out; } + break; } -out: read_unlock(&ksocknal_data.ksnd_global_lock); return rc; } diff --git a/lnet/klnds/socklnd/socklnd.h b/lnet/klnds/socklnd/socklnd.h index 9bb361c..fefa0a8 100644 --- a/lnet/klnds/socklnd/socklnd.h +++ b/lnet/klnds/socklnd/socklnd.h @@ -415,8 +415,6 @@ struct ksock_peer_ni { struct list_head ksnp_zc_req_list; time64_t ksnp_send_keepalive; /* time to send keepalive */ struct lnet_ni *ksnp_ni; /* which network */ - int ksnp_n_passive_ips; /* # of... */ - __u32 ksnp_passive_ips[LNET_INTERFACES_NUM]; /* preferred local interfaces */ }; struct ksock_connreq { -- 1.8.3.1