Subject: Re: [PATCH net-next v6 4/7] selftest: tun: Add helpers for GSO over UDP tunnel

From: Jakub Kicinski <[email-masked]>
Date: Fri, 23 Jan 2026 11:43:12 -0800

On Wed, 21 Jan 2026 18:04:58 +0800 Xu Du wrote:
> +static int geneve_fill_newlink(struct rt_link_newlink_req *req, void *data)
> +{
> +	struct geneve_setup_config *cfg = data;
> +
> +#define SET_GENEVE_REMOTE rt_link_newlink_req_set_linkinfo_data_geneve_remote
> +#define SET_GENEVE_REMOTE6 rt_link_newlink_req_set_linkinfo_data_geneve_remote6
> +
> +	rt_link_newlink_req_set_address(req, cfg->hwaddr, ETH_ALEN);
> +	rt_link_newlink_req_set_linkinfo_data_geneve_id(req, cfg->vnid);
> +	rt_link_newlink_req_set_linkinfo_data_geneve_port(req, cfg->vnport);
> +	rt_link_newlink_req_set_linkinfo_data_geneve_udp_csum(req, cfg->csum);
> +
> +	if (cfg->family == AF_INET)
> +		SET_GENEVE_REMOTE(req, cfg->remote.r4.s_addr);
> +	else
> +		SET_GENEVE_REMOTE6(req, &cfg->remote.r6,
> +				   sizeof(cfg->remote.r6));
> +
> +	return 0;
> +}
> +
> +static int geneve_create(const char *dev, int family, void *remote,
> +			 void *hwaddr)
> +{
> +	struct geneve_setup_config geneve;
> +
> +	memset(&geneve, 0, sizeof(geneve));
> +	geneve.vnid = VN_ID;
> +	geneve.vnport = htons(VN_PORT);
> +	geneve.csum = 1;
> +	geneve.family = family;
> +	if (family == AF_INET)
> +		memcpy(&geneve.remote.r4, remote, sizeof(struct in_addr));
> +	else
> +		memcpy(&geneve.remote.r6, remote, sizeof(struct in6_addr));
> +	memcpy(geneve.hwaddr, hwaddr, ETH_ALEN);
> +
> +	return ip_link_add(dev, "geneve", geneve_fill_newlink, (void *)&geneve);
> +}

I'd be tempted to allocate the request in the here, and instead 
of passing the "fill" callback optionally pass in partially /
pre-populated req. Just food for thought in case you'd like the idea
and what to follow up. v6 looks good so I'll merge as is already.

Thanks for converting to YNL!