From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E03E1454EF; Tue, 25 Jun 2024 13:15:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E1EB427B3; Tue, 25 Jun 2024 13:15:24 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 5AA03402C4 for ; Tue, 25 Jun 2024 13:15:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314104; x=1750850104; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=njTGiKjrOmF1w4JeO1iRAY+ufE1fzbBL5syflGk+NCA=; b=JKvbxJrJSociNlN0cMssUL89NixD47mPVIb/XWSzV5HKhRU9XymLtF9h WEJUY0Igx6VAjUQ/VYyDvO7lLfYXe9yZc4wjG8bB2wMaYZBOChZHSDvCv nBX6eGWLd1NKMLN9ziknssGHbCmgtVFU/CMP8B31vU0Z9/+OANVvSNvwV SSzSwcVkcomn2YN4eCUT5tXZ3+ClkgxA2LpCjhi8njwxWSKuuVcHxUXZp LkX9G6bRkPwphNBC6FeAZ767S0P8ald6ixO2DqRw89whiEzmXul1IfeAX VsrnFfAzC4zyUWFPQlsbHqsY91cVK013KU9Ah02S8pGv0lhcs6F6ps/e4 w==; X-CSE-ConnectionGUID: ziHolgIpTOugVpOIfS/9rw== X-CSE-MsgGUID: TQs0EbWMRlSkyw1HqKt4Wg== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080059" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080059" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:15:03 -0700 X-CSE-ConnectionGUID: z6Eu6bMQQMu5JeKFa1ml7w== X-CSE-MsgGUID: hfWKFUE9Q/qjWLuhlG+UXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43718814" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:15:00 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Przemek Kitszel , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 002/129] net/ice/base: replace ICE_SUCCESS with int Date: Tue, 25 Jun 2024 12:12:07 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Przemek Kitszel Replace all usages of ICE_SUCCESS with its integer equivalent. Signed-off-by: Przemek Kitszel Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_acl.c | 2 +- drivers/net/ice/base/ice_acl_ctrl.c | 16 +-- drivers/net/ice/base/ice_common.c | 78 +++++++------- drivers/net/ice/base/ice_controlq.c | 26 ++--- drivers/net/ice/base/ice_dcb.c | 22 ++-- drivers/net/ice/base/ice_ddp.c | 20 ++-- drivers/net/ice/base/ice_fdir.c | 4 +- drivers/net/ice/base/ice_flex_pipe.c | 108 +++++++++---------- drivers/net/ice/base/ice_flow.c | 64 +++++------ drivers/net/ice/base/ice_nvm.c | 54 +++++----- drivers/net/ice/base/ice_parser.c | 8 +- drivers/net/ice/base/ice_parser_rt.c | 2 +- drivers/net/ice/base/ice_ptp_hw.c | 152 +++++++++++++-------------- drivers/net/ice/base/ice_sched.c | 142 ++++++++++++------------- drivers/net/ice/base/ice_switch.c | 127 +++++++++++----------- drivers/net/ice/base/ice_vlan_mode.c | 10 +- 16 files changed, 418 insertions(+), 417 deletions(-) diff --git a/drivers/net/ice/base/ice_acl.c b/drivers/net/ice/base/ice_acl.c index 58550395e3..6ace29c946 100644 --- a/drivers/net/ice/base/ice_acl.c +++ b/drivers/net/ice/base/ice_acl.c @@ -332,7 +332,7 @@ ice_query_acl_prof(struct ice_hw *hw, u8 prof_id, */ static int ice_aq_acl_cntrs_chk_params(struct ice_acl_cntrs *cntrs) { - int status = ICE_SUCCESS; + int status = 0; if (!cntrs || !cntrs->amount) return ICE_ERR_PARAM; diff --git a/drivers/net/ice/base/ice_acl_ctrl.c b/drivers/net/ice/base/ice_acl_ctrl.c index 4a902cbe7f..6cee2c98ea 100644 --- a/drivers/net/ice/base/ice_acl_ctrl.c +++ b/drivers/net/ice/base/ice_acl_ctrl.c @@ -83,7 +83,7 @@ ice_acl_scen_free_entry_idx(struct ice_acl_scen *scen, u16 idx) if (!ice_test_and_clear_bit(idx, scen->entry_bitmap)) return ICE_ERR_DOES_NOT_EXIST; - return ICE_SUCCESS; + return 0; } /** @@ -145,8 +145,8 @@ static int ice_acl_init_tbl(struct ice_hw *hw) { struct ice_aqc_actpair act_buf; struct ice_aqc_acl_data buf; - int status = ICE_SUCCESS; struct ice_acl_tbl *tbl; + int status = 0; u8 tcam_idx, i; u16 idx; @@ -547,7 +547,7 @@ ice_acl_alloc_partition(struct ice_hw *hw, struct ice_acl_scen *req) } } while (!done); - return cnt >= r_entries ? ICE_SUCCESS : ICE_ERR_MAX_LIMIT; + return cnt >= r_entries ? 0 : ICE_ERR_MAX_LIMIT; } /** @@ -882,7 +882,7 @@ static int ice_acl_destroy_scen(struct ice_hw *hw, u16 scen_id) ice_free(hw, scen); } - return ICE_SUCCESS; + return 0; } /** @@ -947,7 +947,7 @@ int ice_acl_destroy_tbl(struct ice_hw *hw) ice_free(hw, hw->acl_tbl); hw->acl_tbl = NULL; - return ICE_SUCCESS; + return 0; } /** @@ -974,7 +974,7 @@ ice_acl_add_entry(struct ice_hw *hw, struct ice_acl_scen *scen, struct ice_aqc_acl_data buf; u8 entry_tcam, offset; u16 i, num_cscd, idx; - int status = ICE_SUCCESS; + int status = 0; if (!scen) return ICE_ERR_DOES_NOT_EXIST; @@ -1050,7 +1050,7 @@ ice_acl_prog_act(struct ice_hw *hw, struct ice_acl_scen *scen, { u16 idx, entry_tcam, num_cscd, i, actx_idx = 0; struct ice_aqc_actpair act_buf; - int status = ICE_SUCCESS; + int status = 0; if (entry_idx >= scen->num_entry) return ICE_ERR_MAX_LIMIT; @@ -1110,8 +1110,8 @@ ice_acl_rem_entry(struct ice_hw *hw, struct ice_acl_scen *scen, u16 entry_idx) { struct ice_aqc_actpair act_buf; struct ice_aqc_acl_data buf; - int status = ICE_SUCCESS; u16 num_cscd, idx, i; + int status = 0; u8 entry_tcam; if (!scen) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index da8681d3e8..d79162b5d1 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -183,7 +183,7 @@ static int ice_set_mac_type(struct ice_hw *hw) } ice_debug(hw, ICE_DBG_INIT, "mac_type: %d\n", hw->mac_type); - return ICE_SUCCESS; + return 0; } /** @@ -342,7 +342,7 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, ETH_ALEN, ICE_DMA_TO_NONDMA); break; } - return ICE_SUCCESS; + return 0; } /** @@ -423,7 +423,7 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, ice_debug(hw, ICE_DBG_LINK, "%s: module_type[2] = 0x%x\n", prefix, pcaps->module_type[2]); - if (status == ICE_SUCCESS && report_mode == ICE_AQC_REPORT_TOPO_CAP_MEDIA) { + if (!status && report_mode == ICE_AQC_REPORT_TOPO_CAP_MEDIA) { pi->phy.phy_type_low = LE64_TO_CPU(pcaps->phy_type_low); pi->phy.phy_type_high = LE64_TO_CPU(pcaps->phy_type_high); ice_memcpy(pi->phy.link_info.module_type, &pcaps->module_type, @@ -457,7 +457,7 @@ ice_aq_get_netlist_node_pin(struct ice_hw *hw, *node_handle = LE16_TO_CPU(desc.params.get_link_topo_pin.addr.handle); - return ICE_SUCCESS; + return 0; } /** @@ -485,7 +485,7 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd, if (node_part_number) *node_part_number = desc.params.get_link_topo.node_part_num; - return ICE_SUCCESS; + return 0; } #define MAX_NETLIST_SIZE 10 @@ -497,7 +497,7 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd, * @node_handle: output parameter if node found - optional * * Find and return the node handle for a given node type and part number in the - * netlist. When found ICE_SUCCESS is returned, ICE_ERR_DOES_NOT_EXIST + * netlist. When found 0 is returned, ICE_ERR_DOES_NOT_EXIST * otherwise. If node_handle provided, it would be set to found node handle. */ int @@ -527,7 +527,7 @@ ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number, if (rec_node_part_number == node_part_number) { if (node_handle) *node_handle = rec_node_handle; - return ICE_SUCCESS; + return 0; } } @@ -724,7 +724,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, status = ice_aq_send_cmd(hw, &desc, &link_data, sizeof(link_data), cd); - if (status != ICE_SUCCESS) + if (status) return status; /* save off old link status information */ @@ -783,7 +783,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, /* flag cleared so calling functions don't call AQ again */ pi->phy.get_link_info = false; - return ICE_SUCCESS; + return 0; } /** @@ -880,7 +880,7 @@ int ice_init_fltr_mgmt_struct(struct ice_hw *hw) ice_free(hw, hw->switch_info); return status; } - return ICE_SUCCESS; + return 0; } /** @@ -1163,7 +1163,7 @@ int ice_init_hw(struct ice_hw *hw) goto err_unroll_fltr_mgmt_struct; ice_init_lock(&hw->tnl_lock); - return ICE_SUCCESS; + return 0; err_unroll_fltr_mgmt_struct: ice_cleanup_fltr_mgmt_struct(hw); @@ -1260,7 +1260,7 @@ int ice_check_reset(struct ice_hw *hw) return ICE_ERR_RESET_FAILED; } - return ICE_SUCCESS; + return 0; } /** @@ -1285,7 +1285,7 @@ static int ice_pf_reset(struct ice_hw *hw) if (ice_check_reset(hw)) return ICE_ERR_RESET_FAILED; - return ICE_SUCCESS; + return 0; } /* Reset the PF */ @@ -1311,7 +1311,7 @@ static int ice_pf_reset(struct ice_hw *hw) return ICE_ERR_RESET_FAILED; } - return ICE_SUCCESS; + return 0; } /** @@ -1381,7 +1381,7 @@ ice_copy_rxq_ctx_to_hw(struct ice_hw *hw, u8 *ice_rxq_ctx, u32 rxq_index) *((u32 *)(ice_rxq_ctx + (i * sizeof(u32))))); } - return ICE_SUCCESS; + return 0; } /** @@ -1412,7 +1412,7 @@ ice_copy_rxq_ctx_from_hw(struct ice_hw *hw, u8 *ice_rxq_ctx, u32 rxq_index) ice_debug(hw, ICE_DBG_QCTX, "qrxdata[%d]: %08X\n", i, *ctx); } - return ICE_SUCCESS; + return 0; } /* LAN Rx Queue Context */ @@ -1510,7 +1510,7 @@ int ice_clear_rxq_ctx(struct ice_hw *hw, u32 rxq_index) for (i = 0; i < ICE_RXQ_CTX_SIZE_DWORDS; i++) wr32(hw, QRX_CONTEXT(i, rxq_index), 0); - return ICE_SUCCESS; + return 0; } /* LAN Tx Queue Context used for set Tx config by ice_aqc_opc_add_txqs, @@ -1579,7 +1579,7 @@ ice_copy_tx_cmpltnq_ctx_to_hw(struct ice_hw *hw, u8 *ice_tx_cmpltnq_ctx, *((u32 *)(ice_tx_cmpltnq_ctx + (i * sizeof(u32))))); } - return ICE_SUCCESS; + return 0; } /* LAN Tx Completion Queue Context */ @@ -1637,7 +1637,7 @@ ice_clear_tx_cmpltnq_ctx(struct ice_hw *hw, u32 tx_cmpltnq_index) for (i = 0; i < ICE_TX_CMPLTNQ_CTX_SIZE_DWORDS; i++) wr32(hw, GLTCLAN_CQ_CNTX(i, tx_cmpltnq_index), 0); - return ICE_SUCCESS; + return 0; } /** @@ -1669,7 +1669,7 @@ ice_copy_tx_drbell_q_ctx_to_hw(struct ice_hw *hw, u8 *ice_tx_drbell_q_ctx, *((u32 *)(ice_tx_drbell_q_ctx + (i * sizeof(u32))))); } - return ICE_SUCCESS; + return 0; } /* LAN Tx Doorbell Queue Context info */ @@ -1729,7 +1729,7 @@ ice_clear_tx_drbell_q_ctx(struct ice_hw *hw, u32 tx_drbell_q_index) for (i = 0; i < ICE_TX_DRBELL_Q_CTX_SIZE_DWORDS; i++) wr32(hw, QTX_COMM_DBLQ_CNTX(i, tx_drbell_q_index), 0); - return ICE_SUCCESS; + return 0; } /* Sideband Queue command wrappers */ @@ -1917,7 +1917,7 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq, do { status = ice_sq_send_cmd(hw, cq, desc, buf, buf_size, cd); - if (!is_cmd_for_retry || status == ICE_SUCCESS || + if (!is_cmd_for_retry || !status || hw->adminq.sq_last_status != ICE_AQ_RC_EBUSY) break; @@ -1964,7 +1964,7 @@ ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf, if (retval) retval &= 0xff; if (retval == ICE_AQ_RC_OK) - status = ICE_SUCCESS; + status = 0; else status = ICE_ERR_AQ_ERROR; } @@ -2083,7 +2083,7 @@ int ice_aq_q_shutdown(struct ice_hw *hw, bool unloading) * Requests common resource using the admin queue commands (0x0008). * When attempting to acquire the Global Config Lock, the driver can * learn of three states: - * 1) ICE_SUCCESS - acquired lock, and can perform download package + * 1) 0 - acquired lock, and can perform download package * 2) ICE_ERR_AQ_ERROR - did not get lock, driver should fail to load * 3) ICE_ERR_AQ_NO_WORK - did not get lock, but another driver has * successfully downloaded the package; the driver does @@ -2134,7 +2134,7 @@ ice_aq_req_res(struct ice_hw *hw, enum ice_aq_res_ids res, if (res == ICE_GLOBAL_CFG_LOCK_RES_ID) { if (LE16_TO_CPU(cmd_resp->status) == ICE_AQ_RES_GLBL_SUCCESS) { *timeout = LE32_TO_CPU(cmd_resp->timeout); - return ICE_SUCCESS; + return 0; } else if (LE16_TO_CPU(cmd_resp->status) == ICE_AQ_RES_GLBL_IN_PROG) { *timeout = LE32_TO_CPU(cmd_resp->timeout); @@ -3478,7 +3478,7 @@ ice_aq_set_phy_cfg(struct ice_hw *hw, struct ice_port_info *pi, status = ice_aq_send_cmd(hw, &desc, cfg, sizeof(*cfg), cd); if (hw->adminq.sq_last_status == ICE_AQ_RC_EMODE) - status = ICE_SUCCESS; + status = 0; if (!status) pi->phy.curr_user_phy_cfg = *cfg; @@ -3517,7 +3517,7 @@ int ice_update_link_info(struct ice_port_info *pi) status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA, pcaps, NULL); - if (status == ICE_SUCCESS) + if (!status) ice_memcpy(li->module_type, &pcaps->module_type, sizeof(li->module_type), ICE_NONDMA_TO_NONDMA); @@ -3679,7 +3679,7 @@ ice_cfg_phy_fc(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, cache_data.data.curr_user_fc_req = req_mode; ice_cache_phy_user_req(pi, cache_data, ICE_FC_MODE); - return ICE_SUCCESS; + return 0; } /** @@ -3751,7 +3751,7 @@ ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, bool ena_auto_link_update) for (retry_count = 0; retry_count < retry_max; retry_count++) { status = ice_update_link_info(pi); - if (status == ICE_SUCCESS) + if (!status) break; ice_msec_delay(100, true); @@ -3934,7 +3934,7 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, int ice_get_link_status(struct ice_port_info *pi, bool *link_up) { struct ice_phy_info *phy_info; - int status = ICE_SUCCESS; + int status = 0; if (!pi || !link_up) return ICE_ERR_PARAM; @@ -4173,7 +4173,7 @@ ice_aq_read_topo_dev_nvm(struct ice_hw *hw, ice_memcpy(data, cmd->data_read, data_size, ICE_NONDMA_TO_NONDMA); - return ICE_SUCCESS; + return 0; } /** @@ -4825,7 +4825,7 @@ ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx, } } - return ICE_SUCCESS; + return 0; } /** @@ -5090,7 +5090,7 @@ ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) } } - return ICE_SUCCESS; + return 0; } /** @@ -5198,7 +5198,7 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle, /* add the LAN queue */ status = ice_aq_add_lan_txq(hw, num_qgrps, buf, buf_size, cd); - if (status != ICE_SUCCESS) { + if (status != 0) { ice_debug(hw, ICE_DBG_SCHED, "enable queue %d failed %d\n", LE16_TO_CPU(buf->txqs[0].txq_id), hw->adminq.sq_last_status); @@ -5293,7 +5293,7 @@ ice_dis_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_queues, status = ice_aq_dis_lan_txq(hw, 1, qg_list, buf_size, rst_src, vmvf_num, cd); - if (status != ICE_SUCCESS) + if (status) break; ice_free_sched_node(pi, node); q_ctx->q_handle = ICE_INVAL_Q_HANDLE; @@ -5317,7 +5317,7 @@ static int ice_cfg_vsi_qs(struct ice_port_info *pi, u16 vsi_handle, u16 tc_bitmap, u16 *maxqs, u8 owner) { - int status = ICE_SUCCESS; + int status = 0; u8 i; if (!pi || pi->port_state != ICE_SCHED_PORT_STATE_READY) @@ -5634,7 +5634,7 @@ ice_sched_query_elem(struct ice_hw *hw, u32 node_teid, buf->node_teid = CPU_TO_LE32(node_teid); status = ice_aq_query_sched_elems(hw, 1, buf, buf_size, &num_elem_ret, NULL); - if (status != ICE_SUCCESS || num_elem_ret != 1) + if (status || num_elem_ret != 1) ice_debug(hw, ICE_DBG_SCHED, "query element failed\n"); return status; } @@ -5829,7 +5829,7 @@ ice_aq_get_driver_param(struct ice_hw *hw, enum ice_aqc_driver_params idx, *value = LE32_TO_CPU(cmd->param_val); - return ICE_SUCCESS; + return 0; } /** @@ -5887,7 +5887,7 @@ ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, return status; *value = !!cmd->gpio_val; - return ICE_SUCCESS; + return 0; } /** diff --git a/drivers/net/ice/base/ice_controlq.c b/drivers/net/ice/base/ice_controlq.c index 8c02a5067f..db80fe8c1d 100644 --- a/drivers/net/ice/base/ice_controlq.c +++ b/drivers/net/ice/base/ice_controlq.c @@ -108,7 +108,7 @@ ice_alloc_ctrlq_sq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq) return ICE_ERR_NO_MEMORY; } - return ICE_SUCCESS; + return 0; } /** @@ -124,7 +124,7 @@ ice_alloc_ctrlq_rq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq) cq->rq.desc_buf.va = ice_alloc_dma_mem(hw, &cq->rq.desc_buf, size); if (!cq->rq.desc_buf.va) return ICE_ERR_NO_MEMORY; - return ICE_SUCCESS; + return 0; } /** @@ -190,7 +190,7 @@ ice_alloc_rq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq) desc->params.generic.param0 = 0; desc->params.generic.param1 = 0; } - return ICE_SUCCESS; + return 0; unwind_alloc_rq_bufs: /* don't try to free the one that failed... */ @@ -230,7 +230,7 @@ ice_alloc_sq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq) if (!bi->va) goto unwind_alloc_sq_bufs; } - return ICE_SUCCESS; + return 0; unwind_alloc_sq_bufs: /* don't try to free the one that failed... */ @@ -260,7 +260,7 @@ ice_cfg_cq_regs(struct ice_hw *hw, struct ice_ctl_q_ring *ring, u16 num_entries) if (rd32(hw, ring->bal) != ICE_LO_DWORD(ring->desc_buf.pa)) return ICE_ERR_AQ_ERROR; - return ICE_SUCCESS; + return 0; } /** @@ -295,7 +295,7 @@ ice_cfg_rq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq) /* Update tail in the HW to post pre-allocated buffers */ wr32(hw, cq->rq.tail, (u32)(cq->num_rq_entries - 1)); - return ICE_SUCCESS; + return 0; } #define ICE_FREE_CQ_BUFS(hw, qi, ring) \ @@ -450,7 +450,7 @@ static int ice_init_rq(struct ice_hw *hw, struct ice_ctl_q_info *cq) static int ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) { - int ret_code = ICE_SUCCESS; + int ret_code = 0; ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); @@ -521,7 +521,7 @@ static bool ice_aq_ver_check(struct ice_hw *hw) static int ice_shutdown_rq(struct ice_hw *hw, struct ice_ctl_q_info *cq) { - int ret_code = ICE_SUCCESS; + int ret_code = 0; ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); @@ -571,7 +571,7 @@ static int ice_init_check_adminq(struct ice_hw *hw) goto init_ctrlq_free_rq; } - return ICE_SUCCESS; + return 0; init_ctrlq_free_rq: ice_shutdown_rq(hw, cq); @@ -638,7 +638,7 @@ static int ice_init_ctrlq(struct ice_hw *hw, enum ice_ctl_q q_type) goto init_ctrlq_free_sq; /* success! */ - return ICE_SUCCESS; + return 0; init_ctrlq_free_sq: ice_shutdown_sq(hw, cq); @@ -949,9 +949,9 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq, struct ice_dma_mem *dma_buf = NULL; struct ice_aq_desc *desc_on_ring; bool cmd_completed = false; - int status = ICE_SUCCESS; struct ice_sq_cd *details; u32 total_delay = 0; + int status = 0; u16 retval = 0; u32 val = 0; @@ -1125,7 +1125,7 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq, struct ice_aq_desc *desc, void *buf, u16 buf_size, struct ice_sq_cd *cd) { - int status = ICE_SUCCESS; + int status = 0; /* if reset is in progress return a soft error */ if (hw->reset_ongoing) @@ -1170,9 +1170,9 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq, { u16 ntc = cq->rq.next_to_clean; enum ice_aq_err rq_last_status; - int ret_code = ICE_SUCCESS; struct ice_aq_desc *desc; struct ice_dma_mem *bi; + int ret_code = 0; u16 desc_idx; u16 datalen; u16 flags; diff --git a/drivers/net/ice/base/ice_dcb.c b/drivers/net/ice/base/ice_dcb.c index dc401f7c00..4ef54613b1 100644 --- a/drivers/net/ice/base/ice_dcb.c +++ b/drivers/net/ice/base/ice_dcb.c @@ -604,8 +604,8 @@ ice_parse_org_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg) int ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg) { struct ice_lldp_org_tlv *tlv; - int ret = ICE_SUCCESS; u16 offset = 0; + int ret = 0; u16 typelen; u16 type; u16 len; @@ -655,8 +655,8 @@ int ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype, struct ice_dcbx_cfg *dcbcfg) { - int ret; u8 *lldpmib; + int ret; /* Allocate the LLDPDU */ lldpmib = (u8 *)ice_malloc(hw, ICE_LLDPDU_SIZE); @@ -666,7 +666,7 @@ ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype, ret = ice_aq_get_lldp_mib(hw, bridgetype, mib_type, (void *)lldpmib, ICE_LLDPDU_SIZE, NULL, NULL, NULL); - if (ret == ICE_SUCCESS) + if (!ret) /* Parse LLDP MIB to get DCB configuration */ ret = ice_lldp_to_dcb_cfg(lldpmib, dcbcfg); @@ -686,7 +686,7 @@ ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype, * @cd: pointer to command details structure or NULL * * Start/Stop the embedded dcbx Agent. In case that this wrapper function - * returns ICE_SUCCESS, caller will need to check if FW returns back the same + * returns 0, caller will need to check if FW returns back the same * value as stated in dcbx_agent_status, and react accordingly. (0x0A09) */ int @@ -711,7 +711,7 @@ ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent, *dcbx_agent_status = false; - if (status == ICE_SUCCESS && + if (!status && cmd->command == ICE_AQC_START_STOP_AGENT_START_DCBX) *dcbx_agent_status = true; @@ -775,7 +775,7 @@ ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd) if (cmd->pfc_mode != pfc_mode) return ICE_ERR_NOT_SUPPORTED; - return ICE_SUCCESS; + return 0; } /** @@ -934,7 +934,7 @@ ice_get_ieee_or_cee_dcb_cfg(struct ice_port_info *pi, u8 dcbx_mode) ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID, dcbx_cfg); /* Don't treat ENOENT as an error for Remote MIBs */ if (pi->hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT) - ret = ICE_SUCCESS; + ret = 0; out: return ret; @@ -956,7 +956,7 @@ int ice_get_dcb_cfg(struct ice_port_info *pi) return ICE_ERR_PARAM; ret = ice_aq_get_cee_dcb_cfg(pi->hw, &cee_cfg, NULL); - if (ret == ICE_SUCCESS) { + if (!ret) { /* CEE mode */ ret = ice_get_ieee_or_cee_dcb_cfg(pi, ICE_DCBX_MODE_CEE); ice_cee_to_dcb_cfg(&cee_cfg, pi); @@ -1017,7 +1017,7 @@ void ice_get_dcb_cfg_from_mib_change(struct ice_port_info *pi, int ice_init_dcb(struct ice_hw *hw, bool enable_mib_change) { struct ice_qos_cfg *qos_cfg = &hw->port_info->qos_cfg; - int ret = ICE_SUCCESS; + int ret = 0; if (!hw->func_caps.common_cap.dcb) return ICE_ERR_NOT_SUPPORTED; @@ -1512,9 +1512,9 @@ int ice_set_dcb_cfg(struct ice_port_info *pi) { u8 mib_type, *lldpmib = NULL; struct ice_dcbx_cfg *dcbcfg; - int ret; struct ice_hw *hw; u16 miblen; + int ret; if (!pi) return ICE_ERR_PARAM; @@ -1583,8 +1583,8 @@ ice_update_port_tc_tree_cfg(struct ice_port_info *pi, { struct ice_sched_node *node, *tc_node; struct ice_aqc_txsched_elem_data elem; - int status = ICE_SUCCESS; u32 teid1, teid2; + int status = 0; u8 i, j; if (!pi) diff --git a/drivers/net/ice/base/ice_ddp.c b/drivers/net/ice/base/ice_ddp.c index 6b0af7f601..fcf6dc69e3 100644 --- a/drivers/net/ice/base/ice_ddp.c +++ b/drivers/net/ice/base/ice_ddp.c @@ -231,7 +231,7 @@ ice_is_signing_seg_type_at_idx(struct ice_pkg_hdr *pkg_hdr, u32 idx, int ice_update_pkg_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 count) { - int status = ICE_SUCCESS; + int status = 0; u32 i; for (i = 0; i < count; i++) { @@ -1181,7 +1181,7 @@ static int ice_get_prof_index_max(struct ice_hw *hw) hw->switch_info->max_used_prof_index = max_prof_index; - return ICE_SUCCESS; + return 0; } /** @@ -1584,7 +1584,7 @@ ice_get_sw_fv_list(struct ice_hw *hw, struct ice_prot_lkup_ext *lkups, u32 offset; if (!lkups->n_val_words) - return ICE_SUCCESS; + return 0; ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM); @@ -1634,7 +1634,7 @@ ice_get_sw_fv_list(struct ice_hw *hw, struct ice_prot_lkup_ext *lkups, ice_warn(hw, "Required profiles not found in currently loaded DDP package"); return ICE_ERR_CFG; } - return ICE_SUCCESS; + return 0; err: LIST_FOR_EACH_ENTRY_SAFE(fvl, tmp, fv_list, ice_sw_fv_list_entry, @@ -1738,7 +1738,7 @@ ice_pkg_buf_reserve_section(struct ice_buf_build *bld, u16 count) FLEX_ARRAY_SIZE(buf, section_entry, count); buf->data_end = CPU_TO_LE16(data_end); - return ICE_SUCCESS; + return 0; } /** @@ -2148,7 +2148,7 @@ ice_find_boost_entry(struct ice_seg *ice_seg, u16 addr, ice_boost_tcam_handler); if (tcam && LE16_TO_CPU(tcam->addr) == addr) { *entry = tcam; - return ICE_SUCCESS; + return 0; } ice_seg = NULL; @@ -2224,7 +2224,7 @@ void ice_init_pkg_hints(struct ice_hw *hw, struct ice_seg *ice_seg) * or writing of the package. When attempting to obtain write access, the * caller must check for the following two return values: * - * ICE_SUCCESS - Means the caller has acquired the global config lock + * 0 - Means the caller has acquired the global config lock * and can perform writing of the package. * ICE_ERR_AQ_NO_WORK - Indicates another driver has already written the * package or has found that no update was necessary; in @@ -2321,7 +2321,7 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size, if (!set && flags) *flags = desc.params.get_set_tx_topo.set_flags; - return ICE_SUCCESS; + return 0; } /** @@ -2463,7 +2463,7 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len) /* Reset is in progress, re-init the hw again */ ice_debug(hw, ICE_DBG_INIT, "Reset is in progress. layer topology might be applied already\n"); ice_check_reset(hw); - return ICE_SUCCESS; + return 0; } /* set new topology */ @@ -2480,5 +2480,5 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len) /* CORER will clear the global lock, so no explicit call * required for release */ - return ICE_SUCCESS; + return 0; } diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c index 9334933a2e..75fae4408f 100644 --- a/drivers/net/ice/base/ice_fdir.c +++ b/drivers/net/ice/base/ice_fdir.c @@ -3706,7 +3706,7 @@ ice_fdir_get_open_tunnel_port(struct ice_hw *hw, enum ice_fltr_ptype flow, return ICE_ERR_DOES_NOT_EXIST; } - return ICE_SUCCESS; + return 0; } /** @@ -4801,7 +4801,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, if (input->flex_fltr) ice_pkt_insert_u16(loc, input->flex_offset, input->flex_word); - return ICE_SUCCESS; + return 0; } /** diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c index 0e75ae9ebe..e06dbb0885 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -226,7 +226,7 @@ ice_gen_key_word(u8 val, u8 valid, u8 dont_care, u8 nvr_mtch, u8 *key, in_key_inv >>= 1; } - return ICE_SUCCESS; + return 0; } /** @@ -313,7 +313,7 @@ ice_set_key(u8 *key, u16 size, u8 *val, u8 *upd, u8 *dc, u8 *nm, u16 off, key + off + i, key + half_size + off + i)) return ICE_ERR_CFG; - return ICE_SUCCESS; + return 0; } /** @@ -525,7 +525,7 @@ int ice_set_dvm_boost_entries(struct ice_hw *hw) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -550,7 +550,7 @@ ice_create_tunnel(struct ice_hw *hw, enum ice_tunnel_type type, u16 port) if (ice_tunnel_port_in_use_hlpr(hw, port, &index)) { hw->tnl.tbl[index].ref++; - status = ICE_SUCCESS; + status = 0; goto ice_create_tunnel_end; } @@ -640,7 +640,7 @@ int ice_destroy_tunnel(struct ice_hw *hw, u16 port, bool all) if (!all && ice_tunnel_port_in_use_hlpr(hw, port, &index)) if (hw->tnl.tbl[index].ref > 1) { hw->tnl.tbl[index].ref--; - status = ICE_SUCCESS; + status = 0; goto ice_destroy_tunnel_end; } @@ -746,7 +746,7 @@ ice_find_prot_off(struct ice_hw *hw, enum ice_block blk, u8 prof, u8 fv_idx, *prot = fv_ext[fv_idx].prot_id; *off = fv_ext[fv_idx].off; - return ICE_SUCCESS; + return 0; } /* PTG Management */ @@ -769,7 +769,7 @@ ice_ptg_find_ptype(struct ice_hw *hw, enum ice_block blk, u16 ptype, u8 *ptg) return ICE_ERR_PARAM; *ptg = hw->blk[blk].xlt1.ptypes[ptype].ptg; - return ICE_SUCCESS; + return 0; } /** @@ -828,7 +828,7 @@ ice_ptg_remove_ptype(struct ice_hw *hw, enum ice_block blk, u16 ptype, u8 ptg) hw->blk[blk].xlt1.ptypes[ptype].ptg = ICE_DEFAULT_PTG; hw->blk[blk].xlt1.ptypes[ptype].next_ptype = NULL; - return ICE_SUCCESS; + return 0; } /** @@ -861,7 +861,7 @@ ice_ptg_add_mv_ptype(struct ice_hw *hw, enum ice_block blk, u16 ptype, u8 ptg) /* Is ptype already in the correct PTG? */ if (original_ptg == ptg) - return ICE_SUCCESS; + return 0; /* Remove from original PTG and move back to the default PTG */ if (original_ptg != ICE_DEFAULT_PTG) @@ -869,7 +869,7 @@ ice_ptg_add_mv_ptype(struct ice_hw *hw, enum ice_block blk, u16 ptype, u8 ptg) /* Moving to default PTG? Then we're done with this request */ if (ptg == ICE_DEFAULT_PTG) - return ICE_SUCCESS; + return 0; /* Add ptype to PTG at beginning of list */ hw->blk[blk].xlt1.ptypes[ptype].next_ptype = @@ -880,7 +880,7 @@ ice_ptg_add_mv_ptype(struct ice_hw *hw, enum ice_block blk, u16 ptype, u8 ptg) hw->blk[blk].xlt1.ptypes[ptype].ptg = ptg; hw->blk[blk].xlt1.t[ptype] = ptg; - return ICE_SUCCESS; + return 0; } /* Block / table size info */ @@ -999,7 +999,7 @@ ice_vsig_find_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 *vsig) */ *vsig = hw->blk[blk].xlt2.vsis[vsi].vsig; - return ICE_SUCCESS; + return 0; } /** @@ -1067,7 +1067,7 @@ ice_find_dup_props_vsig(struct ice_hw *hw, enum ice_block blk, if (xlt2->vsig_tbl[i].in_use && ice_match_prop_lst(chs, &xlt2->vsig_tbl[i].prop_lst)) { *vsig = ICE_VSIG_VALUE(i, hw->pf_id); - return ICE_SUCCESS; + return 0; } return ICE_ERR_DOES_NOT_EXIST; @@ -1130,7 +1130,7 @@ ice_vsig_free(struct ice_hw *hw, enum ice_block blk, u16 vsig) */ INIT_LIST_HEAD(&hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst); - return ICE_SUCCESS; + return 0; } /** @@ -1159,7 +1159,7 @@ ice_vsig_remove_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig) /* entry already in default VSIG, don't have to remove */ if (idx == ICE_DEFAULT_VSIG) - return ICE_SUCCESS; + return 0; vsi_head = &hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; if (!(*vsi_head)) @@ -1186,7 +1186,7 @@ ice_vsig_remove_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig) vsi_cur->changed = 1; vsi_cur->next_vsi = NULL; - return ICE_SUCCESS; + return 0; } /** @@ -1226,7 +1226,7 @@ ice_vsig_add_mv_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig) /* no update required if vsigs match */ if (orig_vsig == vsig) - return ICE_SUCCESS; + return 0; if (orig_vsig != ICE_DEFAULT_VSIG) { /* remove entry from orig_vsig and add to default VSIG */ @@ -1236,7 +1236,7 @@ ice_vsig_add_mv_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig) } if (idx == ICE_DEFAULT_VSIG) - return ICE_SUCCESS; + return 0; /* Create VSI entry and add VSIG and prop_mask values */ hw->blk[blk].xlt2.vsis[vsi].vsig = vsig; @@ -1249,7 +1249,7 @@ ice_vsig_add_mv_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig) hw->blk[blk].xlt2.vsis[vsi].next_vsi = tmp; hw->blk[blk].xlt2.t[vsi] = vsig; - return ICE_SUCCESS; + return 0; } /** @@ -1348,7 +1348,7 @@ ice_find_prof_id_with_mask(struct ice_hw *hw, enum ice_block blk, continue; *prof_id = i; - return ICE_SUCCESS; + return 0; } return ICE_ERR_DOES_NOT_EXIST; @@ -1465,9 +1465,9 @@ ice_free_tcam_ent(struct ice_hw *hw, enum ice_block blk, u16 tcam_idx) static int ice_alloc_prof_id(struct ice_hw *hw, enum ice_block blk, u8 *prof_id) { - int status; u16 res_type; u16 get_prof; + int status; if (!ice_prof_id_rsrc_type(blk, &res_type)) return ICE_ERR_PARAM; @@ -1513,7 +1513,7 @@ ice_prof_inc_ref(struct ice_hw *hw, enum ice_block blk, u8 prof_id) hw->blk[blk].es.ref_count[prof_id]++; - return ICE_SUCCESS; + return 0; } /** @@ -1684,7 +1684,7 @@ ice_alloc_prof_mask(struct ice_hw *hw, enum ice_block blk, u16 idx, u16 mask, hw->blk[blk].masks.masks[i].ref++; *mask_idx = i; - status = ICE_SUCCESS; + status = 0; err_ice_alloc_prof_mask: ice_release_lock(&hw->blk[blk].masks.lock); @@ -1731,7 +1731,7 @@ ice_free_prof_mask(struct ice_hw *hw, enum ice_block blk, u16 mask_idx) exit_ice_free_prof_mask: ice_release_lock(&hw->blk[blk].masks.lock); - return ICE_SUCCESS; + return 0; } /** @@ -1754,7 +1754,7 @@ ice_free_prof_masks(struct ice_hw *hw, enum ice_block blk, u16 prof_id) if (mask_bm & BIT(i)) ice_free_prof_mask(hw, blk, i); - return ICE_SUCCESS; + return 0; } /** @@ -1813,7 +1813,7 @@ ice_update_prof_masking(struct ice_hw *hw, enum ice_block blk, u16 prof_id, /* Only support FD and RSS masking, otherwise nothing to be done */ if (blk != ICE_BLK_RSS && blk != ICE_BLK_FD) - return ICE_SUCCESS; + return 0; for (i = 0; i < hw->blk[blk].es.fvw; i++) if (masks[i] && masks[i] != 0xFFFF) { @@ -1841,7 +1841,7 @@ ice_update_prof_masking(struct ice_hw *hw, enum ice_block blk, u16 prof_id, /* store enabled masks with profile so that they can be freed later */ hw->blk[blk].es.mask_ena[prof_id] = ena_mask; - return ICE_SUCCESS; + return 0; } /** @@ -1888,7 +1888,7 @@ ice_prof_dec_ref(struct ice_hw *hw, enum ice_block blk, u8 prof_id) } } - return ICE_SUCCESS; + return 0; } /* Block / table section IDs */ @@ -2250,7 +2250,7 @@ int ice_init_hw_tbls(struct ice_hw *hw) if (!es->mask_ena) goto err; } - return ICE_SUCCESS; + return 0; err: ice_free_hw_tbls(hw); @@ -2593,7 +2593,7 @@ ice_vsig_get_ref(struct ice_hw *hw, enum ice_block blk, u16 vsig, u16 *refs) ptr = ptr->next_vsi; } - return ICE_SUCCESS; + return 0; } /** @@ -2657,7 +2657,7 @@ ice_prof_bld_es(struct ice_hw *hw, enum ice_block blk, ICE_NONDMA_TO_NONDMA); } - return ICE_SUCCESS; + return 0; } /** @@ -2698,7 +2698,7 @@ ice_prof_bld_tcam(struct ice_hw *hw, enum ice_block blk, ICE_NONDMA_TO_NONDMA); } - return ICE_SUCCESS; + return 0; } /** @@ -2733,7 +2733,7 @@ ice_prof_bld_xlt1(enum ice_block blk, struct ice_buf_build *bld, p->value[0] = tmp->ptg; } - return ICE_SUCCESS; + return 0; } /** @@ -2775,7 +2775,7 @@ ice_prof_bld_xlt2(enum ice_block blk, struct ice_buf_build *bld, } } - return ICE_SUCCESS; + return 0; } /** @@ -2790,12 +2790,12 @@ ice_upd_prof_hw(struct ice_hw *hw, enum ice_block blk, { struct ice_buf_build *b; struct ice_chs_chg *tmp; - int status; u16 pkg_sects; u16 xlt1 = 0; u16 xlt2 = 0; u16 tcam = 0; u16 es = 0; + int status; u16 sects; /* count number of sections we need */ @@ -2822,7 +2822,7 @@ ice_upd_prof_hw(struct ice_hw *hw, enum ice_block blk, sects = xlt1 + xlt2 + tcam + es; if (!sects) - return ICE_SUCCESS; + return 0; /* Build update package buffer */ b = ice_pkg_buf_alloc(hw); @@ -3087,7 +3087,7 @@ ice_update_fd_swap(struct ice_hw *hw, u16 prof_id, struct ice_fv_word *es) /* initially clear the mask select for this profile */ ice_update_fd_mask(hw, prof_id, 0); - return ICE_SUCCESS; + return 0; } /* The entries here needs to match the order of enum ice_ptype_attrib */ @@ -3141,7 +3141,7 @@ ice_add_prof_attrib(struct ice_prof_map *prof, u8 ptg, u16 ptype, if (!found) return ICE_ERR_DOES_NOT_EXIST; - return ICE_SUCCESS; + return 0; } /** @@ -3288,7 +3288,7 @@ ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, } LIST_ADD(&prof->list, &hw->blk[blk].es.prof_map); - status = ICE_SUCCESS; + status = 0; err_ice_add_prof: ice_release_lock(&hw->blk[blk].es.prof_map_lock); @@ -3387,7 +3387,7 @@ ice_rem_prof_id(struct ice_hw *hw, enum ice_block blk, return ICE_ERR_HW_TABLE; } - return ICE_SUCCESS; + return 0; } /** @@ -3569,9 +3569,9 @@ static int ice_get_prof(struct ice_hw *hw, enum ice_block blk, u64 hdl, struct LIST_HEAD_TYPE *chg) { - int status = ICE_SUCCESS; struct ice_prof_map *map; struct ice_chs_chg *p; + int status = 0; u16 i; ice_acquire_lock(&hw->blk[blk].es.prof_map_lock); @@ -3640,7 +3640,7 @@ ice_get_profs_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, LIST_ADD_TAIL(&p->list, lst); } - return ICE_SUCCESS; + return 0; err_ice_get_profs_vsig: LIST_FOR_EACH_ENTRY_SAFE(ent1, ent2, lst, ice_vsig_prof, list) { @@ -3662,9 +3662,9 @@ static int ice_add_prof_to_lst(struct ice_hw *hw, enum ice_block blk, struct LIST_HEAD_TYPE *lst, u64 hdl) { - int status = ICE_SUCCESS; struct ice_prof_map *map; struct ice_vsig_prof *p; + int status = 0; u16 i; ice_acquire_lock(&hw->blk[blk].es.prof_map_lock); @@ -3710,9 +3710,9 @@ static int ice_move_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig, struct LIST_HEAD_TYPE *chg) { - int status; struct ice_chs_chg *p; u16 orig_vsig; + int status; p = (struct ice_chs_chg *)ice_malloc(hw, sizeof(*p)); if (!p) @@ -3734,7 +3734,7 @@ ice_move_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig, LIST_ADD(&p->list_entry, chg); - return ICE_SUCCESS; + return 0; } /** @@ -3842,7 +3842,7 @@ ice_prof_tcam_ena_dis(struct ice_hw *hw, enum ice_block blk, bool enable, /* log change */ LIST_ADD(&p->list_entry, chg); - return ICE_SUCCESS; + return 0; err_ice_prof_tcam_ena_dis: ice_free(hw, p); @@ -3888,9 +3888,9 @@ ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig, { ice_declare_bitmap(ptgs_used, ICE_XLT1_CNT); struct ice_tcam_inf **attr_used; - int status = ICE_SUCCESS; struct ice_vsig_prof *t; u16 attr_used_cnt = 0; + int status = 0; u16 idx; #define ICE_MAX_PTG_ATTRS 1024 @@ -3978,11 +3978,11 @@ ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl, u8 vl_msk[ICE_TCAM_KEY_VAL_SZ] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; u8 dc_msk[ICE_TCAM_KEY_VAL_SZ] = { 0xFF, 0xFF, 0x00, 0x00, 0x00 }; u8 nm_msk[ICE_TCAM_KEY_VAL_SZ] = { 0x00, 0x00, 0x00, 0x00, 0x00 }; - int status = ICE_SUCCESS; struct ice_prof_map *map; struct ice_vsig_prof *t; struct ice_chs_chg *p; u16 vsig_idx, i; + int status = 0; /* Error, if this VSIG already has this profile */ if (ice_has_prof_vsig(hw, blk, vsig, hdl)) @@ -4090,9 +4090,9 @@ static int ice_create_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl, struct LIST_HEAD_TYPE *chg) { - int status; struct ice_chs_chg *p; u16 new_vsig; + int status; p = (struct ice_chs_chg *)ice_malloc(hw, sizeof(*p)); if (!p) @@ -4119,7 +4119,7 @@ ice_create_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl, LIST_ADD(&p->list_entry, chg); - return ICE_SUCCESS; + return 0; err_ice_create_prof_id_vsig: /* let caller clean up the change list */ @@ -4163,7 +4163,7 @@ ice_create_vsig_from_lst(struct ice_hw *hw, enum ice_block blk, u16 vsi, *new_vsig = vsig; - return ICE_SUCCESS; + return 0; } /** @@ -4194,7 +4194,7 @@ ice_find_prof_vsig(struct ice_hw *hw, enum ice_block blk, u64 hdl, u16 *vsig) LIST_DEL(&t->list); ice_free(hw, t); - return status == ICE_SUCCESS; + return !status; } /** @@ -4399,7 +4399,7 @@ ice_rem_prof_from_list(struct ice_hw *hw, struct LIST_HEAD_TYPE *lst, u64 hdl) if (ent->profile_cookie == hdl) { LIST_DEL(&ent->list); ice_free(hw, ent); - return ICE_SUCCESS; + return 0; } return ICE_ERR_DOES_NOT_EXIST; @@ -4554,7 +4554,7 @@ int ice_flow_assoc_hw_prof(struct ice_hw *hw, enum ice_block blk, u16 dest_vsi_handle, u16 fdir_vsi_handle, int id) { - int status = ICE_SUCCESS; + int status = 0; u16 vsi_num; vsi_num = ice_get_hw_vsi_num(hw, dest_vsi_handle); diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index d8181805f1..0b9974aee2 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -1033,7 +1033,7 @@ ice_flow_val_hdrs(struct ice_flow_seg_info *segs, u8 segs_cnt) return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /* Sizes of fixed known protocol headers without header options */ @@ -1318,7 +1318,7 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) } } - return ICE_SUCCESS; + return 0; } /** @@ -1354,7 +1354,7 @@ ice_flow_xtract_pkt_flags(struct ice_hw *hw, params->es[idx].off = (u16)flags; params->es_cnt++; - return ICE_SUCCESS; + return 0; } /** @@ -1617,7 +1617,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, off += ICE_FLOW_FV_EXTRACT_SZ; } - return ICE_SUCCESS; + return 0; } /** @@ -1635,7 +1635,7 @@ ice_flow_xtract_raws(struct ice_hw *hw, struct ice_flow_prof_params *params, u8 i; if (!params->prof->segs[seg].raws_cnt) - return ICE_SUCCESS; + return 0; if (params->prof->segs[seg].raws_cnt > ARRAY_SIZE(params->prof->segs[seg].raws)) @@ -1693,7 +1693,7 @@ ice_flow_xtract_raws(struct ice_hw *hw, struct ice_flow_prof_params *params, } } - return ICE_SUCCESS; + return 0; } /** @@ -1708,7 +1708,7 @@ static int ice_flow_create_xtrct_seq(struct ice_hw *hw, struct ice_flow_prof_params *params) { - int status = ICE_SUCCESS; + int status = 0; u8 i; /* For ACL, we also need to extract the direction bit (Rx,Tx) data from @@ -1771,7 +1771,7 @@ ice_flow_sel_acl_scen(struct ice_hw *hw, struct ice_flow_prof_params *params) params->prof->cfg.scen = cand_scen; - return ICE_SUCCESS; + return 0; } /** @@ -1852,7 +1852,7 @@ ice_flow_acl_def_entry_frmt(struct ice_flow_prof_params *params) /* Store # bytes required for entry for later use */ params->entry_length = index - ICE_AQC_ACL_PROF_BYTE_SEL_START_IDX; - return ICE_SUCCESS; + return 0; } /** @@ -1876,7 +1876,7 @@ ice_flow_proc_segs(struct ice_hw *hw, struct ice_flow_prof_params *params) switch (params->blk) { case ICE_BLK_FD: case ICE_BLK_RSS: - status = ICE_SUCCESS; + status = 0; break; case ICE_BLK_ACL: status = ice_flow_acl_def_entry_frmt(params); @@ -2030,7 +2030,7 @@ ice_flow_get_hw_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id, map = ice_search_prof_id(hw, blk, prof_id); if (map) { *hw_prof_id = map->prof_id; - status = ICE_SUCCESS; + status = 0; } ice_release_lock(&hw->blk[blk].es.prof_map_lock); return status; @@ -2044,7 +2044,7 @@ ice_flow_get_hw_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id, * @prof: pointer to flow profile * @buf: destination buffer function writes partial extraction sequence to * - * returns ICE_SUCCESS if no PF is associated to the given profile + * returns 0 if no PF is associated to the given profile * returns ICE_ERR_IN_USE if at least one PF is associated to the given profile * returns other error code for real error */ @@ -2071,7 +2071,7 @@ ice_flow_acl_is_prof_in_use(struct ice_hw *hw, struct ice_flow_prof *prof, buf->pf_scenario_num[2] == 0 && buf->pf_scenario_num[3] == 0 && buf->pf_scenario_num[4] == 0 && buf->pf_scenario_num[5] == 0 && buf->pf_scenario_num[6] == 0 && buf->pf_scenario_num[7] == 0) - return ICE_SUCCESS; + return 0; if (buf->pf_scenario_num[0] == ICE_ACL_INVALID_SCEN && buf->pf_scenario_num[1] == ICE_ACL_INVALID_SCEN && @@ -2081,7 +2081,7 @@ ice_flow_acl_is_prof_in_use(struct ice_hw *hw, struct ice_flow_prof *prof, buf->pf_scenario_num[5] == ICE_ACL_INVALID_SCEN && buf->pf_scenario_num[6] == ICE_ACL_INVALID_SCEN && buf->pf_scenario_num[7] == ICE_ACL_INVALID_SCEN) - return ICE_SUCCESS; + return 0; return ICE_ERR_IN_USE; } @@ -2126,7 +2126,7 @@ ice_flow_acl_free_act_cntr(struct ice_hw *hw, struct ice_flow_action *acts, return status; } } - return ICE_SUCCESS; + return 0; } /** @@ -2140,7 +2140,7 @@ static int ice_flow_acl_disassoc_scen(struct ice_hw *hw, struct ice_flow_prof *prof) { struct ice_aqc_acl_prof_generic_frmt buf; - int status = ICE_SUCCESS; + int status = 0; u8 prof_id = 0; ice_memset(&buf, 0, sizeof(buf), ICE_NONDMA_MEM); @@ -2194,7 +2194,7 @@ ice_flow_rem_entry_sync(struct ice_hw *hw, enum ice_block blk, ice_dealloc_flow_entry(hw, entry); - return ICE_SUCCESS; + return 0; } /** @@ -2504,7 +2504,7 @@ int ice_flow_assoc_prof(struct ice_hw *hw, enum ice_block blk, struct ice_flow_prof *prof, u16 vsi_handle) { - int status = ICE_SUCCESS; + int status = 0; if (!ice_is_bit_set(prof->vsis, vsi_handle)) { if (blk == ICE_BLK_ACL) { @@ -2540,7 +2540,7 @@ static int ice_flow_disassoc_prof(struct ice_hw *hw, enum ice_block blk, struct ice_flow_prof *prof, u16 vsi_handle) { - int status = ICE_SUCCESS; + int status = 0; if (ice_is_bit_set(prof->vsis, vsi_handle)) { status = ice_rem_prof_id_flow(hw, blk, @@ -2632,7 +2632,7 @@ ice_flow_set_hw_prof(struct ice_hw *hw, u16 dest_vsi_handle, if (status) goto free_params; - return ICE_SUCCESS; + return 0; free_params: ice_free(hw, params); @@ -2812,7 +2812,7 @@ ice_flow_acl_check_actions(struct ice_hw *hw, struct ice_flow_action *acts, } } - return ICE_SUCCESS; + return 0; } /** @@ -3247,7 +3247,7 @@ ice_flow_acl_union_rng_chk(struct ice_aqc_acl_profile_ranges *dst_buf, } } - return ICE_SUCCESS; + return 0; } /** @@ -3268,8 +3268,8 @@ ice_flow_acl_add_scen_entry_sync(struct ice_hw *hw, struct ice_flow_prof *prof, struct ice_aqc_acl_profile_ranges query_rng_buf, cfg_rng_buf; struct ice_acl_act_entry *acts = NULL; struct ice_flow_entry *exist; - int status = ICE_SUCCESS; struct ice_flow_entry *e; + int status = 0; u8 i; if (!entry || !(*entry) || !prof) @@ -3440,7 +3440,7 @@ ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id, { struct ice_flow_entry *e = NULL; struct ice_flow_prof *prof; - int status = ICE_SUCCESS; + int status = 0; /* ACL entries must indicate an action */ if (blk == ICE_BLK_ACL && (!acts || !acts_cnt)) @@ -3529,7 +3529,7 @@ int ice_flow_rem_entry(struct ice_hw *hw, enum ice_block blk, { struct ice_flow_entry *entry; struct ice_flow_prof *prof; - int status = ICE_SUCCESS; + int status = 0; if (entry_h == ICE_FLOW_ENTRY_HANDLE_INVAL) return ICE_ERR_PARAM; @@ -3699,7 +3699,7 @@ int ice_flow_rem_vsi_prof(struct ice_hw *hw, enum ice_block blk, u16 vsi_handle, u64 prof_id) { struct ice_flow_prof *prof = NULL; - int status = ICE_SUCCESS; + int status = 0; if (blk >= ICE_BLK_COUNT || !ice_is_vsi_valid(hw, vsi_handle)) return ICE_ERR_PARAM; @@ -3814,7 +3814,7 @@ ice_flow_set_rss_seg_info(struct ice_flow_seg_info *segs, u8 seg_cnt, if (val && !ice_is_pow2(val)) return ICE_ERR_CFG; - return ICE_SUCCESS; + return 0; } /** @@ -3855,14 +3855,14 @@ int ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle) { const enum ice_block blk = ICE_BLK_RSS; struct ice_flow_prof *p, *t; - int status = ICE_SUCCESS; + int status = 0; u16 vsig; if (!ice_is_vsi_valid(hw, vsi_handle)) return ICE_ERR_PARAM; if (LIST_EMPTY(&hw->fl_profs[blk])) - return ICE_SUCCESS; + return 0; ice_acquire_lock(&hw->rss_locks); LIST_FOR_EACH_ENTRY_SAFE(p, t, &hw->fl_profs[blk], ice_flow_prof, @@ -3970,7 +3970,7 @@ ice_add_rss_list(struct ice_hw *hw, u16 vsi_handle, struct ice_flow_prof *prof) r->hash.addl_hdrs == prof->segs[prof->segs_cnt - 1].hdrs && r->hash.hdr_type == hdr_type) { ice_set_bit(vsi_handle, r->vsis); - return ICE_SUCCESS; + return 0; } rss_cfg = (struct ice_rss_cfg *)ice_malloc(hw, sizeof(*rss_cfg)); @@ -3985,7 +3985,7 @@ ice_add_rss_list(struct ice_hw *hw, u16 vsi_handle, struct ice_flow_prof *prof) LIST_ADD_TAIL(&rss_cfg->l_entry, &hw->rss_list_head); - return ICE_SUCCESS; + return 0; } #define ICE_FLOW_PROF_HASH_S 0 @@ -4495,8 +4495,8 @@ ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, */ int ice_replay_rss_cfg(struct ice_hw *hw, u16 vsi_handle) { - int status = ICE_SUCCESS; struct ice_rss_cfg *r; + int status = 0; if (!ice_is_vsi_valid(hw, vsi_handle)) return ICE_ERR_PARAM; diff --git a/drivers/net/ice/base/ice_nvm.c b/drivers/net/ice/base/ice_nvm.c index 95d455f376..9cebe7a07b 100644 --- a/drivers/net/ice/base/ice_nvm.c +++ b/drivers/net/ice/base/ice_nvm.c @@ -144,7 +144,7 @@ ice_read_sr_word_aq(struct ice_hw *hw, u16 offset, u16 *data) return status; *data = LE16_TO_CPU(data_local); - return ICE_SUCCESS; + return 0; } /** @@ -192,7 +192,7 @@ int ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access) ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); if (hw->flash.blank_nvm_mode) - return ICE_SUCCESS; + return 0; return ice_acquire_res(hw, ICE_NVM_RES_ID, access, ICE_NVM_TIMEOUT); } @@ -382,7 +382,7 @@ ice_get_nvm_css_hdr_len(struct ice_hw *hw, enum ice_bank_select bank, hdr_len_dword = hdr_len_h << 16 | hdr_len_l; *hdr_len = (hdr_len_dword * 2) + ICE_NVM_AUTH_HEADER_LEN; - return ICE_SUCCESS; + return 0; } /** @@ -476,12 +476,12 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, int status; status = ice_read_sr_word(hw, ICE_SR_PFA_PTR, &pfa_ptr); - if (status != ICE_SUCCESS) { + if (status) { ice_debug(hw, ICE_DBG_INIT, "Preserved Field Array pointer.\n"); return status; } status = ice_read_sr_word(hw, pfa_ptr, &pfa_len); - if (status != ICE_SUCCESS) { + if (status) { ice_debug(hw, ICE_DBG_INIT, "Failed to read PFA length.\n"); return status; } @@ -495,13 +495,13 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, /* Read TLV type */ status = ice_read_sr_word(hw, next_tlv, &tlv_sub_module_type); - if (status != ICE_SUCCESS) { + if (status) { ice_debug(hw, ICE_DBG_INIT, "Failed to read TLV type.\n"); break; } /* Read TLV length */ status = ice_read_sr_word(hw, next_tlv + 1, &tlv_len); - if (status != ICE_SUCCESS) { + if (status) { ice_debug(hw, ICE_DBG_INIT, "Failed to read TLV length.\n"); break; } @@ -509,7 +509,7 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, if (tlv_len) { *module_tlv = next_tlv; *module_tlv_len = tlv_len; - return ICE_SUCCESS; + return 0; } return ICE_ERR_INVAL_SIZE; } @@ -540,14 +540,14 @@ ice_read_pba_string(struct ice_hw *hw, u8 *pba_num, u32 pba_num_size) status = ice_get_pfa_module_tlv(hw, &pba_tlv, &pba_tlv_len, ICE_SR_PBA_BLOCK_PTR); - if (status != ICE_SUCCESS) { + if (status) { ice_debug(hw, ICE_DBG_INIT, "Failed to read PBA Block TLV.\n"); return status; } /* pba_size is the next word */ status = ice_read_sr_word(hw, (pba_tlv + 2), &pba_size); - if (status != ICE_SUCCESS) { + if (status) { ice_debug(hw, ICE_DBG_INIT, "Failed to read PBA Section size.\n"); return status; } @@ -568,7 +568,7 @@ ice_read_pba_string(struct ice_hw *hw, u8 *pba_num, u32 pba_num_size) for (i = 0; i < pba_size; i++) { status = ice_read_sr_word(hw, (pba_tlv + 2 + 1) + i, &pba_word); - if (status != ICE_SUCCESS) { + if (status) { ice_debug(hw, ICE_DBG_INIT, "Failed to read PBA Block word %d.\n", i); return status; } @@ -605,7 +605,7 @@ static int ice_get_nvm_srev(struct ice_hw *hw, enum ice_bank_select bank, u32 *s *srev = srev_h << 16 | srev_l; - return ICE_SUCCESS; + return 0; } /** @@ -649,7 +649,7 @@ ice_get_nvm_ver_info(struct ice_hw *hw, enum ice_bank_select bank, struct ice_nv if (status) ice_debug(hw, ICE_DBG_NVM, "Failed to read NVM security revision.\n"); - return ICE_SUCCESS; + return 0; } /** @@ -707,7 +707,7 @@ static int ice_get_orom_srev(struct ice_hw *hw, enum ice_bank_select bank, u32 * *srev = srev_h << 16 | srev_l; - return ICE_SUCCESS; + return 0; } /** @@ -777,7 +777,7 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, *civd = *tmp; ice_free(hw, orom_data); - return ICE_SUCCESS; + return 0; } ice_debug(hw, ICE_DBG_NVM, "Unable to locate CIVD data within the Option ROM\n"); @@ -821,7 +821,7 @@ ice_get_orom_ver_info(struct ice_hw *hw, enum ice_bank_select bank, struct ice_o return status; } - return ICE_SUCCESS; + return 0; } /** @@ -867,7 +867,7 @@ static int ice_discover_flash_size(struct ice_hw *hw) hw->adminq.sq_last_status == ICE_AQ_RC_EINVAL) { ice_debug(hw, ICE_DBG_NVM, "%s: New upper bound of %u bytes\n", __func__, offset); - status = ICE_SUCCESS; + status = 0; max_size = offset; } else if (!status) { ice_debug(hw, ICE_DBG_NVM, "%s: New lower bound of %u bytes\n", @@ -919,7 +919,7 @@ ice_read_sr_pointer(struct ice_hw *hw, u16 offset, u32 *pointer) else *pointer = value * 2; - return ICE_SUCCESS; + return 0; } /** @@ -948,7 +948,7 @@ ice_read_sr_area_size(struct ice_hw *hw, u16 offset, u32 *size) /* Area sizes are always specified in 4KB units */ *size = value * 4 * 1024; - return ICE_SUCCESS; + return 0; } /** @@ -1031,7 +1031,7 @@ ice_determine_active_flash_banks(struct ice_hw *hw) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -1092,7 +1092,7 @@ int ice_init_nvm(struct ice_hw *hw) if (status) ice_debug(hw, ICE_DBG_INIT, "Failed to read Option ROM info.\n"); - return ICE_SUCCESS; + return 0; } /** @@ -1208,7 +1208,7 @@ ice_nvm_access_get_features(struct ice_nvm_access_cmd *cmd, data->drv_features.size = sizeof(struct ice_nvm_features); data->drv_features.features[0] = ICE_NVM_FEATURES_0_REG_ACCESS; - return ICE_SUCCESS; + return 0; } /** @@ -1281,18 +1281,18 @@ ice_validate_nvm_rw_reg(struct ice_nvm_access_cmd *cmd) case GLNVM_GENS: case GLNVM_FLA: case PF_FUNC_RID: - return ICE_SUCCESS; + return 0; default: break; } for (i = 0; i <= GL_HIDA_MAX_INDEX; i++) if (offset == (u32)GL_HIDA(i)) - return ICE_SUCCESS; + return 0; for (i = 0; i <= GL_HIBA_MAX_INDEX; i++) if (offset == (u32)GL_HIBA(i)) - return ICE_SUCCESS; + return 0; /* All other register offsets are not valid */ return ICE_ERR_OUT_OF_RANGE; @@ -1328,7 +1328,7 @@ ice_nvm_access_read(struct ice_hw *hw, struct ice_nvm_access_cmd *cmd, /* Read the register and store the contents in the data field */ data->regval = rd32(hw, cmd->offset); - return ICE_SUCCESS; + return 0; } /** @@ -1367,7 +1367,7 @@ ice_nvm_access_write(struct ice_hw *hw, struct ice_nvm_access_cmd *cmd, /* Write the data field to the specified register */ wr32(hw, cmd->offset, data->regval); - return ICE_SUCCESS; + return 0; } /** diff --git a/drivers/net/ice/base/ice_parser.c b/drivers/net/ice/base/ice_parser.c index 05fb297d78..551e24a5f5 100644 --- a/drivers/net/ice/base/ice_parser.c +++ b/drivers/net/ice/base/ice_parser.c @@ -270,7 +270,7 @@ int ice_parser_create(struct ice_hw *hw, struct ice_parser **psr) } *psr = p; - return ICE_SUCCESS; + return 0; err: ice_parser_destroy(p); return status; @@ -389,7 +389,7 @@ _tunnel_port_set(struct ice_parser *psr, const char *prefix, u16 udp_port, item->key[15] = (u8)(0xff - buf[0]); item->key[16] = (u8)(0xff - buf[1]); - return ICE_SUCCESS; + return 0; /* found a matched slot to delete */ } else if (!on && (item->key_inv[15] == buf[0] || item->key_inv[16] == buf[1])) { @@ -398,7 +398,7 @@ _tunnel_port_set(struct ice_parser *psr, const char *prefix, u16 udp_port, item->key[15] = 0xff; item->key[16] = 0xfe; - return ICE_SUCCESS; + return 0; } i++; } @@ -528,7 +528,7 @@ int ice_parser_profile_init(struct ice_parser_result *rslt, prof->fv_num++; } - return ICE_SUCCESS; + return 0; } /** diff --git a/drivers/net/ice/base/ice_parser_rt.c b/drivers/net/ice/base/ice_parser_rt.c index b10e10861c..69655fdd96 100644 --- a/drivers/net/ice/base/ice_parser_rt.c +++ b/drivers/net/ice/base/ice_parser_rt.c @@ -773,12 +773,12 @@ static void _result_resolve(struct ice_parser_rt *rt, int ice_parser_rt_execute(struct ice_parser_rt *rt, struct ice_parser_result *rslt) { - int status = ICE_SUCCESS; struct ice_pg_nm_cam_item *pg_nm_cam; struct ice_parser *psr = rt->psr; struct ice_pg_cam_item *pg_cam; struct ice_bst_tcam_item *bst; struct ice_imem_item *imem; + int status = 0; u16 node; u16 pc; diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index 3b842475e4..8ce803bfb3 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -130,7 +130,7 @@ ice_read_cgu_reg_e822(struct ice_hw *hw, u16 addr, u32 *val) *val = cgu_msg.data; - return ICE_SUCCESS; + return 0; } /** @@ -161,7 +161,7 @@ ice_write_cgu_reg_e822(struct ice_hw *hw, u16 addr, u32 val) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -341,7 +341,7 @@ ice_cfg_cgu_pll_e822(struct ice_hw *hw, enum ice_time_ref_freq clk_freq, ice_clk_freq_str(dw9.field.time_ref_freq_sel), bwm_lf.field.plllock_true_lock_cri ? "locked" : "unlocked"); - return ICE_SUCCESS; + return 0; } /** @@ -378,7 +378,7 @@ static int ice_init_cgu_e822(struct ice_hw *hw) if (status) return status; - return ICE_SUCCESS; + return 0; } /** @@ -540,7 +540,7 @@ ice_phy_port_reg_address_eth56g(u8 port, u16 offset, u32 *address) *address = offset + eth56g_port_base[phy] + PHY_PTP_LANE_ADDR_STEP * lane; - return ICE_SUCCESS; + return 0; } /** @@ -563,7 +563,7 @@ ice_phy_port_mem_address_eth56g(u8 port, u16 offset, u32 *address) *address = offset + eth56g_port_base[phy] + PHY_PTP_MEM_START + PHY_PTP_MEM_LANE_STEP * lane; - return ICE_SUCCESS; + return 0; } /** @@ -789,7 +789,7 @@ ice_read_40b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val) *val = ((u64)hi << P_REG_40B_HIGH_S) | (lo & P_REG_40B_LOW_M); - return ICE_SUCCESS; + return 0; } /** @@ -830,7 +830,7 @@ ice_read_64b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val) *val = ((u64)hi << 32) | lo; - return ICE_SUCCESS; + return 0; } /** @@ -872,7 +872,7 @@ ice_write_40b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 val) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -913,7 +913,7 @@ ice_write_64b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 val) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -956,7 +956,7 @@ ice_read_phy_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx, u64 *tstamp) */ *tstamp = ((u64)hi) << TS_PHY_HIGH_S | ((u64)lo & TS_PHY_LOW_M); - return ICE_SUCCESS; + return 0; } /** @@ -983,7 +983,7 @@ ice_clear_phy_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -1047,7 +1047,7 @@ ice_ptp_prep_phy_time_eth56g(struct ice_hw *hw, u32 time) } } - return ICE_SUCCESS; + return 0; } /** @@ -1103,7 +1103,7 @@ ice_ptp_prep_port_adj_eth56g(struct ice_hw *hw, u8 port, s64 time, if (status) goto exit_err; - return ICE_SUCCESS; + return 0; exit_err: ice_debug(hw, ICE_DBG_PTP, "Failed to write time adjust for port %u, status %d\n", @@ -1125,7 +1125,7 @@ ice_ptp_prep_port_adj_eth56g(struct ice_hw *hw, u8 port, s64 time, static int ice_ptp_prep_phy_adj_eth56g(struct ice_hw *hw, s32 adj, bool lock_sbq) { - int status = ICE_SUCCESS; + int status = 0; s64 cycles; u8 port; @@ -1176,7 +1176,7 @@ ice_ptp_prep_phy_incval_eth56g(struct ice_hw *hw, u64 incval) } } - return ICE_SUCCESS; + return 0; } /** @@ -1203,7 +1203,7 @@ ice_ptp_read_phy_incval_eth56g(struct ice_hw *hw, u8 port, u64 *incval) ice_debug(hw, ICE_DBG_PTP, "read INCVAL = 0x%016llx\n", (unsigned long long)*incval); - return ICE_SUCCESS; + return 0; } /** @@ -1258,7 +1258,7 @@ ice_ptp_prep_phy_adj_target_eth56g(struct ice_hw *hw, u32 target_time) goto exit_err; } - return ICE_SUCCESS; + return 0; exit_err: ice_debug(hw, ICE_DBG_PTP, "Failed to write target time for port %u, status %d\n", @@ -1306,7 +1306,7 @@ ice_ptp_read_port_capture_eth56g(struct ice_hw *hw, u8 port, u64 *tx_ts, ice_debug(hw, ICE_DBG_PTP, "rx_init = %#016llx\n", (unsigned long long)*rx_ts); - return ICE_SUCCESS; + return 0; } /** @@ -1393,7 +1393,7 @@ ice_ptp_one_port_cmd_eth56g(struct ice_hw *hw, u8 port, return status; } - return ICE_SUCCESS; + return 0; } /** @@ -1421,7 +1421,7 @@ ice_ptp_port_cmd_eth56g(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd, return status; } - return ICE_SUCCESS; + return 0; } /** @@ -1581,7 +1581,7 @@ ice_read_phy_and_phc_time_eth56g(struct ice_hw *hw, u8 port, u64 *phy_time, *phy_time = tx_time; - return ICE_SUCCESS; + return 0; } /** @@ -1678,7 +1678,7 @@ ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset) ice_debug(hw, ICE_DBG_PTP, "Disabled clock on PHY port %u\n", port); - return ICE_SUCCESS; + return 0; } /** @@ -1740,7 +1740,7 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass) ice_debug(hw, ICE_DBG_PTP, "Enabled clock on PHY port %u\n", port); - return ICE_SUCCESS; + return 0; } /** @@ -1751,7 +1751,7 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass) */ static int ice_ptp_init_phc_eth56g(struct ice_hw *hw) { - int status = ICE_SUCCESS; + int status = 0; u32 regval; /* Enable reading switch and PHY registers over the sideband queue */ @@ -1786,7 +1786,7 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status) ice_debug(hw, ICE_DBG_PTP, "PHY interrupt status: %x\n", *ts_status); - return ICE_SUCCESS; + return 0; } /** @@ -1807,7 +1807,7 @@ ice_ptp_init_phy_cfg(struct ice_hw *hw) if (phy_rev == PHY_REVISION_ETH56G) { hw->phy_cfg = ICE_PHY_ETH56G; - return ICE_SUCCESS; + return 0; } if (ice_is_e810(hw)) @@ -1815,7 +1815,7 @@ ice_ptp_init_phy_cfg(struct ice_hw *hw) else hw->phy_cfg = ICE_PHY_E822; - return ICE_SUCCESS; + return 0; } /* ---------------------------------------------------------------------------- @@ -1982,7 +1982,7 @@ ice_read_phy_reg_e822_lp(struct ice_hw *hw, u8 port, u16 offset, u32 *val, *val = msg.data; - return ICE_SUCCESS; + return 0; } int @@ -2035,7 +2035,7 @@ ice_read_40b_phy_reg_e822(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val) *val = (u64)high << P_REG_40B_HIGH_S | (low & P_REG_40B_LOW_M); - return ICE_SUCCESS; + return 0; } /** @@ -2082,7 +2082,7 @@ ice_read_64b_phy_reg_e822(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val) *val = (u64)high << 32 | low; - return ICE_SUCCESS; + return 0; } /** @@ -2113,7 +2113,7 @@ ice_write_phy_reg_e822_lp(struct ice_hw *hw, u8 port, u16 offset, u32 val, return status; } - return ICE_SUCCESS; + return 0; } int @@ -2165,7 +2165,7 @@ ice_write_40b_phy_reg_e822(struct ice_hw *hw, u8 port, u16 low_addr, u64 val) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -2213,7 +2213,7 @@ ice_write_64b_phy_reg_e822(struct ice_hw *hw, u8 port, u16 low_addr, u64 val) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -2243,7 +2243,7 @@ ice_fill_quad_msg_e822(struct ice_sbq_msg_input *msg, u8 quad, u16 offset) msg->msg_addr_low = ICE_LO_WORD(addr); msg->msg_addr_high = ICE_HI_WORD(addr); - return ICE_SUCCESS; + return 0; } /** @@ -2278,7 +2278,7 @@ ice_read_quad_reg_e822_lp(struct ice_hw *hw, u8 quad, u16 offset, u32 *val, else *val = msg.data; - return status; + return ICE_SUCCESS; } int @@ -2318,7 +2318,7 @@ ice_write_quad_reg_e822_lp(struct ice_hw *hw, u8 quad, u16 offset, u32 val, ice_debug(hw, ICE_DBG_PTP, "Failed to send message to phy, status %d\n", status); - return status; + return ICE_SUCCESS; } int @@ -2368,7 +2368,7 @@ ice_read_phy_tstamp_e822(struct ice_hw *hw, u8 quad, u8 idx, u64 *tstamp) */ *tstamp = ((u64)hi) << TS_PHY_HIGH_S | ((u64)lo & TS_PHY_LOW_M); - return ICE_SUCCESS; + return 0; } /** @@ -2403,7 +2403,7 @@ ice_clear_phy_tstamp_e822(struct ice_hw *hw, u8 quad, u8 idx) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -2428,7 +2428,7 @@ int ice_ptp_set_vernier_wl(struct ice_hw *hw) } } - return ICE_SUCCESS; + return 0; } /** @@ -2498,7 +2498,7 @@ ice_ptp_prep_phy_time_e822(struct ice_hw *hw, u32 time) goto exit_err; } - return ICE_SUCCESS; + return 0; exit_err: ice_debug(hw, ICE_DBG_PTP, "Failed to write init time for port %u, status %d\n", @@ -2556,7 +2556,7 @@ ice_ptp_prep_port_adj_e822(struct ice_hw *hw, u8 port, s64 time, if (status) goto exit_err; - return ICE_SUCCESS; + return 0; exit_err: ice_debug(hw, ICE_DBG_PTP, "Failed to write time adjust for port %u, status %d\n", @@ -2599,7 +2599,7 @@ ice_ptp_prep_phy_adj_e822(struct ice_hw *hw, s32 adj, bool lock_sbq) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -2624,7 +2624,7 @@ ice_ptp_prep_phy_incval_e822(struct ice_hw *hw, u64 incval) goto exit_err; } - return ICE_SUCCESS; + return 0; exit_err: ice_debug(hw, ICE_DBG_PTP, "Failed to write incval for port %u, status %d\n", @@ -2656,7 +2656,7 @@ ice_ptp_read_phy_incval_e822(struct ice_hw *hw, u8 port, u64 *incval) ice_debug(hw, ICE_DBG_PTP, "read INCVAL = 0x%016llx\n", (unsigned long long)*incval); - return ICE_SUCCESS; + return 0; } /** @@ -2709,7 +2709,7 @@ ice_ptp_prep_phy_adj_target_e822(struct ice_hw *hw, u32 target_time) goto exit_err; } - return ICE_SUCCESS; + return 0; exit_err: ice_debug(hw, ICE_DBG_PTP, "Failed to write target time for port %u, status %d\n", @@ -2757,7 +2757,7 @@ ice_ptp_read_port_capture_e822(struct ice_hw *hw, u8 port, u64 *tx_ts, ice_debug(hw, ICE_DBG_PTP, "rx_init = 0x%016llx\n", (unsigned long long)*rx_ts); - return ICE_SUCCESS; + return 0; } /** @@ -2847,7 +2847,7 @@ ice_ptp_one_port_cmd_e822(struct ice_hw *hw, u8 port, enum ice_ptp_tmr_cmd cmd, return status; } - return ICE_SUCCESS; + return 0; } /** @@ -2873,7 +2873,7 @@ ice_ptp_port_cmd_e822(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd, return status; } - return ICE_SUCCESS; + return 0; } /* E822 Vernier calibration functions @@ -2956,7 +2956,7 @@ ice_phy_get_speed_and_fec_e822(struct ice_hw *hw, u8 port, if (fec_out) *fec_out = fec; - return ICE_SUCCESS; + return 0; } /** @@ -3082,7 +3082,7 @@ static int ice_phy_cfg_uix_e822(struct ice_hw *hw, u8 port) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -3355,7 +3355,7 @@ int ice_phy_cfg_tx_offset_e822(struct ice_hw *hw, u8 port) if (status) return status; - return ICE_SUCCESS; + return 0; } /** @@ -3396,7 +3396,7 @@ ice_phy_cfg_fixed_tx_offset_e822(struct ice_hw *hw, u8 port) if (status) return status; - return ICE_SUCCESS; + return 0; } /** @@ -3493,7 +3493,7 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port, /* In some cases, there's no need to adjust for the PMD alignment */ if (!mult) { *pmd_adj = 0; - return ICE_SUCCESS; + return 0; } /* Calculate the adjustment by multiplying TUs per second by the @@ -3557,7 +3557,7 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port, /* Return the calculated adjustment */ *pmd_adj = adj; - return ICE_SUCCESS; + return 0; } /** @@ -3676,7 +3676,7 @@ int ice_phy_cfg_rx_offset_e822(struct ice_hw *hw, u8 port) if (status) return status; - return ICE_SUCCESS; + return 0; } /** @@ -3717,7 +3717,7 @@ ice_phy_cfg_fixed_rx_offset_e822(struct ice_hw *hw, u8 port) if (status) return status; - return ICE_SUCCESS; + return 0; } /** @@ -3774,7 +3774,7 @@ ice_read_phy_and_phc_time_e822(struct ice_hw *hw, u8 port, u64 *phy_time, *phy_time = tx_time; - return ICE_SUCCESS; + return 0; } /** @@ -3841,7 +3841,7 @@ static int ice_sync_phy_timer_e822(struct ice_hw *hw, u8 port) ice_ptp_unlock(hw); - return ICE_SUCCESS; + return 0; err_unlock: ice_ptp_unlock(hw); @@ -3895,7 +3895,7 @@ ice_stop_phy_timer_e822(struct ice_hw *hw, u8 port, bool soft_reset) ice_debug(hw, ICE_DBG_PTP, "Disabled clock on PHY port %u\n", port); - return ICE_SUCCESS; + return 0; } /** @@ -4017,7 +4017,7 @@ ice_start_phy_timer_e822(struct ice_hw *hw, u8 port, bool bypass) ice_debug(hw, ICE_DBG_PTP, "Enabled clock on PHY port %u\n", port); - return ICE_SUCCESS; + return 0; } /** @@ -4101,7 +4101,7 @@ int ice_phy_exit_bypass_e822(struct ice_hw *hw, u8 port) ice_info(hw, "Exiting bypass mode on PHY port %u\n", port); - return ICE_SUCCESS; + return 0; } /* E810 functions @@ -4139,7 +4139,7 @@ ice_read_phy_reg_e810_lp(struct ice_hw *hw, u32 addr, u32 *val, bool lock_sbq) *val = msg.data; - return ICE_SUCCESS; + return 0; } static int ice_read_phy_reg_e810(struct ice_hw *hw, u32 addr, u32 *val) @@ -4175,7 +4175,7 @@ ice_write_phy_reg_e810_lp(struct ice_hw *hw, u32 addr, u32 val, bool lock_sbq) return status; } - return ICE_SUCCESS; + return 0; } static int ice_write_phy_reg_e810(struct ice_hw *hw, u32 addr, u32 val) @@ -4213,7 +4213,7 @@ ice_read_phy_tstamp_ll_e810(struct ice_hw *hw, u8 idx, u8 *hi, u32 *lo) /* Read the low 32 bit value and set the TS valid bit */ *lo = rd32(hw, PF_SB_ATQBAH) | TS_VALID; - return ICE_SUCCESS; + return 0; } ice_usec_delay(10, false); @@ -4261,7 +4261,7 @@ ice_read_phy_tstamp_sbq_e810(struct ice_hw *hw, u8 lport, u8 idx, u8 *hi, *lo = lo_val; *hi = (u8)hi_val; - return ICE_SUCCESS; + return 0; } /** @@ -4294,7 +4294,7 @@ ice_read_phy_tstamp_e810(struct ice_hw *hw, u8 lport, u8 idx, u64 *tstamp) */ *tstamp = ((u64)hi) << TS_HIGH_S | ((u64)lo & TS_LOW_M); - return ICE_SUCCESS; + return 0; } /** @@ -4329,7 +4329,7 @@ ice_clear_phy_tstamp_e810(struct ice_hw *hw, u8 lport, u8 idx) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -4403,7 +4403,7 @@ static int ice_ptp_prep_phy_time_e810(struct ice_hw *hw, u32 time) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -4447,7 +4447,7 @@ ice_ptp_prep_phy_adj_e810(struct ice_hw *hw, s32 adj, bool lock_sbq) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -4484,7 +4484,7 @@ ice_ptp_prep_phy_incval_e810(struct ice_hw *hw, u64 incval) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -4523,7 +4523,7 @@ ice_ptp_prep_phy_adj_target_e810(struct ice_hw *hw, u32 target_time) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -4582,7 +4582,7 @@ ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd, return status; } - return ICE_SUCCESS; + return 0; } /* E810T SMA functions @@ -4614,7 +4614,7 @@ ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle) /* If handle was read previously return cached value */ if (hw->io_expander_handle) { *pca9575_handle = hw->io_expander_handle; - return ICE_SUCCESS; + return 0; } memset(&cmd, 0, sizeof(cmd)); @@ -4650,7 +4650,7 @@ ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle) hw->io_expander_handle = node_handle; *pca9575_handle = hw->io_expander_handle; - return ICE_SUCCESS; + return 0; } /** @@ -4913,7 +4913,7 @@ static int ice_ptp_tmr_cmd(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd, ice_ptp_exec_tmr_cmd(hw); ice_ptp_clean_cmd(hw); - return ICE_SUCCESS; + return 0; } /** diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index 80cd057462..d694bfd414 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -38,7 +38,7 @@ ice_sched_add_root_node(struct ice_port_info *pi, ice_memcpy(&root->info, info, sizeof(*info), ICE_DMA_TO_NONDMA); pi->root = root; - return ICE_SUCCESS; + return 0; } /** @@ -200,7 +200,7 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer, node->tx_sched_layer = layer; parent->children[parent->num_children++] = node; node->info = elem; - return ICE_SUCCESS; + return 0; } /** @@ -254,7 +254,7 @@ ice_sched_remove_elems(struct ice_hw *hw, struct ice_sched_node *parent, status = ice_aq_delete_sched_elems(hw, 1, buf, buf_size, &num_groups_removed, NULL); - if (status != ICE_SUCCESS || num_groups_removed != 1) + if (status || num_groups_removed != 1) ice_debug(hw, ICE_DBG_SCHED, "remove node failed FW error %d\n", hw->adminq.sq_last_status); @@ -549,7 +549,7 @@ ice_sched_suspend_resume_elems(struct ice_hw *hw, u8 num_nodes, u32 *node_teids, status = ice_aq_resume_sched_elems(hw, num_nodes, buf, buf_size, &num_elem_ret, NULL); - if (status != ICE_SUCCESS || num_elem_ret != num_nodes) + if (status || num_elem_ret != num_nodes) ice_debug(hw, ICE_DBG_SCHED, "suspend/resume failed\n"); ice_free(hw, buf); @@ -579,7 +579,7 @@ ice_alloc_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 new_numqs) if (!vsi_ctx->lan_q_ctx[tc]) return ICE_ERR_NO_MEMORY; vsi_ctx->num_lan_q_entries[tc] = new_numqs; - return ICE_SUCCESS; + return 0; } /* num queues are increased, update the queue contexts */ if (new_numqs > vsi_ctx->num_lan_q_entries[tc]) { @@ -595,7 +595,7 @@ ice_alloc_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 new_numqs) vsi_ctx->lan_q_ctx[tc] = q_ctx; vsi_ctx->num_lan_q_entries[tc] = new_numqs; } - return ICE_SUCCESS; + return 0; } /** @@ -920,8 +920,8 @@ ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node, struct ice_sched_node *prev, *new_node; struct ice_aqc_add_elem *buf; u16 i, num_groups_added = 0; - int status = ICE_SUCCESS; struct ice_hw *hw = pi->hw; + int status = 0; u16 buf_size; u32 teid; @@ -951,7 +951,7 @@ ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node, status = ice_aq_add_sched_elems(hw, 1, buf, buf_size, &num_groups_added, NULL); - if (status != ICE_SUCCESS || num_groups_added != 1) { + if (status || num_groups_added != 1) { ice_debug(hw, ICE_DBG_SCHED, "add node failed FW Error %d\n", hw->adminq.sq_last_status); ice_free(hw, buf); @@ -966,7 +966,7 @@ ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node, else status = ice_sched_add_node(pi, layer, &buf->generic[i], NULL); - if (status != ICE_SUCCESS) { + if (status) { ice_debug(hw, ICE_DBG_SCHED, "add nodes in SW DB failed status =%d\n", status); break; @@ -1027,7 +1027,7 @@ ice_sched_add_nodes_to_hw_layer(struct ice_port_info *pi, *num_nodes_added = 0; if (!num_nodes) - return ICE_SUCCESS; + return 0; if (!parent || layer < pi->hw->sw_entry_point_layer) return ICE_ERR_PARAM; @@ -1068,7 +1068,7 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi, { u32 *first_teid_ptr = first_node_teid; u16 new_num_nodes = num_nodes; - int status = ICE_SUCCESS; + int status = 0; *num_nodes_added = 0; while (*num_nodes_added < num_nodes) { @@ -1079,7 +1079,7 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi, layer, new_num_nodes, first_teid_ptr, &num_added); - if (status == ICE_SUCCESS) + if (!status) *num_nodes_added += num_added; /* added more nodes than requested ? */ if (*num_nodes_added > num_nodes) { @@ -1089,10 +1089,10 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi, break; } /* break if all the nodes are added successfully */ - if (status == ICE_SUCCESS && (*num_nodes_added == num_nodes)) + if (!status && (*num_nodes_added == num_nodes)) break; /* break if the error is not max limit */ - if (status != ICE_SUCCESS && status != ICE_ERR_MAX_LIMIT) + if (status && status != ICE_ERR_MAX_LIMIT) break; /* Exceeded the max children */ max_child_nodes = pi->hw->max_children[parent->tx_sched_layer]; @@ -1365,8 +1365,8 @@ struct ice_sched_node *ice_sched_get_node(struct ice_port_info *pi, u32 teid) int ice_sched_query_res_alloc(struct ice_hw *hw) { struct ice_aqc_query_txsched_res_resp *buf; - int status = ICE_SUCCESS; __le16 max_sibl; + int status = 0; u8 i; if (hw->layer_info) @@ -1658,7 +1658,7 @@ static bool ice_sched_check_node(struct ice_hw *hw, struct ice_sched_node *node) node_teid = LE32_TO_CPU(node->info.node_teid); status = ice_sched_query_elem(hw, node_teid, &buf); - if (status != ICE_SUCCESS) + if (status) return false; if (memcmp(&buf, &node->info, sizeof(buf))) { @@ -1733,7 +1733,7 @@ ice_sched_add_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle, num_nodes[i], &first_node_teid, &num_added); - if (status != ICE_SUCCESS || num_nodes[i] != num_added) + if (status || num_nodes[i] != num_added) return ICE_ERR_CFG; /* The newly added node can be a new parent for the next @@ -1752,7 +1752,7 @@ ice_sched_add_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle, } } - return ICE_SUCCESS; + return 0; } /** @@ -1834,7 +1834,7 @@ ice_sched_add_vsi_support_nodes(struct ice_port_info *pi, u16 vsi_handle, i, num_nodes[i], &first_node_teid, &num_added); - if (status != ICE_SUCCESS || num_nodes[i] != num_added) + if (status || num_nodes[i] != num_added) return ICE_ERR_CFG; /* The newly added node can be a new parent for the next @@ -1853,7 +1853,7 @@ ice_sched_add_vsi_support_nodes(struct ice_port_info *pi, u16 vsi_handle, parent->vsi_handle = vsi_handle; } - return ICE_SUCCESS; + return 0; } /** @@ -1900,8 +1900,8 @@ ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle, struct ice_sched_node *vsi_node; struct ice_sched_node *tc_node; struct ice_vsi_ctx *vsi_ctx; - int status = ICE_SUCCESS; struct ice_hw *hw = pi->hw; + int status = 0; u16 prev_numqs; tc_node = ice_sched_get_tc_node(pi, tc); @@ -1939,7 +1939,7 @@ ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle, return status; vsi_ctx->sched.max_lanq[tc] = new_numqs; - return ICE_SUCCESS; + return 0; } /** @@ -1961,8 +1961,8 @@ ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs, { struct ice_sched_node *vsi_node, *tc_node; struct ice_vsi_ctx *vsi_ctx; - int status = ICE_SUCCESS; struct ice_hw *hw = pi->hw; + int status = 0; ice_debug(pi->hw, ICE_DBG_SCHED, "add/config VSI %d\n", vsi_handle); tc_node = ice_sched_get_tc_node(pi, tc); @@ -2134,7 +2134,7 @@ ice_sched_rm_vsi_cfg(struct ice_port_info *pi, u16 vsi_handle, u8 owner) if (owner == ICE_SCHED_NODE_OWNER_LAN) vsi_ctx->sched.max_lanq[i] = 0; } - status = ICE_SUCCESS; + status = 0; exit_sched_rm_vsi_cfg: ice_release_lock(&pi->sched_lock); @@ -2313,11 +2313,11 @@ static int ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent, u16 num_items, u32 *list) { - int status = ICE_SUCCESS; struct ice_aqc_move_elem *buf; struct ice_sched_node *node; u16 i, grps_movd = 0; struct ice_hw *hw; + int status = 0; u16 buf_len; hw = pi->hw; @@ -2397,7 +2397,7 @@ ice_sched_move_vsi_to_agg(struct ice_port_info *pi, u16 vsi_handle, u32 agg_id, /* Is this VSI already part of given aggregator? */ if (ice_sched_find_node_in_subtree(pi->hw, agg_node, vsi_node)) - return ICE_SUCCESS; + return 0; aggl = ice_sched_get_agg_layer(pi->hw); vsil = ice_sched_get_vsi_layer(pi->hw); @@ -2422,7 +2422,7 @@ ice_sched_move_vsi_to_agg(struct ice_port_info *pi, u16 vsi_handle, u32 agg_id, num_nodes[i], &first_node_teid, &num_nodes_added); - if (status != ICE_SUCCESS || num_nodes[i] != num_nodes_added) + if (status || num_nodes[i] != num_nodes_added) return ICE_ERR_CFG; /* The newly added node can be a new parent for the next @@ -2461,7 +2461,7 @@ ice_move_all_vsi_to_dflt_agg(struct ice_port_info *pi, { struct ice_sched_agg_vsi_info *agg_vsi_info; struct ice_sched_agg_vsi_info *tmp; - int status = ICE_SUCCESS; + int status = 0; LIST_FOR_EACH_ENTRY_SAFE(agg_vsi_info, tmp, &agg_info->agg_vsi_list, ice_sched_agg_vsi_info, list_entry) { @@ -2552,7 +2552,7 @@ ice_sched_rm_agg_cfg(struct ice_port_info *pi, u32 agg_id, u8 tc) } ice_free_sched_node(pi, agg_node); - return ICE_SUCCESS; + return 0; } /** @@ -2570,7 +2570,7 @@ static int ice_rm_agg_cfg_tc(struct ice_port_info *pi, struct ice_sched_agg_info *agg_info, u8 tc, bool rm_vsi_info) { - int status = ICE_SUCCESS; + int status = 0; /* If nothing to remove - return success */ if (!ice_is_tc_ena(agg_info->tc_bitmap[0], tc)) @@ -2610,7 +2610,7 @@ ice_save_agg_tc_bitmap(struct ice_port_info *pi, u32 agg_id, return ICE_ERR_PARAM; ice_cp_bitmap(agg_info->replay_tc_bitmap, tc_bitmap, ICE_MAX_TRAFFIC_CLASS); - return ICE_SUCCESS; + return 0; } /** @@ -2627,10 +2627,10 @@ ice_sched_add_agg_cfg(struct ice_port_info *pi, u32 agg_id, u8 tc) { struct ice_sched_node *parent, *agg_node, *tc_node; u16 num_nodes[ICE_AQC_TOPO_MAX_LEVEL_NUM] = { 0 }; - int status = ICE_SUCCESS; struct ice_hw *hw = pi->hw; u32 first_node_teid; u16 num_nodes_added; + int status = 0; u8 i, aggl; tc_node = ice_sched_get_tc_node(pi, tc); @@ -2676,7 +2676,7 @@ ice_sched_add_agg_cfg(struct ice_port_info *pi, u32 agg_id, u8 tc) num_nodes[i], &first_node_teid, &num_nodes_added); - if (status != ICE_SUCCESS || num_nodes[i] != num_nodes_added) + if (status || num_nodes[i] != num_nodes_added) return ICE_ERR_CFG; /* The newly added node can be a new parent for the next @@ -2693,7 +2693,7 @@ ice_sched_add_agg_cfg(struct ice_port_info *pi, u32 agg_id, u8 tc) } } - return ICE_SUCCESS; + return 0; } /** @@ -2717,8 +2717,8 @@ ice_sched_cfg_agg(struct ice_port_info *pi, u32 agg_id, enum ice_agg_type agg_type, ice_bitmap_t *tc_bitmap) { struct ice_sched_agg_info *agg_info; - int status = ICE_SUCCESS; struct ice_hw *hw = pi->hw; + int status = 0; u8 tc; agg_info = ice_get_agg_info(hw, agg_id); @@ -2863,7 +2863,7 @@ ice_save_agg_vsi_tc_bitmap(struct ice_port_info *pi, u32 agg_id, u16 vsi_handle, return ICE_ERR_PARAM; ice_cp_bitmap(agg_vsi_info->replay_tc_bitmap, tc_bitmap, ICE_MAX_TRAFFIC_CLASS); - return ICE_SUCCESS; + return 0; } /** @@ -2883,8 +2883,8 @@ ice_sched_assoc_vsi_to_agg(struct ice_port_info *pi, u32 agg_id, { struct ice_sched_agg_vsi_info *agg_vsi_info, *old_agg_vsi_info = NULL; struct ice_sched_agg_info *agg_info, *old_agg_info; - int status = ICE_SUCCESS; struct ice_hw *hw = pi->hw; + int status = 0; u8 tc; if (!ice_is_vsi_valid(pi->hw, vsi_handle)) @@ -2980,9 +2980,9 @@ ice_sched_update_elem(struct ice_hw *hw, struct ice_sched_node *node, struct ice_aqc_txsched_elem_data *info) { struct ice_aqc_txsched_elem_data buf; - int status; u16 elem_cfgd = 0; u16 num_elems = 1; + int status; buf = *info; /* For TC nodes, CIR config is not supported */ @@ -3082,7 +3082,7 @@ ice_move_vsi_to_agg(struct ice_port_info *pi, u32 agg_id, u16 vsi_handle, int ice_rm_agg_cfg(struct ice_port_info *pi, u32 agg_id) { struct ice_sched_agg_info *agg_info; - int status = ICE_SUCCESS; + int status = 0; u8 tc; ice_acquire_lock(&pi->sched_lock); @@ -3184,7 +3184,7 @@ ice_sched_save_vsi_bw_alloc(struct ice_port_info *pi, u16 vsi_handle, u8 tc, default: return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /** @@ -3278,7 +3278,7 @@ ice_sched_save_vsi_bw(struct ice_port_info *pi, u16 vsi_handle, u8 tc, default: return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /** @@ -3320,7 +3320,7 @@ ice_sched_save_vsi_prio(struct ice_port_info *pi, u16 vsi_handle, u8 tc, if (tc >= ICE_MAX_TRAFFIC_CLASS) return ICE_ERR_PARAM; ice_set_clear_prio(&vsi_ctx->sched.bw_t_info[tc], prio); - return ICE_SUCCESS; + return 0; } /** @@ -3354,7 +3354,7 @@ ice_sched_save_agg_bw_alloc(struct ice_port_info *pi, u32 agg_id, u8 tc, default: return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /** @@ -3391,7 +3391,7 @@ ice_sched_save_agg_bw(struct ice_port_info *pi, u32 agg_id, u8 tc, default: return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /** @@ -3697,7 +3697,7 @@ ice_sched_save_q_bw_alloc(struct ice_q_ctx *q_ctx, enum ice_rl_type rl_type, default: return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /** @@ -3842,7 +3842,7 @@ int ice_cfg_vsi_bw_alloc(struct ice_port_info *pi, u16 vsi_handle, u8 ena_tcmap, enum ice_rl_type rl_type, u8 *bw_alloc) { - int status = ICE_SUCCESS; + int status = 0; u8 tc; if (!ice_is_vsi_valid(pi->hw, vsi_handle)) @@ -3896,8 +3896,8 @@ ice_cfg_agg_bw_alloc(struct ice_port_info *pi, u32 agg_id, u8 ena_tcmap, { struct ice_sched_agg_info *agg_info; bool agg_id_present = false; - int status = ICE_SUCCESS; struct ice_hw *hw = pi->hw; + int status = 0; u8 tc; ice_acquire_lock(&pi->sched_lock); @@ -4042,7 +4042,7 @@ ice_sched_bw_to_rl_profile(struct ice_hw *hw, u32 bw, profile->rl_multiply = CPU_TO_LE16(mv); profile->wake_up_calc = CPU_TO_LE16(wm); profile->rl_encode = CPU_TO_LE16(encode); - status = ICE_SUCCESS; + status = 0; } else { status = ICE_ERR_DOES_NOT_EXIST; } @@ -4104,7 +4104,7 @@ ice_sched_add_rl_profile(struct ice_hw *hw, enum ice_rl_type rl_type, return NULL; status = ice_sched_bw_to_rl_profile(hw, bw, &rl_prof_elem->profile); - if (status != ICE_SUCCESS) + if (status) goto exit_add_rl_prof; rl_prof_elem->bw = bw; @@ -4288,7 +4288,7 @@ ice_sched_rm_rl_profile(struct ice_hw *hw, u8 layer_num, u8 profile_type, u16 profile_id) { struct ice_aqc_rl_profile_info *rl_prof_elem; - int status = ICE_SUCCESS; + int status = 0; if (!hw || layer_num >= hw->num_tx_sched_layers) return ICE_ERR_PARAM; @@ -4309,7 +4309,7 @@ ice_sched_rm_rl_profile(struct ice_hw *hw, u8 layer_num, u8 profile_type, break; } if (status == ICE_ERR_IN_USE) - status = ICE_SUCCESS; + status = 0; return status; } @@ -4329,10 +4329,10 @@ ice_sched_set_node_bw_dflt(struct ice_port_info *pi, struct ice_sched_node *node, enum ice_rl_type rl_type, u8 layer_num) { - int status; struct ice_hw *hw; u8 profile_type; u16 rl_prof_id; + int status; u16 old_id; hw = pi->hw; @@ -4363,7 +4363,7 @@ ice_sched_set_node_bw_dflt(struct ice_port_info *pi, /* Remove stale RL profile ID */ if (old_id == ICE_SCHED_DFLT_RL_PROF_ID || old_id == ICE_SCHED_INVAL_PROF_ID) - return ICE_SUCCESS; + return 0; return ice_sched_rm_rl_profile(hw, layer_num, profile_type, old_id); } @@ -4409,7 +4409,7 @@ ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node, /* Check for old ID removal */ if ((old_id == ICE_SCHED_DFLT_RL_PROF_ID && rl_type != ICE_SHARED_BW) || old_id == ICE_SCHED_INVAL_PROF_ID || old_id == rl_prof_id) - return ICE_SUCCESS; + return 0; return ice_sched_rm_rl_profile(hw, layer_num, rl_prof_info->profile.flags & @@ -4493,7 +4493,7 @@ ice_sched_validate_srl_node(struct ice_sched_node *node, u8 sel_layer) node->num_children == 1) || ((sel_layer == node->tx_sched_layer - 1) && (node->parent && node->parent->num_children == 1))) - return ICE_SUCCESS; + return 0; return ICE_ERR_CFG; } @@ -4522,7 +4522,7 @@ ice_sched_save_q_bw(struct ice_q_ctx *q_ctx, enum ice_rl_type rl_type, u32 bw) default: return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /** @@ -4654,7 +4654,7 @@ ice_sched_save_tc_node_bw(struct ice_port_info *pi, u8 tc, default: return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /** @@ -4752,7 +4752,7 @@ ice_sched_save_tc_node_bw_alloc(struct ice_port_info *pi, u8 tc, default: return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /** @@ -4820,7 +4820,7 @@ int ice_sched_set_agg_bw_dflt_lmt(struct ice_port_info *pi, u16 vsi_handle) { struct ice_vsi_ctx *vsi_ctx; - int status = ICE_SUCCESS; + int status = 0; u8 tc; if (!ice_is_vsi_valid(pi->hw, vsi_handle)) @@ -5010,7 +5010,7 @@ ice_sched_validate_vsi_srl_node(struct ice_port_info *pi, u16 vsi_handle) if (status) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -5116,7 +5116,7 @@ int ice_sched_set_vsi_bw_shared_lmt(struct ice_port_info *pi, u16 vsi_handle, u32 min_bw, u32 max_bw, u32 shared_bw) { - int status = ICE_SUCCESS; + int status = 0; u8 tc; if (!pi) @@ -5168,7 +5168,7 @@ ice_sched_validate_agg_srl_node(struct ice_port_info *pi, u32 agg_id) u8 sel_layer = ICE_SCHED_INVAL_LAYER_NUM; struct ice_sched_agg_info *agg_info; bool agg_id_present = false; - int status = ICE_SUCCESS; + int status = 0; u8 tc; LIST_FOR_EACH_ENTRY(agg_info, &pi->hw->agg_list, ice_sched_agg_info, @@ -5239,7 +5239,7 @@ ice_sched_validate_agg_id(struct ice_port_info *pi, u32 agg_id) if (!agg_id_present) return ICE_ERR_PARAM; - return ICE_SUCCESS; + return 0; } /** @@ -5487,7 +5487,7 @@ int ice_cfg_rl_burst_size(struct ice_hw *hw, u32 bytes) burst_size_to_prog |= (u16)(bytes / 1024); } hw->max_burst_size = burst_size_to_prog; - return ICE_SUCCESS; + return 0; } /** @@ -5537,7 +5537,7 @@ ice_sched_replay_node_bw(struct ice_hw *hw, struct ice_sched_node *node, if (!node) return status; if (!ice_is_any_bit_set(bw_t_info->bw_t_bitmap, ICE_BW_TYPE_CNT)) - return ICE_SUCCESS; + return 0; if (ice_is_bit_set(bw_t_info->bw_t_bitmap, ICE_BW_TYPE_PRIO)) { status = ice_sched_replay_node_prio(hw, node, bw_t_info->generic); @@ -5588,7 +5588,7 @@ static int ice_sched_replay_agg_bw(struct ice_hw *hw, struct ice_sched_agg_info *agg_info) { struct ice_sched_node *tc_node, *agg_node; - int status = ICE_SUCCESS; + int status = 0; u8 tc; if (!agg_info) @@ -5719,7 +5719,7 @@ void ice_sched_replay_agg_vsi_preinit(struct ice_hw *hw) */ int ice_sched_replay_root_node_bw(struct ice_port_info *pi) { - int status = ICE_SUCCESS; + int status = 0; if (!pi->hw) return ICE_ERR_PARAM; @@ -5739,7 +5739,7 @@ int ice_sched_replay_root_node_bw(struct ice_port_info *pi) */ int ice_sched_replay_tc_node_bw(struct ice_port_info *pi) { - int status = ICE_SUCCESS; + int status = 0; u8 tc; if (!pi->hw) @@ -5777,7 +5777,7 @@ ice_sched_replay_vsi_bw(struct ice_hw *hw, u16 vsi_handle, struct ice_port_info *pi = hw->port_info; struct ice_bw_type_info *bw_t_info; struct ice_vsi_ctx *vsi_ctx; - int status = ICE_SUCCESS; + int status = 0; u8 tc; vsi_ctx = ice_get_vsi_ctx(pi->hw, vsi_handle); @@ -5823,10 +5823,10 @@ ice_sched_replay_vsi_agg(struct ice_hw *hw, u16 vsi_handle) return ICE_ERR_PARAM; agg_info = ice_get_vsi_agg_info(hw, vsi_handle); if (!agg_info) - return ICE_SUCCESS; /* Not present in list - default Agg case */ + return 0; /* Not present in list - default Agg case */ agg_vsi_info = ice_get_agg_vsi_info(agg_info, vsi_handle); if (!agg_vsi_info) - return ICE_SUCCESS; /* Not present in list - default Agg case */ + return 0; /* Not present in list - default Agg case */ ice_sched_get_ena_tc_bitmap(pi, agg_info->replay_tc_bitmap, replay_bitmap); /* Replay aggregator node associated to vsi_handle */ diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index ad823edb7e..489678c85b 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -2438,10 +2438,10 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid, struct ice_aqc_recipe_data_elem *tmp; u16 num_recps = ICE_MAX_NUM_RECIPES; struct ice_prot_lkup_ext *lkup_exts; - int status; u8 fv_word_idx = 0; bool vlan = false; u16 sub_recps; + int status; ice_zero_bitmap(result_bm, ICE_MAX_FV_WORDS); @@ -2641,7 +2641,7 @@ ice_init_def_sw_recp(struct ice_hw *hw, struct ice_sw_recipe **recp_list) *recp_list = recps; - return ICE_SUCCESS; + return 0; } /** @@ -2808,8 +2808,8 @@ ice_alloc_sw(struct ice_hw *hw, bool ena_stats, bool shared_res, u16 *sw_id, { struct ice_aqc_alloc_free_res_elem *sw_buf; struct ice_aqc_res_elem *sw_ele; - int status; u16 buf_len; + int status; buf_len = ice_struct_size(sw_buf, elem, 1); sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len); @@ -3198,7 +3198,7 @@ ice_add_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx, tmp_vsi_ctx->vsi_num = vsi_ctx->vsi_num; } - return ICE_SUCCESS; + return 0; } /** @@ -3300,9 +3300,9 @@ ice_aq_add_update_mir_rule(struct ice_hw *hw, u16 rule_type, u16 dest_vsi, { struct ice_aqc_add_update_mir_rule *cmd; struct ice_aq_desc desc; - int status; __le16 *mr_list = NULL; u16 buf_size = 0; + int status; switch (rule_type) { case ICE_AQC_RULE_TYPE_VPORT_INGRESS: @@ -3430,8 +3430,8 @@ ice_aq_alloc_free_vsi_list(struct ice_hw *hw, u16 *vsi_list_id, { struct ice_aqc_alloc_free_res_elem *sw_buf; struct ice_aqc_res_elem *vsi_ele; - int status; u16 buf_len; + int status; buf_len = ice_struct_size(sw_buf, elem, 1); sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len); @@ -3513,8 +3513,8 @@ int ice_aq_get_storm_ctrl(struct ice_hw *hw, u32 *bcast_thresh, u32 *mcast_thresh, u32 *ctl_bitmask) { - int status; struct ice_aq_desc desc; + int status; ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_storm_cfg); @@ -3627,8 +3627,8 @@ ice_aq_get_recipe(struct ice_hw *hw, { struct ice_aqc_add_get_recipe *cmd; struct ice_aq_desc desc; - int status; u16 buf_size; + int status; if (*num_recipes != ICE_MAX_NUM_RECIPES) return ICE_ERR_PARAM; @@ -3771,8 +3771,8 @@ ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, int ice_alloc_recipe(struct ice_hw *hw, u16 *rid) { struct ice_aqc_alloc_free_res_elem *sw_buf; - int status; u16 buf_len; + int status; buf_len = ice_struct_size(sw_buf, elem, 1); sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len); @@ -3823,10 +3823,10 @@ ice_init_port_info(struct ice_port_info *pi, u16 vsi_port_num, u8 type, int ice_get_initial_sw_cfg(struct ice_hw *hw) { struct ice_aqc_get_sw_cfg_resp_elem *rbuf; - int status; u8 num_total_ports; u16 req_desc = 0; u16 num_elems; + int status; u8 j = 0; u16 i; @@ -4123,9 +4123,9 @@ ice_add_marker_act(struct ice_hw *hw, struct ice_fltr_mgmt_list_entry *m_ent, * 3. GENERIC VALUE action to hold the software marker ID */ const u16 num_lg_acts = 3; - int status; u16 lg_act_size; u16 rules_size; + int status; u32 act; u16 id; @@ -4219,13 +4219,13 @@ ice_add_counter_act(struct ice_hw *hw, struct ice_fltr_mgmt_list_entry *m_ent, { struct ice_aqc_sw_rules_elem *lg_act; struct ice_aqc_sw_rules_elem *rx_tx; - int status; /* 2 actions will be added while adding a large action counter */ const int num_acts = 2; u16 lg_act_size; u16 rules_size; u16 f_rule_id; u32 act; + int status; u16 id; if (m_ent->fltr_info.lkup_type != ICE_SW_LKUP_MAC) @@ -4344,9 +4344,9 @@ ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi, enum ice_sw_lkup_type lkup_type) { struct ice_aqc_sw_rules_elem *s_rule; - int status; u16 s_rule_size; u16 rule_type; + int status; int i; if (!num_vsi) @@ -4520,10 +4520,11 @@ ice_update_pkt_fwd_rule(struct ice_hw *hw, struct ice_fltr_info *f_info) int ice_update_sw_rule_bridge_mode(struct ice_hw *hw) { struct ice_fltr_mgmt_list_entry *fm_entry; - int status = ICE_SUCCESS; struct LIST_HEAD_TYPE *rule_head; struct ice_lock *rule_lock; /* Lock to protect filter rule list */ struct ice_switch_info *sw; + int status = 0; + sw = hw->switch_info; rule_lock = &sw->recp_list[ICE_SW_LKUP_MAC].filt_rule_lock; @@ -4581,8 +4582,8 @@ ice_add_update_vsi_list(struct ice_hw *hw, struct ice_fltr_info *cur_fltr, struct ice_fltr_info *new_fltr) { - int status = ICE_SUCCESS; u16 vsi_list_id = 0; + int status = 0; if ((cur_fltr->fltr_act == ICE_FWD_TO_Q || cur_fltr->fltr_act == ICE_FWD_TO_QGRP)) @@ -4651,7 +4652,7 @@ ice_add_update_vsi_list(struct ice_hw *hw, /* A rule already exists with the new VSI being added */ if (ice_is_bit_set(m_entry->vsi_list_info->vsi_map, vsi_handle)) - return ICE_SUCCESS; + return 0; /* Update the previously created VSI list set with * the new VSI ID passed in @@ -4767,7 +4768,7 @@ ice_add_rule_internal(struct ice_hw *hw, struct ice_sw_recipe *recp_list, struct ice_fltr_info *new_fltr, *cur_fltr; struct ice_fltr_mgmt_list_entry *m_entry; struct ice_lock *rule_lock; /* Lock to protect filter rule list */ - int status = ICE_SUCCESS; + int status = 0; if (!ice_is_vsi_valid(hw, f_entry->fltr_info.vsi_handle)) return ICE_ERR_PARAM; @@ -4833,8 +4834,8 @@ ice_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle, struct ice_fltr_mgmt_list_entry *fm_list) { enum ice_sw_lkup_type lkup_type; - int status = ICE_SUCCESS; u16 vsi_list_id; + int status = 0; if (fm_list->fltr_info.fltr_act != ICE_FWD_TO_VSI_LIST || fm_list->vsi_count == 0) @@ -4922,8 +4923,8 @@ ice_remove_rule_internal(struct ice_hw *hw, struct ice_sw_recipe *recp_list, { struct ice_fltr_mgmt_list_entry *list_elem; struct ice_lock *rule_lock; /* Lock to protect filter rule list */ - int status = ICE_SUCCESS; bool remove_rule = false; + int status = 0; u16 vsi_handle; if (!ice_is_vsi_valid(hw, f_entry->fltr_info.vsi_handle)) @@ -5105,8 +5106,8 @@ ice_add_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list, struct LIST_HEAD_TYPE *rule_head; u16 total_elem_left, s_rule_size; struct ice_lock *rule_lock; /* Lock to protect filter rule list */ - int status = ICE_SUCCESS; u16 num_unicast = 0; + int status = 0; u8 elem_sent; s_rule = NULL; @@ -5156,7 +5157,7 @@ ice_add_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list, ice_acquire_lock(rule_lock); /* Exit if no suitable entries were found for adding bulk switch rule */ if (!num_unicast) { - status = ICE_SUCCESS; + status = 0; goto ice_add_mac_exit; } @@ -5270,7 +5271,7 @@ ice_add_vlan_internal(struct ice_hw *hw, struct ice_sw_recipe *recp_list, enum ice_sw_lkup_type lkup_type; u16 vsi_list_id = 0, vsi_handle; struct ice_lock *rule_lock; /* Lock to protect filter rule list */ - int status = ICE_SUCCESS; + int status = 0; if (!ice_is_vsi_valid(hw, f_entry->fltr_info.vsi_handle)) return ICE_ERR_PARAM; @@ -5433,7 +5434,7 @@ ice_add_vlan_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list, if (v_list_itr->status) return v_list_itr->status; } - return ICE_SUCCESS; + return 0; } /** @@ -5488,7 +5489,7 @@ ice_add_mac_vlan_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *mv_list, if (mv_list_itr->status) return mv_list_itr->status; } - return ICE_SUCCESS; + return 0; } /** @@ -5543,7 +5544,7 @@ ice_add_eth_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *em_list, if (em_list_itr->status) return em_list_itr->status; } - return ICE_SUCCESS; + return 0; } /** @@ -5592,7 +5593,7 @@ ice_remove_eth_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *em_list, if (em_list_itr->status) return em_list_itr->status; } - return ICE_SUCCESS; + return 0; } /** @@ -5645,7 +5646,7 @@ ice_get_lg_act_aqc_res_type(u16 *res_type, int num_acts) return ICE_ERR_PARAM; } - return ICE_SUCCESS; + return 0; } /** @@ -5658,8 +5659,8 @@ static int ice_alloc_res_lg_act(struct ice_hw *hw, u16 *l_id, u16 num_acts) { struct ice_aqc_alloc_free_res_elem *sw_buf; - int status; u16 buf_len, res_type; + int status; if (!l_id) return ICE_ERR_BAD_PTR; @@ -5933,7 +5934,7 @@ ice_remove_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list, if (list_itr->status) return list_itr->status; } - return ICE_SUCCESS; + return 0; } /** @@ -5973,7 +5974,7 @@ ice_remove_vlan_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list, if (v_list_itr->status) return v_list_itr->status; } - return ICE_SUCCESS; + return 0; } /** @@ -6019,7 +6020,7 @@ ice_remove_mac_vlan_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list, if (v_list_itr->status) return v_list_itr->status; } - return ICE_SUCCESS; + return 0; } /** @@ -6095,7 +6096,7 @@ ice_add_entry_to_vsi_fltr_list(struct ice_hw *hw, u16 vsi_handle, LIST_ADD(&tmp->list_entry, vsi_list_head); - return ICE_SUCCESS; + return 0; } /** @@ -6117,7 +6118,7 @@ ice_add_to_vsi_fltr_list(struct ice_hw *hw, u16 vsi_handle, struct LIST_HEAD_TYPE *vsi_list_head) { struct ice_fltr_mgmt_list_entry *fm_entry; - int status = ICE_SUCCESS; + int status = 0; /* check to make sure VSI ID is valid and within boundary */ if (!ice_is_vsi_valid(hw, vsi_handle)) @@ -6210,7 +6211,7 @@ _ice_get_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 *promisc_mask, } ice_release_lock(rule_lock); - return ICE_SUCCESS; + return 0; } /** @@ -6265,7 +6266,7 @@ ice_remove_promisc(struct ice_hw *hw, u8 recp_id, if (v_list_itr->status) return v_list_itr->status; } - return ICE_SUCCESS; + return 0; } /** @@ -6285,7 +6286,7 @@ _ice_clear_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask, struct ice_fltr_mgmt_list_entry *itr; struct LIST_HEAD_TYPE *rule_head; struct ice_lock *rule_lock; /* Lock to protect filter rule list */ - int status = ICE_SUCCESS; + int status = 0; u8 recipe_id; if (!ice_is_vsi_valid(hw, vsi_handle)) @@ -6373,9 +6374,9 @@ _ice_set_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask, { enum { UCAST_FLTR = 1, MCAST_FLTR, BCAST_FLTR }; struct ice_fltr_list_entry f_list_entry; - struct ice_fltr_info new_fltr; - int status = ICE_SUCCESS; bool is_tx_fltr; + struct ice_fltr_info new_fltr; + int status = 0; u16 hw_vsi_id; int pkt_type; u8 recipe_id; @@ -6471,7 +6472,7 @@ _ice_set_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask, status = ice_add_rule_internal(hw, recp_list, lport, &f_list_entry); - if (status != ICE_SUCCESS) + if (status) goto set_promisc_exit; } @@ -6693,8 +6694,8 @@ ice_alloc_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items, u16 *counter_id) { struct ice_aqc_alloc_free_res_elem *buf; - int status; u16 buf_len; + int status; /* Allocate resource */ buf_len = ice_struct_size(buf, elem, 1); @@ -6731,8 +6732,8 @@ ice_free_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items, u16 counter_id) { struct ice_aqc_alloc_free_res_elem *buf; - int status; u16 buf_len; + int status; /* Free resource */ buf_len = ice_struct_size(buf, elem, 1); @@ -7265,7 +7266,7 @@ ice_create_first_fit_recp_def(struct ice_hw *hw, grp->n_val_pairs++; } - return ICE_SUCCESS; + return 0; } /** @@ -7286,7 +7287,7 @@ ice_fill_fv_word_index(struct ice_hw *hw, struct LIST_HEAD_TYPE *fv_list, struct ice_fv_word *fv_ext; if (LIST_EMPTY(fv_list)) - return ICE_SUCCESS; + return 0; fv = LIST_FIRST_ENTRY(fv_list, struct ice_sw_fv_list_entry, list_entry); fv_ext = fv->fv_ptr->ew; @@ -7322,7 +7323,7 @@ ice_fill_fv_word_index(struct ice_hw *hw, struct LIST_HEAD_TYPE *fv_list, } } - return ICE_SUCCESS; + return 0; } /** @@ -7828,7 +7829,7 @@ ice_add_special_words(struct ice_adv_rule_info *rinfo, } } - return ICE_SUCCESS; + return 0; } /* ice_get_compat_fv_bitmap - Get compatible field vector bitmap for rule @@ -8940,7 +8941,7 @@ ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, s_rule->pdata.lkup_tx_rx.hdr_len = CPU_TO_LE16(pkt_len); - return ICE_SUCCESS; + return 0; } /** @@ -8974,7 +8975,7 @@ ice_fill_adv_packet_tun(struct ice_hw *hw, enum ice_sw_tunnel_type tun_type, default: /* Nothing needs to be done for this tunnel type */ - return ICE_SUCCESS; + return 0; } /* Find the outer UDP protocol header and insert the port number */ @@ -8987,7 +8988,7 @@ ice_fill_adv_packet_tun(struct ice_hw *hw, enum ice_sw_tunnel_type tun_type, hdr = (struct ice_l4_hdr *)&pkt[offset]; hdr->dst_port = CPU_TO_BE16(open_port); - return ICE_SUCCESS; + return 0; } } @@ -9017,7 +9018,7 @@ ice_fill_adv_packet_vlan(u16 vlan_type, u8 *pkt, hdr = (struct ice_vlan_hdr *)&pkt[offset]; hdr->type = CPU_TO_BE16(vlan_type); - return ICE_SUCCESS; + return 0; } } @@ -9093,8 +9094,8 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw, struct ice_adv_rule_info *cur_fltr, struct ice_adv_rule_info *new_fltr) { - int status; u16 vsi_list_id = 0; + int status; if (cur_fltr->sw_act.fltr_act == ICE_FWD_TO_Q || cur_fltr->sw_act.fltr_act == ICE_FWD_TO_QGRP || @@ -9263,7 +9264,6 @@ ice_fill_sw_marker_lg_act(struct ice_hw *hw, u32 sw_marker, u16 l_id, struct ice_aqc_sw_rules_elem *rx_tx, *lg_act; const u16 offset_generic_md_word_0 = 0; const u16 offset_generic_md_word_1 = 1; - int status = ICE_SUCCESS; union lg_act_entry lg_e_lo; union lg_act_entry lg_e_hi; const u8 priority = 0x3; @@ -9704,10 +9704,11 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, { struct ice_adv_fltr_mgmt_list_entry *list_elem; struct ice_prot_lkup_ext lkup_exts; - struct ice_lock *rule_lock; /* Lock to protect filter rule list */ - int status = ICE_SUCCESS; bool remove_rule = false; + struct ice_lock *rule_lock; /* Lock to protect filter rule list */ u16 i, rid, vsi_handle; + bool is_add = false; + int status = ICE_SUCCESS; ice_memset(&lkup_exts, 0, sizeof(lkup_exts), ICE_NONDMA_MEM); for (i = 0; i < lkups_cnt; i++) { @@ -9835,7 +9836,7 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw, * * This function is used to remove all the rules for a given VSI and as soon * as removing a rule fails, it will return immediately with the error code, - * else it will return ICE_SUCCESS + * else it will return 0 */ int ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle) { @@ -9893,10 +9894,10 @@ static int ice_replay_fltr(struct ice_hw *hw, u8 recp_id, struct LIST_HEAD_TYPE *list_head) { struct ice_fltr_mgmt_list_entry *itr; - int status = ICE_SUCCESS; struct ice_sw_recipe *recp_list; u8 lport = hw->port_info->lport; struct LIST_HEAD_TYPE l_head; + int status = 0; if (LIST_EMPTY(list_head)) return status; @@ -9920,7 +9921,7 @@ ice_replay_fltr(struct ice_hw *hw, u8 recp_id, struct LIST_HEAD_TYPE *list_head) if (itr->vsi_count < 2 && recp_id != ICE_SW_LKUP_VLAN) { status = ice_add_rule_internal(hw, recp_list, lport, &f_entry); - if (status != ICE_SUCCESS) + if (status) goto end; continue; } @@ -9943,7 +9944,7 @@ ice_replay_fltr(struct ice_hw *hw, u8 recp_id, struct LIST_HEAD_TYPE *list_head) status = ice_add_rule_internal(hw, recp_list, lport, &f_entry); - if (status != ICE_SUCCESS) + if (status) goto end; } } @@ -9994,8 +9995,8 @@ ice_replay_vsi_fltr(struct ice_hw *hw, struct ice_port_info *pi, struct LIST_HEAD_TYPE *list_head) { struct ice_fltr_mgmt_list_entry *itr; - int status = ICE_SUCCESS; struct ice_sw_recipe *recp_list; + int status = 0; u16 hw_vsi_id; if (LIST_EMPTY(list_head)) @@ -10016,7 +10017,7 @@ ice_replay_vsi_fltr(struct ice_hw *hw, struct ice_port_info *pi, status = ice_add_rule_internal(hw, recp_list, pi->lport, &f_entry); - if (status != ICE_SUCCESS) + if (status) goto end; continue; } @@ -10036,7 +10037,7 @@ ice_replay_vsi_fltr(struct ice_hw *hw, struct ice_port_info *pi, status = ice_add_rule_internal(hw, recp_list, pi->lport, &f_entry); - if (status != ICE_SUCCESS) + if (status) goto end; } end: @@ -10057,7 +10058,7 @@ ice_replay_vsi_adv_rule(struct ice_hw *hw, u16 vsi_handle, { struct ice_rule_query_data added_entry = { 0 }; struct ice_adv_fltr_mgmt_list_entry *adv_fltr; - int status = ICE_SUCCESS; + int status = 0; if (LIST_EMPTY(list_head)) return status; @@ -10104,11 +10105,11 @@ ice_replay_vsi_all_fltr(struct ice_hw *hw, struct ice_port_info *pi, head); else status = ice_replay_vsi_adv_rule(hw, vsi_handle, head); - if (status != ICE_SUCCESS) + if (status) return status; } - return ICE_SUCCESS; + return 0; } /** diff --git a/drivers/net/ice/base/ice_vlan_mode.c b/drivers/net/ice/base/ice_vlan_mode.c index 2e1e922d00..85cb2686d9 100644 --- a/drivers/net/ice/base/ice_vlan_mode.c +++ b/drivers/net/ice/base/ice_vlan_mode.c @@ -262,7 +262,7 @@ static int ice_dvm_update_dflt_recipes(struct ice_hw *hw) } } - return ICE_SUCCESS; + return 0; } /** @@ -345,7 +345,7 @@ static int ice_set_dvm(struct ice_hw *hw) return status; } - return ICE_SUCCESS; + return 0; } /** @@ -391,13 +391,13 @@ int ice_set_vlan_mode(struct ice_hw *hw) * mode is done by the PF. */ if (hw->dcf_enabled) - return ICE_SUCCESS; + return 0; if (!ice_is_dvm_supported(hw)) - return ICE_SUCCESS; + return 0; if (!ice_set_dvm(hw)) - return ICE_SUCCESS; + return 0; return ice_set_svm(hw); } -- 2.43.0