Skip to content

Commit ff9b305

Browse files
committed
Merge branch 'bnxt_en-bug-fixes'
Michael Chan says: ==================== bnxt_en: Bug fixes There are 2 bug fixes in this series. This first one fixes the issue of setting the gso_type incorrectly for HW GRO packets on 5750X (Thor) chips. This can cause HW GRO packets to be dropped by the stack if they are re-segmented. The second one fixes a potential division by zero crash when dumping FW log coredump. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 5e7aa97 + fab4b4d commit ff9b305

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ static void bnxt_tpa_start(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
15311531
if (TPA_START_IS_IPV6(tpa_start1))
15321532
tpa_info->gso_type = SKB_GSO_TCPV6;
15331533
/* RSS profiles 1 and 3 with extract code 0 for inner 4-tuple */
1534-
else if (cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP &&
1534+
else if (!BNXT_CHIP_P4_PLUS(bp) &&
15351535
TPA_START_HASH_TYPE(tpa_start) == 3)
15361536
tpa_info->gso_type = SKB_GSO_TCPV6;
15371537
tpa_info->rss_hash =
@@ -2226,15 +2226,13 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
22262226
if (cmp_type == CMP_TYPE_RX_L2_V3_CMP) {
22272227
type = bnxt_rss_ext_op(bp, rxcmp);
22282228
} else {
2229-
u32 hash_type = RX_CMP_HASH_TYPE(rxcmp);
2229+
u32 itypes = RX_CMP_ITYPES(rxcmp);
22302230

2231-
/* RSS profiles 1 and 3 with extract code 0 for inner
2232-
* 4-tuple
2233-
*/
2234-
if (hash_type != 1 && hash_type != 3)
2235-
type = PKT_HASH_TYPE_L3;
2236-
else
2231+
if (itypes == RX_CMP_FLAGS_ITYPE_TCP ||
2232+
itypes == RX_CMP_FLAGS_ITYPE_UDP)
22372233
type = PKT_HASH_TYPE_L4;
2234+
else
2235+
type = PKT_HASH_TYPE_L3;
22382236
}
22392237
skb_set_hash(skb, le32_to_cpu(rxcmp->rx_cmp_rss_hash), type);
22402238
}
@@ -8367,7 +8365,7 @@ static int bnxt_alloc_all_ctx_pg_info(struct bnxt *bp, int ctx_max)
83678365
struct bnxt_ctx_mem_type *ctxm = &ctx->ctx_arr[type];
83688366
int n = 1;
83698367

8370-
if (!ctxm->max_entries)
8368+
if (!ctxm->max_entries || ctxm->pg_info)
83718369
continue;
83728370

83738371
if (ctxm->instance_bmap)
@@ -8971,8 +8969,8 @@ static int bnxt_backing_store_cfg_v2(struct bnxt *bp, u32 ena)
89718969
continue;
89728970
}
89738971
bnxt_bs_trace_init(bp, ctxm);
8974-
last_type = type;
89758972
}
8973+
last_type = type;
89768974
}
89778975

89788976
if (last_type == BNXT_CTX_INV) {

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ struct rx_cmp {
267267
(((le32_to_cpu((rxcmp)->rx_cmp_misc_v1) & RX_CMP_RSS_HASH_TYPE) >>\
268268
RX_CMP_RSS_HASH_TYPE_SHIFT) & RSS_PROFILE_ID_MASK)
269269

270+
#define RX_CMP_ITYPES(rxcmp) \
271+
(le32_to_cpu((rxcmp)->rx_cmp_len_flags_type) & RX_CMP_FLAGS_ITYPES_MASK)
272+
270273
#define RX_CMP_V3_HASH_TYPE_LEGACY(rxcmp) \
271274
((le32_to_cpu((rxcmp)->rx_cmp_misc_v1) & RX_CMP_V3_RSS_EXT_OP_LEGACY) >>\
272275
RX_CMP_V3_RSS_EXT_OP_LEGACY_SHIFT)

0 commit comments

Comments
 (0)