From: "Hoang Le" <hoang.h.le@dektech.com.au>
To: "'Eric Dumazet'" <eric.dumazet@gmail.com>,
<jon.maloy@ericsson.com>, <maloy@donjonn.com>,
<tipc-discussion@lists.sourceforge.net>, <netdev@vger.kernel.org>
Subject: RE: [net-next] tipc: improve throughput between nodes in netns
Date: Tue, 22 Oct 2019 10:33:56 +0700 [thread overview]
Message-ID: <004401d58889$8a3ba740$9eb2f5c0$@dektech.com.au> (raw)
In-Reply-To: <88e00511-ae7f-cbd3-46b1-df0f0509c04e@gmail.com>
Hi Eric,
Thanks for quick feedback.
See my inline answer.
Regards,
Hoang
-----Original Message-----
From: Eric Dumazet <eric.dumazet@gmail.com>
Sent: Tuesday, October 22, 2019 9:41 AM
To: Hoang Le <hoang.h.le@dektech.com.au>; jon.maloy@ericsson.com; maloy@donjonn.com; tipc-discussion@lists.sourceforge.net; netdev@vger.kernel.org
Subject: Re: [net-next] tipc: improve throughput between nodes in netns
On 10/21/19 7:20 PM, Hoang Le wrote:
> n->net = net;
> n->capabilities = capabilities;
> + n->pnet = NULL;
> + for_each_net_rcu(tmp) {
This does not scale well, if say you have a thousand netns ?
[Hoang] This check execs only once at setup step. So we get no problem with huge namespaces.
> + tn_peer = net_generic(tmp, tipc_net_id);
> + if (!tn_peer)
> + continue;
> + /* Integrity checking whether node exists in namespace or not */
> + if (tn_peer->net_id != tn->net_id)
> + continue;
> + if (memcmp(peer_id, tn_peer->node_id, NODE_ID_LEN))
> + continue;
> +
> + hash_chk = tn_peer->random;
> + hash_chk ^= net_hash_mix(&init_net);
Why the xor with net_hash_mix(&init_net) is needed ?
[Hoang] We're trying to eliminate a sniff at injectable discovery message.
Building hash-mixes as much as possible is to prevent fake discovery messages.
> + hash_chk ^= net_hash_mix(tmp);
> + if (hash_chk ^ hash_mixes)
> + continue;
> + n->pnet = tmp;
> + break;
> + }
How can we set n->pnet without increasing netns ->count ?
Using check_net() later might trigger an use-after-free.
[Hoang] In this case, peer node is down. I assume the tipc xmit function already bypassed these lines.
next prev parent reply other threads:[~2019-10-22 3:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-22 2:20 [net-next] tipc: improve throughput between nodes in netns Hoang Le
2019-10-22 2:40 ` Eric Dumazet
2019-10-22 3:33 ` Hoang Le [this message]
2019-10-22 3:57 ` Eric Dumazet
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='004401d58889$8a3ba740$9eb2f5c0$@dektech.com.au' \
--to=hoang.h.le@dektech.com.au \
--cc=eric.dumazet@gmail.com \
--cc=jon.maloy@ericsson.com \
--cc=maloy@donjonn.com \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
/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