lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKhg4tL7fK=xdO6NuKqz2-DuXv=w-GFkaSbBWxtoVo-1XRJOTg@mail.gmail.com>
Date: Thu, 24 Aug 2023 12:27:08 +0800
From: Liang Chen <liangchen.linux@...il.com>
To: Jesper Dangaard Brouer <hawk@...nel.org>
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com, 
	kuba@...nel.org, davem@...emloft.net, lorenzo@...nel.org, 
	Ilias Apalodimas <ilias.apalodimas@...aro.org>, mtahhan@...hat.com, 
	huangjie.albert@...edance.com, Yunsheng Lin <linyunsheng@...wei.com>
Subject: Re: [PATCH net-next RFC v1 0/4] veth: reduce reallocations of SKBs
 when XDP bpf-prog is loaded

On Wed, Aug 23, 2023 at 1:59 AM Jesper Dangaard Brouer <hawk@...nel.org> wrote:
>
> Loading an XDP bpf-prog on veth device driver results in a significant
> performance degradation (for normal unrelated traffic) due to
> veth_convert_skb_to_xdp_buff() in most cases fully reallocates an SKB and copy
> data over, even when XDP prog does nothing (e.g. XDP_PASS).
>
> This patchset reduce the cases that cause reallocation.
> After patchset UDP and AF_XDP sending avoids reallocations.
>

This approach is a lot more elegant than registering two XDP memory
models and fiddling with the skb and XDP buffer. The tests conducted
in our environment show similar figures in terms of performance
improvements. For example, using pktgen (skb data buffer allocated by
kmalloc) with the following setup: pktgen -> veth1 -> veth0 (XDP_TX)
-> veth1 (XDP_PASS) gives an improvement of around 23%. Thanks!


Thanks,
Liang

> Future work will investigate TCP.
>
> ---
>
> Jesper Dangaard Brouer (4):
>       veth: use same bpf_xdp_adjust_head check as generic-XDP
>       veth: use generic-XDP functions when dealing with SKBs
>       veth: lift skb_head_is_locked restriction for SKB based XDP
>       veth: when XDP is loaded increase needed_headroom
>
>
>  drivers/net/veth.c | 86 +++++++++++++++++++---------------------------
>  net/core/dev.c     |  1 +
>  net/core/filter.c  |  1 +
>  3 files changed, 38 insertions(+), 50 deletions(-)
>
> --
> Jesper
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ