]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
e1000: Remove unnecessary use of kmap_atomic()
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Mon, 19 Sep 2022 18:09:48 +0000 (11:09 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 2 Nov 2022 18:09:13 +0000 (11:09 -0700)
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>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/e1000/e1000_main.c

index 61e60e4de600fb2059f6a01b47e87cb199a03c09..da6e303ad99b510212948e424e1edc34a35d6f5a 100644 (file)
@@ -4229,8 +4229,6 @@ process_skb:
                                 */
                                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 @@ process_skb:
                                        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
                                         */