From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2495FA04B5; Tue, 3 Dec 2019 08:00:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 59E911BDFD; Tue, 3 Dec 2019 08:00:20 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id BCBDE4CA6 for ; Tue, 3 Dec 2019 08:00:17 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Dec 2019 23:00:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,272,1571727600"; d="scan'208";a="410729626" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by fmsmga005.fm.intel.com with ESMTP; 02 Dec 2019 23:00:15 -0800 From: Qi Zhang To: xiaolong.ye@intel.com Cc: haiyue.wang@intel.com, dev@dpdk.org, Qi Zhang , Paul M Stillwell Jr Date: Tue, 3 Dec 2019 15:03:03 +0800 Message-Id: <20191203070318.39620-3-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20191203070318.39620-1-qi.z.zhang@intel.com> References: <20191203070318.39620-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH 02/17] net/iavf/base: rename error code enum X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Rename iavf_status_code to iavf_status to align with kernel driver's implementation. Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/iavf/base/iavf_adminq.c | 56 ++++++++--------- drivers/net/iavf/base/iavf_alloc.h | 8 +-- drivers/net/iavf/base/iavf_common.c | 106 ++++++++++++++++----------------- drivers/net/iavf/base/iavf_prototype.h | 90 ++++++++++++++-------------- drivers/net/iavf/base/iavf_status.h | 2 +- drivers/net/iavf/iavf_ethdev.c | 8 +-- drivers/net/iavf/iavf_vchnl.c | 8 +-- 7 files changed, 139 insertions(+), 139 deletions(-) diff --git a/drivers/net/iavf/base/iavf_adminq.c b/drivers/net/iavf/base/iavf_adminq.c index 1ba8b5221..ae8150e4f 100644 --- a/drivers/net/iavf/base/iavf_adminq.c +++ b/drivers/net/iavf/base/iavf_adminq.c @@ -35,9 +35,9 @@ STATIC void iavf_adminq_init_regs(struct iavf_hw *hw) * iavf_alloc_adminq_asq_ring - Allocate Admin Queue send rings * @hw: pointer to the hardware structure **/ -enum iavf_status_code iavf_alloc_adminq_asq_ring(struct iavf_hw *hw) +enum iavf_status iavf_alloc_adminq_asq_ring(struct iavf_hw *hw) { - enum iavf_status_code ret_code; + enum iavf_status ret_code; ret_code = iavf_allocate_dma_mem(hw, &hw->aq.asq.desc_buf, iavf_mem_atq_ring, @@ -62,9 +62,9 @@ enum iavf_status_code iavf_alloc_adminq_asq_ring(struct iavf_hw *hw) * iavf_alloc_adminq_arq_ring - Allocate Admin Queue receive rings * @hw: pointer to the hardware structure **/ -enum iavf_status_code iavf_alloc_adminq_arq_ring(struct iavf_hw *hw) +enum iavf_status iavf_alloc_adminq_arq_ring(struct iavf_hw *hw) { - enum iavf_status_code ret_code; + enum iavf_status ret_code; ret_code = iavf_allocate_dma_mem(hw, &hw->aq.arq.desc_buf, iavf_mem_arq_ring, @@ -103,9 +103,9 @@ void iavf_free_adminq_arq(struct iavf_hw *hw) * iavf_alloc_arq_bufs - Allocate pre-posted buffers for the receive queue * @hw: pointer to the hardware structure **/ -STATIC enum iavf_status_code iavf_alloc_arq_bufs(struct iavf_hw *hw) +STATIC enum iavf_status iavf_alloc_arq_bufs(struct iavf_hw *hw) { - enum iavf_status_code ret_code; + enum iavf_status ret_code; struct iavf_aq_desc *desc; struct iavf_dma_mem *bi; int i; @@ -170,9 +170,9 @@ STATIC enum iavf_status_code iavf_alloc_arq_bufs(struct iavf_hw *hw) * iavf_alloc_asq_bufs - Allocate empty buffer structs for the send queue * @hw: pointer to the hardware structure **/ -STATIC enum iavf_status_code iavf_alloc_asq_bufs(struct iavf_hw *hw) +STATIC enum iavf_status iavf_alloc_asq_bufs(struct iavf_hw *hw) { - enum iavf_status_code ret_code; + enum iavf_status ret_code; struct iavf_dma_mem *bi; int i; @@ -254,9 +254,9 @@ STATIC void iavf_free_asq_bufs(struct iavf_hw *hw) * * Configure base address and length registers for the transmit queue **/ -STATIC enum iavf_status_code iavf_config_asq_regs(struct iavf_hw *hw) +STATIC enum iavf_status iavf_config_asq_regs(struct iavf_hw *hw) { - enum iavf_status_code ret_code = IAVF_SUCCESS; + enum iavf_status ret_code = IAVF_SUCCESS; u32 reg = 0; /* Clear Head and Tail */ @@ -289,9 +289,9 @@ STATIC enum iavf_status_code iavf_config_asq_regs(struct iavf_hw *hw) * * Configure base address and length registers for the receive (event queue) **/ -STATIC enum iavf_status_code iavf_config_arq_regs(struct iavf_hw *hw) +STATIC enum iavf_status iavf_config_arq_regs(struct iavf_hw *hw) { - enum iavf_status_code ret_code = IAVF_SUCCESS; + enum iavf_status ret_code = IAVF_SUCCESS; u32 reg = 0; /* Clear Head and Tail */ @@ -334,9 +334,9 @@ STATIC enum iavf_status_code iavf_config_arq_regs(struct iavf_hw *hw) * Do *NOT* hold the lock when calling this as the memory allocation routines * called are not going to be atomic context safe **/ -enum iavf_status_code iavf_init_asq(struct iavf_hw *hw) +enum iavf_status iavf_init_asq(struct iavf_hw *hw) { - enum iavf_status_code ret_code = IAVF_SUCCESS; + enum iavf_status ret_code = IAVF_SUCCESS; if (hw->aq.asq.count > 0) { /* queue already initialized */ @@ -393,9 +393,9 @@ enum iavf_status_code iavf_init_asq(struct iavf_hw *hw) * Do *NOT* hold the lock when calling this as the memory allocation routines * called are not going to be atomic context safe **/ -enum iavf_status_code iavf_init_arq(struct iavf_hw *hw) +enum iavf_status iavf_init_arq(struct iavf_hw *hw) { - enum iavf_status_code ret_code = IAVF_SUCCESS; + enum iavf_status ret_code = IAVF_SUCCESS; if (hw->aq.arq.count > 0) { /* queue already initialized */ @@ -445,9 +445,9 @@ enum iavf_status_code iavf_init_arq(struct iavf_hw *hw) * * The main shutdown routine for the Admin Send Queue **/ -enum iavf_status_code iavf_shutdown_asq(struct iavf_hw *hw) +enum iavf_status iavf_shutdown_asq(struct iavf_hw *hw) { - enum iavf_status_code ret_code = IAVF_SUCCESS; + enum iavf_status ret_code = IAVF_SUCCESS; iavf_acquire_spinlock(&hw->aq.asq_spinlock); @@ -479,9 +479,9 @@ enum iavf_status_code iavf_shutdown_asq(struct iavf_hw *hw) * * The main shutdown routine for the Admin Receive Queue **/ -enum iavf_status_code iavf_shutdown_arq(struct iavf_hw *hw) +enum iavf_status iavf_shutdown_arq(struct iavf_hw *hw) { - enum iavf_status_code ret_code = IAVF_SUCCESS; + enum iavf_status ret_code = IAVF_SUCCESS; iavf_acquire_spinlock(&hw->aq.arq_spinlock); @@ -518,9 +518,9 @@ enum iavf_status_code iavf_shutdown_arq(struct iavf_hw *hw) * - hw->aq.arq_buf_size * - hw->aq.asq_buf_size **/ -enum iavf_status_code iavf_init_adminq(struct iavf_hw *hw) +enum iavf_status iavf_init_adminq(struct iavf_hw *hw) { - enum iavf_status_code ret_code; + enum iavf_status ret_code; /* verify input for valid configuration */ if ((hw->aq.num_arq_entries == 0) || @@ -568,9 +568,9 @@ enum iavf_status_code iavf_init_adminq(struct iavf_hw *hw) * iavf_shutdown_adminq - shutdown routine for the Admin Queue * @hw: pointer to the hardware structure **/ -enum iavf_status_code iavf_shutdown_adminq(struct iavf_hw *hw) +enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw) { - enum iavf_status_code ret_code = IAVF_SUCCESS; + enum iavf_status ret_code = IAVF_SUCCESS; if (iavf_check_asq_alive(hw)) iavf_aq_queue_shutdown(hw, true); @@ -654,13 +654,13 @@ bool iavf_asq_done(struct iavf_hw *hw) * This is the main send command driver routine for the Admin Queue send * queue. It runs the queue, cleans the queue, etc **/ -enum iavf_status_code iavf_asq_send_command(struct iavf_hw *hw, +enum iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct iavf_aq_desc *desc, void *buff, /* can be NULL */ u16 buff_size, struct iavf_asq_cmd_details *cmd_details) { - enum iavf_status_code status = IAVF_SUCCESS; + enum iavf_status status = IAVF_SUCCESS; struct iavf_dma_mem *dma_buff = NULL; struct iavf_asq_cmd_details *details; struct iavf_aq_desc *desc_on_ring; @@ -877,11 +877,11 @@ void iavf_fill_default_direct_cmd_desc(struct iavf_aq_desc *desc, * the contents through e. It can also return how many events are * left to process through 'pending' **/ -enum iavf_status_code iavf_clean_arq_element(struct iavf_hw *hw, +enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw, struct iavf_arq_event_info *e, u16 *pending) { - enum iavf_status_code ret_code = IAVF_SUCCESS; + enum iavf_status ret_code = IAVF_SUCCESS; u16 ntc = hw->aq.arq.next_to_clean; struct iavf_aq_desc *desc; struct iavf_dma_mem *bi; diff --git a/drivers/net/iavf/base/iavf_alloc.h b/drivers/net/iavf/base/iavf_alloc.h index 4ff307d23..da872bdbb 100644 --- a/drivers/net/iavf/base/iavf_alloc.h +++ b/drivers/net/iavf/base/iavf_alloc.h @@ -21,16 +21,16 @@ enum iavf_memory_type { }; /* prototype for functions used for dynamic memory allocation */ -enum iavf_status_code iavf_allocate_dma_mem(struct iavf_hw *hw, +enum iavf_status iavf_allocate_dma_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem, enum iavf_memory_type type, u64 size, u32 alignment); -enum iavf_status_code iavf_free_dma_mem(struct iavf_hw *hw, +enum iavf_status iavf_free_dma_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem); -enum iavf_status_code iavf_allocate_virt_mem(struct iavf_hw *hw, +enum iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem, u32 size); -enum iavf_status_code iavf_free_virt_mem(struct iavf_hw *hw, +enum iavf_status iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem); #endif /* _IAVF_ALLOC_H_ */ diff --git a/drivers/net/iavf/base/iavf_common.c b/drivers/net/iavf/base/iavf_common.c index 916a8388b..0b9f83415 100644 --- a/drivers/net/iavf/base/iavf_common.c +++ b/drivers/net/iavf/base/iavf_common.c @@ -15,9 +15,9 @@ * This function sets the mac type of the adapter based on the * vendor ID and device ID stored in the hw structure. **/ -enum iavf_status_code iavf_set_mac_type(struct iavf_hw *hw) +enum iavf_status iavf_set_mac_type(struct iavf_hw *hw) { - enum iavf_status_code status = IAVF_SUCCESS; + enum iavf_status status = IAVF_SUCCESS; DEBUGFUNC("iavf_set_mac_type\n"); @@ -107,7 +107,7 @@ const char *iavf_aq_str(struct iavf_hw *hw, enum iavf_admin_queue_err aq_err) * @hw: pointer to the HW structure * @stat_err: the status error code to convert **/ -const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status_code stat_err) +const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err) { switch (stat_err) { case IAVF_SUCCESS: @@ -348,13 +348,13 @@ bool iavf_check_asq_alive(struct iavf_hw *hw) * Tell the Firmware that we're shutting down the AdminQ and whether * or not the driver is unloading as well. **/ -enum iavf_status_code iavf_aq_queue_shutdown(struct iavf_hw *hw, +enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading) { struct iavf_aq_desc desc; struct iavf_aqc_queue_shutdown *cmd = (struct iavf_aqc_queue_shutdown *)&desc.params.raw; - enum iavf_status_code status; + enum iavf_status status; iavf_fill_default_direct_cmd_desc(&desc, iavf_aqc_opc_queue_shutdown); @@ -377,12 +377,12 @@ enum iavf_status_code iavf_aq_queue_shutdown(struct iavf_hw *hw, * * Internal function to get or set RSS look up table **/ -STATIC enum iavf_status_code iavf_aq_get_set_rss_lut(struct iavf_hw *hw, +STATIC enum iavf_status iavf_aq_get_set_rss_lut(struct iavf_hw *hw, u16 vsi_id, bool pf_lut, u8 *lut, u16 lut_size, bool set) { - enum iavf_status_code status; + enum iavf_status status; struct iavf_aq_desc desc; struct iavf_aqc_get_set_rss_lut *cmd_resp = (struct iavf_aqc_get_set_rss_lut *)&desc.params.raw; @@ -430,7 +430,7 @@ STATIC enum iavf_status_code iavf_aq_get_set_rss_lut(struct iavf_hw *hw, * * get the RSS lookup table, PF or VSI type **/ -enum iavf_status_code iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id, +enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id, bool pf_lut, u8 *lut, u16 lut_size) { return iavf_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, @@ -447,7 +447,7 @@ enum iavf_status_code iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id, * * set the RSS lookup table, PF or VSI type **/ -enum iavf_status_code iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 vsi_id, +enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 vsi_id, bool pf_lut, u8 *lut, u16 lut_size) { return iavf_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, true); @@ -462,12 +462,12 @@ enum iavf_status_code iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 vsi_id, * * get the RSS key per VSI **/ -STATIC enum iavf_status_code iavf_aq_get_set_rss_key(struct iavf_hw *hw, +STATIC enum iavf_status iavf_aq_get_set_rss_key(struct iavf_hw *hw, u16 vsi_id, struct iavf_aqc_get_set_rss_key_data *key, bool set) { - enum iavf_status_code status; + enum iavf_status status; struct iavf_aq_desc desc; struct iavf_aqc_get_set_rss_key *cmd_resp = (struct iavf_aqc_get_set_rss_key *)&desc.params.raw; @@ -502,7 +502,7 @@ STATIC enum iavf_status_code iavf_aq_get_set_rss_key(struct iavf_hw *hw, * @key: pointer to key info struct * **/ -enum iavf_status_code iavf_aq_get_rss_key(struct iavf_hw *hw, +enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 vsi_id, struct iavf_aqc_get_set_rss_key_data *key) { @@ -517,7 +517,7 @@ enum iavf_status_code iavf_aq_get_rss_key(struct iavf_hw *hw, * * set the RSS key per VSI **/ -enum iavf_status_code iavf_aq_set_rss_key(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 vsi_id, struct iavf_aqc_get_set_rss_key_data *key) { @@ -896,9 +896,9 @@ struct iavf_rx_ptype_decoded iavf_ptype_lookup[] = { * * Tests a MAC address to ensure it is a valid Individual Address **/ -enum iavf_status_code iavf_validate_mac_addr(u8 *mac_addr) +enum iavf_status iavf_validate_mac_addr(u8 *mac_addr) { - enum iavf_status_code status = IAVF_SUCCESS; + enum iavf_status status = IAVF_SUCCESS; DEBUGFUNC("iavf_validate_mac_addr"); @@ -924,14 +924,14 @@ enum iavf_status_code iavf_validate_mac_addr(u8 *mac_addr) * Use the firmware to read the Rx control register, * especially useful if the Rx unit is under heavy pressure **/ -enum iavf_status_code iavf_aq_rx_ctl_read_register(struct iavf_hw *hw, +enum iavf_status iavf_aq_rx_ctl_read_register(struct iavf_hw *hw, u32 reg_addr, u32 *reg_val, struct iavf_asq_cmd_details *cmd_details) { struct iavf_aq_desc desc; struct iavf_aqc_rx_ctl_reg_read_write *cmd_resp = (struct iavf_aqc_rx_ctl_reg_read_write *)&desc.params.raw; - enum iavf_status_code status; + enum iavf_status status; if (reg_val == NULL) return IAVF_ERR_PARAM; @@ -955,7 +955,7 @@ enum iavf_status_code iavf_aq_rx_ctl_read_register(struct iavf_hw *hw, **/ u32 iavf_read_rx_ctl(struct iavf_hw *hw, u32 reg_addr) { - enum iavf_status_code status = IAVF_SUCCESS; + enum iavf_status status = IAVF_SUCCESS; bool use_register; int retry = 5; u32 val = 0; @@ -990,14 +990,14 @@ u32 iavf_read_rx_ctl(struct iavf_hw *hw, u32 reg_addr) * Use the firmware to write to an Rx control register, * especially useful if the Rx unit is under heavy pressure **/ -enum iavf_status_code iavf_aq_rx_ctl_write_register(struct iavf_hw *hw, +enum iavf_status iavf_aq_rx_ctl_write_register(struct iavf_hw *hw, u32 reg_addr, u32 reg_val, struct iavf_asq_cmd_details *cmd_details) { struct iavf_aq_desc desc; struct iavf_aqc_rx_ctl_reg_read_write *cmd = (struct iavf_aqc_rx_ctl_reg_read_write *)&desc.params.raw; - enum iavf_status_code status; + enum iavf_status status; iavf_fill_default_direct_cmd_desc(&desc, iavf_aqc_opc_rx_ctl_reg_write); @@ -1017,7 +1017,7 @@ enum iavf_status_code iavf_aq_rx_ctl_write_register(struct iavf_hw *hw, **/ void iavf_write_rx_ctl(struct iavf_hw *hw, u32 reg_addr, u32 reg_val) { - enum iavf_status_code status = IAVF_SUCCESS; + enum iavf_status status = IAVF_SUCCESS; bool use_register; int retry = 5; @@ -1051,7 +1051,7 @@ void iavf_write_rx_ctl(struct iavf_hw *hw, u32 reg_addr, u32 reg_val) * * Write the external PHY register. **/ -enum iavf_status_code iavf_aq_set_phy_register(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_phy_register(struct iavf_hw *hw, u8 phy_select, u8 dev_addr, u32 reg_addr, u32 reg_val, struct iavf_asq_cmd_details *cmd_details) @@ -1059,7 +1059,7 @@ enum iavf_status_code iavf_aq_set_phy_register(struct iavf_hw *hw, struct iavf_aq_desc desc; struct iavf_aqc_phy_register_access *cmd = (struct iavf_aqc_phy_register_access *)&desc.params.raw; - enum iavf_status_code status; + enum iavf_status status; iavf_fill_default_direct_cmd_desc(&desc, iavf_aqc_opc_set_phy_register); @@ -1085,7 +1085,7 @@ enum iavf_status_code iavf_aq_set_phy_register(struct iavf_hw *hw, * * Read the external PHY register. **/ -enum iavf_status_code iavf_aq_get_phy_register(struct iavf_hw *hw, +enum iavf_status iavf_aq_get_phy_register(struct iavf_hw *hw, u8 phy_select, u8 dev_addr, u32 reg_addr, u32 *reg_val, struct iavf_asq_cmd_details *cmd_details) @@ -1093,7 +1093,7 @@ enum iavf_status_code iavf_aq_get_phy_register(struct iavf_hw *hw, struct iavf_aq_desc desc; struct iavf_aqc_phy_register_access *cmd = (struct iavf_aqc_phy_register_access *)&desc.params.raw; - enum iavf_status_code status; + enum iavf_status status; iavf_fill_default_direct_cmd_desc(&desc, iavf_aqc_opc_get_phy_register); @@ -1123,15 +1123,15 @@ enum iavf_status_code iavf_aq_get_phy_register(struct iavf_hw *hw, * is sent asynchronously, i.e. iavf_asq_send_command() does not wait for * completion before returning. **/ -enum iavf_status_code iavf_aq_send_msg_to_pf(struct iavf_hw *hw, +enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw, enum virtchnl_ops v_opcode, - enum iavf_status_code v_retval, + enum iavf_status v_retval, u8 *msg, u16 msglen, struct iavf_asq_cmd_details *cmd_details) { struct iavf_aq_desc desc; struct iavf_asq_cmd_details details; - enum iavf_status_code status; + enum iavf_status status; iavf_fill_default_direct_cmd_desc(&desc, iavf_aqc_opc_send_msg_to_pf); desc.flags |= CPU_TO_LE16((u16)IAVF_AQ_FLAG_SI); @@ -1200,7 +1200,7 @@ void iavf_parse_hw_config(struct iavf_hw *hw, * as none will be forthcoming. Immediately after calling this function, * the admin queue should be shut down and (optionally) reinitialized. **/ -enum iavf_status_code iavf_reset(struct iavf_hw *hw) +enum iavf_status iavf_reset(struct iavf_hw *hw) { return iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF, IAVF_SUCCESS, NULL, 0, NULL); @@ -1215,12 +1215,12 @@ enum iavf_status_code iavf_reset(struct iavf_hw *hw) * Set ARP offload parameters from pre-populated * iavf_aqc_arp_proxy_data struct **/ -enum iavf_status_code iavf_aq_set_arp_proxy_config(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_arp_proxy_config(struct iavf_hw *hw, struct iavf_aqc_arp_proxy_data *proxy_config, struct iavf_asq_cmd_details *cmd_details) { struct iavf_aq_desc desc; - enum iavf_status_code status; + enum iavf_status status; if (!proxy_config) return IAVF_ERR_PARAM; @@ -1251,12 +1251,12 @@ enum iavf_status_code iavf_aq_set_arp_proxy_config(struct iavf_hw *hw, * Set IPv6 Neighbor Solicitation (NS) protocol offload parameters * from pre-populated iavf_aqc_ns_proxy_data struct **/ -enum iavf_status_code iavf_aq_set_ns_proxy_table_entry(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_ns_proxy_table_entry(struct iavf_hw *hw, struct iavf_aqc_ns_proxy_data *ns_proxy_table_entry, struct iavf_asq_cmd_details *cmd_details) { struct iavf_aq_desc desc; - enum iavf_status_code status; + enum iavf_status status; if (!ns_proxy_table_entry) return IAVF_ERR_PARAM; @@ -1293,7 +1293,7 @@ enum iavf_status_code iavf_aq_set_ns_proxy_table_entry(struct iavf_hw *hw, * * Set or clear WoL filter for port attached to the PF **/ -enum iavf_status_code iavf_aq_set_clear_wol_filter(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_clear_wol_filter(struct iavf_hw *hw, u8 filter_index, struct iavf_aqc_set_wol_filter_data *filter, bool set_filter, bool no_wol_tco, @@ -1303,7 +1303,7 @@ enum iavf_status_code iavf_aq_set_clear_wol_filter(struct iavf_hw *hw, struct iavf_aq_desc desc; struct iavf_aqc_set_wol_filter *cmd = (struct iavf_aqc_set_wol_filter *)&desc.params.raw; - enum iavf_status_code status; + enum iavf_status status; u16 cmd_flags = 0; u16 valid_flags = 0; u16 buff_len = 0; @@ -1355,14 +1355,14 @@ enum iavf_status_code iavf_aq_set_clear_wol_filter(struct iavf_hw *hw, * * Get information for the reason of a Wake Up event **/ -enum iavf_status_code iavf_aq_get_wake_event_reason(struct iavf_hw *hw, +enum iavf_status iavf_aq_get_wake_event_reason(struct iavf_hw *hw, u16 *wake_reason, struct iavf_asq_cmd_details *cmd_details) { struct iavf_aq_desc desc; struct iavf_aqc_get_wake_reason_completion *resp = (struct iavf_aqc_get_wake_reason_completion *)&desc.params.raw; - enum iavf_status_code status; + enum iavf_status status; iavf_fill_default_direct_cmd_desc(&desc, iavf_aqc_opc_get_wake_reason); @@ -1381,11 +1381,11 @@ enum iavf_status_code iavf_aq_get_wake_event_reason(struct iavf_hw *hw, * * Get information for the reason of a Wake Up event **/ -enum iavf_status_code iavf_aq_clear_all_wol_filters(struct iavf_hw *hw, +enum iavf_status iavf_aq_clear_all_wol_filters(struct iavf_hw *hw, struct iavf_asq_cmd_details *cmd_details) { struct iavf_aq_desc desc; - enum iavf_status_code status; + enum iavf_status status; iavf_fill_default_direct_cmd_desc(&desc, iavf_aqc_opc_clear_all_wol_filters); @@ -1406,7 +1406,7 @@ enum iavf_status_code iavf_aq_clear_all_wol_filters(struct iavf_hw *hw, * @cmd_details: pointer to command details structure or NULL **/ enum -iavf_status_code iavf_aq_write_ddp(struct iavf_hw *hw, void *buff, +iavf_status iavf_aq_write_ddp(struct iavf_hw *hw, void *buff, u16 buff_size, u32 track_id, u32 *error_offset, u32 *error_info, struct iavf_asq_cmd_details *cmd_details) @@ -1416,7 +1416,7 @@ iavf_status_code iavf_aq_write_ddp(struct iavf_hw *hw, void *buff, (struct iavf_aqc_write_personalization_profile *) &desc.params.raw; struct iavf_aqc_write_ddp_resp *resp; - enum iavf_status_code status; + enum iavf_status status; iavf_fill_default_direct_cmd_desc(&desc, iavf_aqc_opc_write_personalization_profile); @@ -1450,14 +1450,14 @@ iavf_status_code iavf_aq_write_ddp(struct iavf_hw *hw, void *buff, * @cmd_details: pointer to command details structure or NULL **/ enum -iavf_status_code iavf_aq_get_ddp_list(struct iavf_hw *hw, void *buff, +iavf_status iavf_aq_get_ddp_list(struct iavf_hw *hw, void *buff, u16 buff_size, u8 flags, struct iavf_asq_cmd_details *cmd_details) { struct iavf_aq_desc desc; struct iavf_aqc_get_applied_profiles *cmd = (struct iavf_aqc_get_applied_profiles *)&desc.params.raw; - enum iavf_status_code status; + enum iavf_status status; iavf_fill_default_direct_cmd_desc(&desc, iavf_aqc_opc_get_personalization_profile_list); @@ -1557,10 +1557,10 @@ iavf_find_section_in_profile(u32 section_type, * @aq: command buffer containing all data to execute AQ **/ STATIC enum -iavf_status_code iavf_ddp_exec_aq_section(struct iavf_hw *hw, +iavf_status iavf_ddp_exec_aq_section(struct iavf_hw *hw, struct iavf_profile_aq_section *aq) { - enum iavf_status_code status; + enum iavf_status status; struct iavf_aq_desc desc; u8 *msg = NULL; u16 msglen; @@ -1605,12 +1605,12 @@ iavf_status_code iavf_ddp_exec_aq_section(struct iavf_hw *hw, * * Validates supported devices and profile's sections. */ -STATIC enum iavf_status_code +STATIC enum iavf_status iavf_validate_profile(struct iavf_hw *hw, struct iavf_profile_segment *profile, u32 track_id, bool rollback) { struct iavf_profile_section_header *sec = NULL; - enum iavf_status_code status = IAVF_SUCCESS; + enum iavf_status status = IAVF_SUCCESS; struct iavf_section_table *sec_tbl; u32 vendor_dev_id; u32 dev_cnt; @@ -1670,11 +1670,11 @@ iavf_validate_profile(struct iavf_hw *hw, struct iavf_profile_segment *profile, * * Handles the download of a complete package. */ -enum iavf_status_code +enum iavf_status iavf_write_profile(struct iavf_hw *hw, struct iavf_profile_segment *profile, u32 track_id) { - enum iavf_status_code status = IAVF_SUCCESS; + enum iavf_status status = IAVF_SUCCESS; struct iavf_section_table *sec_tbl; struct iavf_profile_section_header *sec = NULL; struct iavf_profile_aq_section *ddp_aq; @@ -1733,12 +1733,12 @@ iavf_write_profile(struct iavf_hw *hw, struct iavf_profile_segment *profile, * * Rolls back previously loaded package. */ -enum iavf_status_code +enum iavf_status iavf_rollback_profile(struct iavf_hw *hw, struct iavf_profile_segment *profile, u32 track_id) { struct iavf_profile_section_header *sec = NULL; - enum iavf_status_code status = IAVF_SUCCESS; + enum iavf_status status = IAVF_SUCCESS; struct iavf_section_table *sec_tbl; u32 offset = 0, info = 0; u32 section_size = 0; @@ -1785,12 +1785,12 @@ iavf_rollback_profile(struct iavf_hw *hw, struct iavf_profile_segment *profile, * * Register a profile to the list of loaded profiles. */ -enum iavf_status_code +enum iavf_status iavf_add_pinfo_to_list(struct iavf_hw *hw, struct iavf_profile_segment *profile, u8 *profile_info_sec, u32 track_id) { - enum iavf_status_code status = IAVF_SUCCESS; + enum iavf_status status = IAVF_SUCCESS; struct iavf_profile_section_header *sec = NULL; struct iavf_profile_info *pinfo; u32 offset = 0, info = 0; diff --git a/drivers/net/iavf/base/iavf_prototype.h b/drivers/net/iavf/base/iavf_prototype.h index fbc2b2382..4b428b8d9 100644 --- a/drivers/net/iavf/base/iavf_prototype.h +++ b/drivers/net/iavf/base/iavf_prototype.h @@ -17,23 +17,23 @@ */ /* adminq functions */ -enum iavf_status_code iavf_init_adminq(struct iavf_hw *hw); -enum iavf_status_code iavf_shutdown_adminq(struct iavf_hw *hw); -enum iavf_status_code iavf_init_asq(struct iavf_hw *hw); -enum iavf_status_code iavf_init_arq(struct iavf_hw *hw); -enum iavf_status_code iavf_alloc_adminq_asq_ring(struct iavf_hw *hw); -enum iavf_status_code iavf_alloc_adminq_arq_ring(struct iavf_hw *hw); -enum iavf_status_code iavf_shutdown_asq(struct iavf_hw *hw); -enum iavf_status_code iavf_shutdown_arq(struct iavf_hw *hw); +enum iavf_status iavf_init_adminq(struct iavf_hw *hw); +enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw); +enum iavf_status iavf_init_asq(struct iavf_hw *hw); +enum iavf_status iavf_init_arq(struct iavf_hw *hw); +enum iavf_status iavf_alloc_adminq_asq_ring(struct iavf_hw *hw); +enum iavf_status iavf_alloc_adminq_arq_ring(struct iavf_hw *hw); +enum iavf_status iavf_shutdown_asq(struct iavf_hw *hw); +enum iavf_status iavf_shutdown_arq(struct iavf_hw *hw); u16 iavf_clean_asq(struct iavf_hw *hw); void iavf_free_adminq_asq(struct iavf_hw *hw); void iavf_free_adminq_arq(struct iavf_hw *hw); -enum iavf_status_code iavf_validate_mac_addr(u8 *mac_addr); +enum iavf_status iavf_validate_mac_addr(u8 *mac_addr); void iavf_adminq_init_ring_data(struct iavf_hw *hw); -enum iavf_status_code iavf_clean_arq_element(struct iavf_hw *hw, +enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw, struct iavf_arq_event_info *e, u16 *events_pending); -enum iavf_status_code iavf_asq_send_command(struct iavf_hw *hw, +enum iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct iavf_aq_desc *desc, void *buff, /* can be NULL */ u16 buff_size, @@ -46,23 +46,23 @@ void iavf_debug_aq(struct iavf_hw *hw, enum iavf_debug_mask mask, void iavf_idle_aq(struct iavf_hw *hw); bool iavf_check_asq_alive(struct iavf_hw *hw); -enum iavf_status_code iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading); +enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading); -enum iavf_status_code iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid, +enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid, bool pf_lut, u8 *lut, u16 lut_size); -enum iavf_status_code iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid, +enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid, bool pf_lut, u8 *lut, u16 lut_size); -enum iavf_status_code iavf_aq_get_rss_key(struct iavf_hw *hw, +enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 seid, struct iavf_aqc_get_set_rss_key_data *key); -enum iavf_status_code iavf_aq_set_rss_key(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid, struct iavf_aqc_get_set_rss_key_data *key); const char *iavf_aq_str(struct iavf_hw *hw, enum iavf_admin_queue_err aq_err); -const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status_code stat_err); +const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err); -enum iavf_status_code iavf_set_mac_type(struct iavf_hw *hw); +enum iavf_status iavf_set_mac_type(struct iavf_hw *hw); extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[]; @@ -80,81 +80,81 @@ void iavf_destroy_spinlock(struct iavf_spinlock *sp); /* iavf_common for VF drivers*/ void iavf_parse_hw_config(struct iavf_hw *hw, struct virtchnl_vf_resource *msg); -enum iavf_status_code iavf_reset(struct iavf_hw *hw); -enum iavf_status_code iavf_aq_send_msg_to_pf(struct iavf_hw *hw, +enum iavf_status iavf_reset(struct iavf_hw *hw); +enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw, enum virtchnl_ops v_opcode, - enum iavf_status_code v_retval, + enum iavf_status v_retval, u8 *msg, u16 msglen, struct iavf_asq_cmd_details *cmd_details); -enum iavf_status_code iavf_set_filter_control(struct iavf_hw *hw, +enum iavf_status iavf_set_filter_control(struct iavf_hw *hw, struct iavf_filter_control_settings *settings); -enum iavf_status_code iavf_aq_add_rem_control_packet_filter(struct iavf_hw *hw, +enum iavf_status iavf_aq_add_rem_control_packet_filter(struct iavf_hw *hw, u8 *mac_addr, u16 ethtype, u16 flags, u16 vsi_seid, u16 queue, bool is_add, struct iavf_control_filter_stats *stats, struct iavf_asq_cmd_details *cmd_details); -enum iavf_status_code iavf_aq_debug_dump(struct iavf_hw *hw, u8 cluster_id, +enum iavf_status iavf_aq_debug_dump(struct iavf_hw *hw, u8 cluster_id, u8 table_id, u32 start_index, u16 buff_size, void *buff, u16 *ret_buff_size, u8 *ret_next_table, u32 *ret_next_index, struct iavf_asq_cmd_details *cmd_details); void iavf_add_filter_to_drop_tx_flow_control_frames(struct iavf_hw *hw, u16 vsi_seid); -enum iavf_status_code iavf_aq_rx_ctl_read_register(struct iavf_hw *hw, +enum iavf_status iavf_aq_rx_ctl_read_register(struct iavf_hw *hw, u32 reg_addr, u32 *reg_val, struct iavf_asq_cmd_details *cmd_details); u32 iavf_read_rx_ctl(struct iavf_hw *hw, u32 reg_addr); -enum iavf_status_code iavf_aq_rx_ctl_write_register(struct iavf_hw *hw, +enum iavf_status iavf_aq_rx_ctl_write_register(struct iavf_hw *hw, u32 reg_addr, u32 reg_val, struct iavf_asq_cmd_details *cmd_details); void iavf_write_rx_ctl(struct iavf_hw *hw, u32 reg_addr, u32 reg_val); -enum iavf_status_code iavf_aq_set_phy_register(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_phy_register(struct iavf_hw *hw, u8 phy_select, u8 dev_addr, u32 reg_addr, u32 reg_val, struct iavf_asq_cmd_details *cmd_details); -enum iavf_status_code iavf_aq_get_phy_register(struct iavf_hw *hw, +enum iavf_status iavf_aq_get_phy_register(struct iavf_hw *hw, u8 phy_select, u8 dev_addr, u32 reg_addr, u32 *reg_val, struct iavf_asq_cmd_details *cmd_details); -enum iavf_status_code iavf_aq_set_arp_proxy_config(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_arp_proxy_config(struct iavf_hw *hw, struct iavf_aqc_arp_proxy_data *proxy_config, struct iavf_asq_cmd_details *cmd_details); -enum iavf_status_code iavf_aq_set_ns_proxy_table_entry(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_ns_proxy_table_entry(struct iavf_hw *hw, struct iavf_aqc_ns_proxy_data *ns_proxy_table_entry, struct iavf_asq_cmd_details *cmd_details); -enum iavf_status_code iavf_aq_set_clear_wol_filter(struct iavf_hw *hw, +enum iavf_status iavf_aq_set_clear_wol_filter(struct iavf_hw *hw, u8 filter_index, struct iavf_aqc_set_wol_filter_data *filter, bool set_filter, bool no_wol_tco, bool filter_valid, bool no_wol_tco_valid, struct iavf_asq_cmd_details *cmd_details); -enum iavf_status_code iavf_aq_get_wake_event_reason(struct iavf_hw *hw, +enum iavf_status iavf_aq_get_wake_event_reason(struct iavf_hw *hw, u16 *wake_reason, struct iavf_asq_cmd_details *cmd_details); -enum iavf_status_code iavf_aq_clear_all_wol_filters(struct iavf_hw *hw, +enum iavf_status iavf_aq_clear_all_wol_filters(struct iavf_hw *hw, struct iavf_asq_cmd_details *cmd_details); -enum iavf_status_code iavf_read_phy_register_clause22(struct iavf_hw *hw, +enum iavf_status iavf_read_phy_register_clause22(struct iavf_hw *hw, u16 reg, u8 phy_addr, u16 *value); -enum iavf_status_code iavf_write_phy_register_clause22(struct iavf_hw *hw, +enum iavf_status iavf_write_phy_register_clause22(struct iavf_hw *hw, u16 reg, u8 phy_addr, u16 value); -enum iavf_status_code iavf_read_phy_register_clause45(struct iavf_hw *hw, +enum iavf_status iavf_read_phy_register_clause45(struct iavf_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 *value); -enum iavf_status_code iavf_write_phy_register_clause45(struct iavf_hw *hw, +enum iavf_status iavf_write_phy_register_clause45(struct iavf_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 value); -enum iavf_status_code iavf_read_phy_register(struct iavf_hw *hw, +enum iavf_status iavf_read_phy_register(struct iavf_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 *value); -enum iavf_status_code iavf_write_phy_register(struct iavf_hw *hw, +enum iavf_status iavf_write_phy_register(struct iavf_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 value); u8 iavf_get_phy_address(struct iavf_hw *hw, u8 dev_num); -enum iavf_status_code iavf_blink_phy_link_led(struct iavf_hw *hw, +enum iavf_status iavf_blink_phy_link_led(struct iavf_hw *hw, u32 time, u32 interval); -enum iavf_status_code iavf_aq_write_ddp(struct iavf_hw *hw, void *buff, +enum iavf_status iavf_aq_write_ddp(struct iavf_hw *hw, void *buff, u16 buff_size, u32 track_id, u32 *error_offset, u32 *error_info, struct iavf_asq_cmd_details * cmd_details); -enum iavf_status_code iavf_aq_get_ddp_list(struct iavf_hw *hw, void *buff, +enum iavf_status iavf_aq_get_ddp_list(struct iavf_hw *hw, void *buff, u16 buff_size, u8 flags, struct iavf_asq_cmd_details * cmd_details); @@ -164,13 +164,13 @@ iavf_find_segment_in_package(u32 segment_type, struct iavf_profile_section_header * iavf_find_section_in_profile(u32 section_type, struct iavf_profile_segment *profile); -enum iavf_status_code +enum iavf_status iavf_write_profile(struct iavf_hw *hw, struct iavf_profile_segment *iavf_seg, u32 track_id); -enum iavf_status_code +enum iavf_status iavf_rollback_profile(struct iavf_hw *hw, struct iavf_profile_segment *iavf_seg, u32 track_id); -enum iavf_status_code +enum iavf_status iavf_add_pinfo_to_list(struct iavf_hw *hw, struct iavf_profile_segment *profile, u8 *profile_info_sec, u32 track_id); diff --git a/drivers/net/iavf/base/iavf_status.h b/drivers/net/iavf/base/iavf_status.h index cb91afb01..32b391589 100644 --- a/drivers/net/iavf/base/iavf_status.h +++ b/drivers/net/iavf/base/iavf_status.h @@ -6,7 +6,7 @@ #define _IAVF_STATUS_H_ /* Error Codes */ -enum iavf_status_code { +enum iavf_status { IAVF_SUCCESS = 0, IAVF_ERR_NVM = -1, IAVF_ERR_NVM_CHECKSUM = -2, diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index a39ba1466..4f80113ae 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1470,7 +1470,7 @@ RTE_INIT(iavf_init_log) } /* memory func for base code */ -enum iavf_status_code +enum iavf_status iavf_allocate_dma_mem_d(__rte_unused struct iavf_hw *hw, struct iavf_dma_mem *mem, u64 size, @@ -1499,7 +1499,7 @@ iavf_allocate_dma_mem_d(__rte_unused struct iavf_hw *hw, return IAVF_SUCCESS; } -enum iavf_status_code +enum iavf_status iavf_free_dma_mem_d(__rte_unused struct iavf_hw *hw, struct iavf_dma_mem *mem) { @@ -1517,7 +1517,7 @@ iavf_free_dma_mem_d(__rte_unused struct iavf_hw *hw, return IAVF_SUCCESS; } -enum iavf_status_code +enum iavf_status iavf_allocate_virt_mem_d(__rte_unused struct iavf_hw *hw, struct iavf_virt_mem *mem, u32 size) @@ -1534,7 +1534,7 @@ iavf_allocate_virt_mem_d(__rte_unused struct iavf_hw *hw, return IAVF_ERR_NO_MEMORY; } -enum iavf_status_code +enum iavf_status iavf_free_virt_mem_d(__rte_unused struct iavf_hw *hw, struct iavf_virt_mem *mem) { diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 14395fed3..4320a7f91 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -31,7 +31,7 @@ #define ASQ_DELAY_MS 10 /* Read data in admin queue to get msg from pf driver */ -static enum iavf_status_code +static enum iavf_status iavf_read_msg_from_pf(struct iavf_adapter *adapter, uint16_t buf_len, uint8_t *buf) { @@ -69,7 +69,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) { struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(adapter); struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - enum iavf_status_code ret; + enum iavf_status ret; int err = 0; int i = 0; @@ -175,7 +175,7 @@ iavf_handle_virtchnl_msg(struct rte_eth_dev *dev) struct iavf_arq_event_info info; uint16_t pending, aq_opc; enum virtchnl_ops msg_opc; - enum iavf_status_code msg_ret; + enum iavf_status msg_ret; int ret; info.buf_len = IAVF_AQ_BUF_SZ; @@ -201,7 +201,7 @@ iavf_handle_virtchnl_msg(struct rte_eth_dev *dev) */ msg_opc = (enum virtchnl_ops)rte_le_to_cpu_32( info.desc.cookie_high); - msg_ret = (enum iavf_status_code)rte_le_to_cpu_32( + msg_ret = (enum iavf_status)rte_le_to_cpu_32( info.desc.cookie_low); switch (aq_opc) { case iavf_aqc_opc_send_msg_to_vf: -- 2.13.6