netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, ast@kernel.org,
	andrii@kernel.org, lorenzo.bianconi@redhat.com
Subject: Re: [PATCH bpf-next] selftests/bpf: use ifname instead of ifindex in XDP compliance test tool
Date: Mon, 6 Mar 2023 17:01:10 +0100	[thread overview]
Message-ID: <ZAYORsGRSdCsV8fL@lore-desk> (raw)
In-Reply-To: <19947245-b305-f9c5-f79d-f79a152aaaaa@iogearbox.net>

[-- Attachment #1: Type: text/plain, Size: 2175 bytes --]

> 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@kernel.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.

ack, I will do.

Regards,
Lorenzo

> 
> Thanks,
> Daniel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2023-03-06 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 17:21 [PATCH bpf-next] selftests/bpf: use ifname instead of ifindex in XDP compliance test tool Lorenzo Bianconi
2023-03-06 15:35 ` Daniel Borkmann
2023-03-06 16:01   ` Lorenzo Bianconi [this message]

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=ZAYORsGRSdCsV8fL@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).