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 26/50] lnet: change src_nid arg to lnet_parse() to 16byte
Date: Sun, 20 Mar 2022 09:30:40 -0400 [thread overview]
Message-ID: <1647783064-20688-27-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1647783064-20688-1-git-send-email-jsimmons@infradead.org>
From: Mr NeilBrown <neilb@suse.de>
lnet_parse() now gets the source nid as 'struct lnet_nid *'.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: eb0eedbb1a68297b8 ("LU-10391 lnet: change src_nid arg to lnet_parse() to 16byte")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/43614
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-lnet.h | 2 +-
net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 10 +++++++---
net/lnet/klnds/socklnd/socklnd_cb.c | 2 +-
net/lnet/lnet/lib-move.c | 39 +++++++++++++++++--------------------
net/lnet/lnet/lo.c | 3 +--
5 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/include/linux/lnet/lib-lnet.h b/include/linux/lnet/lib-lnet.h
index fe2fd83..33fee17 100644
--- a/include/linux/lnet/lib-lnet.h
+++ b/include/linux/lnet/lib-lnet.h
@@ -706,7 +706,7 @@ void lnet_ptl_attach_md(struct lnet_me *me, struct lnet_libmd *md,
/* message functions */
int lnet_parse(struct lnet_ni *ni, struct lnet_hdr *hdr,
- lnet_nid_t fromnid, void *private, int rdma_req);
+ struct lnet_nid *fromnid, void *private, int rdma_req);
int lnet_parse_local(struct lnet_ni *ni, struct lnet_msg *msg);
int lnet_parse_forward_locked(struct lnet_ni *ni, struct lnet_msg *msg);
diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
index c1be2f7..983599f 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -323,6 +323,7 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
int rc2;
int post_credit;
struct lnet_hdr hdr;
+ struct lnet_nid srcnid;
LASSERT(conn->ibc_state >= IBLND_CONN_ESTABLISHED);
@@ -382,7 +383,8 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
case IBLND_MSG_IMMEDIATE:
post_credit = IBLND_POSTRX_DONT_POST;
lnet_hdr_from_nid4(&hdr, &msg->ibm_u.immediate.ibim_hdr);
- rc = lnet_parse(ni, &hdr, msg->ibm_srcnid, rx, 0);
+ lnet_nid4_to_nid(msg->ibm_srcnid, &srcnid);
+ rc = lnet_parse(ni, &hdr, &srcnid, rx, 0);
if (rc < 0) /* repost on error */
post_credit = IBLND_POSTRX_PEER_CREDIT;
break;
@@ -390,7 +392,8 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
case IBLND_MSG_PUT_REQ:
post_credit = IBLND_POSTRX_DONT_POST;
lnet_hdr_from_nid4(&hdr, &msg->ibm_u.putreq.ibprm_hdr);
- rc = lnet_parse(ni, &hdr, msg->ibm_srcnid, rx, 1);
+ lnet_nid4_to_nid(msg->ibm_srcnid, &srcnid);
+ rc = lnet_parse(ni, &hdr, &srcnid, rx, 1);
if (rc < 0) /* repost on error */
post_credit = IBLND_POSTRX_PEER_CREDIT;
break;
@@ -454,7 +457,8 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
case IBLND_MSG_GET_REQ:
post_credit = IBLND_POSTRX_DONT_POST;
lnet_hdr_from_nid4(&hdr, &msg->ibm_u.get.ibgm_hdr);
- rc = lnet_parse(ni, &hdr, msg->ibm_srcnid, rx, 1);
+ lnet_nid4_to_nid(msg->ibm_srcnid, &srcnid);
+ rc = lnet_parse(ni, &hdr, &srcnid, rx, 1);
if (rc < 0) /* repost on error */
post_credit = IBLND_POSTRX_PEER_CREDIT;
break;
diff --git a/net/lnet/klnds/socklnd/socklnd_cb.c b/net/lnet/klnds/socklnd/socklnd_cb.c
index af35c49..adec183 100644
--- a/net/lnet/klnds/socklnd/socklnd_cb.c
+++ b/net/lnet/klnds/socklnd/socklnd_cb.c
@@ -1189,7 +1189,7 @@ struct ksock_conn_cb *
ksocknal_conn_addref(conn); /* ++ref while parsing */
rc = lnet_parse(conn->ksnc_peer->ksnp_ni, &hdr,
- lnet_nid_to_nid4(&conn->ksnc_peer->ksnp_id.nid),
+ &conn->ksnc_peer->ksnp_id.nid,
conn, 0);
if (rc < 0) {
/* I just received garbage: give up on this conn */
diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index 051bea1..8a90822 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -4229,8 +4229,8 @@ void lnet_monitor_thr_stop(void)
EXPORT_SYMBOL(lnet_msgtyp2str);
int
-lnet_parse(struct lnet_ni *ni, struct lnet_hdr *hdr, lnet_nid_t from_nid4,
- void *private, int rdma_req)
+lnet_parse(struct lnet_ni *ni, struct lnet_hdr *hdr,
+ struct lnet_nid *from_nid, void *private, int rdma_req)
{
struct lnet_peer_ni *lpni;
struct lnet_msg *msg;
@@ -4238,7 +4238,6 @@ void lnet_monitor_thr_stop(void)
lnet_pid_t dest_pid;
struct lnet_nid dest_nid;
struct lnet_nid src_nid;
- struct lnet_nid from_nid;
bool push = false;
int for_me;
u32 type;
@@ -4247,8 +4246,6 @@ void lnet_monitor_thr_stop(void)
LASSERT(!in_interrupt());
- lnet_nid4_to_nid(from_nid4, &from_nid);
-
type = hdr->type;
src_nid = hdr->src_nid;
dest_nid = hdr->dest_nid;
@@ -4256,7 +4253,7 @@ void lnet_monitor_thr_stop(void)
payload_length = hdr->payload_length;
for_me = nid_same(&ni->ni_nid, &dest_nid);
- cpt = lnet_nid2cpt(&from_nid, ni);
+ cpt = lnet_nid2cpt(from_nid, ni);
CDEBUG(D_NET, "TRACE: %s(%s) <- %s : %s\n",
libcfs_nidstr(&dest_nid),
@@ -4269,7 +4266,7 @@ void lnet_monitor_thr_stop(void)
case LNET_MSG_GET:
if (payload_length > 0) {
CERROR("%s, src %s: bad %s payload %d (0 expected)\n",
- libcfs_nid2str(from_nid4),
+ libcfs_nidstr(from_nid),
libcfs_nidstr(&src_nid),
lnet_msgtyp2str(type), payload_length);
return -EPROTO;
@@ -4281,7 +4278,7 @@ void lnet_monitor_thr_stop(void)
if (payload_length >
(u32)(for_me ? LNET_MAX_PAYLOAD : LNET_MTU)) {
CERROR("%s, src %s: bad %s payload %d (%d max expected)\n",
- libcfs_nid2str(from_nid4),
+ libcfs_nidstr(from_nid),
libcfs_nidstr(&src_nid),
lnet_msgtyp2str(type),
payload_length,
@@ -4292,7 +4289,7 @@ void lnet_monitor_thr_stop(void)
default:
CERROR("%s, src %s: Bad message type 0x%x\n",
- libcfs_nid2str(from_nid4),
+ libcfs_nidstr(from_nid),
libcfs_nidstr(&src_nid), type);
return -EPROTO;
}
@@ -4319,7 +4316,7 @@ void lnet_monitor_thr_stop(void)
if (LNET_NID_NET(&dest_nid) == LNET_NID_NET(&ni->ni_nid)) {
/* should have gone direct */
CERROR("%s, src %s: Bad dest nid %s (should have been sent direct)\n",
- libcfs_nid2str(from_nid4),
+ libcfs_nidstr(from_nid),
libcfs_nidstr(&src_nid),
libcfs_nidstr(&dest_nid));
return -EPROTO;
@@ -4330,7 +4327,7 @@ void lnet_monitor_thr_stop(void)
* this node's NID on its own network
*/
CERROR("%s, src %s: Bad dest nid %s (it's my nid but on a different network)\n",
- libcfs_nid2str(from_nid4),
+ libcfs_nidstr(from_nid),
libcfs_nidstr(&src_nid),
libcfs_nidstr(&dest_nid));
return -EPROTO;
@@ -4338,7 +4335,7 @@ void lnet_monitor_thr_stop(void)
if (rdma_req && type == LNET_MSG_GET) {
CERROR("%s, src %s: Bad optimized GET for %s (final destination must be me)\n",
- libcfs_nid2str(from_nid4),
+ libcfs_nidstr(from_nid),
libcfs_nidstr(&src_nid),
libcfs_nidstr(&dest_nid));
return -EPROTO;
@@ -4346,7 +4343,7 @@ void lnet_monitor_thr_stop(void)
if (!the_lnet.ln_routing) {
CERROR("%s, src %s: Dropping message for %s (routing not enabled)\n",
- libcfs_nid2str(from_nid4),
+ libcfs_nidstr(from_nid),
libcfs_nidstr(&src_nid),
libcfs_nidstr(&dest_nid));
goto drop;
@@ -4360,7 +4357,7 @@ void lnet_monitor_thr_stop(void)
if (!list_empty(&the_lnet.ln_test_peers) && /* normally we don't */
fail_peer(&src_nid, 0)) { /* shall we now? */
CERROR("%s, src %s: Dropping %s to simulate failure\n",
- libcfs_nid2str(from_nid4), libcfs_nidstr(&src_nid),
+ libcfs_nidstr(from_nid), libcfs_nidstr(&src_nid),
lnet_msgtyp2str(type));
goto drop;
}
@@ -4369,7 +4366,7 @@ void lnet_monitor_thr_stop(void)
if (!list_empty(&the_lnet.ln_drop_rules) &&
lnet_drop_rule_match(hdr, lnet_nid_to_nid4(&ni->ni_nid), NULL)) {
CDEBUG(D_NET, "%s, src %s, dst %s: Dropping %s to simulate silent message loss\n",
- libcfs_nid2str(from_nid4), libcfs_nidstr(&src_nid),
+ libcfs_nidstr(from_nid), libcfs_nidstr(&src_nid),
libcfs_nidstr(&dest_nid), lnet_msgtyp2str(type));
goto drop;
}
@@ -4377,7 +4374,7 @@ void lnet_monitor_thr_stop(void)
msg = kmem_cache_zalloc(lnet_msg_cachep, GFP_NOFS);
if (!msg) {
CERROR("%s, src %s: Dropping %s (out of memory)\n",
- libcfs_nid2str(from_nid4), libcfs_nidstr(&src_nid),
+ libcfs_nidstr(from_nid), libcfs_nidstr(&src_nid),
lnet_msgtyp2str(type));
goto drop;
}
@@ -4394,7 +4391,7 @@ void lnet_monitor_thr_stop(void)
msg->msg_offset = 0;
msg->msg_hdr = *hdr;
/* for building message event */
- msg->msg_from = from_nid;
+ msg->msg_from = *from_nid;
if (!for_me) {
msg->msg_target.pid = dest_pid;
msg->msg_target.nid = dest_nid;
@@ -4402,12 +4399,12 @@ void lnet_monitor_thr_stop(void)
}
lnet_net_lock(cpt);
- lpni = lnet_peerni_by_nid_locked(&from_nid, &ni->ni_nid, cpt);
+ lpni = lnet_peerni_by_nid_locked(from_nid, &ni->ni_nid, cpt);
if (IS_ERR(lpni)) {
lnet_net_unlock(cpt);
rc = PTR_ERR(lpni);
CERROR("%s, src %s: Dropping %s (error %d looking up sender)\n",
- libcfs_nid2str(from_nid4), libcfs_nidstr(&src_nid),
+ libcfs_nidstr(from_nid), libcfs_nidstr(&src_nid),
lnet_msgtyp2str(type), rc);
kfree(msg);
if (rc == -ESHUTDOWN)
@@ -4422,7 +4419,7 @@ void lnet_monitor_thr_stop(void)
*/
if (((lnet_drop_asym_route && for_me) ||
!lpni->lpni_peer_net->lpn_peer->lp_alive) &&
- LNET_NID_NET(&src_nid) != LNET_NIDNET(from_nid4)) {
+ LNET_NID_NET(&src_nid) != LNET_NID_NET(from_nid)) {
u32 src_net_id = LNET_NID_NET(&src_nid);
struct lnet_peer *gw = lpni->lpni_peer_net->lpn_peer;
struct lnet_route *route;
@@ -4457,7 +4454,7 @@ void lnet_monitor_thr_stop(void)
* => asymmetric routing detected but forbidden
*/
CERROR("%s, src %s: Dropping asymmetrical route %s\n",
- libcfs_nid2str(from_nid4),
+ libcfs_nidstr(from_nid),
libcfs_nidstr(&src_nid), lnet_msgtyp2str(type));
kfree(msg);
goto drop;
diff --git a/net/lnet/lnet/lo.c b/net/lnet/lnet/lo.c
index 3d3dcf8..90155b5 100644
--- a/net/lnet/lnet/lo.c
+++ b/net/lnet/lnet/lo.c
@@ -40,8 +40,7 @@
LASSERT(!lntmsg->msg_routing);
LASSERT(!lntmsg->msg_target_is_router);
- return lnet_parse(ni, &lntmsg->msg_hdr,
- lnet_nid_to_nid4(&ni->ni_nid), lntmsg, 0);
+ return lnet_parse(ni, &lntmsg->msg_hdr, &ni->ni_nid, lntmsg, 0);
}
static int
--
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-03-20 13:33 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-20 13:30 [lustre-devel] [PATCH 00/50] lustre: update to OpenSFS tree as of March 20, 2022 James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 01/50] lustre: type cleanups and remove debug statements James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 02/50] lustre: osc: Fix grant test for ARM James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 03/50] lnet: extend nids in struct lnet_msg James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 04/50] lnet: Change lnet_send() to take large-addr nids James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 05/50] lnet: use large nids in struct lnet_event James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 06/50] lnet: socklnd: prepare for new KSOCK_MSG type James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 07/50] lnet: socklnd: don't deref lnet_hdr in LNDs James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 08/50] lustre: sec: make client encryption compatible with ext4 James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 09/50] lustre: sec: allow subdir mount of encrypted dir James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 10/50] lustre: fld: repeat rpc in fld_client_rpc after EAGAIN James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 11/50] lustre: fld: don't obtain a slot for fld request James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 12/50] lustre: update version to 2.14.57 James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 13/50] lustre: llite: deadlock in ll_new_node() James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 14/50] lnet: o2iblnd: avoid static allocation for msg tx James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 15/50] lnet: separate lnet_hdr in msg from that in lnd James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 16/50] lnet: change lnet_hdr to store large nids James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 17/50] lnet: change lnet_prep_send to take net_processid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 18/50] lnet: convert to struct lnet_process_id in lib-move James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 19/50] lnet: convert LNetGetID to return an large-addr pid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 20/50] lnet: alter lnd_notify_peer_down() to take lnet_nid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 21/50] lnet: socklnd: move lnet_hdr unpack into ->pro_unpack James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 22/50] lnet: socklnd: Change ksock_hello_msg to struct lnet_nid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 23/50] lnet: socklnd: add hello message version 4 James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 24/50] lnet: Convert ping to support 16-bytes address James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 25/50] lnet: convert nids in lnet_parse to lnet_nid James Simmons
2022-03-20 13:30 ` James Simmons [this message]
2022-03-20 13:30 ` [lustre-devel] [PATCH 27/50] lnet: Fix NULL-deref in lnet_nidstr_r() James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 28/50] lnet: change lnet_del_route() to take lnet_nid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 29/50] lustre: llite: Move free user pages James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 30/50] lustre: llite: Do not get/put DIO pages James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 31/50] lustre: llite: Remove unnecessary page get/put James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 32/50] lustre: llite: LL_IOC_LMV_GETSTRIPE 'default' shows inherit layout James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 33/50] lustre: hsm: update size upon completion of data version James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 34/50] lustre: llite: Delay dput in ll_dirty_page_discard_warn James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 35/50] lnet: libcfs: Use FAIL_CHECK_QUIET for fake i/o James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 36/50] lnet: Avoid peer NI recovery for local interface James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 37/50] lustre: osc: add OBD_IOC_GETATTR support for osc James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 38/50] lustre: sec: present .fscrypt in subdir mount James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 39/50] lnet: improve hash distribution across CPTs James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 40/50] lustre: osc: osc_extent_wait() deadlock James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 41/50] lustre: quota: delete unused quota ID James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 42/50] lnet: Check LNET_NID_IS_ANY in LNET_NID_NET James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 43/50] lustre: llite: clear async errors on write commit sync James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 44/50] lnet: lnet_peer_data_present() memory leak James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 45/50] lnet: Don't use pref NI for reserved portal James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 46/50] lnet: o2iblnd: avoid memory copy for short msg James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 47/50] lustre: llite: set default LMV hash type with 2.12 MDS James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 48/50] lnet: Stop discovery on deleted peer NI James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 49/50] lustre: sec: fix DIO for encrypted files James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 50/50] lustre: ptlrpc: Use after free of 'conn' in rhashtable retry 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=1647783064-20688-27-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).