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]
Date:   Thu, 23 Jan 2020 19:00:26 +0100
From:   Toke Høiland-Jørgensen <toke@...hat.com>
To:     Luigi Rizzo <lrizzo@...gle.com>,
        Daniel Borkmann <daniel@...earbox.net>
Cc:     netdev@...r.kernel.org, Jesper Dangaard Brouer <hawk@...nel.org>,
        "David S. Miller" <davem@...emloft.net>, sameehj@...zon.com
Subject: Re: [PATCH] net-xdp: netdev attribute to control xdpgeneric skb linearization

Luigi Rizzo <lrizzo@...gle.com> writes:

> On Thu, Jan 23, 2020 at 7:48 AM Daniel Borkmann <daniel@...earbox.net> wrote:
>>
>> On 1/23/20 10:53 AM, Toke Høiland-Jørgensen wrote:
>> > Luigi Rizzo <lrizzo@...gle.com> writes:
>> >
>> >> Add a netdevice flag to control skb linearization in generic xdp mode.
>> >> Among the various mechanism to control the flag, the sysfs
>> >> interface seems sufficiently simple and self-contained.
>> >> The attribute can be modified through
>> >>      /sys/class/net/<DEVICE>/xdp_linearize
>> >> The default is 1 (on)
>>
>> Needs documentation in Documentation/ABI/testing/sysfs-class-net.
>>
>> > Erm, won't turning off linearization break the XDP program's ability to
>> > do direct packet access?
>>
>> Yes, in the worst case you only have eth header pulled into linear section. :/
>> In tc/BPF for direct packet access we have bpf_skb_pull_data() helper which can
>> pull in up to X bytes into linear section on demand. I guess something like this
>> could be done for XDP context as well, e.g. generic XDP would pull when non-linear
>> and native XDP would have nothing todo (though in this case you end up writing the
>> prog specifically for generic XDP with slowdown when you'd load it on native XDP
>> where it's linear anyway, but that could/should be documented if so).
>
> There was some discussion on multi-segment xdp
> https://www.spinics.net/lists/netdev/msg620140.html
> https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp-multi-buffer01-design.org
>
> with no clear decision as far as I can tell.
>
> I wanted to point out that linearization might be an issue for native
> xdp as well (specifically with NICs that do header split, LRO,
> scatter-gather, MTU pagesize ...) and having to unconditionally pay
> the linearization cost (or disable the above features) by just loading
> an xdp program may be a big performance hit.

Right, sure, but then I'd rather fix it for all of XDP instead of
introduce (more) differences between native and generic mode...

-Toke

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ