lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250415173329.27f83c52@kernel.org>
Date: Tue, 15 Apr 2025 17:33:29 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jiawen Wu <jiawenwu@...stnetic.com>
Cc: netdev@...r.kernel.org, andrew+netdev@...n.ch, davem@...emloft.net,
 edumazet@...gle.com, pabeni@...hat.com, horms@...nel.org,
 dlemoal@...nel.org, jdamato@...tly.com, saikrishnag@...vell.com,
 vadim.fedorenko@...ux.dev, przemyslaw.kitszel@...el.com,
 ecree.xilinx@...il.com, rmk+kernel@...linux.org.uk,
 mengyuanlou@...-swift.com
Subject: Re: [PATCH net-next v2 1/2] net: txgbe: Support to set UDP tunnel
 port

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ