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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250422183421.27fd9875@kernel.org>
Date: Tue, 22 Apr 2025 18:34:21 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Bui Quang Minh <minhquangbui99@...il.com>
Cc: virtualization@...ts.linux.dev, "Michael S. Tsirkin" <mst@...hat.com>,
 Jason Wang <jasowang@...hat.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
 Andrew Lunn <andrew+netdev@...n.ch>, Eric Dumazet <edumazet@...gle.com>,
 Paolo Abeni <pabeni@...hat.com>, Alexei Starovoitov <ast@...nel.org>,
 Daniel Borkmann <daniel@...earbox.net>, Jesper Dangaard Brouer
 <hawk@...nel.org>, John Fastabend <john.fastabend@...il.com>, Eugenio
 Pérez <eperezma@...hat.com>, "David S. Miller"
 <davem@...emloft.net>, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH v4 3/4] selftests: net: add flag to force zerocopy mode
 in xdp_helper

On Thu, 17 Apr 2025 14:28:05 +0700 Bui Quang Minh wrote:
> +	if (argc == 4 && strcmp(argv[3], "-z")) {
> +		fprintf(stderr, "Usage: %s ifindex queue_id [-z]\n\n"
> +			"where:\n\t-z: force zerocopy mode\n", argv[0]);
> +		return 1;
> +	} else if (argc == 4) {
> +		sxdp.sxdp_flags = XDP_ZEROCOPY;
> +	}

I've applied the fix, the tests need a couple touch ups, so please
repost just the tests for net-next?

Here I think it'd be cleaner to write the change as:

static void print_usage(const char *bin)
{
	fprintf(stderr, "Usage: %s ifindex queue_id [-z]\n\n"
		"where:\n\t-z: force zerocopy mode\n", bin);	
}

[...]

	if (argc > 3) {
		if (!strcmp(argv[3], "-z")) {
			sxdp.sxdp_flags |= XDP_ZEROCOPY;
		} else {
			print_usage(argv[0]);
			return 1;
		}
	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ