<div dir="ltr"><div>did you read my response to that question? Pasted below:</div><div><br></div><div>---</div><div><div>This area was re-implemented. There is no need for ni_cptlist any longer. I looked at the current code and it's not being used.</div><div>Originally
 it was being used to place the the ni on a global list: ln_nis_cpt. 
Which was traversed when attempting to calculate the cpt for a NID using
 lnet_cpt_of_nid_locked(). However that latter function has been 
re-implemented due to how MR works now. So there is not need for 
ni_cptlist.</div><div>___<br></div></div><div><br></div><div>thanks</div><div>amir<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 12 Sep 2018 at 17:35, NeilBrown <<a href="mailto:neilb@suse.com">neilb@suse.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Sep 12 2018, Doug Oucharek wrote:<br>
<br>
> I'm assuming that a future patch will be chaining the NI structure on to the NET structure it belongs to.  This patch is just not chaining the NIs on a global NIS list anymore.  As such, ni_cptlist is being "repurposed".<br>
<br>
The NI is already chained onto the NET through<br>
 lnet_net.net_ni_list and lnet_ni.ni_netlist<br>
<br>
ni_cptlist is not used even in current master.<br>
It is never added to any list, but lnet_ni_unlink_locked() does remove<br>
it from a list.  Is that code wrong (should be checking ni_netlist), or<br>
is it cruft that should be removed?<br>
<br>
Thanks,<br>
NeilBrown<br>
<br>
><br>
> Reviewed-by: Doug Oucharek <<a href="mailto:dougso@me.com" target="_blank">dougso@me.com</a>><br>
><br>
> Doug<br>
><br>
> On 9/6/18, 5:54 PM, "NeilBrown" <<a href="mailto:neilb@suse.com" target="_blank">neilb@suse.com</a>> wrote:<br>
><br>
>     This isn't used any more.<br>
>     The new comment is odd - this is no net_ni_cpt !!<br>
>     The ni_cptlist linkage is no longer used - should it go too?<br>
>     <br>
>     This is part of<br>
>         8cbb8cd3e771e7f7e0f99cafc19fad32770dc015<br>
>            LU-7734 lnet: Multi-Rail local NI split<br>
>     <br>
>     Signed-off-by: NeilBrown <<a href="mailto:neilb@suse.com" target="_blank">neilb@suse.com</a>><br>
>     ---<br>
>      .../staging/lustre/include/linux/lnet/lib-types.h  |    4 +---<br>
>      drivers/staging/lustre/lnet/lnet/api-ni.c          |    7 -------<br>
>      2 files changed, 1 insertion(+), 10 deletions(-)<br>
>     <br>
>     diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h<br>
>     index 6c34ecf22021..dc15fa75a9d2 100644<br>
>     --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h<br>
>     +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h<br>
>     @@ -305,7 +305,7 @@ struct lnet_net {<br>
>      struct lnet_ni {<br>
>       /* chain on the lnet_net structure */<br>
>       struct list_head          ni_netlist;<br>
>     - /* chain on ln_nis_cpt */<br>
>     + /* chain on net_ni_cpt */<br>
>       struct list_head        ni_cptlist;<br>
>      <br>
>       spinlock_t              ni_lock;<br>
>     @@ -671,8 +671,6 @@ struct lnet {<br>
>      <br>
>       /* LND instances */<br>
>       struct list_head                ln_nets;<br>
>     - /* NIs bond on specific CPT(s) */<br>
>     - struct list_head                ln_nis_cpt;<br>
>       /* the loopback NI */<br>
>       struct lnet_ni                  *ln_loni;<br>
>       /* network zombie list */<br>
>     diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c<br>
>     index 546d5101360f..960f235df5e7 100644<br>
>     --- a/drivers/staging/lustre/lnet/lnet/api-ni.c<br>
>     +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c<br>
>     @@ -538,7 +538,6 @@ lnet_prepare(lnet_pid_t requested_pid)<br>
>      <br>
>       INIT_LIST_HEAD(&the_lnet.ln_test_peers);<br>
>       INIT_LIST_HEAD(&the_lnet.ln_nets);<br>
>     - INIT_LIST_HEAD(&the_lnet.ln_nis_cpt);<br>
>       INIT_LIST_HEAD(&the_lnet.ln_routers);<br>
>       INIT_LIST_HEAD(&the_lnet.ln_drop_rules);<br>
>       INIT_LIST_HEAD(&the_lnet.ln_delay_rules);<br>
>     @@ -616,7 +615,6 @@ lnet_unprepare(void)<br>
>       LASSERT(!the_lnet.ln_refcount);<br>
>       LASSERT(list_empty(&the_lnet.ln_test_peers));<br>
>       LASSERT(list_empty(&the_lnet.ln_nets));<br>
>     - LASSERT(list_empty(&the_lnet.ln_nis_cpt));<br>
>      <br>
>       lnet_portals_destroy();<br>
>      <br>
>     @@ -1294,11 +1292,6 @@ lnet_startup_lndni(struct lnet_ni *ni, struct lnet_lnd_tunables *tun)<br>
>       /* refcount for ln_nis */<br>
>       lnet_ni_addref_locked(ni, 0);<br>
>       list_add_tail(&ni->ni_net->net_list, &the_lnet.ln_nets);<br>
>     - if (ni->ni_cpts) {<br>
>     -         lnet_ni_addref_locked(ni, 0);<br>
>     -         list_add_tail(&ni->ni_cptlist, &the_lnet.ln_nis_cpt);<br>
>     - }<br>
>     -<br>
>       lnet_net_unlock(LNET_LOCK_EX);<br>
>      <br>
>       ni->ni_state = LNET_NI_STATE_ACTIVE;<br>
>     <br>
>     <br>
>     <br>
_______________________________________________<br>
lustre-devel mailing list<br>
<a href="mailto:lustre-devel@lists.lustre.org" target="_blank">lustre-devel@lists.lustre.org</a><br>
<a href="http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org" rel="noreferrer" target="_blank">http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org</a><br>
</blockquote></div>