[lustre-devel] [PATCH 22/33] lustre: ptlrpc: switch sptlrpc_rule_set_choose to large nid

James Simmons jsimmons at infradead.org
Sun Feb 2 12:46:22 PST 2025


From: Mr NeilBrown <neilb at suse.de>

sptlrpc_rule_set_choose() and sptlrpc_target_choose_flavor() now take
a large nid.  Only the net number is needed, so this is quite straight
forward.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: 80a4a2ebe0a269d56 ("LU-10391 ptlrpc: switch sptlrpc_rule_set_choose to large nid")
Signed-off-by: Mr NeilBrown <neilb at suse.de>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50102
Reviewed-by: Sebastien Buisson <sbuisson at ddn.com>
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/ptlrpc/sec_config.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/lustre/ptlrpc/sec_config.c b/fs/lustre/ptlrpc/sec_config.c
index 1b56ef40ebda..95e0da4b2da2 100644
--- a/fs/lustre/ptlrpc/sec_config.c
+++ b/fs/lustre/ptlrpc/sec_config.c
@@ -374,7 +374,7 @@ static int sptlrpc_rule_set_merge(struct sptlrpc_rule_set *rset,
 static int sptlrpc_rule_set_choose(struct sptlrpc_rule_set *rset,
 				   enum lustre_sec_part from,
 				   enum lustre_sec_part to,
-				   lnet_nid_t nid,
+				   struct lnet_nid *nid,
 				   struct sptlrpc_flavor *sf)
 {
 	struct sptlrpc_rule *r;
@@ -383,9 +383,9 @@ static int sptlrpc_rule_set_choose(struct sptlrpc_rule_set *rset,
 	for (n = 0; n < rset->srs_nrule; n++) {
 		r = &rset->srs_rules[n];
 
-		if (LNET_NIDNET(nid) != LNET_NET_ANY &&
+		if (!LNET_NID_IS_ANY(nid) &&
 		    r->sr_netid != LNET_NET_ANY &&
-		    LNET_NIDNET(nid) != r->sr_netid)
+		    __be16_to_cpu(nid->nid_num) != r->sr_netid)
 			continue;
 
 		if (from != LUSTRE_SP_ANY && r->sr_from != LUSTRE_SP_ANY &&
@@ -811,13 +811,13 @@ void sptlrpc_conf_choose_flavor(enum lustre_sec_part from,
 	conf_tgt = sptlrpc_conf_get_tgt(conf, name, 0);
 	if (conf_tgt) {
 		rc = sptlrpc_rule_set_choose(&conf_tgt->sct_rset, from, to,
-					     lnet_nid_to_nid4(nid), sf);
+					     nid, sf);
 		if (rc)
 			goto out;
 	}
 
 	rc = sptlrpc_rule_set_choose(&conf->sc_rset, from, to,
-				     lnet_nid_to_nid4(nid), sf);
+				     nid, sf);
 out:
 	mutex_unlock(&sptlrpc_conf_lock);
 
-- 
2.39.3



More information about the lustre-devel mailing list