At current we do check netns local for every neighbor discovery that
is being sent from external netns node. This is become unnecessary
for node acknowledge.

We now improve above checking for peer node come back and discovery
message sent from unacknowledge node.

Fixes: f73b12812a3d ("tipc: improve throughput between nodes in netns")
Signed-off-by: Hoang Le <hoang.h...@dektech.com.au>
---
 net/tipc/node.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index 4b60928049ea..742c04756d72 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -472,10 +472,8 @@ static struct tipc_node *tipc_node_create(struct net *net, 
u32 addr,
                                 tipc_bc_sndlink(net),
                                 &n->bc_entry.link)) {
                pr_warn("Broadcast rcv link creation failed, no memory\n");
-               if (n->peer_net) {
-                       n->peer_net = NULL;
-                       n->peer_hash_mix = 0;
-               }
+               n->peer_net = NULL;
+               n->peer_hash_mix = 0;
                kfree(n);
                n = NULL;
                goto exit;
@@ -1068,6 +1066,9 @@ void tipc_node_check_dest(struct net *net, u32 addr,
        if (sign_match && addr_match && link_up) {
                /* All is fine. Do nothing. */
                reset = false;
+               /* Peer node is not a container/netns local */
+               if (!n->peer_hash_mix)
+                       n->peer_hash_mix = hash_mixes;
        } else if (sign_match && addr_match && !link_up) {
                /* Respond. The link will come up in due time */
                *respond = true;
@@ -1393,11 +1394,8 @@ static void node_lost_contact(struct tipc_node *n,
 
        /* Notify publications from this node */
        n->action_flags |= TIPC_NOTIFY_NODE_DOWN;
-
-       if (n->peer_net) {
-               n->peer_net = NULL;
-               n->peer_hash_mix = 0;
-       }
+       n->peer_net = NULL;
+       n->peer_hash_mix = 0;
        /* Notify sockets connected to node */
        list_for_each_entry_safe(conn, safe, conns, list) {
                skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE, TIPC_CONN_MSG,
-- 
2.20.1



_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to