net: wangxun: use net_prefetch to simplify logic
authorJoe Damato <jdamato@fastly.com>
Mon, 29 Jul 2024 15:26:47 +0000 (15:26 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 31 Jul 2024 01:28:24 +0000 (18:28 -0700)
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.

Signed-off-by: Joe Damato <jdamato@fastly.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Link: https://patch.msgid.link/20240729152651.258713-1-jdamato@fastly.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/wangxun/libwx/wx_lib.c

index 1eecba984f3b8bc7a4be45cc6e13ad30bd621bc6..2b3d6586f44a53be4bae457c73f86a71e76886f0 100644 (file)
@@ -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);