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 02/24] lustre: ptlrpc: change rq_self to struct lnet_nid
Date: Sun, 18 Sep 2022 01:21:52 -0400 [thread overview]
Message-ID: <1663478534-19917-3-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1663478534-19917-1-git-send-email-jsimmons@infradead.org>
From: Mr NeilBrown <neilb@suse.de>
rq_self in struct ptlrpc_request can now store largs NIDs.
ptlrpc_connection_get() is also changed to received a
'struct lnet_nid'.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: 37ba07f338293d249 ("LU-10391 ptlrpc: change rq_self to struct lnet_nid")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/44636
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
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>
---
fs/lustre/include/lustre_net.h | 7 ++++---
fs/lustre/ptlrpc/client.c | 4 ++--
fs/lustre/ptlrpc/connection.c | 4 ++--
fs/lustre/ptlrpc/events.c | 10 ++++++----
fs/lustre/ptlrpc/lproc_ptlrpc.c | 4 ++--
fs/lustre/ptlrpc/niobuf.c | 5 +++--
6 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/fs/lustre/include/lustre_net.h b/fs/lustre/include/lustre_net.h
index f70cc7c..3a35b03 100644
--- a/fs/lustre/include/lustre_net.h
+++ b/fs/lustre/include/lustre_net.h
@@ -941,7 +941,7 @@ struct ptlrpc_request {
/** import where request is being sent */
struct obd_import *rq_import;
/** our LNet NID */
- lnet_nid_t rq_self;
+ struct lnet_nid rq_self;
/** Peer description (the other side) */
struct lnet_process_id rq_peer;
/** Descriptor for the NID from which the peer sent the request. */
@@ -1706,7 +1706,8 @@ static inline bool nrs_policy_compat_one(const struct ptlrpc_service *svc,
/* ptlrpc/events.c */
int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
- struct lnet_process_id *peer, lnet_nid_t *self);
+ struct lnet_process_id *peer,
+ struct lnet_nid *self);
/**
* These callbacks are invoked by LNet when something happened to
* underlying buffer
@@ -1721,7 +1722,7 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
/* ptlrpc/connection.c */
struct ptlrpc_connection *ptlrpc_connection_get(struct lnet_process_id peer,
- lnet_nid_t self,
+ struct lnet_nid *self,
struct obd_uuid *uuid);
static inline void ptlrpc_connection_put(struct ptlrpc_connection *conn)
diff --git a/fs/lustre/ptlrpc/client.c b/fs/lustre/ptlrpc/client.c
index 685d6e2..7a4a9c9 100644
--- a/fs/lustre/ptlrpc/client.c
+++ b/fs/lustre/ptlrpc/client.c
@@ -105,7 +105,7 @@ struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid,
lnet_nid_t nid4refnet)
{
struct ptlrpc_connection *c;
- lnet_nid_t self;
+ struct lnet_nid self;
struct lnet_process_id peer;
int err;
@@ -121,7 +121,7 @@ struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid,
return NULL;
}
- c = ptlrpc_connection_get(peer, self, uuid);
+ c = ptlrpc_connection_get(peer, &self, uuid);
if (c) {
memcpy(c->c_remote_uuid.uuid,
uuid->uuid, sizeof(c->c_remote_uuid.uuid));
diff --git a/fs/lustre/ptlrpc/connection.c b/fs/lustre/ptlrpc/connection.c
index 58161fe..74a1c6a 100644
--- a/fs/lustre/ptlrpc/connection.c
+++ b/fs/lustre/ptlrpc/connection.c
@@ -76,7 +76,7 @@ static int lnet_process_id_cmp(struct rhashtable_compare_arg *arg,
};
struct ptlrpc_connection *
-ptlrpc_connection_get(struct lnet_process_id peer4, lnet_nid_t self,
+ptlrpc_connection_get(struct lnet_process_id peer4, struct lnet_nid *self,
struct obd_uuid *uuid)
{
struct ptlrpc_connection *conn, *conn2;
@@ -95,7 +95,7 @@ struct ptlrpc_connection *
return NULL;
conn->c_peer = peer;
- lnet_nid4_to_nid(self, &conn->c_self);
+ conn->c_self = *self;
atomic_set(&conn->c_refcount, 1);
if (uuid)
obd_str2uuid(&conn->c_remote_uuid, uuid->uuid);
diff --git a/fs/lustre/ptlrpc/events.c b/fs/lustre/ptlrpc/events.c
index 140ea85..231eace 100644
--- a/fs/lustre/ptlrpc/events.c
+++ b/fs/lustre/ptlrpc/events.c
@@ -348,7 +348,7 @@ void request_in_callback(struct lnet_event *ev)
/* Multi-Rail: keep track of both initiator and source NID. */
req->rq_peer = lnet_pid_to_pid4(&ev->initiator);
req->rq_source = lnet_pid_to_pid4(&ev->source);
- req->rq_self = lnet_nid_to_nid4(&ev->target.nid);
+ req->rq_self = ev->target.nid;
req->rq_rqbd = rqbd;
req->rq_phase = RQ_PHASE_NEW;
if (ev->type == LNET_EVENT_PUT)
@@ -468,7 +468,8 @@ static void ptlrpc_master_callback(struct lnet_event *ev)
}
int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
- struct lnet_process_id *peer, lnet_nid_t *self)
+ struct lnet_process_id *peer,
+ struct lnet_nid *self)
{
int best_dist = 0;
u32 best_order = 0;
@@ -492,7 +493,8 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
continue;
if (dist == 0) { /* local! use loopback LND */
- peer->nid = *self = LNET_NID_LO_0;
+ peer->nid = LNET_NID_LO_0;
+ lnet_nid4_to_nid(peer->nid, self);
rc = 0;
break;
}
@@ -504,7 +506,7 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
best_order = order;
peer->nid = lnet_nid_to_nid4(&dst_nid);
- *self = lnet_nid_to_nid4(&src_nid);
+ *self = src_nid;
rc = 0;
}
}
diff --git a/fs/lustre/ptlrpc/lproc_ptlrpc.c b/fs/lustre/ptlrpc/lproc_ptlrpc.c
index 52010cb..bb17a69 100644
--- a/fs/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/fs/lustre/ptlrpc/lproc_ptlrpc.c
@@ -1007,8 +1007,8 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter)
req->rq_history_seq,
req->rq_export && req->rq_export->exp_obd ?
req->rq_export->exp_obd->obd_name :
- libcfs_nid2str_r(req->rq_self, nidstr,
- sizeof(nidstr)),
+ libcfs_nidstr_r(&req->rq_self, nidstr,
+ sizeof(nidstr)),
libcfs_id2str(req->rq_peer), req->rq_xid,
req->rq_reqlen, ptlrpc_rqphase2str(req),
(s64)req->rq_arrival_time.tv_sec,
diff --git a/fs/lustre/ptlrpc/niobuf.c b/fs/lustre/ptlrpc/niobuf.c
index be1811a..3a10411 100644
--- a/fs/lustre/ptlrpc/niobuf.c
+++ b/fs/lustre/ptlrpc/niobuf.c
@@ -416,7 +416,7 @@ int ptlrpc_send_reply(struct ptlrpc_request *req, int flags)
ptlrpc_at_set_reply(req, flags);
if (!req->rq_export || !req->rq_export->exp_connection)
- conn = ptlrpc_connection_get(req->rq_peer, req->rq_self, NULL);
+ conn = ptlrpc_connection_get(req->rq_peer, &req->rq_self, NULL);
else
conn = ptlrpc_connection_addref(req->rq_export->exp_connection);
@@ -435,7 +435,8 @@ int ptlrpc_send_reply(struct ptlrpc_request *req, int flags)
rc = ptl_send_buf(&rs->rs_md_h, rs->rs_repbuf, rs->rs_repdata_len,
(rs->rs_difficult && !rs->rs_no_ack) ?
LNET_ACK_REQ : LNET_NOACK_REQ,
- &rs->rs_cb_id, req->rq_self, req->rq_source,
+ &rs->rs_cb_id, lnet_nid_to_nid4(&req->rq_self),
+ req->rq_source,
ptlrpc_req2svc(req)->srv_rep_portal,
req->rq_rep_mbits ? req->rq_rep_mbits : req->rq_xid,
req->rq_reply_off, NULL);
--
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:[~2022-09-18 5:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-18 5:21 [lustre-devel] [PATCH 00/24] lustre: update to 2.15.52 James Simmons
2022-09-18 5:21 ` [lustre-devel] [PATCH 01/24] lustre: dne: add crush2 hash type James Simmons
2022-09-18 5:21 ` James Simmons [this message]
2022-09-18 5:21 ` [lustre-devel] [PATCH 03/24] lustre: ptlrpc: pass net num to ptlrpc_uuid_to_connection James Simmons
2022-09-18 5:21 ` [lustre-devel] [PATCH 04/24] lustre: ptlrpc: change rq_peer to struct lnet_nid James Simmons
2022-09-18 5:21 ` [lustre-devel] [PATCH 05/24] lustre: ptlrpc: change rq_source " James Simmons
2022-09-18 5:21 ` [lustre-devel] [PATCH 06/24] lustre: ptlrpc: change bd_sender in ptlrpc_bulk_frag_ops James Simmons
2022-09-18 5:21 ` [lustre-devel] [PATCH 07/24] lustre: ptlrpc: pass lnet_nid for self to ptl_send_buf() James Simmons
2022-09-18 5:21 ` [lustre-devel] [PATCH 08/24] lustre: llite: don't use a kms if it invalid James Simmons
2022-09-18 5:21 ` [lustre-devel] [PATCH 09/24] lustre: mdc: check/grab import before access James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 10/24] lustre: llog: handle -EBADR for catalog processing James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 11/24] lnet: Always use ping reply to set route lr_alive James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 12/24] lustre: clio: remove vvp_page_print() James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 13/24] lustre: clio: remove cpo_prep and cpo_make_ready James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 14/24] lustre: clio: remove struct vvp_page James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 15/24] lustre: clio: remove unused convenience functions James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 16/24] lustre: clio: remove cpl_obj James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 17/24] lustre: osc: remove oap_cli James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 18/24] lustre: osc: Remove submit time James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 19/24] lnet: selftest: revert "LU-16011 lnet: use preallocate bulk for server" James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 20/24] lustre: flr: allow layout version update from client/MDS James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 21/24] lustre: ptlrpc: adds configurable ping interval James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 22/24] lnet: allow direct messages regardless of peer NI status James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 23/24] lnet: Honor peer timeout of zero James Simmons
2022-09-18 5:22 ` [lustre-devel] [PATCH 24/24] lustre: update version to 2.15.52 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=1663478534-19917-3-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).