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] [day] [month] [year] [list]
Message-ID: <ZAYORsGRSdCsV8fL@lore-desk>
Date:   Mon, 6 Mar 2023 17:01:10 +0100
From:   Lorenzo Bianconi <lorenzo@...nel.org>
To:     Daniel Borkmann <daniel@...earbox.net>
Cc:     bpf@...r.kernel.org, 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.

ack, I will do.

Regards,
Lorenzo

> 
> Thanks,
> Daniel

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ