Whamcloud - gitweb
LU-10391 lnet: convert to struct lnet_process_id in lib-move 06/43606/11
authorMr NeilBrown <neilb@suse.de>
Fri, 26 Jun 2020 06:04:25 +0000 (16:04 +1000)
committerOleg Drokin <green@whamcloud.com>
Wed, 26 Jan 2022 05:13:01 +0000 (05:13 +0000)
Various functions in lib-move.c create a 'struct lnet_process_id' just
for the purpose of reporting it in error/debug messages.

Change these to 'struct lnet_processid' with larger address support.

Test-Parameters: trivial
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I1d5d01eb5d42852a1413ad270a040d7698a0c145
Reviewed-on: https://review.whamcloud.com/43606
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/lib-move.c

index 229cd33..b85cdf5 100644 (file)
@@ -4307,7 +4307,7 @@ lnet_parse_reply(struct lnet_ni *ni, struct lnet_msg *msg)
 {
        void *private = msg->msg_private;
        struct lnet_hdr *hdr = &msg->msg_hdr;
-       struct lnet_process_id src = {0};
+       struct lnet_processid src = {};
        struct lnet_libmd *md;
        unsigned int rlength;
        unsigned int mlength;
@@ -4316,7 +4316,7 @@ lnet_parse_reply(struct lnet_ni *ni, struct lnet_msg *msg)
        cpt = lnet_cpt_of_cookie(hdr->msg.reply.dst_wmd.wh_object_cookie);
        lnet_res_lock(cpt);
 
-       src.nid = lnet_nid_to_nid4(&hdr->src_nid);
+       src.nid = hdr->src_nid;
        src.pid = hdr->src_pid;
 
        /* NB handles only looked up by creator (no flips) */
@@ -4324,7 +4324,7 @@ lnet_parse_reply(struct lnet_ni *ni, struct lnet_msg *msg)
        if (md == NULL || md->md_threshold == 0 || md->md_me != NULL) {
                CNETERR("%s: Dropping REPLY from %s for %s "
                        "MD %#llx.%#llx\n",
-                       libcfs_nidstr(&ni->ni_nid), libcfs_id2str(src),
+                       libcfs_nidstr(&ni->ni_nid), libcfs_idstr(&src),
                        (md == NULL) ? "invalid" : "inactive",
                        hdr->msg.reply.dst_wmd.wh_interface_cookie,
                        hdr->msg.reply.dst_wmd.wh_object_cookie);
@@ -4345,7 +4345,7 @@ lnet_parse_reply(struct lnet_ni *ni, struct lnet_msg *msg)
            (md->md_options & LNET_MD_TRUNCATE) == 0) {
                CNETERR("%s: Dropping REPLY from %s length %d "
                        "for MD %#llx would overflow (%d)\n",
-                       libcfs_nidstr(&ni->ni_nid), libcfs_id2str(src),
+                       libcfs_nidstr(&ni->ni_nid), libcfs_idstr(&src),
                        rlength, hdr->msg.reply.dst_wmd.wh_object_cookie,
                        mlength);
                lnet_res_unlock(cpt);
@@ -4353,7 +4353,7 @@ lnet_parse_reply(struct lnet_ni *ni, struct lnet_msg *msg)
        }
 
        CDEBUG(D_NET, "%s: Reply from %s of length %d/%d into md %#llx\n",
-              libcfs_nidstr(&ni->ni_nid), libcfs_id2str(src),
+              libcfs_nidstr(&ni->ni_nid), libcfs_idstr(&src),
               mlength, rlength, hdr->msg.reply.dst_wmd.wh_object_cookie);
 
        lnet_msg_attach_md(msg, md, 0, mlength);
@@ -4373,11 +4373,11 @@ static int
 lnet_parse_ack(struct lnet_ni *ni, struct lnet_msg *msg)
 {
        struct lnet_hdr *hdr = &msg->msg_hdr;
-       struct lnet_process_id src = {0};
+       struct lnet_processid src = {};
        struct lnet_libmd *md;
        int cpt;
 
-       src.nid = lnet_nid_to_nid4(&hdr->src_nid);
+       src.nid = hdr->src_nid;
        src.pid = hdr->src_pid;
 
        /* Convert ack fields to host byte order */
@@ -4393,7 +4393,7 @@ lnet_parse_ack(struct lnet_ni *ni, struct lnet_msg *msg)
                /* Don't moan; this is expected */
                CDEBUG(D_NET,
                       "%s: Dropping ACK from %s to %s MD %#llx.%#llx\n",
-                      libcfs_nidstr(&ni->ni_nid), libcfs_id2str(src),
+                      libcfs_nidstr(&ni->ni_nid), libcfs_idstr(&src),
                       (md == NULL) ? "invalid" : "inactive",
                       hdr->msg.ack.dst_wmd.wh_interface_cookie,
                       hdr->msg.ack.dst_wmd.wh_object_cookie);
@@ -4406,7 +4406,7 @@ lnet_parse_ack(struct lnet_ni *ni, struct lnet_msg *msg)
        }
 
        CDEBUG(D_NET, "%s: ACK from %s into md %#llx\n",
-              libcfs_nidstr(&ni->ni_nid), libcfs_id2str(src),
+              libcfs_nidstr(&ni->ni_nid), libcfs_idstr(&src),
               hdr->msg.ack.dst_wmd.wh_object_cookie);
 
        lnet_msg_attach_md(msg, md, 0, 0);
@@ -4806,13 +4806,13 @@ void
 lnet_drop_delayed_msg_list(struct list_head *head, char *reason)
 {
        while (!list_empty(head)) {
-               struct lnet_process_id id = {0};
+               struct lnet_processid id = {};
                struct lnet_msg *msg;
 
                msg = list_entry(head->next, struct lnet_msg, msg_list);
                list_del(&msg->msg_list);
 
-               id.nid = lnet_nid_to_nid4(&msg->msg_hdr.src_nid);
+               id.nid = msg->msg_hdr.src_nid;
                id.pid = msg->msg_hdr.src_pid;
 
                LASSERT(msg->msg_md == NULL);
@@ -4822,7 +4822,7 @@ lnet_drop_delayed_msg_list(struct list_head *head, char *reason)
 
                CWARN("Dropping delayed PUT from %s portal %d match %llu"
                      " offset %d length %d: %s\n",
-                     libcfs_id2str(id),
+                     libcfs_idstr(&id),
                      msg->msg_hdr.msg.put.ptl_index,
                      msg->msg_hdr.msg.put.match_bits,
                      msg->msg_hdr.msg.put.offset,
@@ -4851,7 +4851,7 @@ lnet_recv_delayed_msg_list(struct list_head *head)
 {
        while (!list_empty(head)) {
                struct lnet_msg *msg;
-               struct lnet_process_id id;
+               struct lnet_processid id;
 
                msg = list_entry(head->next, struct lnet_msg, msg_list);
                list_del(&msg->msg_list);
@@ -4859,7 +4859,7 @@ lnet_recv_delayed_msg_list(struct list_head *head)
                /* md won't disappear under me, since each msg
                 * holds a ref on it */
 
-               id.nid = lnet_nid_to_nid4(&msg->msg_hdr.src_nid);
+               id.nid = msg->msg_hdr.src_nid;
                id.pid = msg->msg_hdr.src_pid;
 
                LASSERT(msg->msg_rx_delayed);
@@ -4870,7 +4870,7 @@ lnet_recv_delayed_msg_list(struct list_head *head)
 
                CDEBUG(D_NET, "Resuming delayed PUT from %s portal %d "
                       "match %llu offset %d length %d.\n",
-                       libcfs_id2str(id), msg->msg_hdr.msg.put.ptl_index,
+                       libcfs_idstr(&id), msg->msg_hdr.msg.put.ptl_index,
                        msg->msg_hdr.msg.put.match_bits,
                        msg->msg_hdr.msg.put.offset,
                        msg->msg_hdr.payload_length);