public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Jijie Shao <shaojijie@huawei.com>,
	yisen.zhuang@huawei.com, salil.mehta@huawei.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	wojciech.drewek@intel.com
Cc: shenjian15@huawei.com, wangjie125@huawei.com,
	liuyonglong@huawei.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 net 1/2] net: hns: fix wrong head when modify the tx feature when sending packets
Date: Wed, 06 Dec 2023 12:18:45 +0100	[thread overview]
Message-ID: <ffd7a4cbefa8c4f435db5bab0f5f7f2d4e2dad73.camel@redhat.com> (raw)
In-Reply-To: <20231204143232.3221542-2-shaojijie@huawei.com>

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


  reply	other threads:[~2023-12-06 11:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 14:32 [PATCH V3 net 0/2] There are some bugfix for the HNS ethernet driver Jijie Shao
2023-12-04 14:32 ` [PATCH V3 net 1/2] net: hns: fix wrong head when modify the tx feature when sending packets Jijie Shao
2023-12-06 11:18   ` Paolo Abeni [this message]
2023-12-06 12:31     ` Jijie Shao
2023-12-06 14:27       ` Paolo Abeni
2023-12-04 14:32 ` [PATCH V3 net 2/2] net: hns: fix fake link up on xge port Jijie Shao
2023-12-05 11:44   ` Wojciech Drewek
2023-12-06 11:30 ` [PATCH V3 net 0/2] There are some bugfix for the HNS ethernet driver 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=ffd7a4cbefa8c4f435db5bab0f5f7f2d4e2dad73.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=shaojijie@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=wangjie125@huawei.com \
    --cc=wojciech.drewek@intel.com \
    --cc=yisen.zhuang@huawei.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