Commit 22b9c41a authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'bnxt_en-5-bug-fixes'

Michael Chan says:

====================
bnxt_en: 5 Bug fixes

This patchset fixes various issues, including SRIOV error unwinding,
one error recovery path, live patch reporting, XDP transmit path,
and PHC clock reading.
====================

Link: https://lore.kernel.org/r/1657592778-12730-1-git-send-email-michael.chan@broadcom.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents f946964a ddde5412
...@@ -7790,7 +7790,7 @@ static void bnxt_hwrm_dbg_qcaps(struct bnxt *bp) ...@@ -7790,7 +7790,7 @@ static void bnxt_hwrm_dbg_qcaps(struct bnxt *bp)
static int bnxt_hwrm_queue_qportcfg(struct bnxt *bp); static int bnxt_hwrm_queue_qportcfg(struct bnxt *bp);
static int bnxt_hwrm_func_qcaps(struct bnxt *bp) int bnxt_hwrm_func_qcaps(struct bnxt *bp)
{ {
int rc; int rc;
...@@ -10065,7 +10065,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up) ...@@ -10065,7 +10065,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_RESC_CHANGE) if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_RESC_CHANGE)
resc_reinit = true; resc_reinit = true;
if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE) if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE ||
test_bit(BNXT_STATE_FW_RESET_DET, &bp->state))
fw_reset = true; fw_reset = true;
else else
bnxt_remap_fw_health_regs(bp); bnxt_remap_fw_health_regs(bp);
......
...@@ -2314,6 +2314,7 @@ int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset); ...@@ -2314,6 +2314,7 @@ int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset);
int bnxt_hwrm_alloc_wol_fltr(struct bnxt *bp); int bnxt_hwrm_alloc_wol_fltr(struct bnxt *bp);
int bnxt_hwrm_free_wol_fltr(struct bnxt *bp); int bnxt_hwrm_free_wol_fltr(struct bnxt *bp);
int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp, bool all); int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp, bool all);
int bnxt_hwrm_func_qcaps(struct bnxt *bp);
int bnxt_hwrm_fw_set_time(struct bnxt *); int bnxt_hwrm_fw_set_time(struct bnxt *);
int bnxt_open_nic(struct bnxt *, bool, bool); int bnxt_open_nic(struct bnxt *, bool, bool);
int bnxt_half_open_nic(struct bnxt *bp); int bnxt_half_open_nic(struct bnxt *bp);
......
...@@ -979,9 +979,11 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req, ...@@ -979,9 +979,11 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
if (rc) if (rc)
return rc; return rc;
rc = bnxt_dl_livepatch_info_put(bp, req, BNXT_FW_SRT_PATCH); if (BNXT_CHIP_P5(bp)) {
if (rc) rc = bnxt_dl_livepatch_info_put(bp, req, BNXT_FW_SRT_PATCH);
return rc; if (rc)
return rc;
}
return bnxt_dl_livepatch_info_put(bp, req, BNXT_FW_CRT_PATCH); return bnxt_dl_livepatch_info_put(bp, req, BNXT_FW_CRT_PATCH);
} }
......
...@@ -76,14 +76,23 @@ static int bnxt_refclk_read(struct bnxt *bp, struct ptp_system_timestamp *sts, ...@@ -76,14 +76,23 @@ static int bnxt_refclk_read(struct bnxt *bp, struct ptp_system_timestamp *sts,
u64 *ns) u64 *ns)
{ {
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
u32 high_before, high_now, low;
if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
return -EIO; return -EIO;
high_before = readl(bp->bar0 + ptp->refclk_mapped_regs[1]);
ptp_read_system_prets(sts); ptp_read_system_prets(sts);
*ns = readl(bp->bar0 + ptp->refclk_mapped_regs[0]); low = readl(bp->bar0 + ptp->refclk_mapped_regs[0]);
ptp_read_system_postts(sts); ptp_read_system_postts(sts);
*ns |= (u64)readl(bp->bar0 + ptp->refclk_mapped_regs[1]) << 32; high_now = readl(bp->bar0 + ptp->refclk_mapped_regs[1]);
if (high_now != high_before) {
ptp_read_system_prets(sts);
low = readl(bp->bar0 + ptp->refclk_mapped_regs[0]);
ptp_read_system_postts(sts);
}
*ns = ((u64)high_now << 32) | low;
return 0; return 0;
} }
......
...@@ -823,8 +823,10 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs) ...@@ -823,8 +823,10 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
goto err_out2; goto err_out2;
rc = pci_enable_sriov(bp->pdev, *num_vfs); rc = pci_enable_sriov(bp->pdev, *num_vfs);
if (rc) if (rc) {
bnxt_ulp_sriov_cfg(bp, 0);
goto err_out2; goto err_out2;
}
return 0; return 0;
...@@ -832,6 +834,9 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs) ...@@ -832,6 +834,9 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
/* Free the resources reserved for various VF's */ /* Free the resources reserved for various VF's */
bnxt_hwrm_func_vf_resource_free(bp, *num_vfs); bnxt_hwrm_func_vf_resource_free(bp, *num_vfs);
/* Restore the max resources */
bnxt_hwrm_func_qcaps(bp);
err_out1: err_out1:
bnxt_free_vf_resources(bp); bnxt_free_vf_resources(bp);
......
...@@ -28,7 +28,7 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp, ...@@ -28,7 +28,7 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
struct xdp_buff *xdp) struct xdp_buff *xdp)
{ {
struct skb_shared_info *sinfo; struct skb_shared_info *sinfo;
struct bnxt_sw_tx_bd *tx_buf, *first_buf; struct bnxt_sw_tx_bd *tx_buf;
struct tx_bd *txbd; struct tx_bd *txbd;
int num_frags = 0; int num_frags = 0;
u32 flags; u32 flags;
...@@ -43,13 +43,14 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp, ...@@ -43,13 +43,14 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
/* fill up the first buffer */ /* fill up the first buffer */
prod = txr->tx_prod; prod = txr->tx_prod;
tx_buf = &txr->tx_buf_ring[prod]; tx_buf = &txr->tx_buf_ring[prod];
first_buf = tx_buf;
tx_buf->nr_frags = num_frags; tx_buf->nr_frags = num_frags;
if (xdp) if (xdp)
tx_buf->page = virt_to_head_page(xdp->data); tx_buf->page = virt_to_head_page(xdp->data);
txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)]; txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)];
flags = ((len) << TX_BD_LEN_SHIFT) | ((num_frags + 1) << TX_BD_FLAGS_BD_CNT_SHIFT); flags = (len << TX_BD_LEN_SHIFT) |
((num_frags + 1) << TX_BD_FLAGS_BD_CNT_SHIFT) |
bnxt_lhint_arr[len >> 9];
txbd->tx_bd_len_flags_type = cpu_to_le32(flags); txbd->tx_bd_len_flags_type = cpu_to_le32(flags);
txbd->tx_bd_opaque = prod; txbd->tx_bd_opaque = prod;
txbd->tx_bd_haddr = cpu_to_le64(mapping); txbd->tx_bd_haddr = cpu_to_le64(mapping);
...@@ -82,7 +83,6 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp, ...@@ -82,7 +83,6 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
flags = frag_len << TX_BD_LEN_SHIFT; flags = frag_len << TX_BD_LEN_SHIFT;
txbd->tx_bd_len_flags_type = cpu_to_le32(flags); txbd->tx_bd_len_flags_type = cpu_to_le32(flags);
txbd->tx_bd_opaque = prod;
txbd->tx_bd_haddr = cpu_to_le64(frag_mapping); txbd->tx_bd_haddr = cpu_to_le64(frag_mapping);
len = frag_len; len = frag_len;
...@@ -96,7 +96,7 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp, ...@@ -96,7 +96,7 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
prod = NEXT_TX(prod); prod = NEXT_TX(prod);
txr->tx_prod = prod; txr->tx_prod = prod;
return first_buf; return tx_buf;
} }
static void __bnxt_xmit_xdp(struct bnxt *bp, struct bnxt_tx_ring_info *txr, static void __bnxt_xmit_xdp(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment