Skip to contentSkip to conversation

net: wangxun: use net_prefetch to simplify logic

PATCH In review Joe Damato 3 participants 4 messages Jul 22, 2024 – Jul 23, 2024

Subsystems (3)
lore
Share & tools
lore

Joe Damato

author
#0 lore raw

PATCH 1/1 net: wangxun: use net_prefetch to simplify logic

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")
---
 drivers/net/ethernet/wangxun/libwx/wx_lib.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/wangxun/libwx/wx_lib.c +1 -4
index 1eecba984f3b..2b3d6586f44a 100644
@@ -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);
Signature · 1 line
2.25.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Joe Damato

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")

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.

maintainer
#2 lore raw
Quoted 6 lines · Simon Horman
Quoted 5 lines · Joe Damato

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.

Quoted 7 lines
Quoted 2 lines
Fixes 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI")

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

author
#3 lore raw
Quoted 12 lines · Paolo Abeni
Quoted 9 lines · Simon Horman
Quoted 7 lines · Joe Damato

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")
Quoted 6 lines
Quoted 4 lines

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