From: James Simmons <jsimmons@infradead.org>
To: Andreas Dilger <adilger@whamcloud.com>,
Oleg Drokin <green@whamcloud.com>, NeilBrown <neilb@suse.de>
Cc: Lustre Development List <lustre-devel@lists.lustre.org>
Subject: [lustre-devel] [PATCH 07/24] lnet: change lp_disc_*_nid to struct lnet_nid
Date: Tue, 21 Sep 2021 22:19:44 -0400 [thread overview]
Message-ID: <1632277201-6920-8-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1632277201-6920-1-git-send-email-jsimmons@infradead.org>
From: Mr NeilBrown <neilb@suse.de>
Change lp_disc_src_nid and lp_disc_dst_nid in struct lnet_peer to
struct lnet_nid.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: f38529cd3a1722119 ("LU-10391 lnet: change lp_disc_*_nid to struct lnet_nid")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/44620
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
include/linux/lnet/lib-types.h | 4 ++--
net/lnet/lnet/peer.c | 20 ++++++++++----------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/linux/lnet/lib-types.h b/include/linux/lnet/lib-types.h
index f980f2f..ba900e8 100644
--- a/include/linux/lnet/lib-types.h
+++ b/include/linux/lnet/lib-types.h
@@ -672,9 +672,9 @@ struct lnet_peer {
struct lnet_nid lp_primary_nid;
/* source NID to use during discovery */
- lnet_nid_t lp_disc_src_nid;
+ struct lnet_nid lp_disc_src_nid;
/* destination NID to use during discovery */
- lnet_nid_t lp_disc_dst_nid;
+ struct lnet_nid lp_disc_dst_nid;
/* net to perform discovery on */
u32 lp_disc_net_id;
diff --git a/net/lnet/lnet/peer.c b/net/lnet/lnet/peer.c
index 7f2c6f3..17f99ee 100644
--- a/net/lnet/lnet/peer.c
+++ b/net/lnet/lnet/peer.c
@@ -224,8 +224,8 @@
init_waitqueue_head(&lp->lp_dc_waitq);
spin_lock_init(&lp->lp_lock);
lp->lp_primary_nid = nid;
- lp->lp_disc_src_nid = LNET_NID_ANY;
- lp->lp_disc_dst_nid = LNET_NID_ANY;
+ lp->lp_disc_src_nid = LNET_ANY_NID;
+ lp->lp_disc_dst_nid = LNET_ANY_NID;
if (lnet_peers_start_down())
lp->lp_alive = false;
else
@@ -2635,8 +2635,8 @@ static void lnet_peer_clear_discovery_error(struct lnet_peer *lp)
spin_lock(&lp->lp_lock);
- lp->lp_disc_src_nid = ev->target.nid;
- lp->lp_disc_dst_nid = ev->source.nid;
+ lnet_nid4_to_nid(ev->target.nid, &lp->lp_disc_src_nid);
+ lnet_nid4_to_nid(ev->source.nid, &lp->lp_disc_dst_nid);
/*
* If some kind of error happened the contents of message
@@ -3367,7 +3367,7 @@ static int lnet_peer_data_present(struct lnet_peer *lp)
* received by lp, we need to set the discovery source
* NID for new_lp to the NID stored in lp.
*/
- if (lp->lp_disc_src_nid != LNET_NID_ANY) {
+ if (!LNET_NID_IS_ANY(&lp->lp_disc_src_nid)) {
new_lp->lp_disc_src_nid = lp->lp_disc_src_nid;
new_lp->lp_disc_dst_nid = lp->lp_disc_dst_nid;
}
@@ -3567,13 +3567,13 @@ static int lnet_peer_send_push(struct lnet_peer *lp)
/* Refcount for MD. */
lnet_peer_addref_locked(lp);
id.pid = LNET_PID_LUSTRE;
- if (lp->lp_disc_dst_nid != LNET_NID_ANY)
- id.nid = lp->lp_disc_dst_nid;
+ if (!LNET_NID_IS_ANY(&lp->lp_disc_dst_nid))
+ id.nid = lnet_nid_to_nid4(&lp->lp_disc_dst_nid);
else
id.nid = lnet_nid_to_nid4(&lp->lp_primary_nid);
lnet_net_unlock(cpt);
- rc = LNetPut(lp->lp_disc_src_nid, lp->lp_push_mdh,
+ rc = LNetPut(lnet_nid_to_nid4(&lp->lp_disc_src_nid), lp->lp_push_mdh,
LNET_ACK_REQ, id, LNET_RESERVED_PORTAL,
LNET_PROTO_PING_MATCHBITS, 0, 0);
/* reset the discovery nid. There is no need to restrict sending
@@ -3581,8 +3581,8 @@ static int lnet_peer_send_push(struct lnet_peer *lp)
* get set to a specific NID, if we initiate discovery from the
* scratch
*/
- lp->lp_disc_src_nid = LNET_NID_ANY;
- lp->lp_disc_dst_nid = LNET_NID_ANY;
+ lp->lp_disc_src_nid = LNET_ANY_NID;
+ lp->lp_disc_dst_nid = LNET_ANY_NID;
if (rc)
goto fail_unlink;
--
1.8.3.1
_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
next prev parent reply other threads:[~2021-09-22 2:21 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-22 2:19 [lustre-devel] [PATCH 00/24] lustre: Update to OpenSFS Sept 21, 2021 James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 01/24] lnet: Lock primary NID logic James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 02/24] lustre: quota: enforce block quota for chgrp James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 03/24] lnet: introduce struct lnet_nid James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 04/24] lnet: add string formating/parsing for IPv6 nids James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 05/24] lnet: change lpni_nid in lnet_peer_ni to lnet_nid James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 06/24] lnet: change lp_primary_nid to struct lnet_nid James Simmons
2021-09-22 2:19 ` James Simmons [this message]
2021-09-22 2:19 ` [lustre-devel] [PATCH 08/24] lnet: socklnd: factor out key calculation for ksnd_peers James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 09/24] lnet: introduce lnet_processid for ksock_peer_ni James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 10/24] lnet: enhance connect/accept to support large addr James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 11/24] lnet: change lr_nid to struct lnet_nid James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 12/24] lnet: extend rspt_next_hop_nid in lnet_rsp_tracker James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 13/24] lustre: ptlrpc: two replay lock threads James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 14/24] lustre: llite: Always do lookup on ENOENT in open James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 15/24] lustre: llite: Remove inode locking in ll_fsync James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 16/24] lnet: socklnd: fix link state detection James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 17/24] lustre: llite: check read only mount for setquota James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 18/24] lustre: llite: don't touch vma after filemap_fault James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 19/24] lnet: Check for -ESHUTDOWN in lnet_parse James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 20/24] lustre: obdclass: EAGAIN after rhashtable_walk_next() James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 21/24] lustre: sec: filename encryption James Simmons
2021-09-22 2:19 ` [lustre-devel] [PATCH 22/24] lustre: uapi: fixup UAPI headers for native Linux client James Simmons
2021-09-22 2:20 ` [lustre-devel] [PATCH 23/24] lustre: ptlrpc: separate out server code for wiretest James Simmons
2021-09-22 2:20 ` [lustre-devel] [PATCH 24/24] lustre: pcc: VM_WRITE should not trigger layout write James Simmons
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=1632277201-6920-8-git-send-email-jsimmons@infradead.org \
--to=jsimmons@infradead.org \
--cc=adilger@whamcloud.com \
--cc=green@whamcloud.com \
--cc=lustre-devel@lists.lustre.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;
as well as URLs for NNTP newsgroup(s).