* [PATCH net] net: wangxun: use net_prefetch to simplify logic
@ 2024-07-22 19:08 Joe Damato
2024-07-23 7:26 ` Simon Horman
0 siblings, 1 reply; 4+ messages in thread
From: Joe Damato @ 2024-07-22 19:08 UTC (permalink / raw)
To: linux-kernel, netdev
Cc: Joe Damato, Jiawen Wu, Mengyuan Lou, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Duanqiang Wen
Use net_prefetch to remove #ifdef and simplify prefetch logic. This
follows the pattern introduced in a previous commit f468f21b7af0 ("net:
Take common prefetch code structure into a function"), which replaced
the same logic in all existing drivers at that time.
Fixes: 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI")
Signed-off-by: Joe Damato <jdamato@fastly.com>
---
drivers/net/ethernet/wangxun/libwx/wx_lib.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
index 1eecba984f3b..2b3d6586f44a 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
@@ -251,10 +251,7 @@ static struct sk_buff *wx_build_skb(struct wx_ring *rx_ring,
rx_buffer->page_offset;
/* prefetch first cache line of first page */
- prefetch(page_addr);
-#if L1_CACHE_BYTES < 128
- prefetch(page_addr + L1_CACHE_BYTES);
-#endif
+ net_prefetch(page_addr);
/* allocate a skb to store the frags */
skb = napi_alloc_skb(&rx_ring->q_vector->napi, WX_RXBUFFER_256);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: wangxun: use net_prefetch to simplify logic
2024-07-22 19:08 [PATCH net] net: wangxun: use net_prefetch to simplify logic Joe Damato
@ 2024-07-23 7:26 ` Simon Horman
2024-07-23 11:05 ` Paolo Abeni
0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2024-07-23 7:26 UTC (permalink / raw)
To: Joe Damato
Cc: linux-kernel, netdev, Jiawen Wu, Mengyuan Lou, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Duanqiang Wen
On Mon, Jul 22, 2024 at 07:08:13PM +0000, Joe Damato wrote:
> Use net_prefetch to remove #ifdef and simplify prefetch logic. This
> follows the pattern introduced in a previous commit f468f21b7af0 ("net:
> Take common prefetch code structure into a function"), which replaced
> the same logic in all existing drivers at that time.
>
> Fixes: 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI")
> Signed-off-by: Joe Damato <jdamato@fastly.com>
Hi Joe,
I would lean more towards this being a clean-up than a fix
(for net-next when it reopens, without a Fixes tag).
But that aside, this looks good to me.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: wangxun: use net_prefetch to simplify logic
2024-07-23 7:26 ` Simon Horman
@ 2024-07-23 11:05 ` Paolo Abeni
2024-07-23 16:02 ` Joe Damato
0 siblings, 1 reply; 4+ messages in thread
From: Paolo Abeni @ 2024-07-23 11:05 UTC (permalink / raw)
To: Simon Horman, Joe Damato
Cc: linux-kernel, netdev, Jiawen Wu, Mengyuan Lou, David S. Miller,
Eric Dumazet, Jakub Kicinski, Duanqiang Wen
On 7/23/24 09:26, Simon Horman wrote:
> On Mon, Jul 22, 2024 at 07:08:13PM +0000, Joe Damato wrote:
>> Use net_prefetch to remove #ifdef and simplify prefetch logic. This
>> follows the pattern introduced in a previous commit f468f21b7af0 ("net:
>> Take common prefetch code structure into a function"), which replaced
>> the same logic in all existing drivers at that time.
>>
>> Fixes: 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI")
>> Signed-off-by: Joe Damato <jdamato@fastly.com>
>
> Hi Joe,
>
> I would lean more towards this being a clean-up than a fix
> (for net-next when it reopens, without a Fixes tag).
Same feeling here, please repost for net-next after the merge window.
Thanks!
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: wangxun: use net_prefetch to simplify logic
2024-07-23 11:05 ` Paolo Abeni
@ 2024-07-23 16:02 ` Joe Damato
0 siblings, 0 replies; 4+ messages in thread
From: Joe Damato @ 2024-07-23 16:02 UTC (permalink / raw)
To: Paolo Abeni
Cc: Simon Horman, linux-kernel, netdev, Jiawen Wu, Mengyuan Lou,
David S. Miller, Eric Dumazet, Jakub Kicinski, Duanqiang Wen
On Tue, Jul 23, 2024 at 01:05:32PM +0200, Paolo Abeni wrote:
>
>
> On 7/23/24 09:26, Simon Horman wrote:
> > On Mon, Jul 22, 2024 at 07:08:13PM +0000, Joe Damato wrote:
> > > Use net_prefetch to remove #ifdef and simplify prefetch logic. This
> > > follows the pattern introduced in a previous commit f468f21b7af0 ("net:
> > > Take common prefetch code structure into a function"), which replaced
> > > the same logic in all existing drivers at that time.
> > >
> > > Fixes: 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI")
> > > Signed-off-by: Joe Damato <jdamato@fastly.com>
> >
> > Hi Joe,
> >
> > I would lean more towards this being a clean-up than a fix
> > (for net-next when it reopens, without a Fixes tag).
>
> Same feeling here, please repost for net-next after the merge window.
Sure will do; sorry for the noise, I was on the fence whether this
was net or net-next. I'll know for next time though!
Thanks,
Joe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-23 16:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-22 19:08 [PATCH net] net: wangxun: use net_prefetch to simplify logic Joe Damato
2024-07-23 7:26 ` Simon Horman
2024-07-23 11:05 ` Paolo Abeni
2024-07-23 16:02 ` Joe Damato
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).