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: <8bb53544-94f4-601b-24ad-96c6cc87cf50@linux.dev>
Date:   Tue, 21 Feb 2023 13:58:22 -0800
From:   Martin KaFai Lau <martin.lau@...ux.dev>
To:     Jesper Dangaard Brouer <jbrouer@...hat.com>,
        Stanislav Fomichev <sdf@...gle.com>
Cc:     brouer@...hat.com, bpf@...r.kernel.org, netdev@...r.kernel.org,
        martin.lau@...nel.org, ast@...nel.org, daniel@...earbox.net,
        alexandr.lobakin@...el.com, larysa.zaremba@...el.com,
        xdp-hints@...-project.net
Subject: Re: [PATCH bpf-next V3] xdp: bpf_xdp_metadata use EOPNOTSUPP for no
 driver support

On 2/21/23 12:39 PM, Jesper Dangaard Brouer wrote:
> For me this is more about the API we are giving the BPF-programmer.
> 
> There can be natural cases why a driver doesn't provide any hardware
> info for a specific hint.  The RX-timestamp is a good practical example,
> as often only PTP packets will be timestamped by hardware.
> 
> I can write a BPF-prog that create a stats-map for counting
> RX-timestamps, expecting to catch any PTP packets with timestamps.  The
> problem is my stats-map cannot record the difference of EOPNOTSUPP vs
> ENODATA.  Thus, the user of my RX-timestamps stats program can draw the
> wrong conclusion, that there are no packets with (PTP) timestamps, when
> this was actually a case of driver not implementing this.
> 
> I hope this simple stats example make is clearer that the BPF-prog can
> make use of this info runtime.  It is simply a question of keeping these
> cases as separate return codes. Is that too much to ask for from an API?

Instead of reserving an errno for this purpose, it can be decided at load time 
instead of keep calling a kfunc always returning the same dedicated errno. I 
still don't hear why xdp-features + bpf global const won't work.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ