diff mbox series

[net] net: wangxun: use net_prefetch to simplify logic

Message ID 20240722190815.402355-1-jdamato@fastly.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] net: wangxun: use net_prefetch to simplify logic | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 273 this patch: 273
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 281 this patch: 281
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 281 this patch: 281
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 14 this patch: 14
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-22--21-00 (tests: 670)

Commit Message

Joe Damato July 22, 2024, 7:08 p.m. UTC
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(-)

Comments

Simon Horman July 23, 2024, 7:26 a.m. UTC | #1
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>
Paolo Abeni July 23, 2024, 11:05 a.m. UTC | #2
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
Joe Damato July 23, 2024, 4:02 p.m. UTC | #3
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
diff mbox series

Patch

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