From: Rasesh Mody Date: Sat, 7 Oct 2017 06:31:06 +0000 (-0700) Subject: net/qede/base: code cleanup X-Git-Tag: spdx-start~1546 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b9ebba32cc3e68f62ce13cee4a7ca364d9ac01b9;p=dpdk.git net/qede/base: code cleanup - Remove some dead definitions, function declarations and unused variables - Remove an obsolete workaround from ecore_int_igu_enable() - Remove set variables that are not used - Remove needless check in ecore_init_wfq_param() when configuring minimum vport BW. We already check whether total for all vports is greater than the PF's, so no need to check independently the current requested configuration as well. Signed-off-by: Rasesh Mody --- diff --git a/drivers/net/qede/base/ecore_dcbx.c b/drivers/net/qede/base/ecore_dcbx.c index edb711e429..632297a78e 100644 --- a/drivers/net/qede/base/ecore_dcbx.c +++ b/drivers/net/qede/base/ecore_dcbx.c @@ -163,7 +163,6 @@ ecore_dcbx_update_app_info(struct ecore_dcbx_results *p_data, { enum ecore_pci_personality personality; enum dcbx_protocol_type id; - const char *name; /* @DPDK */ int i; for (i = 0; i < OSAL_ARRAY_SIZE(ecore_dcbx_app_update); i++) { @@ -173,7 +172,6 @@ ecore_dcbx_update_app_info(struct ecore_dcbx_results *p_data, continue; personality = ecore_dcbx_app_update[i].personality; - name = ecore_dcbx_app_update[i].name; ecore_dcbx_set_params(p_data, p_hwfn, enable, prio, tc, type, personality); @@ -882,8 +880,6 @@ ecore_dcbx_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, rc = ecore_dcbx_process_mib_info(p_hwfn); if (!rc) { - bool enabled; - /* reconfigure tcs of QM queues according * to negotiation results */ @@ -891,11 +887,6 @@ ecore_dcbx_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, /* update storm FW with negotiation results */ ecore_sp_pf_update_dcbx(p_hwfn); - - /* set eagle enigne 1 flow control workaround - * according to negotiation results - */ - enabled = p_hwfn->p_dcbx_info->results.dcbx_enabled; } } diff --git a/drivers/net/qede/base/ecore_dcbx_api.h b/drivers/net/qede/base/ecore_dcbx_api.h index 249fb536ef..9ff4df4c66 100644 --- a/drivers/net/qede/base/ecore_dcbx_api.h +++ b/drivers/net/qede/base/ecore_dcbx_api.h @@ -102,7 +102,6 @@ struct ecore_dcbx_params { bool ets_willing; bool ets_enabled; bool ets_cbs; - bool valid; /* Indicate validity of params */ u8 ets_pri_tc_tbl[ECORE_MAX_PFC_PRIORITIES]; u8 ets_tc_bw_tbl[ECORE_MAX_PFC_PRIORITIES]; u8 ets_tc_tsa_tbl[ECORE_MAX_PFC_PRIORITIES]; diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c index 412af07365..75fcfae1fd 100644 --- a/drivers/net/qede/base/ecore_dev.c +++ b/drivers/net/qede/base/ecore_dev.c @@ -5239,13 +5239,6 @@ static enum _ecore_status_t ecore_init_wfq_param(struct ecore_hwfn *p_hwfn, non_requested_count = num_vports - req_count; /* validate possible error cases */ - if (req_rate > min_pf_rate) { - DP_VERBOSE(p_hwfn, ECORE_MSG_LINK, - "Vport [%d] - Requested rate[%d Mbps] is greater than configured PF min rate[%d Mbps]\n", - vport_id, req_rate, min_pf_rate); - return ECORE_INVAL; - } - if (req_rate < min_pf_rate / ECORE_WFQ_UNIT) { DP_VERBOSE(p_hwfn, ECORE_MSG_LINK, "Vport [%d] - Requested rate[%d Mbps] is less than one percent of configured PF min rate[%d Mbps]\n", diff --git a/drivers/net/qede/base/ecore_hw.h b/drivers/net/qede/base/ecore_hw.h index 392351a1e4..0b9814f5ea 100644 --- a/drivers/net/qede/base/ecore_hw.h +++ b/drivers/net/qede/base/ecore_hw.h @@ -249,35 +249,6 @@ enum _ecore_status_t ecore_dmae_info_alloc(struct ecore_hwfn *p_hwfn); */ void ecore_dmae_info_free(struct ecore_hwfn *p_hwfn); -union ecore_qm_pq_params { - struct { - u8 q_idx; - } iscsi; - - struct { - u8 tc; - } core; - - struct { - u8 is_vf; - u8 vf_id; - u8 tc; - } eth; - - struct { - u8 dcqcn; - u8 qpid; /* roce relative */ - } roce; - - struct { - u8 qidx; - } iwarp; -}; - -u16 ecore_get_qm_pq(struct ecore_hwfn *p_hwfn, - enum protocol_type proto, - union ecore_qm_pq_params *params); - enum _ecore_status_t ecore_init_fw_data(struct ecore_dev *p_dev, const u8 *fw_data); diff --git a/drivers/net/qede/base/ecore_int.c b/drivers/net/qede/base/ecore_int.c index 56ad1e79f0..f9ad513400 100644 --- a/drivers/net/qede/base/ecore_int.c +++ b/drivers/net/qede/base/ecore_int.c @@ -1926,15 +1926,6 @@ ecore_int_igu_enable(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, enum ecore_int_mode int_mode) { enum _ecore_status_t rc = ECORE_SUCCESS; - u32 tmp; - - /* @@@tmp - Starting with MFW 8.2.1.0 we've started hitting AVS stop - * attentions. Since we're waiting for BRCM answer regarding this - * attention, in the meanwhile we simply mask it. - */ - tmp = ecore_rd(p_hwfn, p_ptt, MISC_REG_AEU_ENABLE4_IGU_OUT_0); - tmp &= ~0x800; - ecore_wr(p_hwfn, p_ptt, MISC_REG_AEU_ENABLE4_IGU_OUT_0, tmp); ecore_int_igu_enable_attn(p_hwfn, p_ptt); diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c index 028fbb30b7..85cd271f28 100644 --- a/drivers/net/qede/base/ecore_mcp.c +++ b/drivers/net/qede/base/ecore_mcp.c @@ -2961,11 +2961,16 @@ enum _ecore_status_t ecore_mcp_phy_sfp_read(struct ecore_hwfn *p_hwfn, DRV_MSG_CODE_TRANSCEIVER_READ, nvm_offset, &resp, ¶m, &buf_size, (u32 *)(p_buf + offset)); - if ((resp & FW_MSG_CODE_MASK) == - FW_MSG_CODE_TRANSCEIVER_NOT_PRESENT) { + if (rc != ECORE_SUCCESS) { + DP_NOTICE(p_hwfn, false, + "Failed to send a transceiver read command to the MFW. rc = %d.\n", + rc); + return rc; + } + + if (resp == FW_MSG_CODE_TRANSCEIVER_NOT_PRESENT) return ECORE_NODEV; - } else if ((resp & FW_MSG_CODE_MASK) != - FW_MSG_CODE_TRANSCEIVER_DIAG_OK) + else if (resp != FW_MSG_CODE_TRANSCEIVER_DIAG_OK) return ECORE_UNKNOWN_ERROR; offset += buf_size; @@ -2999,11 +3004,16 @@ enum _ecore_status_t ecore_mcp_phy_sfp_write(struct ecore_hwfn *p_hwfn, DRV_MSG_CODE_TRANSCEIVER_WRITE, nvm_offset, &resp, ¶m, buf_size, (u32 *)&p_buf[buf_idx]); - if ((resp & FW_MSG_CODE_MASK) == - FW_MSG_CODE_TRANSCEIVER_NOT_PRESENT) { + if (rc != ECORE_SUCCESS) { + DP_NOTICE(p_hwfn, false, + "Failed to send a transceiver write command to the MFW. rc = %d.\n", + rc); + return rc; + } + + if (resp == FW_MSG_CODE_TRANSCEIVER_NOT_PRESENT) return ECORE_NODEV; - } else if ((resp & FW_MSG_CODE_MASK) != - FW_MSG_CODE_TRANSCEIVER_DIAG_OK) + else if (resp != FW_MSG_CODE_TRANSCEIVER_DIAG_OK) return ECORE_UNKNOWN_ERROR; buf_idx += buf_size;