]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
bnxt_en: reserve space inside receive page for skb_shared_info
authorAndy Gospodarek <gospo@broadcom.com>
Sat, 2 Apr 2022 00:21:11 +0000 (20:21 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:41:05 +0000 (14:41 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969107
[ Upstream commit facc173cf700e55b2ad249ecbd3a7537f7315691 ]

Insufficient space was being reserved in the page used for packet
reception, so the interface MTU could be set too large to still have
room for the contents of the packet when doing XDP redirect.  This
resulted in the following message when redirecting a packet between
3520 and 3822 bytes with an MTU of 3822:

[311815.561880] XDP_WARN: xdp_update_frame_from_buff(line:200): Driver BUG: missing reserved tailroom

Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 154fc224e65ed601ce585471346da9c8ced820e7)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index 0aaaeecd67eab4d6bffe9f7181145bf0647b2ad5..e5874c829226e2f8319a33bf358518f38fba3644 100644 (file)
@@ -584,7 +584,8 @@ struct nqe_cn {
 #define BNXT_MAX_MTU           9500
 #define BNXT_MAX_PAGE_MODE_MTU \
        ((unsigned int)PAGE_SIZE - VLAN_ETH_HLEN - NET_IP_ALIGN -       \
-        XDP_PACKET_HEADROOM)
+        XDP_PACKET_HEADROOM - \
+        SKB_DATA_ALIGN((unsigned int)sizeof(struct skb_shared_info)))
 
 #define BNXT_MIN_PKT_SIZE      52