Re: [PATCH bpf 1/2] libbpf: Fix bpf_get_link_xdp_id flags handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrey Ignatov <rdna@xxxxxx> writes:

> Currently if one of XDP_FLAGS_{DRV,HW,SKB}_MODE flags is passed to
> bpf_get_link_xdp_id() and there is a single XDP program attached to
> ifindex, that program's id will be returned by bpf_get_link_xdp_id() in
> prog_id argument no matter what mode the program is attached in, i.e.
> flags argument is not taken into account.
>
> For example, if there is a single program attached with
> XDP_FLAGS_SKB_MODE but user calls bpf_get_link_xdp_id() with flags =
> XDP_FLAGS_DRV_MODE, that skb program will be returned.
>
> Fix it by returning info->prog_id only if user didn't specify flags. If
> flags is specified then return corresponding mode-specific-field from
> struct xdp_link_info.
>
> The initial error was introduced in commit 50db9f073188 ("libbpf: Add a
> support for getting xdp prog id on ifindex") and then refactored in
> 473f4e133a12 so 473f4e133a12 is used in the Fixes tag.
>
> Fixes: 473f4e133a12 ("libbpf: Add bpf_get_link_xdp_info() function to get more XDP information")
> Signed-off-by: Andrey Ignatov <rdna@xxxxxx>

Makes sense

Acked-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux