Skip to content

Commit e1de100

Browse files
committed
Merge: bnxt_en: cherry-picked fixes from v6.13-rc7
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6152 JIRA: https://issues.redhat.com/browse/RHEL-72033 Here's handful of bnxt fixes from upstream up to v6.13-rc7. We have a customer issue that is fixed by one of them, "bnxt_en: Fix GSO type for HW GRO packets on 5750X chips". Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: Kamal Heib <kheib@redhat.com> Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents 0d14165 + 1d62059 commit e1de100

File tree

4 files changed

+53
-19
lines changed

4 files changed

+53
-19
lines changed

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

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ static void bnxt_tpa_start(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
15181518
if (TPA_START_IS_IPV6(tpa_start1))
15191519
tpa_info->gso_type = SKB_GSO_TCPV6;
15201520
/* RSS profiles 1 and 3 with extract code 0 for inner 4-tuple */
1521-
else if (cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP &&
1521+
else if (!BNXT_CHIP_P4_PLUS(bp) &&
15221522
TPA_START_HASH_TYPE(tpa_start) == 3)
15231523
tpa_info->gso_type = SKB_GSO_TCPV6;
15241524
tpa_info->rss_hash =
@@ -2212,15 +2212,13 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
22122212
if (cmp_type == CMP_TYPE_RX_L2_V3_CMP) {
22132213
type = bnxt_rss_ext_op(bp, rxcmp);
22142214
} else {
2215-
u32 hash_type = RX_CMP_HASH_TYPE(rxcmp);
2215+
u32 itypes = RX_CMP_ITYPES(rxcmp);
22162216

2217-
/* RSS profiles 1 and 3 with extract code 0 for inner
2218-
* 4-tuple
2219-
*/
2220-
if (hash_type != 1 && hash_type != 3)
2221-
type = PKT_HASH_TYPE_L3;
2222-
else
2217+
if (itypes == RX_CMP_FLAGS_ITYPE_TCP ||
2218+
itypes == RX_CMP_FLAGS_ITYPE_UDP)
22232219
type = PKT_HASH_TYPE_L4;
2220+
else
2221+
type = PKT_HASH_TYPE_L3;
22242222
}
22252223
skb_set_hash(skb, le32_to_cpu(rxcmp->rx_cmp_rss_hash), type);
22262224
}
@@ -2828,6 +2826,13 @@ static int bnxt_hwrm_handler(struct bnxt *bp, struct tx_cmp *txcmp)
28282826
return 0;
28292827
}
28302828

2829+
static bool bnxt_vnic_is_active(struct bnxt *bp)
2830+
{
2831+
struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
2832+
2833+
return vnic->fw_vnic_id != INVALID_HW_RING_ID && vnic->mru > 0;
2834+
}
2835+
28312836
static irqreturn_t bnxt_msix(int irq, void *dev_instance)
28322837
{
28332838
struct bnxt_napi *bnapi = dev_instance;
@@ -3095,7 +3100,7 @@ static int bnxt_poll(struct napi_struct *napi, int budget)
30953100
break;
30963101
}
30973102
}
3098-
if (bp->flags & BNXT_FLAG_DIM) {
3103+
if ((bp->flags & BNXT_FLAG_DIM) && bnxt_vnic_is_active(bp)) {
30993104
struct dim_sample dim_sample = {};
31003105

31013106
dim_update_sample(cpr->event_ctr,
@@ -3226,7 +3231,7 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget)
32263231
poll_done:
32273232
cpr_rx = &cpr->cp_ring_arr[0];
32283233
if (cpr_rx->cp_ring_type == BNXT_NQ_HDL_TYPE_RX &&
3229-
(bp->flags & BNXT_FLAG_DIM)) {
3234+
(bp->flags & BNXT_FLAG_DIM) && bnxt_vnic_is_active(bp)) {
32303235
struct dim_sample dim_sample = {};
32313236

32323237
dim_update_sample(cpr->event_ctr,
@@ -7118,6 +7123,26 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
71187123
return rc;
71197124
}
71207125

7126+
static void bnxt_cancel_dim(struct bnxt *bp)
7127+
{
7128+
int i;
7129+
7130+
/* DIM work is initialized in bnxt_enable_napi(). Proceed only
7131+
* if NAPI is enabled.
7132+
*/
7133+
if (!bp->bnapi || test_bit(BNXT_STATE_NAPI_DISABLED, &bp->state))
7134+
return;
7135+
7136+
/* Make sure NAPI sees that the VNIC is disabled */
7137+
synchronize_net();
7138+
for (i = 0; i < bp->rx_nr_rings; i++) {
7139+
struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i];
7140+
struct bnxt_napi *bnapi = rxr->bnapi;
7141+
7142+
cancel_work_sync(&bnapi->cp_ring.dim.work);
7143+
}
7144+
}
7145+
71217146
static int hwrm_ring_free_send_msg(struct bnxt *bp,
71227147
struct bnxt_ring_struct *ring,
71237148
u32 ring_type, int cmpl_ring_id)
@@ -7218,6 +7243,7 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
72187243
}
72197244
}
72207245

7246+
bnxt_cancel_dim(bp);
72217247
for (i = 0; i < bp->rx_nr_rings; i++) {
72227248
bnxt_hwrm_rx_ring_free(bp, &bp->rx_ring[i], close_path);
72237249
bnxt_hwrm_rx_agg_ring_free(bp, &bp->rx_ring[i], close_path);
@@ -11014,8 +11040,6 @@ static void bnxt_disable_napi(struct bnxt *bp)
1101411040
if (bnapi->in_reset)
1101511041
cpr->sw_stats->rx.rx_resets++;
1101611042
napi_disable(&bnapi->napi);
11017-
if (bnapi->rx_ring)
11018-
cancel_work_sync(&cpr->dim.work);
1101911043
}
1102011044
}
1102111045

@@ -15271,8 +15295,10 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx)
1527115295
bnxt_hwrm_vnic_update(bp, vnic,
1527215296
VNIC_UPDATE_REQ_ENABLES_MRU_VALID);
1527315297
}
15274-
15298+
/* Make sure NAPI sees that the VNIC is disabled */
15299+
synchronize_net();
1527515300
rxr = &bp->rx_ring[idx];
15301+
cancel_work_sync(&rxr->bnapi->cp_ring.dim.work);
1527615302
bnxt_hwrm_rx_ring_free(bp, rxr, false);
1527715303
bnxt_hwrm_rx_agg_ring_free(bp, rxr, false);
1527815304
rxr->rx_next_cons = 0;

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

Lines changed: 6 additions & 3 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)
@@ -378,7 +381,7 @@ struct rx_agg_cmp {
378381
u32 rx_agg_cmp_opaque;
379382
__le32 rx_agg_cmp_v;
380383
#define RX_AGG_CMP_V (1 << 0)
381-
#define RX_AGG_CMP_AGG_ID (0xffff << 16)
384+
#define RX_AGG_CMP_AGG_ID (0x0fff << 16)
382385
#define RX_AGG_CMP_AGG_ID_SHIFT 16
383386
__le32 rx_agg_cmp_unused;
384387
};
@@ -416,7 +419,7 @@ struct rx_tpa_start_cmp {
416419
#define RX_TPA_START_CMP_V3_RSS_HASH_TYPE_SHIFT 7
417420
#define RX_TPA_START_CMP_AGG_ID (0x7f << 25)
418421
#define RX_TPA_START_CMP_AGG_ID_SHIFT 25
419-
#define RX_TPA_START_CMP_AGG_ID_P5 (0xffff << 16)
422+
#define RX_TPA_START_CMP_AGG_ID_P5 (0x0fff << 16)
420423
#define RX_TPA_START_CMP_AGG_ID_SHIFT_P5 16
421424
#define RX_TPA_START_CMP_METADATA1 (0xf << 28)
422425
#define RX_TPA_START_CMP_METADATA1_SHIFT 28
@@ -540,7 +543,7 @@ struct rx_tpa_end_cmp {
540543
#define RX_TPA_END_CMP_PAYLOAD_OFFSET_SHIFT 16
541544
#define RX_TPA_END_CMP_AGG_ID (0x7f << 25)
542545
#define RX_TPA_END_CMP_AGG_ID_SHIFT 25
543-
#define RX_TPA_END_CMP_AGG_ID_P5 (0xffff << 16)
546+
#define RX_TPA_END_CMP_AGG_ID_P5 (0x0fff << 16)
544547
#define RX_TPA_END_CMP_AGG_ID_SHIFT_P5 16
545548

546549
__le32 rx_tpa_end_cmp_tsdelta;

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,10 +1194,14 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd)
11941194
}
11951195
}
11961196

1197-
if (fltr->base.flags & BNXT_ACT_DROP)
1197+
if (fltr->base.flags & BNXT_ACT_DROP) {
11981198
fs->ring_cookie = RX_CLS_FLOW_DISC;
1199-
else
1199+
} else if (fltr->base.flags & BNXT_ACT_RSS_CTX) {
1200+
fs->flow_type |= FLOW_RSS;
1201+
cmd->rss_context = fltr->base.fw_vnic_id;
1202+
} else {
12001203
fs->ring_cookie = fltr->base.rxq;
1204+
}
12011205
rc = 0;
12021206

12031207
fltr_err:

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ int bnxt_send_msg(struct bnxt_en_dev *edev,
208208

209209
rc = hwrm_req_replace(bp, req, fw_msg->msg, fw_msg->msg_len);
210210
if (rc)
211-
return rc;
211+
goto drop_req;
212212

213213
hwrm_req_timeout(bp, req, fw_msg->timeout);
214214
resp = hwrm_req_hold(bp, req);
@@ -220,6 +220,7 @@ int bnxt_send_msg(struct bnxt_en_dev *edev,
220220

221221
memcpy(fw_msg->resp, resp, resp_len);
222222
}
223+
drop_req:
223224
hwrm_req_drop(bp, req);
224225
return rc;
225226
}

0 commit comments

Comments
 (0)