public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Xu Du <xudu@redhat.com>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	horms@kernel.org, shuah@kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v6 4/7] selftest: tun: Add helpers for GSO over UDP tunnel
Date: Fri, 23 Jan 2026 11:43:12 -0800	[thread overview]
Message-ID: <20260123114312.6f7c441e@kernel.org> (raw)
In-Reply-To: <b5787b8c269f43ce11e1756f1691cc7fd9a1e901.1768979440.git.xudu@redhat.com>

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!

  reply	other threads:[~2026-01-23 19:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 10:04 [PATCH net-next v6 0/7] selftest: Extend tun/virtio coverage for GSO over UDP tunnel Xu Du
2026-01-21 10:04 ` [PATCH net-next v6 1/7] selftest: tun: Format tun.c existing code Xu Du
2026-01-21 10:04 ` [PATCH net-next v6 2/7] selftest: tun: Introduce tuntap_helpers.h header for TUN/TAP testing Xu Du
2026-01-21 10:04 ` [PATCH net-next v6 3/7] selftest: tun: Refactor tun_delete to use tuntap_helpers Xu Du
2026-01-21 10:04 ` [PATCH net-next v6 4/7] selftest: tun: Add helpers for GSO over UDP tunnel Xu Du
2026-01-23 19:43   ` Jakub Kicinski [this message]
2026-01-24  7:29     ` Xu Du
2026-01-21 10:04 ` [PATCH net-next v6 5/7] selftest: tun: Add test for sending gso packet into tun Xu Du
2026-01-21 10:05 ` [PATCH net-next v6 6/7] selftest: tun: Add test for receiving gso packet from tun Xu Du
2026-01-21 10:05 ` [PATCH net-next v6 7/7] selftest: tun: Add test data for success and failure paths Xu Du
2026-01-23 19:50 ` [PATCH net-next v6 0/7] selftest: Extend tun/virtio coverage for GSO over UDP tunnel patchwork-bot+netdevbpf

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=20260123114312.6f7c441e@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=xudu@redhat.com \
    /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