From: James Simmons <jsimmons@infradead.org>
To: Eric Biggers <ebiggers@google.com>,
Andreas Dilger <adilger@whamcloud.com>, NeilBrown <neilb@suse.de>
Cc: linux-fscrypt@vger.kernel.org, James Simmons <jsimmons@infradead.org>
Subject: [PATCH 12/18] lnet: socklnd: switch ksocknal_del_peer to lnet_processid
Date: Thu, 9 Jun 2022 08:33:08 -0400 [thread overview]
Message-ID: <1654777994-29806-13-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1654777994-29806-1-git-send-email-jsimmons@infradead.org>
From: Mr NeilBrown <neilb@suse.de>
ksocknal_del_peer now takes a pointer to a lnet_processid,
with room for a large address.
A NULL means "ANY NID, AND PID".
The "ip" argument was completely unused, so has been removed.
This was the last use of 'struct lnet_process_id' in ksocklnd.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: 782e37e54f5c54886 ("LU-10391 socklnd: switch ksocknal_del_peer to lnet_processid")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/44623
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
net/lnet/klnds/socklnd/socklnd.c | 36 +++++++++++++-----------------------
1 file changed, 13 insertions(+), 23 deletions(-)
diff --git a/net/lnet/klnds/socklnd/socklnd.c b/net/lnet/klnds/socklnd/socklnd.c
index 857aa05..01b434f 100644
--- a/net/lnet/klnds/socklnd/socklnd.c
+++ b/net/lnet/klnds/socklnd/socklnd.c
@@ -660,7 +660,7 @@ struct ksock_peer_ni *
}
static void
-ksocknal_del_peer_locked(struct ksock_peer_ni *peer_ni, u32 ip)
+ksocknal_del_peer_locked(struct ksock_peer_ni *peer_ni)
{
struct ksock_conn *conn;
struct ksock_conn *cnxt;
@@ -683,7 +683,7 @@ struct ksock_peer_ni *
}
static int
-ksocknal_del_peer(struct lnet_ni *ni, struct lnet_process_id id4, u32 ip)
+ksocknal_del_peer(struct lnet_ni *ni, struct lnet_processid *id)
{
LIST_HEAD(zombies);
struct hlist_node *pnxt;
@@ -692,15 +692,11 @@ struct ksock_peer_ni *
int hi;
int i;
int rc = -ENOENT;
- struct lnet_processid id;
-
- id.pid = id4.pid;
- lnet_nid4_to_nid(id4.nid, &id.nid);
write_lock_bh(&ksocknal_data.ksnd_global_lock);
- if (!LNET_NID_IS_ANY(&id.nid)) {
- lo = hash_min(nidhash(&id.nid),
+ if (id && !LNET_NID_IS_ANY(&id->nid)) {
+ lo = hash_min(nidhash(&id->nid),
HASH_BITS(ksocknal_data.ksnd_peers));
hi = lo;
} else {
@@ -715,15 +711,15 @@ struct ksock_peer_ni *
if (peer_ni->ksnp_ni != ni)
continue;
- if (!((LNET_NID_IS_ANY(&id.nid) ||
- nid_same(&peer_ni->ksnp_id.nid, &id.nid)) &&
- (id.pid == LNET_PID_ANY ||
- peer_ni->ksnp_id.pid == id.pid)))
+ if (!((!id || LNET_NID_IS_ANY(&id->nid) ||
+ nid_same(&peer_ni->ksnp_id.nid, &id->nid)) &&
+ (!id || id->pid == LNET_PID_ANY ||
+ peer_ni->ksnp_id.pid == id->pid)))
continue;
ksocknal_peer_addref(peer_ni); /* a ref for me... */
- ksocknal_del_peer_locked(peer_ni, ip);
+ ksocknal_del_peer_locked(peer_ni);
if (peer_ni->ksnp_closing &&
!list_empty(&peer_ni->ksnp_tx_queue)) {
@@ -1764,7 +1760,6 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_processid *id)
int
ksocknal_ctl(struct lnet_ni *ni, unsigned int cmd, void *arg)
{
- struct lnet_process_id id4 = {};
struct lnet_processid id = {};
struct libcfs_ioctl_data *data = arg;
int rc;
@@ -1832,10 +1827,9 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_processid *id)
return ksocknal_add_peer(ni, &id, (struct sockaddr *)&sa);
}
case IOC_LIBCFS_DEL_PEER:
- id4.nid = data->ioc_nid;
- id4.pid = LNET_PID_ANY;
- return ksocknal_del_peer(ni, id4,
- data->ioc_u32[0]); /* IP */
+ lnet_nid4_to_nid(data->ioc_nid, &id.nid);
+ id.pid = LNET_PID_ANY;
+ return ksocknal_del_peer(ni, &id);
case IOC_LIBCFS_GET_CONN: {
int txmem;
@@ -2347,10 +2341,6 @@ static int ksocknal_inetaddr_event(struct notifier_block *unused,
ksocknal_shutdown(struct lnet_ni *ni)
{
struct ksock_net *net = ni->ni_data;
- struct lnet_process_id anyid = { 0 };
-
- anyid.nid = LNET_NID_ANY;
- anyid.pid = LNET_PID_ANY;
LASSERT(ksocknal_data.ksnd_init == SOCKNAL_INIT_ALL);
LASSERT(ksocknal_data.ksnd_nnets > 0);
@@ -2359,7 +2349,7 @@ static int ksocknal_inetaddr_event(struct notifier_block *unused,
atomic_add(SOCKNAL_SHUTDOWN_BIAS, &net->ksnn_npeers);
/* Delete all peers */
- ksocknal_del_peer(ni, anyid, 0);
+ ksocknal_del_peer(ni, NULL);
/* Wait for all peer_ni state to clean up */
wait_var_event_warning(&net->ksnn_npeers,
--
1.8.3.1
next prev parent reply other threads:[~2022-06-09 12:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 12:32 [PATCH 00/18] lustre: sync with OpenSFS tree June 8, 2022 James Simmons
2022-06-09 12:32 ` [PATCH 01/18] lustre: llite: reenable fast_read by default James Simmons
2022-06-09 12:32 ` [PATCH 02/18] lustre: llite: Check vmpage in releasepage James Simmons
2022-06-09 12:32 ` [PATCH 03/18] lustre: update version to 2.15.50 James Simmons
2022-06-09 12:33 ` [PATCH 04/18] lustre: llog: read canceled records in llog_backup James Simmons
2022-06-09 12:33 ` [PATCH 05/18] lnet: change LNetPrimaryNID to use struct lnet_nid James Simmons
2022-06-09 12:33 ` [PATCH 06/18] lnet: alter lnet_drop_rule_match() to take lnet_nid James Simmons
2022-06-09 12:33 ` [PATCH 07/18] lnet: Change LNetDist to work with struct lnet_nid James Simmons
2022-06-09 12:33 ` [PATCH 08/18] lnet: convert LNetPut to take 16byte nid and pid James Simmons
2022-06-09 12:33 ` [PATCH 09/18] lnet: change LNetGet " James Simmons
2022-06-09 12:33 ` [PATCH 10/18] lnet: socklnd: pass large processid to ksocknal_add_peer James Simmons
2022-06-09 12:33 ` [PATCH 11/18] lnet: socklnd: large processid for ksocknal_get_peer_info James Simmons
2022-06-09 12:33 ` James Simmons [this message]
2022-06-09 12:33 ` [PATCH 13/18] lustre: llite: access lli_lsm_md with lock in all places James Simmons
2022-06-09 12:33 ` [PATCH 14/18] lustre: quota: fallocate does not increase projectid usage James Simmons
2022-06-09 12:33 ` [PATCH 15/18] lnet: selftest: improve lnet_selftest speed James Simmons
2022-06-09 12:33 ` [PATCH 16/18] lustre: mdc: Use early cancels for hsm requests James Simmons
2022-06-09 12:33 ` [PATCH 17/18] lustre: ptlrpc: send disconnected events James Simmons
2022-06-09 12:33 ` [PATCH 18/18] lnet: Avoid redundant peer NI lookups James Simmons
2022-06-10 0:09 ` [PATCH 00/18] lustre: sync with OpenSFS tree June 8, 2022 Eric Biggers
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=1654777994-29806-13-git-send-email-jsimmons@infradead.org \
--to=jsimmons@infradead.org \
--cc=adilger@whamcloud.com \
--cc=ebiggers@google.com \
--cc=linux-fscrypt@vger.kernel.org \
--cc=neilb@suse.de \
/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