All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ixgbe: Use kmap_local_page in ixgbe_check_lbtest_frame()
@ 2022-06-29  8:58 ` Fabio M. De Francesco
  0 siblings, 0 replies; 40+ messages in thread
From: Fabio M. De Francesco @ 2022-06-29  8:58 UTC (permalink / raw)
  To: Jesse Brandeburg, Tony Nguyen, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, intel-wired-lan, netdev,
	linux-kernel, bpf
  Cc: Fabio M. De Francesco, Ira Weiny

The use of kmap() is being deprecated in favor of kmap_local_page().

With kmap_local_page(), the mapping is per thread, CPU local and not
globally visible. Furthermore, the mapping can be acquired from any context
(including interrupts).

Therefore, use kmap_local_page() in ixgbe_check_lbtest_frame() because
this mapping is per thread, CPU local, and not globally visible.

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 628d0eb0599f..e64d40482bfd 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -1966,14 +1966,14 @@ static bool ixgbe_check_lbtest_frame(struct ixgbe_rx_buffer *rx_buffer,
 
 	frame_size >>= 1;
 
-	data = kmap(rx_buffer->page) + rx_buffer->page_offset;
+	data = kmap_local_page(rx_buffer->page) + rx_buffer->page_offset;
 
 	if (data[3] != 0xFF ||
 	    data[frame_size + 10] != 0xBE ||
 	    data[frame_size + 12] != 0xAF)
 		match = false;
 
-	kunmap(rx_buffer->page);
+	kunmap_local(data);
 
 	return match;
 }
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2022-09-30 22:03 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29  8:58 [PATCH] ixgbe: Use kmap_local_page in ixgbe_check_lbtest_frame() Fabio M. De Francesco
2022-06-29  8:58 ` [Intel-wired-lan] " Fabio M. De Francesco
2022-06-30 10:10 ` Maciej Fijalkowski
2022-06-30 10:10   ` [Intel-wired-lan] " Maciej Fijalkowski
2022-06-30 15:17   ` Alexander Duyck
2022-06-30 15:17     ` Alexander Duyck
2022-06-30 15:21     ` Maciej Fijalkowski
2022-06-30 15:21       ` Maciej Fijalkowski
2022-06-30 15:25     ` Eric Dumazet
2022-06-30 15:25       ` Eric Dumazet
2022-06-30 16:09       ` Alexander Duyck
2022-06-30 16:09         ` Alexander Duyck
2022-06-30 18:18         ` Fabio M. De Francesco
2022-06-30 18:18           ` Fabio M. De Francesco
2022-06-30 21:59           ` Alexander Duyck
2022-06-30 21:59             ` Alexander Duyck
2022-07-01 15:36             ` Fabio M. De Francesco
2022-07-01 15:36               ` Fabio M. De Francesco
2022-09-22 20:07               ` Anirudh Venkataramanan
2022-09-22 20:07                 ` Anirudh Venkataramanan
2022-09-22 20:58                 ` Alexander Duyck
2022-09-22 20:58                   ` Alexander Duyck
2022-09-22 22:38                   ` Anirudh Venkataramanan
2022-09-22 22:38                     ` Anirudh Venkataramanan
2022-09-23 15:05                     ` Fabio M. De Francesco
2022-09-23 15:05                       ` Fabio M. De Francesco
2022-09-23 17:59                       ` Anirudh Venkataramanan
2022-09-23 17:59                         ` Anirudh Venkataramanan
2022-09-30 22:03                       ` Fabio M. De Francesco
2022-09-30 22:03                         ` Fabio M. De Francesco
2022-09-23 15:31                     ` Alexander Duyck
2022-09-23 15:31                       ` Alexander Duyck
2022-09-23 18:50                       ` Anirudh Venkataramanan
2022-09-23 18:50                         ` Anirudh Venkataramanan
2022-09-23 21:31                         ` Alexander Duyck
2022-09-23 21:31                           ` Alexander Duyck
2022-06-30 18:13     ` Fabio M. De Francesco
2022-06-30 18:13       ` Fabio M. De Francesco
2022-08-04 12:53 ` G, GurucharanX
2022-08-04 12:53   ` G, GurucharanX

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.