All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: Eric Dumazet <edumazet@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	Ido Schimmel <idosch@nvidia.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net 2/2] ipv4: reserve one IP ID per segment for UDP GSO packets
Date: Wed, 30 Sep 2026 07:50:29 -0600	[thread overview]
Message-ID: <16cb8491-c7d9-422a-b3cc-c0225f12b7ba@kernel.org> (raw)
In-Reply-To: <CANn89iJ3KgVOYKD-dT0M=ZOpCJzuOcrG8BWvSKrX0eO1VN7Tpw@mail.gmail.com>

On 9/30/26 7:58 AM, Eric Dumazet wrote:
> On Wed, Sep 30, 2026 at 2:29 PM David Ahern <dsahern@kernel.org> wrote:
>>
>> On 9/29/26 8:12 AM, Eric Dumazet wrote:
>>> @@ -1464,7 +1465,19 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
>>>       iph->ttl = ttl;
>>>       iph->protocol = sk->sk_protocol;
>>>       ip_copy_addrs(iph, fl4);
>>> -     ip_select_ident(net, skb, sk);
>>> +
>>> +     /* UDP GSO packets are segmented later (see udp_send_skb()):
>>> +      * reserve one IP ID per segment.
>>> +      */
>>> +     segs = 1;
>>> +     if (cork->gso_size) {
>>> +             int datalen = skb->len - skb_transport_offset(skb) -
>>> +                           sizeof(struct udphdr);
>>
>> hard coding a specific transport header in L3 code is crossing layers.
>>
> 
> Only UDP sets cork->gso_size, so this is UDP specific code in
> __ip_make_skb(), like the existing sk_is_tcp() case in the same
> function.

I went looking for other transport references in L3 code and missed this
one.

> 
> I can make this explicit in v2 with:
> 
> if (cork->gso_size && sk_is_udp(sk)) {
> 
> Selecting the IP ID from udp_send_skb() instead would either burn
> one extra IP ID per packet (50 % more for 2-segment GSO packets,
> making wraparound faster), or require __ip_make_skb() to leave
> iph->id unset for UDP GSO packets, with a simlar kayer violation concern.
> 
> Would this be acceptable, or do you have another suggestion?

sure. I went down the path of adding an input arg to __ip_make_skb, but
this is simpler.

  reply	other threads:[~2026-09-30 13:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 13:12 [PATCH net 0/2] ipv4: fix IP ID reuse for GSO packets Eric Dumazet
2026-09-29 13:12 ` [PATCH net 1/2] ipv4: fix IP ID reuse in ip_select_ident_segs() Eric Dumazet
2026-09-30  6:20   ` Jiayuan Chen
2026-09-30 12:30   ` David Ahern
2026-09-29 13:12 ` [PATCH net 2/2] ipv4: reserve one IP ID per segment for UDP GSO packets Eric Dumazet
2026-09-30  6:18   ` Jiayuan Chen
2026-09-30 12:28   ` David Ahern
2026-09-30 12:58     ` Eric Dumazet
2026-09-30 13:50       ` David Ahern [this message]
2026-09-30 14:24         ` 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=16cb8491-c7d9-422a-b3cc-c0225f12b7ba@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.