netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Jakub Kicinski'" <kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, <andrew+netdev@lunn.ch>,
	<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
	<horms@kernel.org>, <dlemoal@kernel.org>, <jdamato@fastly.com>,
	<saikrishnag@marvell.com>, <vadim.fedorenko@linux.dev>,
	<przemyslaw.kitszel@intel.com>, <ecree.xilinx@gmail.com>,
	<rmk+kernel@armlinux.org.uk>, <mengyuanlou@net-swift.com>
Subject: RE: [PATCH net-next v2 1/2] net: txgbe: Support to set UDP tunnel port
Date: Thu, 17 Apr 2025 10:40:36 +0800	[thread overview]
Message-ID: <013901dbaf42$194fbcc0$4bef3640$@trustnetic.com> (raw)
In-Reply-To: <00f201dbae98$edc58b10$c950a130$@trustnetic.com>

On Wed, Apr 16, 2025 2:30 PM, Jiawen Wu wrote:
> On Wed, Apr 16, 2025 8:33 AM, Jakub Kicinski wrote:
> > On Mon, 14 Apr 2025 17:10:21 +0800 Jiawen Wu wrote:
> > > +	udp_tunnel_nic_reset_ntf(netdev);
> >
> > you issue the reset here, without clearing the ports...
> >
> > >  	return 0;
> > >
> > >  err_free_irq:
> > > @@ -537,6 +540,87 @@ void txgbe_do_reset(struct net_device *netdev)
> > >  		txgbe_reset(wx);
> > >  }
> > >
> > > +static int txgbe_udp_tunnel_set(struct net_device *dev, unsigned int table,
> > > +				unsigned int entry, struct udp_tunnel_info *ti)
> > > +{
> > > +	struct wx *wx = netdev_priv(dev);
> > > +	struct txgbe *txgbe = wx->priv;
> > > +
> > > +	switch (ti->type) {
> > > +	case UDP_TUNNEL_TYPE_VXLAN:
> > > +		if (txgbe->vxlan_port == ti->port)
> >
> > then you ignore the set if the port is already the same.
> >
> > Why do you need the udp_tunnel_nic_reset_ntf() call?
> > Read the kdoc on that function.
> > It doesn't seem like your NIC loses the state.
> >
> > > +			break;
> > > +
> > > +		if (txgbe->vxlan_port) {
> > > +			wx_err(wx, "VXLAN port %d set, not adding port %d\n",
> > > +			       txgbe->vxlan_port, ti->port);
> > > +			return -EINVAL;
> > > +		}
> >
> > Why...
> >
> > > +		txgbe->vxlan_port = ti->port;
> > > +		wr32(wx, TXGBE_CFG_VXLAN, ntohs(ti->port));
> > > +		break;
> >
> > > +static const struct udp_tunnel_nic_info txgbe_udp_tunnels = {
> > > +	.set_port	= txgbe_udp_tunnel_set,
> > > +	.unset_port	= txgbe_udp_tunnel_unset,
> > > +	.flags		= UDP_TUNNEL_NIC_INFO_MAY_SLEEP,
> >
> > Where do the callbacks sleep?
> 
> I now understand how the "reset" works, it will be changed to
> UDP_TUNNEL_NIC_INFO_OPEN_ONLY, and use .sync_table to simplify the flow.

But I have a question.

There are two ethernet chips on the board with four ports eth0~eth3,
they all use txgbe driver. When I add a VXLAN port for eth0, in fact, all
4 devices are configured. So I can't add another different VXLAN port
for eth1~eth3. Is this a fixed behavior of the kernel?



  reply	other threads:[~2025-04-17  2:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14  9:10 [PATCH net-next v2 0/2] Implement udp tunnel port for txgbe Jiawen Wu
2025-04-14  8:52 ` Michal Kubiak
2025-04-14  9:10 ` [PATCH net-next v2 1/2] net: txgbe: Support to set UDP tunnel port Jiawen Wu
2025-04-16  0:33   ` Jakub Kicinski
2025-04-16  6:29     ` Jiawen Wu
2025-04-17  2:40       ` Jiawen Wu [this message]
2025-04-14  9:10 ` [PATCH net-next v2 2/2] net: wangxun: restrict feature flags for tunnel packets Jiawen Wu

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='013901dbaf42$194fbcc0$4bef3640$@trustnetic.com' \
    --to=jiawenwu@trustnetic.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dlemoal@kernel.org \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=saikrishnag@marvell.com \
    --cc=vadim.fedorenko@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).