From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v1 net-next] inetpeer: get rid of ip_id_count
Date: Sun, 01 Jun 2014 19:01:47 -0700 (PDT) [thread overview]
Message-ID: <20140601.190147.889157989845313443.davem@davemloft.net> (raw)
In-Reply-To: <1401668284.3645.165.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 01 Jun 2014 17:18:04 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> Ideally, we would need to generate IP ID using a per destination IP
> generator.
>
> linux kernels used inet_peer cache for this purpose, but this had a huge
> cost on servers disabling MTU discovery.
>
> 1) each inet_peer struct consumes 192 bytes
>
> 2) inetpeer cache uses a binary tree of inet_peer structs,
> with a nominal size of ~66000 elements under load.
>
> 3) lookups in this tree are hitting a lot of cache lines, as tree depth
> is about 20.
>
> 4) If server deals with many tcp flows, we have a high probability of
> not finding the inet_peer, allocating a fresh one, inserting it in
> the tree with same initial ip_id_count, (cf secure_ip_id())
>
> 5) We garbage collect inet_peer aggressively.
>
> IP ID generation do not have to be 'perfect'
>
> Goal is trying to avoid duplicates in a short period of time,
> so that reassembly units have a chance to complete reassembly of
> fragments belonging to one message before receiving other fragments
> with a recycled ID.
>
> We simply use an array of generators, and a Jenkin hash using the dst IP
> as a key.
>
> ipv6_select_ident() is put back into net/ipv6/ip6_output.c where it
> belongs (it is only used from this file)
>
> secure_ip_id() and secure_ipv6_id() no longer are needed.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> Note: Based on current net-next, but needs a respin or merge resolution
> after other patch [1] is merged.
I like it.
I think we should get rid of the 'dst' argument from __ip_select_ident() (and thus
ip_select_ident() and ip_select_ident_mode()), it is completely unused.
It might even help to do so for ipv6_select_ident(), having it just pass the
dest addr pointer in instead.
next prev parent reply other threads:[~2014-06-02 2:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-02 0:18 [PATCH v1 net-next] inetpeer: get rid of ip_id_count Eric Dumazet
2014-06-02 2:01 ` David Miller [this message]
2014-06-02 12:17 ` Eric Dumazet
2014-06-02 12:26 ` [PATCH v2 " Eric Dumazet
2014-06-02 18:01 ` David Miller
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=20140601.190147.889157989845313443.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).