From: Ira Weiny <ira.weiny@intel.com>
To: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Cc: "Fabio M . De Francesco" <fmdefrancesco@gmail.com>,
intel-wired-lan@lists.osuosl.org
Subject: Re: [Intel-wired-lan] [RESEND PATCH net-next 1/2] e1000: Remove unnecessary use of kmap_atomic()
Date: Thu, 29 Sep 2022 15:31:37 -0700 [thread overview]
Message-ID: <YzYcyasuTqdPmbOb@iweiny-desk3> (raw)
In-Reply-To: <20220919180949.388785-1-anirudh.venkataramanan@intel.com>
On Mon, Sep 19, 2022 at 11:09:48AM -0700, Venkataramanan, Anirudh wrote:
> buffer_info->rxbuf.page accessed in e1000_clean_jumbo_rx_irq() is
> allocated using GFP_ATOMIC. Pages allocated with GFP_ATOMIC can't come from
> highmem and so there's no need to kmap() them. Just use page_address().
>
> I don't have access to a 32-bit system so did some limited testing on
> qemu (qemu-system-i386 -m 4096 -smp 4 -device e1000e) with a 32-bit
> Debian 11.04 image.
>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
> Suggested-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
> ---
> drivers/net/ethernet/intel/e1000/e1000_main.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
> index 23299fc..93e57b1 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> @@ -4229,8 +4229,6 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
> */
> p = buffer_info->rxbuf.page;
> if (length <= copybreak) {
> - u8 *vaddr;
> -
> if (likely(!(netdev->features & NETIF_F_RXFCS)))
> length -= 4;
> skb = e1000_alloc_rx_skb(adapter,
> @@ -4238,10 +4236,9 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
> if (!skb)
> break;
>
> - vaddr = kmap_atomic(p);
> - memcpy(skb_tail_pointer(skb), vaddr,
> - length);
> - kunmap_atomic(vaddr);
> + memcpy(skb_tail_pointer(skb),
> + page_address(p), length);
> +
> /* re-use the page, so don't erase
> * buffer_info->rxbuf.page
> */
> --
> 2.37.2
>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
prev parent reply other threads:[~2022-09-29 22:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 18:09 [Intel-wired-lan] [RESEND PATCH net-next 1/2] e1000: Remove unnecessary use of kmap_atomic() Anirudh Venkataramanan
2022-09-19 18:09 ` [Intel-wired-lan] [RESEND PATCH net-next 2/2] e1000e: " Anirudh Venkataramanan
2022-09-29 22:40 ` Ira Weiny
2022-09-30 18:20 ` Anirudh Venkataramanan
2022-09-30 21:57 ` Tony Nguyen
2022-09-29 22:31 ` Ira Weiny [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YzYcyasuTqdPmbOb@iweiny-desk3 \
--to=ira.weiny@intel.com \
--cc=anirudh.venkataramanan@intel.com \
--cc=fmdefrancesco@gmail.com \
--cc=intel-wired-lan@lists.osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox