netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Herms <oliver.peter.herms@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: yoshfuji@linux-ipv6.org, kuznet@ms2.inr.ac.ru, netdev@vger.kernel.org
Subject: Re: [PATCH v2] net: ip/tnl: Set iph->id only when don't fragment is not set
Date: Wed, 27 Nov 2019 13:19:42 +0100	[thread overview]
Message-ID: <57bf0aa5-9640-bf41-41f1-005a1d5d0b62@gmail.com> (raw)
In-Reply-To: <edbe602e-40ae-3f1e-8abd-a6c36b306865@gmail.com>

On 27.11.19 01:28, Eric Dumazet wrote:
> 
> 
> On 11/26/19 3:32 PM, Oliver Herms wrote:
>> Using a simple incrementation here, as with sockets, would solve my problem well enough.
>>
> 
> I have to ask : Are you aware that linux is SMP OS ?
> 
> If on a mostly idle host, two packets need a different ID, using a " simple incrementation" 
> wont fit the need.
> 
> sockets are protected against concurrent increments by their lock.
> 
I know and I'm not going to mess around with TCP.
I've double checked and found that for non IP tunnel traffic (UDP, TCP, etc.) the cheap function
ip_select_ident_segs() is being used. That is absolutely fine. Nothing to optimize here.

For IP tunnels __ip_select_ident is being called.
And that one is way more expensive than ip_select_ident_segs().

ip_select_ident_segs() increments a counter (yes, I'm aware it is protected by lock).
If somehow __ip_select_ident could be refactored to work in a similar fashion that
would solve my problem.

Thanks
Oliver

      reply	other threads:[~2019-11-27 12:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-24 13:24 [PATCH v2] net: ip/tnl: Set iph->id only when don't fragment is not set Oliver Herms
2019-11-25 22:41 ` David Miller
2019-11-26 19:10   ` Oliver Herms
2019-11-26 20:51     ` David Miller
2019-11-26 22:45     ` Eric Dumazet
2019-11-26 23:32       ` Oliver Herms
2019-11-27  0:23         ` Eric Dumazet
2019-11-27  0:28         ` Eric Dumazet
2019-11-27 12:19           ` Oliver Herms [this message]

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=57bf0aa5-9640-bf41-41f1-005a1d5d0b62@gmail.com \
    --to=oliver.peter.herms@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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).