Re: [PATCH v4 3/4] selftests: net: add flag to force zerocopy mode in xdp_helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
		}
	}




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux