mirror of
https://git.proxmox.com/git/pve-kernel
synced 2025-10-04 10:10:42 +00:00
cherry-pick "bnxt_en: Fix GSO type for HW GRO packets on 5750X chips"
Fix a incomplete backport by cherry-picking a follow-up fix [0]. [0]: https://lore.kernel.org/all/d50c0384-4607-4890-8012-e2e7032a5354@ovn.org/ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c2d3be5a9c
commit
e76a71c365
@ -0,0 +1,86 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Chan <michael.chan@broadcom.com>
|
||||||
|
Date: Wed, 4 Dec 2024 13:59:17 -0800
|
||||||
|
Subject: [PATCH] bnxt_en: Fix GSO type for HW GRO packets on 5750X chips
|
||||||
|
|
||||||
|
The existing code is using RSS profile to determine IPV4/IPV6 GSO type
|
||||||
|
on all chips older than 5760X. This won't work on 5750X chips that may
|
||||||
|
be using modified RSS profiles. This commit from 2018 has updated the
|
||||||
|
driver to not use RSS profile for HW GRO packets on newer chips:
|
||||||
|
|
||||||
|
50f011b63d8c ("bnxt_en: Update RSS setup and GRO-HW logic according to the latest spec.")
|
||||||
|
|
||||||
|
However, a recent commit to add support for the newest 5760X chip broke
|
||||||
|
the logic. If the GRO packet needs to be re-segmented by the stack, the
|
||||||
|
wrong GSO type will cause the packet to be dropped.
|
||||||
|
|
||||||
|
Fix it to only use RSS profile to determine GSO type on the oldest
|
||||||
|
5730X/5740X chips which cannot use the new method and is safe to use the
|
||||||
|
RSS profiles.
|
||||||
|
|
||||||
|
Also fix the L3/L4 hash type for RX packets by not using the RSS
|
||||||
|
profile for the same reason. Use the ITYPE field in the RX completion
|
||||||
|
to determine L3/L4 hash types correctly.
|
||||||
|
|
||||||
|
Fixes: a7445d69809f ("bnxt_en: Add support for new RX and TPA_START completion types for P7")
|
||||||
|
Reviewed-by: Colin Winegarden <colin.winegarden@broadcom.com>
|
||||||
|
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
|
||||||
|
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
|
||||||
|
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
|
||||||
|
Link: https://patch.msgid.link/20241204215918.1692597-2-michael.chan@broadcom.com
|
||||||
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
(cherry picked from commit de37faf41ac55619dd329229a9bd9698faeabc52)
|
||||||
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||||
|
---
|
||||||
|
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 14 ++++++--------
|
||||||
|
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 +++
|
||||||
|
2 files changed, 9 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
|
||||||
|
index 6f9325062a51..d75149895937 100644
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
|
||||||
|
@@ -1419,7 +1419,7 @@ static void bnxt_tpa_start(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
|
||||||
|
if (TPA_START_IS_IPV6(tpa_start1))
|
||||||
|
tpa_info->gso_type = SKB_GSO_TCPV6;
|
||||||
|
/* RSS profiles 1 and 3 with extract code 0 for inner 4-tuple */
|
||||||
|
- else if (cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP &&
|
||||||
|
+ else if (!BNXT_CHIP_P4_PLUS(bp) &&
|
||||||
|
TPA_START_HASH_TYPE(tpa_start) == 3)
|
||||||
|
tpa_info->gso_type = SKB_GSO_TCPV6;
|
||||||
|
tpa_info->rss_hash =
|
||||||
|
@@ -2110,15 +2110,13 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
|
||||||
|
if (cmp_type == CMP_TYPE_RX_L2_V3_CMP) {
|
||||||
|
type = bnxt_rss_ext_op(bp, rxcmp);
|
||||||
|
} else {
|
||||||
|
- u32 hash_type = RX_CMP_HASH_TYPE(rxcmp);
|
||||||
|
+ u32 itypes = RX_CMP_ITYPES(rxcmp);
|
||||||
|
|
||||||
|
- /* RSS profiles 1 and 3 with extract code 0 for inner
|
||||||
|
- * 4-tuple
|
||||||
|
- */
|
||||||
|
- if (hash_type != 1 && hash_type != 3)
|
||||||
|
- type = PKT_HASH_TYPE_L3;
|
||||||
|
- else
|
||||||
|
+ if (itypes == RX_CMP_FLAGS_ITYPE_TCP ||
|
||||||
|
+ itypes == RX_CMP_FLAGS_ITYPE_UDP)
|
||||||
|
type = PKT_HASH_TYPE_L4;
|
||||||
|
+ else
|
||||||
|
+ type = PKT_HASH_TYPE_L3;
|
||||||
|
}
|
||||||
|
skb_set_hash(skb, le32_to_cpu(rxcmp->rx_cmp_rss_hash), type);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
|
||||||
|
index 6b8d6a7f850a..7abb0963630f 100644
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
|
||||||
|
@@ -241,6 +241,9 @@ struct rx_cmp {
|
||||||
|
(((le32_to_cpu((rxcmp)->rx_cmp_misc_v1) & RX_CMP_RSS_HASH_TYPE) >>\
|
||||||
|
RX_CMP_RSS_HASH_TYPE_SHIFT) & RSS_PROFILE_ID_MASK)
|
||||||
|
|
||||||
|
+#define RX_CMP_ITYPES(rxcmp) \
|
||||||
|
+ (le32_to_cpu((rxcmp)->rx_cmp_len_flags_type) & RX_CMP_FLAGS_ITYPES_MASK)
|
||||||
|
+
|
||||||
|
#define RX_CMP_V3_HASH_TYPE_LEGACY(rxcmp) \
|
||||||
|
((le32_to_cpu((rxcmp)->rx_cmp_misc_v1) & RX_CMP_V3_RSS_EXT_OP_LEGACY) >>\
|
||||||
|
RX_CMP_V3_RSS_EXT_OP_LEGACY_SHIFT)
|
Loading…
Reference in New Issue
Block a user