From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Andrey Ignatov <rdna@fb.com>, bpf@vger.kernel.org
Cc: Andrey Ignatov <rdna@fb.com>,
ast@kernel.org, daniel@iogearbox.net, kernel-team@fb.com
Subject: Re: [PATCH bpf 1/2] libbpf: Fix bpf_get_link_xdp_id flags handling
Date: Tue, 07 Apr 2020 11:04:10 +0200 [thread overview]
Message-ID: <87tv1vacqd.fsf@toke.dk> (raw)
In-Reply-To: <0e9e30490b44b447bb2bebc69c7135e7fe7e4e40.1586236080.git.rdna@fb.com>
Andrey Ignatov <rdna@fb.com> 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@fb.com>
Makes sense
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
next prev parent reply other threads:[~2020-04-07 9:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-07 5:09 [PATCH bpf 0/2] libbpf: Fix bpf_get_link_xdp_id flags handling Andrey Ignatov
2020-04-07 5:09 ` [PATCH bpf 1/2] " Andrey Ignatov
2020-04-07 9:04 ` Toke Høiland-Jørgensen [this message]
2020-04-07 5:09 ` [PATCH bpf 2/2] selftests/bpf: Add test for bpf_get_link_xdp_id Andrey Ignatov
2020-04-07 23:44 ` [PATCH bpf 0/2] libbpf: Fix bpf_get_link_xdp_id flags handling Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tv1vacqd.fsf@toke.dk \
--to=toke@redhat.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=rdna@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox