Skip to content

Commit 37b0a73

Browse files
committed
Merge branch 'bnxt_en-Bug-fixes'
Michael Chan says: ==================== bnxt_en: Bug fixes. 2 Bug fixes related to 57500 shutdown sequence and doorbell sequence, 2 TC Flower bug fixes related to the setting of the flow direction, 1 NVRAM update bug fix, and a minor fix to suppress an unnecessary error message. Please queue for -stable as well. Thanks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f1472cb + 9bf4656 commit 37b0a73

File tree

5 files changed

+42
-29
lines changed

5 files changed

+42
-29
lines changed

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

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,9 +2021,9 @@ static void __bnxt_poll_work_done(struct bnxt *bp, struct bnxt_napi *bnapi)
20212021
if (bnapi->events & BNXT_RX_EVENT) {
20222022
struct bnxt_rx_ring_info *rxr = bnapi->rx_ring;
20232023

2024-
bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod);
20252024
if (bnapi->events & BNXT_AGG_EVENT)
20262025
bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod);
2026+
bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod);
20272027
}
20282028
bnapi->events = 0;
20292029
}
@@ -5064,6 +5064,7 @@ static void bnxt_set_db(struct bnxt *bp, struct bnxt_db_info *db, u32 ring_type,
50645064

50655065
static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
50665066
{
5067+
bool agg_rings = !!(bp->flags & BNXT_FLAG_AGG_RINGS);
50675068
int i, rc = 0;
50685069
u32 type;
50695070

@@ -5139,7 +5140,9 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
51395140
if (rc)
51405141
goto err_out;
51415142
bnxt_set_db(bp, &rxr->rx_db, type, map_idx, ring->fw_ring_id);
5142-
bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod);
5143+
/* If we have agg rings, post agg buffers first. */
5144+
if (!agg_rings)
5145+
bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod);
51435146
bp->grp_info[map_idx].rx_fw_ring_id = ring->fw_ring_id;
51445147
if (bp->flags & BNXT_FLAG_CHIP_P5) {
51455148
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
@@ -5158,7 +5161,7 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
51585161
}
51595162
}
51605163

5161-
if (bp->flags & BNXT_FLAG_AGG_RINGS) {
5164+
if (agg_rings) {
51625165
type = HWRM_RING_ALLOC_AGG;
51635166
for (i = 0; i < bp->rx_nr_rings; i++) {
51645167
struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i];
@@ -5174,6 +5177,7 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
51745177
bnxt_set_db(bp, &rxr->rx_agg_db, type, map_idx,
51755178
ring->fw_ring_id);
51765179
bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod);
5180+
bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod);
51775181
bp->grp_info[grp_idx].agg_fw_ring_id = ring->fw_ring_id;
51785182
}
51795183
}
@@ -7016,19 +7020,29 @@ static void bnxt_hwrm_clear_vnic_rss(struct bnxt *bp)
70167020
bnxt_hwrm_vnic_set_rss(bp, i, false);
70177021
}
70187022

7019-
static void bnxt_hwrm_resource_free(struct bnxt *bp, bool close_path,
7020-
bool irq_re_init)
7023+
static void bnxt_clear_vnic(struct bnxt *bp)
70217024
{
7022-
if (bp->vnic_info) {
7023-
bnxt_hwrm_clear_vnic_filter(bp);
7025+
if (!bp->vnic_info)
7026+
return;
7027+
7028+
bnxt_hwrm_clear_vnic_filter(bp);
7029+
if (!(bp->flags & BNXT_FLAG_CHIP_P5)) {
70247030
/* clear all RSS setting before free vnic ctx */
70257031
bnxt_hwrm_clear_vnic_rss(bp);
70267032
bnxt_hwrm_vnic_ctx_free(bp);
7027-
/* before free the vnic, undo the vnic tpa settings */
7028-
if (bp->flags & BNXT_FLAG_TPA)
7029-
bnxt_set_tpa(bp, false);
7030-
bnxt_hwrm_vnic_free(bp);
70317033
}
7034+
/* before free the vnic, undo the vnic tpa settings */
7035+
if (bp->flags & BNXT_FLAG_TPA)
7036+
bnxt_set_tpa(bp, false);
7037+
bnxt_hwrm_vnic_free(bp);
7038+
if (bp->flags & BNXT_FLAG_CHIP_P5)
7039+
bnxt_hwrm_vnic_ctx_free(bp);
7040+
}
7041+
7042+
static void bnxt_hwrm_resource_free(struct bnxt *bp, bool close_path,
7043+
bool irq_re_init)
7044+
{
7045+
bnxt_clear_vnic(bp);
70327046
bnxt_hwrm_ring_free(bp, close_path);
70337047
bnxt_hwrm_ring_grp_free(bp);
70347048
if (irq_re_init) {

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,13 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
9898
if (idx)
9999
req->dimensions = cpu_to_le16(1);
100100

101-
if (req->req_type == cpu_to_le16(HWRM_NVM_SET_VARIABLE))
101+
if (req->req_type == cpu_to_le16(HWRM_NVM_SET_VARIABLE)) {
102102
memcpy(data_addr, buf, bytesize);
103-
104-
rc = hwrm_send_message(bp, msg, msg_len, HWRM_CMD_TIMEOUT);
103+
rc = hwrm_send_message(bp, msg, msg_len, HWRM_CMD_TIMEOUT);
104+
} else {
105+
rc = hwrm_send_message_silent(bp, msg, msg_len,
106+
HWRM_CMD_TIMEOUT);
107+
}
105108
if (!rc && req->req_type == cpu_to_le16(HWRM_NVM_GET_VARIABLE))
106109
memcpy(buf, data_addr, bytesize);
107110

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,21 +2016,19 @@ static int bnxt_flash_package_from_file(struct net_device *dev,
20162016
mutex_lock(&bp->hwrm_cmd_lock);
20172017
hwrm_err = _hwrm_send_message(bp, &install, sizeof(install),
20182018
INSTALL_PACKAGE_TIMEOUT);
2019-
if (hwrm_err)
2020-
goto flash_pkg_exit;
2021-
2022-
if (resp->error_code) {
2019+
if (hwrm_err) {
20232020
u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err;
20242021

2025-
if (error_code == NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) {
2022+
if (resp->error_code && error_code ==
2023+
NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) {
20262024
install.flags |= cpu_to_le16(
20272025
NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG);
20282026
hwrm_err = _hwrm_send_message(bp, &install,
20292027
sizeof(install),
20302028
INSTALL_PACKAGE_TIMEOUT);
2031-
if (hwrm_err)
2032-
goto flash_pkg_exit;
20332029
}
2030+
if (hwrm_err)
2031+
goto flash_pkg_exit;
20342032
}
20352033

20362034
if (resp->result) {

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ static int __bnxt_tc_del_flow(struct bnxt *bp,
12361236
static void bnxt_tc_set_flow_dir(struct bnxt *bp, struct bnxt_tc_flow *flow,
12371237
u16 src_fid)
12381238
{
1239-
flow->dir = (bp->pf.fw_fid == src_fid) ? BNXT_DIR_RX : BNXT_DIR_TX;
1239+
flow->l2_key.dir = (bp->pf.fw_fid == src_fid) ? BNXT_DIR_RX : BNXT_DIR_TX;
12401240
}
12411241

12421242
static void bnxt_tc_set_src_fid(struct bnxt *bp, struct bnxt_tc_flow *flow,
@@ -1285,9 +1285,7 @@ static int bnxt_tc_add_flow(struct bnxt *bp, u16 src_fid,
12851285
goto free_node;
12861286

12871287
bnxt_tc_set_src_fid(bp, flow, src_fid);
1288-
1289-
if (bp->fw_cap & BNXT_FW_CAP_OVS_64BIT_HANDLE)
1290-
bnxt_tc_set_flow_dir(bp, flow, src_fid);
1288+
bnxt_tc_set_flow_dir(bp, flow, flow->src_fid);
12911289

12921290
if (!bnxt_tc_can_offload(bp, flow)) {
12931291
rc = -EOPNOTSUPP;
@@ -1407,7 +1405,7 @@ static void bnxt_fill_cfa_stats_req(struct bnxt *bp,
14071405
* 2. 15th bit of flow_handle must specify the flow
14081406
* direction (TX/RX).
14091407
*/
1410-
if (flow_node->flow.dir == BNXT_DIR_RX)
1408+
if (flow_node->flow.l2_key.dir == BNXT_DIR_RX)
14111409
handle = CFA_FLOW_INFO_REQ_FLOW_HANDLE_DIR_RX |
14121410
CFA_FLOW_INFO_REQ_FLOW_HANDLE_MAX_MASK;
14131411
else

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ struct bnxt_tc_l2_key {
2323
__be16 inner_vlan_tci;
2424
__be16 ether_type;
2525
u8 num_vlans;
26+
u8 dir;
27+
#define BNXT_DIR_RX 1
28+
#define BNXT_DIR_TX 0
2629
};
2730

2831
struct bnxt_tc_l3_key {
@@ -98,9 +101,6 @@ struct bnxt_tc_flow {
98101

99102
/* flow applicable to pkts ingressing on this fid */
100103
u16 src_fid;
101-
u8 dir;
102-
#define BNXT_DIR_RX 1
103-
#define BNXT_DIR_TX 0
104104
struct bnxt_tc_l2_key l2_key;
105105
struct bnxt_tc_l2_key l2_mask;
106106
struct bnxt_tc_l3_key l3_key;

0 commit comments

Comments
 (0)