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]
Date: Wed, 06 Dec 2023 12:18:45 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Jijie Shao <shaojijie@...wei.com>, yisen.zhuang@...wei.com, 
 salil.mehta@...wei.com, davem@...emloft.net, edumazet@...gle.com,
 kuba@...nel.org,  wojciech.drewek@...el.com
Cc: shenjian15@...wei.com, wangjie125@...wei.com, liuyonglong@...wei.com, 
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V3 net 1/2] net: hns: fix wrong head when modify the tx
 feature when sending packets

On Mon, 2023-12-04 at 22:32 +0800, Jijie Shao wrote:
> @@ -2159,16 +2175,9 @@ static void hns_nic_set_priv_ops(struct net_device *netdev)
>  		priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tx;
>  	} else {
>  		priv->ops.get_rxd_bnum = get_v2rx_desc_bnum;
> -		if ((netdev->features & NETIF_F_TSO) ||
> -		    (netdev->features & NETIF_F_TSO6)) {
> -			priv->ops.fill_desc = fill_tso_desc;
> -			priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tso;
> -			/* This chip only support 7*4096 */
> -			netif_set_tso_max_size(netdev, 7 * 4096);
> -		} else {
> -			priv->ops.fill_desc = fill_v2_desc;
> -			priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tx;
> -		}
> +		priv->ops.fill_desc = fill_desc_v2;
> +		priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tx_v2;
> +		netif_set_tso_max_size(netdev, 7 * 4096);
>  		/* enable tso when init
>  		 * control tso on/off through TSE bit in bd
>  		 */

Side note: since both 'fill_desc' and 'maybe_stop_tx' have constant
values, for net-next you should really consider replacing the function
pointers with direct-calls.

You currently have at least 2 indirect calls per wire packet, which
hurt performances a lot in case security issues mitigations are in
place.

Cheers,

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ