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 15:27:58 +0100	[thread overview]
Message-ID: <d94ba990b99c01853cdb190895185ef3b7834fb1.camel@redhat.com> (raw)
In-Reply-To: <f7588e40-0fea-4350-89fe-c432eacb68f7@huawei.com>

On Wed, 2023-12-06 at 20:31 +0800, Jijie Shao wrote:
> on 2023/12/6 19:18, Paolo Abeni wrote:
> > +		priv->ops.fill_desc = fill_desc_v2;
> > +		priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tx_v2;
> > 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
> 
> Thank you for your advice. Currently, because the hardware behavior is 
> different, the two versions of ops are retained to unify the subsequent 
> process. We will try to unify the two version ops, and if that does not 
> work, we will consider maintaining the status quo. Thanks again! Jijie

Note that even if you will have to resort to call different functions
for different H/W revisions, from performance PoV you will be far
better off doing a test at runtime to call the corresponding helper.

Or you can use the indirect call wrappers - have a look into:

include/linux/indirect_call_wrapper.h

Cheers,

Paolo


  reply	other threads:[~2023-12-06 14:28 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
2023-12-06 12:31     ` Jijie Shao
2023-12-06 14:27       ` Paolo Abeni [this message]
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=d94ba990b99c01853cdb190895185ef3b7834fb1.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