lkml.org 
[lkml]   [2023]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next] net: stmmac: call stmmac_finalize_xdp_rx() on a condition
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

\
 
 \ /
  Last update: 2023-03-27 00:51    [W:0.036 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site