[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19947245-b305-f9c5-f79d-f79a152aaaaa@iogearbox.net>
Date: Mon, 6 Mar 2023 16:35:45 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Lorenzo Bianconi <lorenzo@...nel.org>, bpf@...r.kernel.org
Cc: netdev@...r.kernel.org, ast@...nel.org, andrii@...nel.org,
lorenzo.bianconi@...hat.com
Subject: Re: [PATCH bpf-next] selftests/bpf: use ifname instead of ifindex in
XDP compliance test tool
On 3/3/23 6:21 PM, Lorenzo Bianconi wrote:
> Rely on interface name instead of interface index in error messages or logs
> from XDP compliance test tool.
> Improve XDP compliance test tool error messages.
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
> ---
> tools/testing/selftests/bpf/xdp_features.c | 92 ++++++++++++++--------
> 1 file changed, 57 insertions(+), 35 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/xdp_features.c b/tools/testing/selftests/bpf/xdp_features.c
> index fce12165213b..7414801cd7ec 100644
> --- a/tools/testing/selftests/bpf/xdp_features.c
> +++ b/tools/testing/selftests/bpf/xdp_features.c
> @@ -25,6 +25,7 @@
>
> static struct env {
> bool verbosity;
> + char ifname[IF_NAMESIZE];
> int ifindex;
> bool is_tester;
> struct {
> @@ -109,25 +110,25 @@ static int get_xdp_feature(const char *arg)
> return 0;
> }
>
> -static char *get_xdp_feature_str(void)
> +static char *get_xdp_feature_str(bool color)
> {
> switch (env.feature.action) {
> case XDP_PASS:
> - return YELLOW("XDP_PASS");
> + return color ? YELLOW("XDP_PASS") : "XDP_PASS";
> case XDP_DROP:
> - return YELLOW("XDP_DROP");
> + return color ? YELLOW("XDP_DROP") : "XDP_DROP";
> case XDP_ABORTED:
> - return YELLOW("XDP_ABORTED");
> + return color ? YELLOW("XDP_ABORTED") : "XDP_ABORTED";
> case XDP_TX:
> - return YELLOW("XDP_TX");
> + return color ? YELLOW("XDP_TX") : "XDP_TX";
> case XDP_REDIRECT:
> - return YELLOW("XDP_REDIRECT");
> + return color ? YELLOW("XDP_REDIRECT") : "XDP_REDIRECT";
> default:
> break;
> }
>
> if (env.feature.drv_feature == NETDEV_XDP_ACT_NDO_XMIT)
> - return YELLOW("XDP_NDO_XMIT");
> + return color ? YELLOW("XDP_NDO_XMIT") : "XDP_NDO_XMIT";
>
> return "";
> }
Please split this into multiple patches, logically separated. This one is changing
multiple things at once and above has not much relation to relying on interface names.
Thanks,
Daniel
Powered by blists - more mailing lists