Skip to content

Commit b2a20fd

Browse files
committed
Merge branch 'bnxt_en-Misc-bug-fixes'
Michael Chan says: ==================== bnxt_en: Misc. bug fixes. 6 miscellaneous bug fixes covering several issues in error code paths, a setup issue for statistics DMA, and an improvement for setting up multicast address filters. Please queue these for stable as well. Patch #5 (bnxt_en: Fix statistics context reservation logic) is for the most recent 5.0 stable only. Thanks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents fdfdf86 + 0b397b1 commit b2a20fd

File tree

1 file changed

+32
-21
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+32
-21
lines changed

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

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
16251625
netdev_warn(bp->dev, "RX buffer error %x\n", rx_err);
16261626
bnxt_sched_reset(bp, rxr);
16271627
}
1628-
goto next_rx;
1628+
goto next_rx_no_len;
16291629
}
16301630

16311631
len = le32_to_cpu(rxcmp->rx_cmp_len_flags_type) >> RX_CMP_LEN_SHIFT;
@@ -1706,12 +1706,13 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
17061706
rc = 1;
17071707

17081708
next_rx:
1709-
rxr->rx_prod = NEXT_RX(prod);
1710-
rxr->rx_next_cons = NEXT_RX(cons);
1711-
17121709
cpr->rx_packets += 1;
17131710
cpr->rx_bytes += len;
17141711

1712+
next_rx_no_len:
1713+
rxr->rx_prod = NEXT_RX(prod);
1714+
rxr->rx_next_cons = NEXT_RX(cons);
1715+
17151716
next_rx_no_prod_no_len:
17161717
*raw_cons = tmp_raw_cons;
17171718

@@ -5135,10 +5136,10 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
51355136
for (i = 0; i < bp->tx_nr_rings; i++) {
51365137
struct bnxt_tx_ring_info *txr = &bp->tx_ring[i];
51375138
struct bnxt_ring_struct *ring = &txr->tx_ring_struct;
5138-
u32 cmpl_ring_id;
51395139

5140-
cmpl_ring_id = bnxt_cp_ring_for_tx(bp, txr);
51415140
if (ring->fw_ring_id != INVALID_HW_RING_ID) {
5141+
u32 cmpl_ring_id = bnxt_cp_ring_for_tx(bp, txr);
5142+
51425143
hwrm_ring_free_send_msg(bp, ring,
51435144
RING_FREE_REQ_RING_TYPE_TX,
51445145
close_path ? cmpl_ring_id :
@@ -5151,10 +5152,10 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
51515152
struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i];
51525153
struct bnxt_ring_struct *ring = &rxr->rx_ring_struct;
51535154
u32 grp_idx = rxr->bnapi->index;
5154-
u32 cmpl_ring_id;
51555155

5156-
cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr);
51575156
if (ring->fw_ring_id != INVALID_HW_RING_ID) {
5157+
u32 cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr);
5158+
51585159
hwrm_ring_free_send_msg(bp, ring,
51595160
RING_FREE_REQ_RING_TYPE_RX,
51605161
close_path ? cmpl_ring_id :
@@ -5173,10 +5174,10 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
51735174
struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i];
51745175
struct bnxt_ring_struct *ring = &rxr->rx_agg_ring_struct;
51755176
u32 grp_idx = rxr->bnapi->index;
5176-
u32 cmpl_ring_id;
51775177

5178-
cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr);
51795178
if (ring->fw_ring_id != INVALID_HW_RING_ID) {
5179+
u32 cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr);
5180+
51805181
hwrm_ring_free_send_msg(bp, ring, type,
51815182
close_path ? cmpl_ring_id :
51825183
INVALID_HW_RING_ID);
@@ -5315,17 +5316,16 @@ __bnxt_hwrm_reserve_pf_rings(struct bnxt *bp, struct hwrm_func_cfg_input *req,
53155316
req->num_tx_rings = cpu_to_le16(tx_rings);
53165317
if (BNXT_NEW_RM(bp)) {
53175318
enables |= rx_rings ? FUNC_CFG_REQ_ENABLES_NUM_RX_RINGS : 0;
5319+
enables |= stats ? FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0;
53185320
if (bp->flags & BNXT_FLAG_CHIP_P5) {
53195321
enables |= cp_rings ? FUNC_CFG_REQ_ENABLES_NUM_MSIX : 0;
53205322
enables |= tx_rings + ring_grps ?
5321-
FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS |
5322-
FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0;
5323+
FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS : 0;
53235324
enables |= rx_rings ?
53245325
FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS : 0;
53255326
} else {
53265327
enables |= cp_rings ?
5327-
FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS |
5328-
FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0;
5328+
FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS : 0;
53295329
enables |= ring_grps ?
53305330
FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS |
53315331
FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS : 0;
@@ -5365,14 +5365,13 @@ __bnxt_hwrm_reserve_vf_rings(struct bnxt *bp,
53655365
enables |= tx_rings ? FUNC_VF_CFG_REQ_ENABLES_NUM_TX_RINGS : 0;
53665366
enables |= rx_rings ? FUNC_VF_CFG_REQ_ENABLES_NUM_RX_RINGS |
53675367
FUNC_VF_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS : 0;
5368+
enables |= stats ? FUNC_VF_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0;
53685369
if (bp->flags & BNXT_FLAG_CHIP_P5) {
53695370
enables |= tx_rings + ring_grps ?
5370-
FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS |
5371-
FUNC_VF_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0;
5371+
FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS : 0;
53725372
} else {
53735373
enables |= cp_rings ?
5374-
FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS |
5375-
FUNC_VF_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0;
5374+
FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS : 0;
53765375
enables |= ring_grps ?
53775376
FUNC_VF_CFG_REQ_ENABLES_NUM_HW_RING_GRPS : 0;
53785377
}
@@ -6753,6 +6752,7 @@ static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp)
67536752
struct hwrm_queue_pri2cos_qcfg_input req2 = {0};
67546753
struct hwrm_port_qstats_ext_input req = {0};
67556754
struct bnxt_pf_info *pf = &bp->pf;
6755+
u32 tx_stat_size;
67566756
int rc;
67576757

67586758
if (!(bp->flags & BNXT_FLAG_PORT_STATS_EXT))
@@ -6762,13 +6762,16 @@ static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp)
67626762
req.port_id = cpu_to_le16(pf->port_id);
67636763
req.rx_stat_size = cpu_to_le16(sizeof(struct rx_port_stats_ext));
67646764
req.rx_stat_host_addr = cpu_to_le64(bp->hw_rx_port_stats_ext_map);
6765-
req.tx_stat_size = cpu_to_le16(sizeof(struct tx_port_stats_ext));
6765+
tx_stat_size = bp->hw_tx_port_stats_ext ?
6766+
sizeof(*bp->hw_tx_port_stats_ext) : 0;
6767+
req.tx_stat_size = cpu_to_le16(tx_stat_size);
67666768
req.tx_stat_host_addr = cpu_to_le64(bp->hw_tx_port_stats_ext_map);
67676769
mutex_lock(&bp->hwrm_cmd_lock);
67686770
rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
67696771
if (!rc) {
67706772
bp->fw_rx_stats_ext_size = le16_to_cpu(resp->rx_stat_size) / 8;
6771-
bp->fw_tx_stats_ext_size = le16_to_cpu(resp->tx_stat_size) / 8;
6773+
bp->fw_tx_stats_ext_size = tx_stat_size ?
6774+
le16_to_cpu(resp->tx_stat_size) / 8 : 0;
67726775
} else {
67736776
bp->fw_rx_stats_ext_size = 0;
67746777
bp->fw_tx_stats_ext_size = 0;
@@ -8961,8 +8964,15 @@ static int bnxt_cfg_rx_mode(struct bnxt *bp)
89618964

89628965
skip_uc:
89638966
rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
8967+
if (rc && vnic->mc_list_count) {
8968+
netdev_info(bp->dev, "Failed setting MC filters rc: %d, turning on ALL_MCAST mode\n",
8969+
rc);
8970+
vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST;
8971+
vnic->mc_list_count = 0;
8972+
rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
8973+
}
89648974
if (rc)
8965-
netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %x\n",
8975+
netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %d\n",
89668976
rc);
89678977

89688978
return rc;
@@ -10685,6 +10695,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1068510695
bnxt_clear_int_mode(bp);
1068610696

1068710697
init_err_pci_clean:
10698+
bnxt_free_hwrm_short_cmd_req(bp);
1068810699
bnxt_free_hwrm_resources(bp);
1068910700
bnxt_free_ctx_mem(bp);
1069010701
kfree(bp->ctx);

0 commit comments

Comments
 (0)