All of lore.kernel.org
 help / color / mirror / Atom feed
* question about using UDP GSO in Linux kernel 4.19
@ 2020-07-25 23:07 Han
  2020-07-26 13:42 ` Willem de Bruijn
  0 siblings, 1 reply; 4+ messages in thread
From: Han @ 2020-07-25 23:07 UTC (permalink / raw)
  To: netdev

My apologies if this is not the right place to ask this question.

I'm trying to use UDP GSO to improve the throughput. My testing shows
that UDP GSO works with the local server (i.e. loopback interface) but
fails with a remote server (in WLAN, via wlan0 interface).

My question is: do I need to explicitly enable UDP GSO for wlan0
interface? If yes, how do I do it? I searched online but could not
find a good answer.  I looked at "ethtool" but not clear which option
to use:

$ ethtool  --show-offload wlan0 | grep -i generic-segment
generic-segmentation-offload: off [requested on]

$ ethtool  --show-offload wlan0 | grep -i udp-segment
tx-udp-segmentation: off [fixed]

A quick try did not work:

$ sudo ethtool -K wlan0 gso on
Could not change any device features

My test hardware is Raspberry Pi 4, and the Linux kernel version is
4.19. My test program is in C.

Thanks.
Han

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about using UDP GSO in Linux kernel 4.19
  2020-07-25 23:07 question about using UDP GSO in Linux kernel 4.19 Han
@ 2020-07-26 13:42 ` Willem de Bruijn
  2020-07-26 18:17   ` Han
  0 siblings, 1 reply; 4+ messages in thread
From: Willem de Bruijn @ 2020-07-26 13:42 UTC (permalink / raw)
  To: Han; +Cc: Network Development

On Sat, Jul 25, 2020 at 7:08 PM Han <keepsimple@gmail.com> wrote:
>
> My apologies if this is not the right place to ask this question.
>
> I'm trying to use UDP GSO to improve the throughput. My testing shows
> that UDP GSO works with the local server (i.e. loopback interface) but
> fails with a remote server (in WLAN, via wlan0 interface).
>
> My question is: do I need to explicitly enable UDP GSO for wlan0
> interface? If yes, how do I do it? I searched online but could not
> find a good answer.  I looked at "ethtool" but not clear which option
> to use:
>
> $ ethtool  --show-offload wlan0 | grep -i generic-segment
> generic-segmentation-offload: off [requested on]

Which wireless driver does your device use. Does it have tx checksum offload?
That is a hard requirement. In udp_send_skb:

                if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite ||
                    dst_xfrm(skb_dst(skb))) {
                        kfree_skb(skb);
                        return -EIO;
                }

> $ ethtool  --show-offload wlan0 | grep -i udp-segment
> tx-udp-segmentation: off [fixed]

This is hardware segmentation offload. It is not required.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about using UDP GSO in Linux kernel 4.19
  2020-07-26 13:42 ` Willem de Bruijn
@ 2020-07-26 18:17   ` Han
  2020-07-26 18:45     ` Willem de Bruijn
  0 siblings, 1 reply; 4+ messages in thread
From: Han @ 2020-07-26 18:17 UTC (permalink / raw)
  To: Willem de Bruijn; +Cc: Network Development

On Sun, Jul 26, 2020 at 6:42 AM Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
>
> On Sat, Jul 25, 2020 at 7:08 PM Han <keepsimple@gmail.com> wrote:
> >
> > My apologies if this is not the right place to ask this question.
> >
> > I'm trying to use UDP GSO to improve the throughput. My testing shows
> > that UDP GSO works with the local server (i.e. loopback interface) but
> > fails with a remote server (in WLAN, via wlan0 interface).
> >
> > My question is: do I need to explicitly enable UDP GSO for wlan0
> > interface? If yes, how do I do it? I searched online but could not
> > find a good answer.  I looked at "ethtool" but not clear which option
> > to use:
> >
> > $ ethtool  --show-offload wlan0 | grep -i generic-segment
> > generic-segmentation-offload: off [requested on]
>
> Which wireless driver does your device use. Does it have tx checksum offload?

It seems to be "brcmfmac" :

$ readlink /sys/class/net/wlan0/device/driver
../../../../../../../../bus/sdio/drivers/brcmfmac

I think tx checksum offload is off, and I couldn't turn it on. Does
"[fixed]" mean it cannot be changed?

$ ethtool  --show-offload wlan0 | grep -i sum
rx-checksumming: off [fixed]
tx-checksumming: off
        tx-checksum-ipv4: off [fixed]
        tx-checksum-ip-generic: off [fixed]
        tx-checksum-ipv6: off [fixed]
        tx-checksum-fcoe-crc: off [fixed]
        tx-checksum-sctp: off [fixed]
tx-gre-csum-segmentation: off [fixed]
tx-udp_tnl-csum-segmentation: off [fixed]
esp-tx-csum-hw-offload: off [fixed]

Tried this but didn't work:

$ sudo ethtool --offload wlan0 tx on
Cannot change tx-checksumming
Could not change any device features

$ sudo ethtool -K wlan0 tx-checksum-ipv4 on
Could not change any device features

> That is a hard requirement. In udp_send_skb:
>
>                 if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite ||
>                     dst_xfrm(skb_dst(skb))) {
>                         kfree_skb(skb);
>                         return -EIO;
>                 }
>
> > $ ethtool  --show-offload wlan0 | grep -i udp-segment
> > tx-udp-segmentation: off [fixed]
>
> This is hardware segmentation offload. It is not required.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about using UDP GSO in Linux kernel 4.19
  2020-07-26 18:17   ` Han
@ 2020-07-26 18:45     ` Willem de Bruijn
  0 siblings, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2020-07-26 18:45 UTC (permalink / raw)
  To: Han; +Cc: Willem de Bruijn, Network Development

On Sun, Jul 26, 2020 at 2:18 PM Han <keepsimple@gmail.com> wrote:
>
> On Sun, Jul 26, 2020 at 6:42 AM Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
> >
> > On Sat, Jul 25, 2020 at 7:08 PM Han <keepsimple@gmail.com> wrote:
> > >
> > > My apologies if this is not the right place to ask this question.
> > >
> > > I'm trying to use UDP GSO to improve the throughput. My testing shows
> > > that UDP GSO works with the local server (i.e. loopback interface) but
> > > fails with a remote server (in WLAN, via wlan0 interface).
> > >
> > > My question is: do I need to explicitly enable UDP GSO for wlan0
> > > interface? If yes, how do I do it? I searched online but could not
> > > find a good answer.  I looked at "ethtool" but not clear which option
> > > to use:
> > >
> > > $ ethtool  --show-offload wlan0 | grep -i generic-segment
> > > generic-segmentation-offload: off [requested on]
> >
> > Which wireless driver does your device use. Does it have tx checksum offload?
>
> It seems to be "brcmfmac" :
>
> $ readlink /sys/class/net/wlan0/device/driver
> ../../../../../../../../bus/sdio/drivers/brcmfmac
>
> I think tx checksum offload is off, and I couldn't turn it on. Does
> "[fixed]" mean it cannot be changed?

Indeed. That explains it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-26 18:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25 23:07 question about using UDP GSO in Linux kernel 4.19 Han
2020-07-26 13:42 ` Willem de Bruijn
2020-07-26 18:17   ` Han
2020-07-26 18:45     ` Willem de Bruijn

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.