linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC
@ 2022-09-15 12:40 Fabio M. De Francesco
  2022-09-15 16:30 ` Tony Nguyen
  2022-09-15 16:57 ` Ira Weiny
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio M. De Francesco @ 2022-09-15 12:40 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, Jean Delvare,
	Guenter Roeck, intel-wired-lan, netdev, linux-kernel, bpf,
	linux-hwmon
  Cc: Fabio M. De Francesco, Ira Weiny, Alexander Duyck, Gurucharan

Pages allocated with GFP_ATOMIC cannot come from Highmem. This is why
there is no need to call kmap() on them.

Therefore, don't call kmap() on rx_buffer->page() and instead use a
plain page_address() to get the kernel address.

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Alexander Duyck <alexander.duyck@gmail.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Alexander Duyck <alexander.duyck@gmail.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---

I send again this patch because it was submitted more than two months ago,
Monday 4th July 2022, but for one or more (good?) reasons it has not yet
reached Linus' tree. In the meantime I am also forwarding two "Reviewed-by"
and one "Tested-by" tags (thanks a lot to Ira, Alexander, Gurucharan).
Obviously I have not made any changes to the code.

 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 04f453eabef6..cb5c707538a5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -1964,15 +1964,13 @@ 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 = page_address(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);
-
 	return match;
 }
 
-- 
2.37.2


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

* Re: [RESEND PATCH] ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC
  2022-09-15 12:40 [RESEND PATCH] ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC Fabio M. De Francesco
@ 2022-09-15 16:30 ` Tony Nguyen
  2022-09-15 16:58   ` Ira Weiny
  2022-09-15 16:57 ` Ira Weiny
  1 sibling, 1 reply; 4+ messages in thread
From: Tony Nguyen @ 2022-09-15 16:30 UTC (permalink / raw)
  To: Fabio M. De Francesco, Jesse Brandeburg, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
	Jean Delvare, Guenter Roeck, intel-wired-lan, netdev,
	linux-kernel, bpf, linux-hwmon
  Cc: Ira Weiny, Alexander Duyck, Gurucharan



On 9/15/2022 5:40 AM, Fabio M. De Francesco wrote:
> Pages allocated with GFP_ATOMIC cannot come from Highmem. This is why
> there is no need to call kmap() on them.
> 
> Therefore, don't call kmap() on rx_buffer->page() and instead use a
> plain page_address() to get the kernel address.
> 
> Suggested-by: Ira Weiny <ira.weiny@intel.com>
> Suggested-by: Alexander Duyck <alexander.duyck@gmail.com>
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> Reviewed-by: Alexander Duyck <alexander.duyck@gmail.com>
> Tested-by: Gurucharan <gurucharanx.g@intel.com>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> 
> I send again this patch because it was submitted more than two months ago,
> Monday 4th July 2022, but for one or more (good?) reasons it has not yet
> reached Linus' tree. In the meantime I am also forwarding two "Reviewed-by"
> and one "Tested-by" tags (thanks a lot to Ira, Alexander, Gurucharan).
> Obviously I have not made any changes to the code.

Hi Fabio,

This is accepted into net-next already[1] and will land in the next kernel.

Thanks,
Tony

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=03f51719df032637250af828f9a1ffcc5695982d

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

* Re: [RESEND PATCH] ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC
  2022-09-15 12:40 [RESEND PATCH] ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC Fabio M. De Francesco
  2022-09-15 16:30 ` Tony Nguyen
@ 2022-09-15 16:57 ` Ira Weiny
  1 sibling, 0 replies; 4+ messages in thread
From: Ira Weiny @ 2022-09-15 16:57 UTC (permalink / raw)
  To: Fabio M. De Francesco, Tony Nguyen
  Cc: Jesse Brandeburg, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, Jean Delvare,
	Guenter Roeck, intel-wired-lan, netdev, linux-kernel, bpf,
	linux-hwmon, Alexander Duyck, Gurucharan

On Thu, Sep 15, 2022 at 02:40:12PM +0200, Fabio M. De Francesco wrote:
> Pages allocated with GFP_ATOMIC cannot come from Highmem. This is why
> there is no need to call kmap() on them.
> 
> Therefore, don't call kmap() on rx_buffer->page() and instead use a
> plain page_address() to get the kernel address.
> 
> Suggested-by: Ira Weiny <ira.weiny@intel.com>
> Suggested-by: Alexander Duyck <alexander.duyck@gmail.com>
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> Reviewed-by: Alexander Duyck <alexander.duyck@gmail.com>
> Tested-by: Gurucharan <gurucharanx.g@intel.com>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> 
> I send again this patch because it was submitted more than two months ago,
> Monday 4th July 2022, but for one or more (good?) reasons it has not yet
> reached Linus' tree. In the meantime I am also forwarding two "Reviewed-by"
> and one "Tested-by" tags (thanks a lot to Ira, Alexander, Gurucharan).
> Obviously I have not made any changes to the code.

I see this applied by Tony Nguyen in linux-next:

03f51719df03 ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC

So I assume it will land in the next merge window?

Move Tony to the To line.

Ira

> 
>  drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> index 04f453eabef6..cb5c707538a5 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> @@ -1964,15 +1964,13 @@ 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 = page_address(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);
> -
>  	return match;
>  }
>  
> -- 
> 2.37.2
> 

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

* Re: [RESEND PATCH] ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC
  2022-09-15 16:30 ` Tony Nguyen
@ 2022-09-15 16:58   ` Ira Weiny
  0 siblings, 0 replies; 4+ messages in thread
From: Ira Weiny @ 2022-09-15 16:58 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: Fabio M. De Francesco, Jesse Brandeburg, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
	Jean Delvare, Guenter Roeck, intel-wired-lan, netdev,
	linux-kernel, bpf, linux-hwmon, Alexander Duyck, Gurucharan

On Thu, Sep 15, 2022 at 09:30:50AM -0700, Tony Nguyen wrote:
> 
> 
> On 9/15/2022 5:40 AM, Fabio M. De Francesco wrote:
> > Pages allocated with GFP_ATOMIC cannot come from Highmem. This is why
> > there is no need to call kmap() on them.
> > 
> > Therefore, don't call kmap() on rx_buffer->page() and instead use a
> > plain page_address() to get the kernel address.
> > 
> > Suggested-by: Ira Weiny <ira.weiny@intel.com>
> > Suggested-by: Alexander Duyck <alexander.duyck@gmail.com>
> > Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> > Reviewed-by: Alexander Duyck <alexander.duyck@gmail.com>
> > Tested-by: Gurucharan <gurucharanx.g@intel.com>
> > Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> > ---
> > 
> > I send again this patch because it was submitted more than two months ago,
> > Monday 4th July 2022, but for one or more (good?) reasons it has not yet
> > reached Linus' tree. In the meantime I am also forwarding two "Reviewed-by"
> > and one "Tested-by" tags (thanks a lot to Ira, Alexander, Gurucharan).
> > Obviously I have not made any changes to the code.
> 
> Hi Fabio,
> 
> This is accepted into net-next already[1] and will land in the next kernel.

Thanks, sorry just saw this after sending my last.  :-/  :-D

Ira

> 
> Thanks,
> Tony
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=03f51719df032637250af828f9a1ffcc5695982d

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

end of thread, other threads:[~2022-09-15 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 12:40 [RESEND PATCH] ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC Fabio M. De Francesco
2022-09-15 16:30 ` Tony Nguyen
2022-09-15 16:58   ` Ira Weiny
2022-09-15 16:57 ` Ira Weiny

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