diff mbox series

[08/34] lnet: add cpt to lnet_match_info.

Message ID 153628137155.8267.2566576537174390617.stgit@noble (mailing list archive)
State New, archived
Headers show
Series Beginning of multi-rail support for drivers/staging/lustre | expand

Commit Message

NeilBrown Sept. 7, 2018, 12:49 a.m. UTC
This seems to be a more direct way to get the cpt
needed in lnet_mt_of_match().

This is part of
    8cbb8cd3e771e7f7e0f99cafc19fad32770dc015
       LU-7734 lnet: Multi-Rail local NI split

Signed-off-by: NeilBrown <neilb@suse.com>
---
 .../staging/lustre/include/linux/lnet/lib-types.h  |    1 +
 drivers/staging/lustre/lnet/lnet/lib-move.c        |    1 +
 drivers/staging/lustre/lnet/lnet/lib-ptl.c         |    2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

Comments

Doug Oucharek Sept. 10, 2018, 11:25 p.m. UTC | #1
Reviewed-by: Doug Oucharek <dougso@me.com<mailto:dougso@me.com>>

Doug

On Sep 6, 2018, at 5:49 PM, NeilBrown <neilb@suse.com<mailto:neilb@suse.com>> wrote:

This seems to be a more direct way to get the cpt
needed in lnet_mt_of_match().

This is part of
   8cbb8cd3e771e7f7e0f99cafc19fad32770dc015
      LU-7734 lnet: Multi-Rail local NI split

Signed-off-by: NeilBrown <neilb@suse.com<mailto:neilb@suse.com>>
---
.../staging/lustre/include/linux/lnet/lib-types.h  |    1 +
drivers/staging/lustre/lnet/lnet/lib-move.c        |    1 +
drivers/staging/lustre/lnet/lnet/lib-ptl.c         |    2 +-
3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 255c6c4bbb89..2d2c066a11ba 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -511,6 +511,7 @@ enum lnet_match_flags {
struct lnet_match_info {
__u64 mi_mbits;
struct lnet_process_id mi_id;
+ unsigned int mi_cpt;
unsigned int mi_opc;
unsigned int mi_portal;
unsigned int mi_rlength;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index b8b15f56a275..b6e81a693fc3 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -1303,6 +1303,7 @@ lnet_parse_put(struct lnet_ni *ni, struct lnet_msg *msg)
info.mi_rlength = hdr->payload_length;
info.mi_roffset = hdr->msg.put.offset;
info.mi_mbits = hdr->msg.put.match_bits;
+ info.mi_cpt = msg->msg_rxpeer->lp_cpt;

msg->msg_rx_ready_delay = !ni->ni_net->net_lnd->lnd_eager_recv;
ready_delay = msg->msg_rx_ready_delay;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index 4c5737083422..90ce51801726 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -292,7 +292,7 @@ lnet_mt_of_match(struct lnet_match_info *info, struct lnet_msg *msg)

rotor = ptl->ptl_rotor++; /* get round-robin factor */
if (portal_rotor == LNET_PTL_ROTOR_HASH_RT && routed)
- cpt = lnet_cpt_of_nid(msg->msg_hdr.src_nid);
+ cpt = info->mi_cpt;
else
cpt = rotor % LNET_CPT_NUMBER;
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Reviewed-by: Doug Oucharek &lt;<a href="mailto:dougso@me.com" class="">dougso@me.com</a>&gt;
<div class=""><br class="">
</div>
<div class="">Doug</div>
<div class=""><br class="">
<div style="">
<blockquote type="cite" class="">
<div class="">On Sep 6, 2018, at 5:49 PM, NeilBrown &lt;<a href="mailto:neilb@suse.com" class="">neilb@suse.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">This seems to be a more direct way to get the cpt<br class="">
needed in lnet_mt_of_match().<br class="">
<br class="">
This is part of<br class="">
&nbsp;&nbsp;&nbsp;8cbb8cd3e771e7f7e0f99cafc19fad32770dc015<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LU-7734 lnet: Multi-Rail local NI split<br class="">
<br class="">
Signed-off-by: NeilBrown &lt;<a href="mailto:neilb@suse.com" class="">neilb@suse.com</a>&gt;<br class="">
---<br class="">
.../staging/lustre/include/linux/lnet/lib-types.h &nbsp;| &nbsp;&nbsp;&nbsp;1 &#43;<br class="">
drivers/staging/lustre/lnet/lnet/lib-move.c &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp;&nbsp;&nbsp;1 &#43;<br class="">
drivers/staging/lustre/lnet/lnet/lib-ptl.c &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp;&nbsp;&nbsp;2 &#43;-<br class="">
3 files changed, 3 insertions(&#43;), 1 deletion(-)<br class="">
<br class="">
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h<br class="">
index 255c6c4bbb89..2d2c066a11ba 100644<br class="">
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h<br class="">
&#43;&#43;&#43; b/drivers/staging/lustre/include/linux/lnet/lib-types.h<br class="">
@@ -511,6 &#43;511,7 @@ enum lnet_match_flags {<br class="">
struct lnet_match_info {<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>__u64<span class="Apple-tab-span" style="white-space:pre">
</span><span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>mi_mbits;<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>struct lnet_process_id<span class="Apple-tab-span" style="white-space:pre">
</span>mi_id;<br class="">
&#43;<span class="Apple-tab-span" style="white-space:pre"> </span>unsigned int<span class="Apple-tab-span" style="white-space:pre">
</span><span class="Apple-tab-span" style="white-space:pre"></span>mi_cpt;<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>unsigned int<span class="Apple-tab-span" style="white-space:pre">
</span><span class="Apple-tab-span" style="white-space:pre"></span>mi_opc;<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>unsigned int<span class="Apple-tab-span" style="white-space:pre">
</span><span class="Apple-tab-span" style="white-space:pre"></span>mi_portal;<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>unsigned int<span class="Apple-tab-span" style="white-space:pre">
</span><span class="Apple-tab-span" style="white-space:pre"></span>mi_rlength;<br class="">
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c<br class="">
index b8b15f56a275..b6e81a693fc3 100644<br class="">
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c<br class="">
&#43;&#43;&#43; b/drivers/staging/lustre/lnet/lnet/lib-move.c<br class="">
@@ -1303,6 &#43;1303,7 @@ lnet_parse_put(struct lnet_ni *ni, struct lnet_msg *msg)<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>info.mi_rlength<span class="Apple-tab-span" style="white-space:pre">
</span>= hdr-&gt;payload_length;<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>info.mi_roffset<span class="Apple-tab-span" style="white-space:pre">
</span>= hdr-&gt;msg.put.offset;<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>info.mi_mbits<span class="Apple-tab-span" style="white-space:pre">
</span>= hdr-&gt;msg.put.match_bits;<br class="">
&#43;<span class="Apple-tab-span" style="white-space:pre"> </span>info.mi_cpt<span class="Apple-tab-span" style="white-space:pre">
</span>= msg-&gt;msg_rxpeer-&gt;lp_cpt;<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>msg-&gt;msg_rx_ready_delay = !ni-&gt;ni_net-&gt;net_lnd-&gt;lnd_eager_recv;<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>ready_delay = msg-&gt;msg_rx_ready_delay;<br class="">
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c<br class="">
index 4c5737083422..90ce51801726 100644<br class="">
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c<br class="">
&#43;&#43;&#43; b/drivers/staging/lustre/lnet/lnet/lib-ptl.c<br class="">
@@ -292,7 &#43;292,7 @@ lnet_mt_of_match(struct lnet_match_info *info, struct lnet_msg *msg)<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>rotor = ptl-&gt;ptl_rotor&#43;&#43;; /* get round-robin factor */<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>if (portal_rotor == LNET_PTL_ROTOR_HASH_RT &amp;&amp; routed)<br class="">
-<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>cpt = lnet_cpt_of_nid(msg-&gt;msg_hdr.src_nid);<br class="">
&#43;<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>cpt = info-&gt;mi_cpt;<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>else<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>cpt = rotor % LNET_CPT_NUMBER;<br class="">
<br class="">
<br class="">
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>
James Simmons Sept. 11, 2018, 1:01 a.m. UTC | #2
> This seems to be a more direct way to get the cpt
> needed in lnet_mt_of_match().

Talking to Doug a better comment would be:

This allows LNet to handle a change to a different CPT if the peer
changes. The NID we are sending to can change based on multirail
behavior.
 
I CC Olaf as well for his comment. Code wise its good.

Reviewed-by: James Simmons <jsimmons at infradead.org>

The below needs fixing based on response to cover letter.

> This is part of
>     8cbb8cd3e771e7f7e0f99cafc19fad32770dc015
>        LU-7734 lnet: Multi-Rail local NI split
> 
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>  .../staging/lustre/include/linux/lnet/lib-types.h  |    1 +
>  drivers/staging/lustre/lnet/lnet/lib-move.c        |    1 +
>  drivers/staging/lustre/lnet/lnet/lib-ptl.c         |    2 +-
>  3 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
> index 255c6c4bbb89..2d2c066a11ba 100644
> --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
> +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
> @@ -511,6 +511,7 @@ enum lnet_match_flags {
>  struct lnet_match_info {
>  	__u64			mi_mbits;
>  	struct lnet_process_id	mi_id;
> +	unsigned int		mi_cpt;
>  	unsigned int		mi_opc;
>  	unsigned int		mi_portal;
>  	unsigned int		mi_rlength;
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
> index b8b15f56a275..b6e81a693fc3 100644
> --- a/drivers/staging/lustre/lnet/lnet/lib-move.c
> +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
> @@ -1303,6 +1303,7 @@ lnet_parse_put(struct lnet_ni *ni, struct lnet_msg *msg)
>  	info.mi_rlength	= hdr->payload_length;
>  	info.mi_roffset	= hdr->msg.put.offset;
>  	info.mi_mbits	= hdr->msg.put.match_bits;
> +	info.mi_cpt	= msg->msg_rxpeer->lp_cpt;
>  
>  	msg->msg_rx_ready_delay = !ni->ni_net->net_lnd->lnd_eager_recv;
>  	ready_delay = msg->msg_rx_ready_delay;
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
> index 4c5737083422..90ce51801726 100644
> --- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
> +++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
> @@ -292,7 +292,7 @@ lnet_mt_of_match(struct lnet_match_info *info, struct lnet_msg *msg)
>  
>  	rotor = ptl->ptl_rotor++; /* get round-robin factor */
>  	if (portal_rotor == LNET_PTL_ROTOR_HASH_RT && routed)
> -		cpt = lnet_cpt_of_nid(msg->msg_hdr.src_nid);
> +		cpt = info->mi_cpt;
>  	else
>  		cpt = rotor % LNET_CPT_NUMBER;
>  
> 
> 
>
James Simmons Sept. 11, 2018, 1:01 a.m. UTC | #3
> This seems to be a more direct way to get the cpt
> needed in lnet_mt_of_match().

Talking to Doug a better comment would be:

This allows LNet to handle a change to a different CPT if the peer
changes. The NID we are sending to can change based on multirail
behavior.
 
I CC Olaf as well for his comment. Code wise its good.

Reviewed-by: James Simmons <jsimmons@infradead.org>

The below needs fixing based on response to cover letter.

> This is part of
>     8cbb8cd3e771e7f7e0f99cafc19fad32770dc015
>        LU-7734 lnet: Multi-Rail local NI split
> 
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>  .../staging/lustre/include/linux/lnet/lib-types.h  |    1 +
>  drivers/staging/lustre/lnet/lnet/lib-move.c        |    1 +
>  drivers/staging/lustre/lnet/lnet/lib-ptl.c         |    2 +-
>  3 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
> index 255c6c4bbb89..2d2c066a11ba 100644
> --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
> +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
> @@ -511,6 +511,7 @@ enum lnet_match_flags {
>  struct lnet_match_info {
>  	__u64			mi_mbits;
>  	struct lnet_process_id	mi_id;
> +	unsigned int		mi_cpt;
>  	unsigned int		mi_opc;
>  	unsigned int		mi_portal;
>  	unsigned int		mi_rlength;
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
> index b8b15f56a275..b6e81a693fc3 100644
> --- a/drivers/staging/lustre/lnet/lnet/lib-move.c
> +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
> @@ -1303,6 +1303,7 @@ lnet_parse_put(struct lnet_ni *ni, struct lnet_msg *msg)
>  	info.mi_rlength	= hdr->payload_length;
>  	info.mi_roffset	= hdr->msg.put.offset;
>  	info.mi_mbits	= hdr->msg.put.match_bits;
> +	info.mi_cpt	= msg->msg_rxpeer->lp_cpt;
>  
>  	msg->msg_rx_ready_delay = !ni->ni_net->net_lnd->lnd_eager_recv;
>  	ready_delay = msg->msg_rx_ready_delay;
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
> index 4c5737083422..90ce51801726 100644
> --- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
> +++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
> @@ -292,7 +292,7 @@ lnet_mt_of_match(struct lnet_match_info *info, struct lnet_msg *msg)
>  
>  	rotor = ptl->ptl_rotor++; /* get round-robin factor */
>  	if (portal_rotor == LNET_PTL_ROTOR_HASH_RT && routed)
> -		cpt = lnet_cpt_of_nid(msg->msg_hdr.src_nid);
> +		cpt = info->mi_cpt;
>  	else
>  		cpt = rotor % LNET_CPT_NUMBER;
>  
> 
> 
>
diff mbox series

Patch

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 255c6c4bbb89..2d2c066a11ba 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -511,6 +511,7 @@  enum lnet_match_flags {
 struct lnet_match_info {
 	__u64			mi_mbits;
 	struct lnet_process_id	mi_id;
+	unsigned int		mi_cpt;
 	unsigned int		mi_opc;
 	unsigned int		mi_portal;
 	unsigned int		mi_rlength;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index b8b15f56a275..b6e81a693fc3 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -1303,6 +1303,7 @@  lnet_parse_put(struct lnet_ni *ni, struct lnet_msg *msg)
 	info.mi_rlength	= hdr->payload_length;
 	info.mi_roffset	= hdr->msg.put.offset;
 	info.mi_mbits	= hdr->msg.put.match_bits;
+	info.mi_cpt	= msg->msg_rxpeer->lp_cpt;
 
 	msg->msg_rx_ready_delay = !ni->ni_net->net_lnd->lnd_eager_recv;
 	ready_delay = msg->msg_rx_ready_delay;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index 4c5737083422..90ce51801726 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -292,7 +292,7 @@  lnet_mt_of_match(struct lnet_match_info *info, struct lnet_msg *msg)
 
 	rotor = ptl->ptl_rotor++; /* get round-robin factor */
 	if (portal_rotor == LNET_PTL_ROTOR_HASH_RT && routed)
-		cpt = lnet_cpt_of_nid(msg->msg_hdr.src_nid);
+		cpt = info->mi_cpt;
 	else
 		cpt = rotor % LNET_CPT_NUMBER;