mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leesoo Ahn <lsahn@ooseel.net>
To: Simon Horman <simon.horman@corigine.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net-next] net: stmmac: call stmmac_finalize_xdp_rx() on a condition
Date: Fri, 10 Mar 2023 00:08:29 +0900	[thread overview]
Message-ID: <e75d2a42-4154-e469-bbd7-9409471ab724@ooseel.net> (raw)
In-Reply-To: <ZAnh0TGtDkVUl/1m@corigine.com>



On 23. 3. 9. 22:40, Simon Horman wrote:
> On Thu, Mar 09, 2023 at 01:26:18AM +0900, Leesoo Ahn wrote:
>> The current codebase calls the function no matter net device has XDP
>> programs or not. So the finalize function is being called everytime when RX
>> bottom-half in progress. It needs a few machine instructions for nothing
>> in the case that XDP programs are not attached at all.
>>
>> Lets it call the function on a condition that if xdp_status variable has
>> not zero value. That means XDP programs are attached to the net device
>> and it should be finalized based on the variable.
>>
>> The following instructions show that it's better than calling the function
>> unconditionally.
>>
>>    0.31 │6b8:   ldr     w0, [sp, #196]
>>         │    ┌──cbz     w0, 6cc
>>         │    │  mov     x1, x0
>>         │    │  mov     x0, x27
>>         │    │→ bl     stmmac_finalize_xdp_rx
>>         │6cc:└─→ldr    x1, [sp, #176]
>>
>> with 'if (xdp_status)' statement, jump to '6cc' label if xdp_status has
>> zero value.
>>
>> Signed-off-by: Leesoo Ahn <lsahn@ooseel.net>
> Hi Leesoo,
>
> I am curious to know if you considered going a step further and using
> a static key.
>
> Link: https://www.kernel.org/doc/html/latest/staging/static-keys.html

Thank you for the review.

The function must be called for only XDP_TX or XDP_REDIRECT cases.
So using a static key doesn't look good and the commit message is not 
clear for 'why' as well.
I think that's why you suggested for using 'static key' by the latter 
reason.

I will edit the message and post v2 soon.

Best regards,
Leesoo

  reply	other threads:[~2023-03-09 15:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 16:26 Leesoo Ahn
2023-03-09 13:40 ` Simon Horman
2023-03-09 15:08   ` Leesoo Ahn [this message]
2023-03-09 16:34     ` Simon Horman

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=e75d2a42-4154-e469-bbd7-9409471ab724@ooseel.net \
    --to=lsahn@ooseel.net \
    --cc=alexandre.torgue@foss.st.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=joabreu@synopsys.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=simon.horman@corigine.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

all inboxes | Powered by JetHome®