netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jiawen Wu <jiawenwu@trustnetic.com>
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: Tue, 15 Apr 2025 17:33:29 -0700	[thread overview]
Message-ID: <20250415173329.27f83c52@kernel.org> (raw)
In-Reply-To: <20250414091022.383328-2-jiawenwu@trustnetic.com>

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?
-- 
pw-bot: cr

  reply	other threads:[~2025-04-16  0:33 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 [this message]
2025-04-16  6:29     ` Jiawen Wu
2025-04-17  2:40       ` Jiawen Wu
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=20250415173329.27f83c52@kernel.org \
    --to=kuba@kernel.org \
    --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=jiawenwu@trustnetic.com \
    --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).