All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Eric Dumazet <edumazet@google.com>
Cc: Xin Long <lucien.xin@gmail.com>, netdev@vger.kernel.org
Subject: Re: [RFC] Big TCP and ping support vs. max ICMP{,v6} packet size
Date: Wed, 21 Aug 2024 22:12:35 +0200	[thread overview]
Message-ID: <20240821201235.GA1101240@pevik> (raw)
In-Reply-To: <CANn89iK6Zr4bTaMOevGkNZ-KYHGFaE-8x5y95UgJ5+AwJgdwJg@mail.gmail.com>

Hi Eric, Xin,

> On Tue, Aug 20, 2024 at 5:38 PM Petr Vorel <pvorel@suse.cz> wrote:

> > Hi Eric,

> > > On Mon, Aug 19, 2024 at 2:50 PM Petr Vorel <pvorel@suse.cz> wrote:

> > > > Hi Eric, Xin,

> > > > I see you both worked on Big TCP support for IPv4/IPv6. I wonder if anybody was
> > > > thinking about add Big TCP to raw socket or ICMP datagram socket. I'm not sure
> > > > what would be a real use case (due MTU limitation is Big TCP mostly used on
> > > > local networks anyway).

> > > I think you are mistaken.

> > > BIG TCP does not have any MTU restrictions and can be used on any network.

> > > Think about BIG TCP being GSO/TSO/GRO with bigger logical packet sizes.

> > First, thanks for a quick info. I need to study more BIG TCP. Because I was
> > wondering if this could be used for sending larger ICMP echo requests > 65k
> > as it's possible in FreeBSD, where it's done via Jumbograms [1]:

> >         ping -6 -b 70000 -s 68000 ::1

> I guess ip6_append_data() is a bit conservative and uses IPV6_MAXPLEN
> while it should not ;)

> Also ping needs to add the jumboheader if/when using RAW6 sockets

First I thought you mean to modify kernel net/ipv6/raw.c and net/ipv6/icmp.c
(+ net/ipv4/ping.c for ICMP datagram socket). I.e. to create "Big RAW" and "Big
UDP" (maybe the modification could be in just in net/ipv6/icmp.c for both types
of sockets).

But thinking it twice you may mean to modify userspace ping to add jumboheader.

> With the following patch, the following commands sends big packets just fine

> ifconfig lo mtu 90000
> ping -s 68000 ::1

Yes, it looks like with the above patch it's possible to send a bigger packet,
it goes from userspace to kernel, but here is broken.

From what I observed for 65528 (the first value which exceeds the limit) on raw
socket (net/ipv6/raw.c, net/ipv6/ip6_output.c), rawv6_sendmsg() calls
ip6_append_data() and after that somewhere in 3rd pskb_pull() call skb->data_len
(unsigned int) changes from 65528 to 0, skb->len from 65576 to 40 (IP header).
Also checksum (likely due this) fails.

ICMP datagram socket starts with net/ipv[46]/ping.c but ping_v6_sendmsg() also
calls ip6_append_data() and suffers the same problem.
+ I obviously needed to commented out the check in ping_common_sendmsg()

	if (len > 0xFFFF)
		return -EMSGSIZE;

I'm obviously missing something.

Kind regards,
Petr

> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index ab504d31f0cdd8dec9ab01bf9d6e6517307609cd..6b1668e037dae3c88052c50f02f319355baf4304
> 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -1473,7 +1473,7 @@ static int __ip6_append_data(struct sock *sk,
>         }

>         if (ip6_sk_ignore_df(sk))
> -               maxnonfragsize = sizeof(struct ipv6hdr) + IPV6_MAXPLEN;
> +               maxnonfragsize = max_t(u32, mtu, sizeof(struct
> ipv6hdr) + IPV6_MAXPLEN);
>         else
>                 maxnonfragsize = mtu;

      reply	other threads:[~2024-08-21 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 12:49 [RFC] Big TCP and ping support vs. max ICMP{,v6} packet size Petr Vorel
2024-08-19 12:56 ` Eric Dumazet
2024-08-20 15:38   ` Petr Vorel
2024-08-20 18:35     ` Eric Dumazet
2024-08-21 20:12       ` Petr Vorel [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=20240821201235.GA1101240@pevik \
    --to=pvorel@suse.cz \
    --cc=edumazet@google.com \
    --cc=lucien.xin@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 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.