aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-08-18 16:05:01 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-18 16:05:01 -0400
commit37b0a733c12137bc1d3325c44797333177607632 (patch)
tree0f6a84f04b0c9f236d5e7165b7065701c7fec3b6
parentf1472cb09f11ddb41d4be84f0650835cb65a9073 (diff)
parent9bf46566e80fd94845527d01ebd888eb49313551 (diff)
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 <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c36
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c9
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c12
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c8
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h6
5 files changed, 42 insertions, 29 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 7070349915bc..8dce4069472b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -2021,9 +2021,9 @@ static void __bnxt_poll_work_done(struct bnxt *bp, struct bnxt_napi *bnapi)
2021 if (bnapi->events & BNXT_RX_EVENT) { 2021 if (bnapi->events & BNXT_RX_EVENT) {
2022 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; 2022 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring;
2023 2023
2024 bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod);
2025 if (bnapi->events & BNXT_AGG_EVENT) 2024 if (bnapi->events & BNXT_AGG_EVENT)
2026 bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod); 2025 bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod);
2026 bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod);
2027 } 2027 }
2028 bnapi->events = 0; 2028 bnapi->events = 0;
2029} 2029}
@@ -5064,6 +5064,7 @@ static void bnxt_set_db(struct bnxt *bp, struct bnxt_db_info *db, u32 ring_type,
5064 5064
5065static int bnxt_hwrm_ring_alloc(struct bnxt *bp) 5065static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
5066{ 5066{
5067 bool agg_rings = !!(bp->flags & BNXT_FLAG_AGG_RINGS);
5067 int i, rc = 0; 5068 int i, rc = 0;
5068 u32 type; 5069 u32 type;
5069 5070
@@ -5139,7 +5140,9 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
5139 if (rc) 5140 if (rc)
5140 goto err_out; 5141 goto err_out;
5141 bnxt_set_db(bp, &rxr->rx_db, type, map_idx, ring->fw_ring_id); 5142 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);
5143 bp->grp_info[map_idx].rx_fw_ring_id = ring->fw_ring_id; 5146 bp->grp_info[map_idx].rx_fw_ring_id = ring->fw_ring_id;
5144 if (bp->flags & BNXT_FLAG_CHIP_P5) { 5147 if (bp->flags & BNXT_FLAG_CHIP_P5) {
5145 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; 5148 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
@@ -5158,7 +5161,7 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
5158 } 5161 }
5159 } 5162 }
5160 5163
5161 if (bp->flags & BNXT_FLAG_AGG_RINGS) { 5164 if (agg_rings) {
5162 type = HWRM_RING_ALLOC_AGG; 5165 type = HWRM_RING_ALLOC_AGG;
5163 for (i = 0; i < bp->rx_nr_rings; i++) { 5166 for (i = 0; i < bp->rx_nr_rings; i++) {
5164 struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i]; 5167 struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i];
@@ -5174,6 +5177,7 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
5174 bnxt_set_db(bp, &rxr->rx_agg_db, type, map_idx, 5177 bnxt_set_db(bp, &rxr->rx_agg_db, type, map_idx,
5175 ring->fw_ring_id); 5178 ring->fw_ring_id);
5176 bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod); 5179 bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod);
5180 bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod);
5177 bp->grp_info[grp_idx].agg_fw_ring_id = ring->fw_ring_id; 5181 bp->grp_info[grp_idx].agg_fw_ring_id = ring->fw_ring_id;
5178 } 5182 }
5179 } 5183 }
@@ -7016,19 +7020,29 @@ static void bnxt_hwrm_clear_vnic_rss(struct bnxt *bp)
7016 bnxt_hwrm_vnic_set_rss(bp, i, false); 7020 bnxt_hwrm_vnic_set_rss(bp, i, false);
7017} 7021}
7018 7022
7019static void bnxt_hwrm_resource_free(struct bnxt *bp, bool close_path, 7023static void bnxt_clear_vnic(struct bnxt *bp)
7020 bool irq_re_init)
7021{ 7024{
7022 if (bp->vnic_info) { 7025 if (!bp->vnic_info)
7023 bnxt_hwrm_clear_vnic_filter(bp); 7026 return;
7027
7028 bnxt_hwrm_clear_vnic_filter(bp);
7029 if (!(bp->flags & BNXT_FLAG_CHIP_P5)) {
7024 /* clear all RSS setting before free vnic ctx */ 7030 /* clear all RSS setting before free vnic ctx */
7025 bnxt_hwrm_clear_vnic_rss(bp); 7031 bnxt_hwrm_clear_vnic_rss(bp);
7026 bnxt_hwrm_vnic_ctx_free(bp); 7032 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);
7031 } 7033 }
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
7042static void bnxt_hwrm_resource_free(struct bnxt *bp, bool close_path,
7043 bool irq_re_init)
7044{
7045 bnxt_clear_vnic(bp);
7032 bnxt_hwrm_ring_free(bp, close_path); 7046 bnxt_hwrm_ring_free(bp, close_path);
7033 bnxt_hwrm_ring_grp_free(bp); 7047 bnxt_hwrm_ring_grp_free(bp);
7034 if (irq_re_init) { 7048 if (irq_re_init) {
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index 549c90d3e465..c05d663212b2 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -98,10 +98,13 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
98 if (idx) 98 if (idx)
99 req->dimensions = cpu_to_le16(1); 99 req->dimensions = cpu_to_le16(1);
100 100
101 if (req->req_type == cpu_to_le16(HWRM_NVM_SET_VARIABLE)) 101 if (req->req_type == cpu_to_le16(HWRM_NVM_SET_VARIABLE)) {
102 memcpy(data_addr, buf, bytesize); 102 memcpy(data_addr, buf, bytesize);
103 103 rc = hwrm_send_message(bp, msg, msg_len, HWRM_CMD_TIMEOUT);
104 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 }
105 if (!rc && req->req_type == cpu_to_le16(HWRM_NVM_GET_VARIABLE)) 108 if (!rc && req->req_type == cpu_to_le16(HWRM_NVM_GET_VARIABLE))
106 memcpy(buf, data_addr, bytesize); 109 memcpy(buf, data_addr, bytesize);
107 110
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index c7ee63d69679..8445a0cce849 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -2016,21 +2016,19 @@ static int bnxt_flash_package_from_file(struct net_device *dev,
2016 mutex_lock(&bp->hwrm_cmd_lock); 2016 mutex_lock(&bp->hwrm_cmd_lock);
2017 hwrm_err = _hwrm_send_message(bp, &install, sizeof(install), 2017 hwrm_err = _hwrm_send_message(bp, &install, sizeof(install),
2018 INSTALL_PACKAGE_TIMEOUT); 2018 INSTALL_PACKAGE_TIMEOUT);
2019 if (hwrm_err) 2019 if (hwrm_err) {
2020 goto flash_pkg_exit;
2021
2022 if (resp->error_code) {
2023 u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err; 2020 u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err;
2024 2021
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) {
2026 install.flags |= cpu_to_le16( 2024 install.flags |= cpu_to_le16(
2027 NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG); 2025 NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG);
2028 hwrm_err = _hwrm_send_message(bp, &install, 2026 hwrm_err = _hwrm_send_message(bp, &install,
2029 sizeof(install), 2027 sizeof(install),
2030 INSTALL_PACKAGE_TIMEOUT); 2028 INSTALL_PACKAGE_TIMEOUT);
2031 if (hwrm_err)
2032 goto flash_pkg_exit;
2033 } 2029 }
2030 if (hwrm_err)
2031 goto flash_pkg_exit;
2034 } 2032 }
2035 2033
2036 if (resp->result) { 2034 if (resp->result) {
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
index 6fe4a7174271..dd621f6bd127 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
@@ -1236,7 +1236,7 @@ static int __bnxt_tc_del_flow(struct bnxt *bp,
1236static void bnxt_tc_set_flow_dir(struct bnxt *bp, struct bnxt_tc_flow *flow, 1236static void bnxt_tc_set_flow_dir(struct bnxt *bp, struct bnxt_tc_flow *flow,
1237 u16 src_fid) 1237 u16 src_fid)
1238{ 1238{
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;
1240} 1240}
1241 1241
1242static void bnxt_tc_set_src_fid(struct bnxt *bp, struct bnxt_tc_flow *flow, 1242static 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,
1285 goto free_node; 1285 goto free_node;
1286 1286
1287 bnxt_tc_set_src_fid(bp, flow, src_fid); 1287 bnxt_tc_set_src_fid(bp, flow, src_fid);
1288 1288 bnxt_tc_set_flow_dir(bp, flow, flow->src_fid);
1289 if (bp->fw_cap & BNXT_FW_CAP_OVS_64BIT_HANDLE)
1290 bnxt_tc_set_flow_dir(bp, flow, src_fid);
1291 1289
1292 if (!bnxt_tc_can_offload(bp, flow)) { 1290 if (!bnxt_tc_can_offload(bp, flow)) {
1293 rc = -EOPNOTSUPP; 1291 rc = -EOPNOTSUPP;
@@ -1407,7 +1405,7 @@ static void bnxt_fill_cfa_stats_req(struct bnxt *bp,
1407 * 2. 15th bit of flow_handle must specify the flow 1405 * 2. 15th bit of flow_handle must specify the flow
1408 * direction (TX/RX). 1406 * direction (TX/RX).
1409 */ 1407 */
1410 if (flow_node->flow.dir == BNXT_DIR_RX) 1408 if (flow_node->flow.l2_key.dir == BNXT_DIR_RX)
1411 handle = CFA_FLOW_INFO_REQ_FLOW_HANDLE_DIR_RX | 1409 handle = CFA_FLOW_INFO_REQ_FLOW_HANDLE_DIR_RX |
1412 CFA_FLOW_INFO_REQ_FLOW_HANDLE_MAX_MASK; 1410 CFA_FLOW_INFO_REQ_FLOW_HANDLE_MAX_MASK;
1413 else 1411 else
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h
index ffec57d1a5ec..4f05305052f2 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h
@@ -23,6 +23,9 @@ struct bnxt_tc_l2_key {
23 __be16 inner_vlan_tci; 23 __be16 inner_vlan_tci;
24 __be16 ether_type; 24 __be16 ether_type;
25 u8 num_vlans; 25 u8 num_vlans;
26 u8 dir;
27#define BNXT_DIR_RX 1
28#define BNXT_DIR_TX 0
26}; 29};
27 30
28struct bnxt_tc_l3_key { 31struct bnxt_tc_l3_key {
@@ -98,9 +101,6 @@ struct bnxt_tc_flow {
98 101
99 /* flow applicable to pkts ingressing on this fid */ 102 /* flow applicable to pkts ingressing on this fid */
100 u16 src_fid; 103 u16 src_fid;
101 u8 dir;
102#define BNXT_DIR_RX 1
103#define BNXT_DIR_TX 0
104 struct bnxt_tc_l2_key l2_key; 104 struct bnxt_tc_l2_key l2_key;
105 struct bnxt_tc_l2_key l2_mask; 105 struct bnxt_tc_l2_key l2_mask;
106 struct bnxt_tc_l3_key l3_key; 106 struct bnxt_tc_l3_key l3_key;