[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d94ba990b99c01853cdb190895185ef3b7834fb1.camel@redhat.com>
Date: Wed, 06 Dec 2023 15:27:58 +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 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
Powered by blists - more mailing lists