iavf base code update
cover iavf base code update
Update iavf base code to latest.
main changes
1) Add more supported device ID
2) update virtual channel to latest AVF spec.
3) code clean.
4) couple bug fixes
Qi Zhang (17):
net/iavf/base: remove unnecessary header file net/iavf/base: rename error code enum net/iavf/base: rename register macro net/iavf/base: update device id net/iavf/base: remove unused code net/iavf/base: remove unnecessary compile option net/iavf/base: rename functions net/iavf/base: update virtual channel net/iavf/base: adjust code indent net/iavf/base: increase max VSI count for VFs net/iavf/base: fix command buffer memory free net/iavf/base: update FW API version for X722 net/iavf/base: add more link speed support net/iavf/base: update copyright date net/iavf/base: fix send adminq return value net/iavf: move device state flag net/ice/base: update version info
drivers/net/iavf/base/README | 4 +- drivers/net/iavf/base/iavf_adminq.c | 121 +- drivers/net/iavf/base/iavf_adminq.h | 45 +- drivers/net/iavf/base/iavf_adminq_cmd.h | 2354 ++----------------------------- drivers/net/iavf/base/iavf_alloc.h | 24 +- drivers/net/iavf/base/iavf_common.c | 879 +----------- drivers/net/iavf/base/iavf_devids.h | 7 +- drivers/net/iavf/base/iavf_hmc.h | 216 --- drivers/net/iavf/base/iavf_lan_hmc.h | 171 --- drivers/net/iavf/base/iavf_osdep.h | 2 +- drivers/net/iavf/base/iavf_prototype.h | 149 +- drivers/net/iavf/base/iavf_register.h | 390 ++--- drivers/net/iavf/base/iavf_status.h | 4 +- drivers/net/iavf/base/iavf_type.h | 1144 ++------------- drivers/net/iavf/base/virtchnl.h | 345 +++-- drivers/net/iavf/iavf.h | 1 + drivers/net/iavf/iavf_ethdev.c | 80 +- drivers/net/iavf/iavf_vchnl.c | 10 +- 18 files changed, 692 insertions(+), 5254 deletions(-) delete mode 100644 drivers/net/iavf/base/iavf_hmc.h delete mode 100644 drivers/net/iavf/base/iavf_lan_hmc.h
Signature · 1 line
2.13.6
PATCH 1/17 net/iavf/base: remove unnecessary header file
Delete iavf_hmc.h and iavf_lan_hmc.h since its not necessary.
--- drivers/net/iavf/base/iavf_hmc.h | 216 ----------------------------------- drivers/net/iavf/base/iavf_lan_hmc.h | 171 --------------------------- drivers/net/iavf/base/iavf_type.h | 7 +- 3 files changed, 2 insertions(+), 392 deletions(-) delete mode 100644 drivers/net/iavf/base/iavf_hmc.h delete mode 100644 drivers/net/iavf/base/iavf_lan_hmc.h
drivers/net/iavf/base/iavf_hmc.h deleted +0 -216
@@ -1,216 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation -*/ - -#ifndef _IAVF_HMC_H_ -#define _IAVF_HMC_H_ - -#define IAVF_HMC_MAX_BP_COUNT 512 - -/* forward-declare the HW struct for the compiler */ -struct iavf_hw ; - -#define IAVF_HMC_INFO_SIGNATURE 0x484D5347/* HMSG */ -#define IAVF_HMC_PD_CNT_IN_SD 512 -#define IAVF_HMC_DIRECT_BP_SIZE 0x200000/* 2M */ -#define IAVF_HMC_PAGED_BP_SIZE 4096 -#define IAVF_HMC_PD_BP_BUF_ALIGNMENT 4096 -#define IAVF_FIRST_VF_FPM_ID 16 - -struct iavf_hmc_obj_info { -u64 base;/* base addr in FPM */ -u32 max_cnt;/* max count available for this hmc func */ -u32 cnt;/* count of objects driver actually wants to create */ -u64 size;/* size in bytes of one object */ -}; - -enum iavf_sd_entry_type { -IAVF_SD_TYPE_INVALID =0 , -IAVF_SD_TYPE_PAGED =1 , -IAVF_SD_TYPE_DIRECT =2 -}; - -struct iavf_hmc_bp { -enum iavf_sd_entry_type entry_type; -struct iavf_dma_mem addr;/* populate to be used by hw */ -u32 sd_pd_index; -u32 ref_cnt; -}; - -struct iavf_hmc_pd_entry { -struct iavf_hmc_bp bp; -u32 sd_index; -bool rsrc_pg; -bool valid; -}; - -struct iavf_hmc_pd_table { -struct iavf_dma_mem pd_page_addr;/* populate to be used by hw */ -struct iavf_hmc_pd_entry *pd_entry;/* [512] for sw book keeping */ -struct iavf_virt_mem pd_entry_virt_mem;/* virt mem for pd_entry */ - -u32 ref_cnt; -u32 sd_index; -}; - -struct iavf_hmc_sd_entry { -enum iavf_sd_entry_type entry_type; -bool valid; - -union { -struct iavf_hmc_pd_table pd_table; -struct iavf_hmc_bp bp; - } u; -}; - -struct iavf_hmc_sd_table { -struct iavf_virt_mem addr;/* used to track sd_entry allocations */ -u32 sd_cnt; -u32 ref_cnt; -struct iavf_hmc_sd_entry *sd_entry;/* (sd_cnt*512) entries max */ -}; - -struct iavf_hmc_info { -u32 signature; -/* equals to pci func num for PF and dynamically allocated for VFs */ -u8 hmc_fn_id; -u16 first_sd_index;/* index of the first available SD */ - -/* hmc objects */ -struct iavf_hmc_obj_info *hmc_obj; -struct iavf_virt_mem hmc_obj_virt_mem; -struct iavf_hmc_sd_table sd_table; -}; - -#define IAVF_INC_SD_REFCNT (sd_table) ((sd_table)->ref_cnt++) -#define IAVF_INC_PD_REFCNT (pd_table) ((pd_table)->ref_cnt++) -#define IAVF_INC_BP_REFCNT (bp) ((bp)->ref_cnt++) - -#define IAVF_DEC_SD_REFCNT (sd_table) ((sd_table)->ref_cnt--) -#define IAVF_DEC_PD_REFCNT (pd_table) ((pd_table)->ref_cnt--) -#define IAVF_DEC_BP_REFCNT (bp) ((bp)->ref_cnt--) - -/** -* IAVF_SET_PF_SD_ENTRY - marks the sd entry as valid in the hardware -* @hw: pointer to our hw struct -* @pa: pointer to physical address -* @sd_index: segment descriptor index -* @type: if sd entry is direct or paged -**/ -#define IAVF_SET_PF_SD_ENTRY (hw, pa, sd_index, type) \ -{ \ - u32 val1, val2, val3; \ - val1 = (u32)(IAVF_HI_DWORD(pa)); \ - val2 = (u32)(pa) | (IAVF_HMC_MAX_BP_COUNT << \ - IAVF_PFHMC_SDDATALOW_PMSDBPCOUNT_SHIFT) | \ - ((((type) == IAVF_SD_TYPE_PAGED) ? 0 : 1) << \ - IAVF_PFHMC_SDDATALOW_PMSDTYPE_SHIFT) | \ - BIT(IAVF_PFHMC_SDDATALOW_PMSDVALID_SHIFT); \ - val3 = (sd_index) | BIT_ULL(IAVF_PFHMC_SDCMD_PMSDWR_SHIFT); \ - wr32((hw), IAVF_PFHMC_SDDATAHIGH, val1); \ - wr32((hw), IAVF_PFHMC_SDDATALOW, val2); \ - wr32((hw), IAVF_PFHMC_SDCMD, val3); \ -} - -/** -* IAVF_CLEAR_PF_SD_ENTRY - marks the sd entry as invalid in the hardware -* @hw: pointer to our hw struct -* @sd_index: segment descriptor index -* @type: if sd entry is direct or paged -**/ -#define IAVF_CLEAR_PF_SD_ENTRY (hw, sd_index, type) \ -{ \ - u32 val2, val3; \ - val2 = (IAVF_HMC_MAX_BP_COUNT << \ - IAVF_PFHMC_SDDATALOW_PMSDBPCOUNT_SHIFT) | \ - ((((type) == IAVF_SD_TYPE_PAGED) ? 0 : 1) << \ - IAVF_PFHMC_SDDATALOW_PMSDTYPE_SHIFT); \ - val3 = (sd_index) | BIT_ULL(IAVF_PFHMC_SDCMD_PMSDWR_SHIFT); \ - wr32((hw), IAVF_PFHMC_SDDATAHIGH, 0); \ - wr32((hw), IAVF_PFHMC_SDDATALOW, val2); \ - wr32((hw), IAVF_PFHMC_SDCMD, val3); \ -} - -/** -* IAVF_INVALIDATE_PF_HMC_PD - Invalidates the pd cache in the hardware -* @hw: pointer to our hw struct -* @sd_idx: segment descriptor index -* @pd_idx: page descriptor index -**/ -#define IAVF_INVALIDATE_PF_HMC_PD (hw, sd_idx, pd_idx) \ - wr32((hw), IAVF_PFHMC_PDINV, \ - (((sd_idx) << IAVF_PFHMC_PDINV_PMSDIDX_SHIFT) | \ - ((pd_idx) << IAVF_PFHMC_PDINV_PMPDIDX_SHIFT))) - -/** -* IAVF_FIND_SD_INDEX_LIMIT - finds segment descriptor index limit -* @hmc_info: pointer to the HMC configuration information structure -* @type: type of HMC resources we're searching -* @index: starting index for the object -* @cnt: number of objects we're trying to create -* @sd_idx: pointer to return index of the segment descriptor in question -* @sd_limit: pointer to return the maximum number of segment descriptors -* -* This function calculates the segment descriptor index and index limit -* for the resource defined by iavf_hmc_rsrc_type. -**/ -#define IAVF_FIND_SD_INDEX_LIMIT (hmc_info, type, index, cnt, sd_idx, sd_limit)\ -{ \ - u64 fpm_addr, fpm_limit; \ - fpm_addr = (hmc_info)->hmc_obj[(type)].base + \ - (hmc_info)->hmc_obj[(type)].size * (index); \ - fpm_limit = fpm_addr + (hmc_info)->hmc_obj[(type)].size * (cnt);\ - *(sd_idx) = (u32)(fpm_addr / IAVF_HMC_DIRECT_BP_SIZE); \ - *(sd_limit) = (u32)((fpm_limit - 1) / IAVF_HMC_DIRECT_BP_SIZE); \ -/* add one more to the limit to correct our range */ \ - *(sd_limit) += 1; \ -} - -/** -* IAVF_FIND_PD_INDEX_LIMIT - finds page descriptor index limit -* @hmc_info: pointer to the HMC configuration information struct -* @type: HMC resource type we're examining -* @idx: starting index for the object -* @cnt: number of objects we're trying to create -* @pd_index: pointer to return page descriptor index -* @pd_limit: pointer to return page descriptor index limit -* -* Calculates the page descriptor index and index limit for the resource -* defined by iavf_hmc_rsrc_type. -**/ -#define IAVF_FIND_PD_INDEX_LIMIT (hmc_info, type, idx, cnt, pd_index, pd_limit)\ -{ \ - u64 fpm_adr, fpm_limit; \ - fpm_adr = (hmc_info)->hmc_obj[(type)].base + \ - (hmc_info)->hmc_obj[(type)].size * (idx); \ - fpm_limit = fpm_adr + (hmc_info)->hmc_obj[(type)].size * (cnt); \ - *(pd_index) = (u32)(fpm_adr / IAVF_HMC_PAGED_BP_SIZE); \ - *(pd_limit) = (u32)((fpm_limit - 1) / IAVF_HMC_PAGED_BP_SIZE); \ -/* add one more to the limit to correct our range */ \ - *(pd_limit) +=1 ; \ -} -enum iavf_status_code iavf_add_sd_table_entry (struct iavf_hw *hw, -struct iavf_hmc_info *hmc_info, -u32 sd_index, -enum iavf_sd_entry_type type, -u64 direct_mode_sz); - -enum iavf_status_code iavf_add_pd_table_entry (struct iavf_hw *hw, -struct iavf_hmc_info *hmc_info, -u32 pd_index, -struct iavf_dma_mem *rsrc_pg); -enum iavf_status_code iavf_remove_pd_bp (struct iavf_hw *hw, -struct iavf_hmc_info *hmc_info, -u32 idx); -enum iavf_status_code iavf_prep_remove_sd_bp (struct iavf_hmc_info *hmc_info, -u32 idx); -enum iavf_status_code iavf_remove_sd_bp_new (struct iavf_hw *hw, -struct iavf_hmc_info *hmc_info, -u32 idx,bool is_pf); -enum iavf_status_code iavf_prep_remove_pd_page (struct iavf_hmc_info *hmc_info, -u32 idx); -enum iavf_status_code iavf_remove_pd_page_new (struct iavf_hw *hw, -struct iavf_hmc_info *hmc_info, -u32 idx,bool is_pf); - -#endif /* _IAVF_HMC_H_ */
drivers/net/iavf/base/iavf_lan_hmc.h deleted +0 -171
171 lines not on this page · raw message
drivers/net/iavf/base/iavf_type.h +2 -5
@@ -9,10 +9,10 @@#include "iavf_osdep.h" #include "iavf_register.h" #include "iavf_adminq.h" -#include "iavf_hmc.h" -#include "iavf_lan_hmc.h" #include "iavf_devids.h" +#define IAVF_RXQ_CTX_DBUFF_SHIFT 7 +#define UNREFERENCED_XPARAMETER #define UNREFERENCED_1PARAMETER (_p) (_p);#define UNREFERENCED_2PARAMETER (_p, _q) (_p); (_q);
@@ -683,9 +683,6 @@ struct iavf_hw {bool nvm_release_on_done;u16 nvm_wait_opcode; -/* HMC info */ -struct iavf_hmc_info hmc;/* HMC info struct */ -/* LLDP/DCBX Status */ u16 dcbx_status;
Signature · 1 line
2.13.6
PATCH 2/17 net/iavf/base: rename error code enum
In reply to Qi ZhangRename iavf_status_code to iavf_status to align with kernel driver's implementation.
--- 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(-)
drivers/net/iavf/base/iavf_adminq.c +28 -28
@@ -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;
drivers/net/iavf/base/iavf_alloc.h +4 -4
@@ -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_ */
drivers/net/iavf/base/iavf_common.c +53 -53
383 lines not on this page · raw message
drivers/net/iavf/base/iavf_prototype.h +45 -45
185 lines not on this page · raw message
drivers/net/iavf/base/iavf_status.h +1 -1
@@ -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 ,
drivers/net/iavf/iavf_ethdev.c +4 -4
@@ -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) {
drivers/net/iavf/iavf_vchnl.c +4 -4
@@ -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:
Signature · 1 line
2.13.6
PATCH 3/17 net/iavf/base: rename register macro
In reply to Qi ZhangRename all register macro to align with kernel driver's implementation.
--- drivers/net/iavf/base/iavf_adminq.c | 34 +-- drivers/net/iavf/base/iavf_common.c | 4 +- drivers/net/iavf/base/iavf_osdep.h | 2 +- drivers/net/iavf/base/iavf_register.h | 388 +++++++--------------------------- drivers/net/iavf/iavf_ethdev.c | 59 +++--- 5 files changed, 134 insertions(+), 353 deletions(-)
drivers/net/iavf/base/iavf_adminq.c +17 -17
@@ -18,16 +18,16 @@ STATIC void iavf_adminq_init_regs(struct iavf_hw *hw) {/* set head and tail registers in our local struct */ if (iavf_is_vf (hw)) { - hw->aq.asq.tail =IAVF_ATQT1 ; - hw->aq.asq.head =IAVF_ATQH1 ; - hw->aq.asq.len =IAVF_ATQLEN1 ; - hw->aq.asq.bal =IAVF_ATQBAL1 ; - hw->aq.asq.bah =IAVF_ATQBAH1 ; - hw->aq.arq.tail =IAVF_ARQT1 ; - hw->aq.arq.head =IAVF_ARQH1 ; - hw->aq.arq.len =IAVF_ARQLEN1 ; - hw->aq.arq.bal =IAVF_ARQBAL1 ; - hw->aq.arq.bah =IAVF_ARQBAH1 ; + hw->aq.asq.tail =IAVF_VF_ATQT1 ; + hw->aq.asq.head =IAVF_VF_ATQH1 ; + hw->aq.asq.len =IAVF_VF_ATQLEN1 ; + hw->aq.asq.bal =IAVF_VF_ATQBAL1 ; + hw->aq.asq.bah =IAVF_VF_ATQBAH1 ; + hw->aq.arq.tail =IAVF_VF_ARQT1 ; + hw->aq.arq.head =IAVF_VF_ARQH1 ; + hw->aq.arq.len =IAVF_VF_ARQLEN1 ; + hw->aq.arq.bal =IAVF_VF_ARQBAL1 ; + hw->aq.arq.bah =IAVF_VF_ARQBAH1 ; } }
@@ -267,10 +267,10 @@ STATIC enum iavf_status iavf_config_asq_regs(struct iavf_hw *hw)#ifdef INTEGRATED_VF if (iavf_is_vf (hw))wr32 (hw, hw->aq.asq.len, (hw->aq.num_asq_entries | -IAVF_ATQLEN1_ATQENABLE_MASK )); +IAVF_VF_ATQLEN1_ATQENABLE_MASK ));#else wr32 (hw, hw->aq.asq.len, (hw->aq.num_asq_entries | -IAVF_ATQLEN1_ATQENABLE_MASK )); +IAVF_VF_ATQLEN1_ATQENABLE_MASK ));#endif /* INTEGRATED_VF */ wr32 (hw, hw->aq.asq.bal,IAVF_LO_DWORD (hw->aq.asq.desc_buf.pa));wr32 (hw, hw->aq.asq.bah,IAVF_HI_DWORD (hw->aq.asq.desc_buf.pa));
@@ -302,10 +302,10 @@ STATIC enum iavf_status iavf_config_arq_regs(struct iavf_hw *hw)#ifdef INTEGRATED_VF if (iavf_is_vf (hw))wr32 (hw, hw->aq.arq.len, (hw->aq.num_arq_entries | -IAVF_ARQLEN1_ARQENABLE_MASK )); +IAVF_VF_ARQLEN1_ARQENABLE_MASK ));#else wr32 (hw, hw->aq.arq.len, (hw->aq.num_arq_entries | -IAVF_ARQLEN1_ARQENABLE_MASK )); +IAVF_VF_ARQLEN1_ARQENABLE_MASK ));#endif /* INTEGRATED_VF */ wr32 (hw, hw->aq.arq.bal,IAVF_LO_DWORD (hw->aq.arq.desc_buf.pa));wr32 (hw, hw->aq.arq.bah,IAVF_HI_DWORD (hw->aq.arq.desc_buf.pa));
@@ -834,7 +834,7 @@ enum iavf_status iavf_asq_send_command(struct iavf_hw *hw,/* update the error if time out occurred */ if ((!cmd_completed) && (!details->async && !details->postpone)) { -if (rd32 (hw, hw->aq.asq.len) &IAVF_ATQLEN1_ATQCRIT_MASK ) { +if (rd32 (hw, hw->aq.asq.len) &IAVF_VF_ATQLEN1_ATQCRIT_MASK ) {iavf_debug (hw,IAVF_DEBUG_AQ_MESSAGE ,"AQTX: AQ Critical error.\n" ); status =IAVF_ERR_ADMIN_QUEUE_CRITICAL_ERROR ;
@@ -908,9 +908,9 @@ enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw,if (!iavf_is_vf (hw)) ntu =rd32 (hw, hw->aq.arq.head) &IAVF_PF_ARQH_ARQH_MASK ;else - ntu =rd32 (hw, hw->aq.arq.head) &IAVF_ARQH1_ARQH_MASK ; + ntu =rd32 (hw, hw->aq.arq.head) &IAVF_VF_ARQH1_ARQH_MASK ;#else - ntu =rd32 (hw, hw->aq.arq.head) &IAVF_ARQH1_ARQH_MASK ; + ntu =rd32 (hw, hw->aq.arq.head) &IAVF_VF_ARQH1_ARQH_MASK ;#endif /* INTEGRATED_VF */ if (ntu == ntc) {/* nothing to do - shouldn't need to update ring's values */
drivers/net/iavf/base/iavf_common.c +2 -2
@@ -332,10 +332,10 @@ bool iavf_check_asq_alive(struct iavf_hw *hw)#ifdef INTEGRATED_VF if (iavf_is_vf (hw))return !!(rd32 (hw, hw->aq.asq.len) & -IAVF_ATQLEN1_ATQENABLE_MASK ); +IAVF_VF_ATQLEN1_ATQENABLE_MASK );#else return !!(rd32 (hw, hw->aq.asq.len) & -IAVF_ATQLEN1_ATQENABLE_MASK ); +IAVF_VF_ATQLEN1_ATQENABLE_MASK );#endif /* INTEGRATED_VF */ return false; }
drivers/net/iavf/base/iavf_osdep.h +1 -1
@@ -115,7 +115,7 @@ uint32_t iavf_read_addr(volatile void *addr)#define IAVF_WRITE_REG (hw, reg, value) \ IAVF_PCI_REG_WRITE(IAVF_PCI_REG_ADDR((hw), (reg)), (value))#define IAVF_WRITE_FLUSH (a) \ - IAVF_READ_REG(a, IAVFGEN_RSTAT) + IAVF_READ_REG(a, IAVF_VFGEN_RSTAT)#define rd32 (a, reg) iavf_read_addr(IAVF_PCI_REG_ADDR((a), (reg)))#define wr32 (a, reg, value) \
drivers/net/iavf/base/iavf_register.h +82 -306
395 lines not on this page · raw message
drivers/net/iavf/iavf_ethdev.c +32 -27
104 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH 4/17 net/iavf/base: update device id
In reply to Qi ZhangAdd all supported device id.
--- drivers/net/iavf/base/iavf_common.c | 8 +++++--- drivers/net/iavf/base/iavf_devids.h | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/iavf/base/iavf_common.c +5 -3
@@ -23,9 +23,11 @@ enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)if (hw->vendor_id ==IAVF_INTEL_VENDOR_ID ) {switch (hw->device_id) { -/* TODO: remove undefined device ID now, need to think how to -* remove them in share code -*/ +case IAVF_DEV_ID_X722_VF : + hw->mac.type =IAVF_MAC_X722_VF ; +break ; +case IAVF_DEV_ID_VF : +case IAVF_DEV_ID_VF_HV :case IAVF_DEV_ID_ADAPTIVE_VF : hw->mac.type =IAVF_MAC_VF ;break ;
drivers/net/iavf/base/iavf_devids.h +4 -1
@@ -8,7 +8,10 @@/* Vendor ID */ #define IAVF_INTEL_VENDOR_ID 0x8086 -/* Device IDs */ +/* Device IDs for the VF driver */ +#define IAVF_DEV_ID_VF 0x154C +#define IAVF_DEV_ID_VF_HV 0x1571#define IAVF_DEV_ID_ADAPTIVE_VF 0x1889 +#define IAVF_DEV_ID_X722_VF 0x37CD#endif /* _IAVF_DEVIDS_H_ */
Signature · 1 line
2.13.6
PATCH 5/17 net/iavf/base: remove unused code
In reply to Qi ZhangRemove unused APIs in iavf_prototype.h, iavf_adminq_cmd.h iavf_type.h, iavf_adminq.h and iavf_common.c
--- drivers/net/iavf/base/iavf_adminq.c | 27 +- drivers/net/iavf/base/iavf_adminq.h | 43 - drivers/net/iavf/base/iavf_adminq_cmd.h | 2344 ++----------------------------- drivers/net/iavf/base/iavf_common.c | 787 ----------- drivers/net/iavf/base/iavf_prototype.h | 83 -- drivers/net/iavf/base/iavf_type.h | 1109 +-------------- 6 files changed, 168 insertions(+), 4225 deletions(-)
drivers/net/iavf/base/iavf_adminq.c +10 -17
@@ -17,18 +17,16 @@ STATIC void iavf_adminq_init_regs(struct iavf_hw *hw) {/* set head and tail registers in our local struct */ -if (iavf_is_vf (hw)) { - hw->aq.asq.tail =IAVF_VF_ATQT1 ; - hw->aq.asq.head =IAVF_VF_ATQH1 ; - hw->aq.asq.len =IAVF_VF_ATQLEN1 ; - hw->aq.asq.bal =IAVF_VF_ATQBAL1 ; - hw->aq.asq.bah =IAVF_VF_ATQBAH1 ; - hw->aq.arq.tail =IAVF_VF_ARQT1 ; - hw->aq.arq.head =IAVF_VF_ARQH1 ; - hw->aq.arq.len =IAVF_VF_ARQLEN1 ; - hw->aq.arq.bal =IAVF_VF_ARQBAL1 ; - hw->aq.arq.bah =IAVF_VF_ARQBAH1 ; - } + hw->aq.asq.tail =IAVF_VF_ATQT1 ; + hw->aq.asq.head =IAVF_VF_ATQH1 ; + hw->aq.asq.len =IAVF_VF_ATQLEN1 ; + hw->aq.asq.bal =IAVF_VF_ATQBAL1 ; + hw->aq.asq.bah =IAVF_VF_ATQBAH1 ; + hw->aq.arq.tail =IAVF_VF_ARQT1 ; + hw->aq.arq.head =IAVF_VF_ARQH1 ; + hw->aq.arq.len =IAVF_VF_ARQLEN1 ; + hw->aq.arq.bal =IAVF_VF_ARQBAL1 ; + hw->aq.arq.bah =IAVF_VF_ARQBAH1 ; }/**
@@ -549,8 +547,6 @@ enum iavf_status iavf_init_adminq(struct iavf_hw *hw)if (ret_code !=IAVF_SUCCESS ) goto init_adminq_free_asq; - ret_code =IAVF_SUCCESS ; -/* success! */ goto init_adminq_exit;
@@ -580,9 +576,6 @@ enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw)iavf_destroy_spinlock (&hw->aq.asq_spinlock);iavf_destroy_spinlock (&hw->aq.arq_spinlock); -if (hw->nvm_buff.va) -iavf_free_virt_mem (hw, &hw->nvm_buff); -return ret_code; }
drivers/net/iavf/base/iavf_adminq.h +0 -43
49 lines not on this page · raw message
drivers/net/iavf/base/iavf_adminq_cmd.h +89 -2255
2,408 lines not on this page · raw message
drivers/net/iavf/base/iavf_common.c +0 -787
498 lines not on this page · raw message
drivers/net/iavf/base/iavf_prototype.h +0 -83
83 lines not on this page · raw message
drivers/net/iavf/base/iavf_type.h +69 -1040
1,109 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.13.6
Part of the diff is not shown here. View the raw message.
PATCH 6/17 net/iavf/base: remove unnecessary compile option
In reply to Qi ZhangRemove compile option INTEGRATED_VF.
--- drivers/net/iavf/base/iavf_adminq.c | 19 ------------------- drivers/net/iavf/base/iavf_common.c | 9 ++------- drivers/net/iavf/base/iavf_type.h | 8 -------- 3 files changed, 2 insertions(+), 34 deletions(-)
drivers/net/iavf/base/iavf_adminq.c +0 -19
@@ -262,14 +262,8 @@ STATIC enum iavf_status iavf_config_asq_regs(struct iavf_hw *hw)wr32 (hw, hw->aq.asq.tail,0 );/* set starting point */ -#ifdef INTEGRATED_VF -if (iavf_is_vf (hw)) -wr32 (hw, hw->aq.asq.len, (hw->aq.num_asq_entries | -IAVF_VF_ATQLEN1_ATQENABLE_MASK )); -#else wr32 (hw, hw->aq.asq.len, (hw->aq.num_asq_entries |IAVF_VF_ATQLEN1_ATQENABLE_MASK )); -#endif /* INTEGRATED_VF */ wr32 (hw, hw->aq.asq.bal,IAVF_LO_DWORD (hw->aq.asq.desc_buf.pa));wr32 (hw, hw->aq.asq.bah,IAVF_HI_DWORD (hw->aq.asq.desc_buf.pa));
@@ -297,14 +291,8 @@ STATIC enum iavf_status iavf_config_arq_regs(struct iavf_hw *hw)wr32 (hw, hw->aq.arq.tail,0 );/* set starting point */ -#ifdef INTEGRATED_VF -if (iavf_is_vf (hw)) -wr32 (hw, hw->aq.arq.len, (hw->aq.num_arq_entries | -IAVF_VF_ARQLEN1_ARQENABLE_MASK )); -#else wr32 (hw, hw->aq.arq.len, (hw->aq.num_arq_entries |IAVF_VF_ARQLEN1_ARQENABLE_MASK )); -#endif /* INTEGRATED_VF */ wr32 (hw, hw->aq.arq.bal,IAVF_LO_DWORD (hw->aq.arq.desc_buf.pa));wr32 (hw, hw->aq.arq.bah,IAVF_HI_DWORD (hw->aq.arq.desc_buf.pa));
@@ -897,14 +885,7 @@ enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw, }/* set next_to_use to head */ -#ifdef INTEGRATED_VF -if (!iavf_is_vf (hw)) - ntu =rd32 (hw, hw->aq.arq.head) &IAVF_PF_ARQH_ARQH_MASK ; -else - ntu =rd32 (hw, hw->aq.arq.head) &IAVF_VF_ARQH1_ARQH_MASK ; -#else ntu =rd32 (hw, hw->aq.arq.head) &IAVF_VF_ARQH1_ARQH_MASK ; -#endif /* INTEGRATED_VF */ if (ntu == ntc) {/* nothing to do - shouldn't need to update ring's values */ ret_code =IAVF_ERR_ADMIN_QUEUE_NO_WORK ;
drivers/net/iavf/base/iavf_common.c +2 -7
@@ -331,15 +331,10 @@ void iavf_debug_aq(struct iavf_hw *hw, enum iavf_debug_mask mask, void *desc,bool iavf_check_asq_alive (struct iavf_hw *hw) {if (hw->aq.asq.len) -#ifdef INTEGRATED_VF -if (iavf_is_vf (hw)) -return !!(rd32 (hw, hw->aq.asq.len) & -IAVF_VF_ATQLEN1_ATQENABLE_MASK ); -#else return !!(rd32 (hw, hw->aq.asq.len) &IAVF_VF_ATQLEN1_ATQENABLE_MASK ); -#endif /* INTEGRATED_VF */ -return false; +else +return false; }/**
drivers/net/iavf/base/iavf_type.h +0 -8
@@ -20,14 +20,8 @@#define UNREFERENCED_4PARAMETER (_p, _q, _r, _s) (_p); (_q); (_r); (_s);#define UNREFERENCED_5PARAMETER (_p, _q, _r, _s, _t) (_p); (_q); (_r); (_s); (_t); -#ifndef LINUX_MACROS -#ifndef BIT #define BIT (a) (1UL << (a)) -#endif /* BIT */ -#ifndef BIT_ULL #define BIT_ULL (a) (1ULL << (a)) -#endif /* BIT_ULL */ -#endif /* LINUX_MACROS */ /* IAVF_MASK is a macro used on 32 bit registers */ #define IAVF_MASK (mask, shift) (mask << shift)
@@ -56,9 +50,7 @@struct iavf_hw ;typedef void (*IAVF_ADMINQ_CALLBACK )(struct iavf_hw *,struct iavf_aq_desc *); -#ifndef ETH_ALEN #define ETH_ALEN 6 -#endif /* Data type manipulation macros. */ #define IAVF_HI_DWORD (x) ((u32)((((x) >> 16) >> 16) & 0xFFFFFFFF))#define IAVF_LO_DWORD (x) ((u32)((x) & 0xFFFFFFFF))
Signature · 1 line
2.13.6
PATCH 7/17 net/iavf/base: rename functions
In reply to Qi ZhangRename iavf_parse_hw_config to iavf_vf_parse_hw_config. Rename iavf_reset to iavf_vf_reset.
--- drivers/net/iavf/base/iavf_common.c | 8 ++++---- drivers/net/iavf/base/iavf_prototype.h | 4 ++-- drivers/net/iavf/iavf_vchnl.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/iavf/base/iavf_common.c +4 -4
@@ -955,14 +955,14 @@ enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw, }/** -* iavf_parse_hw_config +* iavf_vf_parse_hw_config * @hw: pointer to the hardware structure * @msg: pointer to the virtual channel VF resource structure * * Given a VF resource message from the PF, populate the hw struct * with appropriate information. **/ -void iavf_parse_hw_config (struct iavf_hw *hw, +void iavf_vf_parse_hw_config (struct iavf_hw *hw,struct virtchnl_vf_resource *msg) {struct virtchnl_vsi_resource *vsi_res;
@@ -991,14 +991,14 @@ void iavf_parse_hw_config(struct iavf_hw *hw, }/** -* iavf_reset +* iavf_vf_reset * @hw: pointer to the hardware structure * * Send a VF_RESET message to the PF. Does not wait for response from PF * as none will be forthcoming. Immediately after calling this function, * the admin queue should be shut down and (optionally) reinitialized. **/ -enum iavf_status iavf_reset (struct iavf_hw *hw) +enum iavf_status iavf_vf_reset (struct iavf_hw *hw) {return iavf_aq_send_msg_to_pf (hw,VIRTCHNL_OP_RESET_VF ,IAVF_SUCCESS ,NULL ,0 ,NULL );
drivers/net/iavf/base/iavf_prototype.h +2 -2
@@ -76,9 +76,9 @@ void iavf_acquire_spinlock(struct iavf_spinlock *sp);void iavf_release_spinlock (struct iavf_spinlock *sp);void iavf_destroy_spinlock (struct iavf_spinlock *sp); -void iavf_parse_hw_config (struct iavf_hw *hw, +void iavf_vf_parse_hw_config (struct iavf_hw *hw,struct virtchnl_vf_resource *msg); -enum iavf_status iavf_reset (struct iavf_hw *hw); +enum iavf_status iavf_vf_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 v_retval,
drivers/net/iavf/iavf_vchnl.c +1 -1
@@ -363,7 +363,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)rte_memcpy (vf->vf_res, args.out_buffer,RTE_MIN (args.out_size, len));/* parse VF config message back from PF*/ -iavf_parse_hw_config (hw, vf->vf_res); +iavf_vf_parse_hw_config (hw, vf->vf_res);for (i =0 ; i < vf->vf_res->num_vsis; i++) {if (vf->vf_res->vsi_res[i].vsi_type ==VIRTCHNL_VSI_SRIOV ) vf->vsi_res = &vf->vf_res->vsi_res[i];
Signature · 1 line
2.13.6
PATCH 8/17 net/iavf/base: update virtual channel
In reply to Qi ZhangUpdate virtual channel API to align with latest spec.
--- drivers/net/iavf/base/virtchnl.h | 343 ++++++++++++++++++++++++++------------- 1 file changed, 232 insertions(+), 111 deletions(-)
drivers/net/iavf/base/virtchnl.h +232 -111
@@ -40,19 +40,27 @@/* Error Codes */ enum virtchnl_status_code {VIRTCHNL_STATUS_SUCCESS =0 , -VIRTCHNL_ERR_PARAM =-5 , +VIRTCHNL_STATUS_ERR_PARAM =-5 , +VIRTCHNL_STATUS_ERR_NO_MEMORY =-18 ,VIRTCHNL_STATUS_ERR_OPCODE_MISMATCH =-38 ,VIRTCHNL_STATUS_ERR_CQP_COMPL_ERROR =-39 ,VIRTCHNL_STATUS_ERR_INVALID_VF_ID =-40 , -VIRTCHNL_STATUS_NOT_SUPPORTED =-64 , +VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR =-53 , +VIRTCHNL_STATUS_ERR_NOT_SUPPORTED =-64 , }; +/* Backward compatibility */ +#define VIRTCHNL_ERR_PARAM VIRTCHNL_STATUS_ERR_PARAM +#define VIRTCHNL_STATUS_NOT_SUPPORTED VIRTCHNL_STATUS_ERR_NOT_SUPPORTED + +#define VIRTCHNL_LINK_SPEED_2_5GB_SHIFT 0x0#define VIRTCHNL_LINK_SPEED_100MB_SHIFT 0x1#define VIRTCHNL_LINK_SPEED_1000MB_SHIFT 0x2#define VIRTCHNL_LINK_SPEED_10GB_SHIFT 0x3#define VIRTCHNL_LINK_SPEED_40GB_SHIFT 0x4#define VIRTCHNL_LINK_SPEED_20GB_SHIFT 0x5#define VIRTCHNL_LINK_SPEED_25GB_SHIFT 0x6 +#define VIRTCHNL_LINK_SPEED_5GB_SHIFT 0x7enum virtchnl_link_speed {VIRTCHNL_LINK_SPEED_UNKNOWN =0 ,
@@ -62,6 +70,8 @@ enum virtchnl_link_speed {VIRTCHNL_LINK_SPEED_40GB =BIT (VIRTCHNL_LINK_SPEED_40GB_SHIFT ),VIRTCHNL_LINK_SPEED_20GB =BIT (VIRTCHNL_LINK_SPEED_20GB_SHIFT ),VIRTCHNL_LINK_SPEED_25GB =BIT (VIRTCHNL_LINK_SPEED_25GB_SHIFT ), +VIRTCHNL_LINK_SPEED_2_5GB =BIT (VIRTCHNL_LINK_SPEED_2_5GB_SHIFT ), + VIRTCHNL_LINK_SPEED_5GB = BIT(VIRTCHNL_LINK_SPEED_5GB_SHIFT), };/* for hsplit_0 field of Rx HMC context */
@@ -105,14 +115,8 @@ enum virtchnl_ops {VIRTCHNL_OP_GET_STATS =15 ,VIRTCHNL_OP_RSVD =16 ,VIRTCHNL_OP_EVENT =17 ,/* must ALWAYS be 17 */ -#ifdef VIRTCHNL_SOL_VF_SUPPORT -VIRTCHNL_OP_GET_ADDNL_SOL_CONFIG =19 , -#endif -#ifdef VIRTCHNL_IWARP -VIRTCHNL_OP_IWARP =20 ,/* advanced opcode */ -VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP =21 ,/* advanced opcode */ -VIRTCHNL_OP_RELEASE_IWARP_IRQ_MAP =22 ,/* advanced opcode */ -#endif +/* opcode 19 is reserved */ +/* opcodes 20, 21, and 22 are reserved */ VIRTCHNL_OP_CONFIG_RSS_KEY =23 ,VIRTCHNL_OP_CONFIG_RSS_LUT =24 , VIRTCHNL_OP_GET_RSS_HENA_CAPS = 25,
@@ -120,16 +124,22 @@ enum virtchnl_ops {VIRTCHNL_OP_ENABLE_VLAN_STRIPPING =27 ,VIRTCHNL_OP_DISABLE_VLAN_STRIPPING =28 ,VIRTCHNL_OP_REQUEST_QUEUES =29 , - +VIRTCHNL_OP_ENABLE_CHANNELS =30 , +VIRTCHNL_OP_DISABLE_CHANNELS =31 , +VIRTCHNL_OP_ADD_CLOUD_FILTER =32 , + VIRTCHNL_OP_DEL_CLOUD_FILTER = 33, + /* opcodes 34, 35, 36, 37 and 38 are reserved */ }; -/* This macro is used to generate a compilation error if a structure +/* These macros are used to generate compilation errors if a structure/union * is not exactly the correct length. It gives a divide by zero error if the -* structure is not of the correct size, otherwise it creates an enum that is -* never used. +* structure/union is not of the correct size, otherwise it creates an enum +* that is never used. */ #define VIRTCHNL_CHECK_STRUCT_LEN (n,X ) enum virtchnl_static_assert_enum_##X \ - {virtchnl_static_assert_##X = (n) / ((sizeof(struct X) == (n)) ? 1 : 0)} + { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } +#define VIRTCHNL_CHECK_UNION_LEN (n,X ) enum virtchnl_static_asset_enum_##X \ + { virtchnl_static_assert_##X = (n)/((sizeof(union X) == (n)) ? 1 : 0) }/* Virtual channel message descriptor. This overlays the admin queue * descriptor. All other data is passed in external buffers.
@@ -144,7 +154,7 @@ struct virtchnl_msg {VIRTCHNL_CHECK_STRUCT_LEN (20 , virtchnl_msg); -/* Message descriptions and data structures.*/ +/* Message descriptions and data structures. */ /* VIRTCHNL_OP_VERSION * VF posts its version number to the PF. PF responds with its version number
@@ -222,6 +232,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource);#define VIRTCHNL_VF_OFFLOAD_RSS_REG 0x00000010#define VIRTCHNL_VF_OFFLOAD_WB_ON_ITR 0x00000020#define VIRTCHNL_VF_OFFLOAD_REQ_QUEUES 0x00000040 +#define VIRTCHNL_VF_OFFLOAD_CRC 0x00000080#define VIRTCHNL_VF_OFFLOAD_VLAN 0x00010000#define VIRTCHNL_VF_OFFLOAD_RX_POLLING 0x00020000#define VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 0x00040000
@@ -229,9 +240,13 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource);#define VIRTCHNL_VF_OFFLOAD_ENCAP 0X00100000#define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM 0X00200000#define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM 0X00400000 -/* Define below the capability flags that are not offloads */ -#define VIRTCHNL_VF_CAP_ADV_LINK_SPEED 0x00000080 +#define VIRTCHNL_VF_OFFLOAD_ADQ 0X00800000 +#define VIRTCHNL_VF_OFFLOAD_ADQ_V2 0X01000000 +#define VIRTCHNL_VF_OFFLOAD_USO 0X02000000 +/* 0X80000000 is reserved */ +/* Define below the capability flags that are not offloads */ +#define VIRTCHNL_VF_CAP_ADV_LINK_SPEED 0x00000080#define VF_BASE_MODE_OFFLOADS (VIRTCHNL_VF_OFFLOAD_L2 | \ VIRTCHNL_VF_OFFLOAD_VLAN | \ VIRTCHNL_VF_OFFLOAD_RSS_PF)
@@ -262,9 +277,9 @@ struct virtchnl_txq_info {u16 vsi_id;u16 queue_id;u16 ring_len;/* number of descriptors, multiple of 8 */ -u16 headwb_enabled;/* deprecated with IAVF 1.0 */ +u16 headwb_enabled;/* deprecated with AVF 1.0 */ u64 dma_ring_addr; -u64 dma_headwb_addr;/* deprecated with IAVF 1.0 */ +u64 dma_headwb_addr;/* deprecated with AVF 1.0 */ };VIRTCHNL_CHECK_STRUCT_LEN (24 , virtchnl_txq_info);
@@ -272,7 +287,13 @@ VIRTCHNL_CHECK_STRUCT_LEN(24, virtchnl_txq_info);/* VIRTCHNL_OP_CONFIG_RX_QUEUE * VF sends this message to set up parameters for one RX queue. * External data buffer contains one instance of virtchnl_rxq_info. -* PF configures requested queue and returns a status code. +* PF configures requested queue and returns a status code. The +* crc_disable flag disables CRC stripping on the VF. Setting +* the crc_disable flag to 1 will disable CRC stripping for each +* queue in the VF where the flag is set. The VIRTCHNL_VF_OFFLOAD_CRC +* offload must have been set prior to sending this info or the PF +* will ignore the request. This flag should be set the same for +* all of the queues for a VF. */ /* Rx queue config info */
@@ -281,23 +302,27 @@ struct virtchnl_rxq_info {u16 queue_id;u32 ring_len;/* number of descriptors, multiple of 32 */ u16 hdr_size; -u16 splithdr_enabled;/* deprecated with IAVF 1.0 */ +u16 splithdr_enabled;/* deprecated with AVF 1.0 */ u32 databuffer_size;u32 max_pkt_size; -u32 pad1; +u8 crc_disable; +u8 pad1[3 ];u64 dma_ring_addr; -enum virtchnl_rx_hsplit rx_split_pos;/* deprecated with IAVF 1.0 */ +enum virtchnl_rx_hsplit rx_split_pos;/* deprecated with AVF 1.0 */ u32 pad2; };VIRTCHNL_CHECK_STRUCT_LEN (40 , virtchnl_rxq_info);/* VIRTCHNL_OP_CONFIG_VSI_QUEUES -* VF sends this message to set parameters for all active TX and RX queues +* VF sends this message to set parameters for active TX and RX queues * associated with the specified VSI. * PF configures queues and returns status. * If the number of queues specified is greater than the number of queues * associated with the VSI, an error is returned and no queues are configured. +* NOTE: The VF is not required to configure all queues in a single request. +* It may send multiple messages. PF drivers must correctly handle all VF +* requests. */ struct virtchnl_queue_pair_info {/* NOTE: vsi_id and queue_id should be identical for both queues. */
@@ -335,8 +360,13 @@ struct virtchnl_vf_res_request {* VF uses this message to map vectors to queues. * The rxq_map and txq_map fields are bitmaps used to indicate which queues * are to be associated with the specified vector. -* The "other" causes are always mapped to vector 0. +* The "other" causes are always mapped to vector 0. The VF may not request +* that vector 0 be used for traffic. * PF configures interrupt mapping and returns status. +* NOTE: due to hardware requirements, all active queues (both TX and RX) +* should be mapped to interrupts, even if the driver intends to operate +* only in polling mode. In this case the interrupt may be disabled, but +* the ITR timer will still run to trigger writebacks. */ struct virtchnl_vector_map {u16 vsi_id;
@@ -363,6 +393,9 @@ VIRTCHNL_CHECK_STRUCT_LEN(14, virtchnl_irq_map_info);* (Currently, we only support 16 queues per VF, but we make the field * u32 to allow for expansion.) * PF performs requested action and returns status. +* NOTE: The VF is not required to enable/disable all queues in a single +* request. It may send multiple messages. +* PF drivers must correctly handle all VF requests. */ struct virtchnl_queue_select {u16 vsi_id;
@@ -400,23 +433,6 @@ struct virtchnl_ether_addr_list {VIRTCHNL_CHECK_STRUCT_LEN (12 , virtchnl_ether_addr_list); -#ifdef VIRTCHNL_SOL_VF_SUPPORT -/* VIRTCHNL_OP_GET_ADDNL_SOL_CONFIG -* VF sends this message to get the default MTU and list of additional ethernet -* addresses it is allowed to use. -* PF responds with an indirect message containing -* virtchnl_addnl_solaris_config with zero or more -* virtchnl_ether_addr structures. -* -* It is expected that this operation will only ever be needed for Solaris VFs -* running under a Solaris PF. -*/ -struct virtchnl_addnl_solaris_config { -u16 default_mtu; -struct virtchnl_ether_addr_list al; -}; - -#endif /* VIRTCHNL_OP_ADD_VLAN * VF sends this message to add one or more VLAN tag filters for receives. * PF adds the filters and returns status.
@@ -469,7 +485,7 @@ struct virtchnl_eth_stats {u64 rx_broadcast;/* received broadcast pkts */ u64 rx_discards;u64 rx_unknown_protocol; -u64 tx_bytes;/* transmitted bytes*/ +u64 tx_bytes;/* transmitted bytes */ u64 tx_unicast;/* transmitted unicast pkts */ u64 tx_multicast;/* transmitted multicast pkts */ u64 tx_broadcast;/* transmitted broadcast pkts */
@@ -515,6 +531,95 @@ struct virtchnl_rss_hena {VIRTCHNL_CHECK_STRUCT_LEN (8 , virtchnl_rss_hena); +/* This is used by PF driver to enforce how many channels can be supported. +* When ADQ_V2 capability is negotiated, it will allow 16 channels otherwise +* PF driver will allow only max 4 channels +*/ +#define VIRTCHNL_MAX_ADQ_CHANNELS 4 +#define VIRTCHNL_MAX_ADQ_V2_CHANNELS 16 + +/* VIRTCHNL_OP_ENABLE_CHANNELS +* VIRTCHNL_OP_DISABLE_CHANNELS +* VF sends these messages to enable or disable channels based on +* the user specified queue count and queue offset for each traffic class. +* This struct encompasses all the information that the PF needs from +* VF to create a channel. +*/ +struct virtchnl_channel_info { +u16 count;/* number of queues in a channel */ +u16 offset;/* queues in a channel start from 'offset' */ +u32 pad; +u64 max_tx_rate; +}; + +VIRTCHNL_CHECK_STRUCT_LEN (16 , virtchnl_channel_info); + +struct virtchnl_tc_info { +u32 num_tc; +u32 pad; +struct virtchnl_channel_info list[1 ]; +}; + +VIRTCHNL_CHECK_STRUCT_LEN (24 , virtchnl_tc_info); + +/* VIRTCHNL_ADD_CLOUD_FILTER +* VIRTCHNL_DEL_CLOUD_FILTER +* VF sends these messages to add or delete a cloud filter based on the +* user specified match and action filters. These structures encompass +* all the information that the PF needs from the VF to add/delete a +* cloud filter. +*/ + +struct virtchnl_l4_spec { +u8 src_mac[ETH_ALEN ]; +u8 dst_mac[ETH_ALEN ]; +/* vlan_prio is part of this 16 bit field even from OS perspective +* vlan_id:12 is actual vlan_id, then vlanid:bit14..12 is vlan_prio +* in future, when decided to offload vlan_prio, pass that information +* as part of the "vlan_id" field, Bit14..12 +*/ +__be16 vlan_id; +__be16 pad;/* reserved for future use */ +__be32 src_ip[4 ]; +__be32 dst_ip[4 ]; +__be16 src_port; +__be16 dst_port; +}; + +VIRTCHNL_CHECK_STRUCT_LEN (52 , virtchnl_l4_spec); + +union virtchnl_flow_spec { +struct virtchnl_l4_spec tcp_spec; +u8 buffer[128 ];/* reserved for future use */ +}; + +VIRTCHNL_CHECK_UNION_LEN (128 , virtchnl_flow_spec); + +enum virtchnl_action { +/* action types */ +VIRTCHNL_ACTION_DROP =0 , +VIRTCHNL_ACTION_TC_REDIRECT , +}; + +enum virtchnl_flow_type { +/* flow types */ +VIRTCHNL_TCP_V4_FLOW =0 , +VIRTCHNL_TCP_V6_FLOW , +VIRTCHNL_UDP_V4_FLOW , +VIRTCHNL_UDP_V6_FLOW , +}; + +struct virtchnl_filter { +union virtchnl_flow_spec data; +union virtchnl_flow_spec mask; +enum virtchnl_flow_type flow_type; +enum virtchnl_action action; +u32 action_meta; +u8 field_flags; +}; + +VIRTCHNL_CHECK_STRUCT_LEN (272 , virtchnl_filter); +/* VIRTCHNL_OP_EVENT * PF sends this message to inform the VF driver of events that may affect it. * No direct response is expected from the VF, though it may generate other
@@ -559,44 +664,33 @@ struct virtchnl_pf_event {VIRTCHNL_CHECK_STRUCT_LEN (16 , virtchnl_pf_event); -#ifdef VIRTCHNL_IWARP - -/* VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP -* VF uses this message to request PF to map IWARP vectors to IWARP queues. -* The request for this originates from the VF IWARP driver through -* a client interface between VF LAN and VF IWARP driver. -* A vector could have an AEQ and CEQ attached to it although -* there is a single AEQ per VF IWARP instance in which case -* most vectors will have an INVALID_IDX for aeq and valid idx for ceq. -* There will never be a case where there will be multiple CEQs attached -* to a single vector. -* PF configures interrupt mapping and returns status. -*/ -/* HW does not define a type value for AEQ; only for RX/TX and CEQ. -* In order for us to keep the interface simple, SW will define a -* unique type value for AEQ. +/* Since VF messages are limited by u16 size, precalculate the maximum possible +* values of nested elements in virtchnl structures that virtual channel can +* possibly handle in a single message. */ -#define QUEUE_TYPE_PE_AEQ 0x80 -#define QUEUE_INVALID_IDX 0xFFFF +enum virtchnl_vector_limits { +VIRTCHNL_OP_CONFIG_VSI_QUEUES_MAX = + ((u16)(~0 ) -sizeof (struct virtchnl_vsi_queue_config_info )) / +sizeof (struct virtchnl_queue_pair_info ), -struct virtchnl_iwarp_qv_info { -u32 v_idx;/* msix_vector */ -u16 ceq_idx; -u16 aeq_idx; -u8 itr_idx; -}; +VIRTCHNL_OP_CONFIG_IRQ_MAP_MAX = + ((u16)(~0 ) -sizeof (struct virtchnl_irq_map_info )) / +sizeof (struct virtchnl_vector_map ), -VIRTCHNL_CHECK_STRUCT_LEN (12 , virtchnl_iwarp_qv_info); +VIRTCHNL_OP_ADD_DEL_ETH_ADDR_MAX = + ((u16)(~0 ) -sizeof (struct virtchnl_ether_addr_list )) / +sizeof (struct virtchnl_ether_addr ), -struct virtchnl_iwarp_qvlist_info { -u32 num_vectors; -struct virtchnl_iwarp_qv_info qv_info[1 ]; -}; +VIRTCHNL_OP_ADD_DEL_VLAN_MAX = + ((u16)(~0 ) -sizeof (struct virtchnl_vlan_filter_list )) / +sizeof (u16), -VIRTCHNL_CHECK_STRUCT_LEN (16 , virtchnl_iwarp_qvlist_info); -#endif +VIRTCHNL_OP_ENABLE_CHANNELS_MAX = + ((u16)(~0 ) -sizeof (struct virtchnl_tc_info )) / +sizeof (struct virtchnl_channel_info ), +};/* VF reset states - these are written into the RSTAT register: * VFGEN_RSTAT on the VF
@@ -653,11 +747,16 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,if (msglen >= valid_len) {struct virtchnl_vsi_queue_config_info *vqc = (struct virtchnl_vsi_queue_config_info *)msg; + +if (vqc->num_queue_pairs ==0 || vqc->num_queue_pairs > +VIRTCHNL_OP_CONFIG_VSI_QUEUES_MAX ) { + err_msg_format = true; +break ; + } + valid_len += (vqc->num_queue_pairs *sizeof (struct virtchnl_queue_pair_info )); -if (vqc->num_queue_pairs ==0 ) - err_msg_format = true; }break ;case VIRTCHNL_OP_CONFIG_IRQ_MAP :
@@ -665,10 +764,15 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,if (msglen >= valid_len) {struct virtchnl_irq_map_info *vimi = (struct virtchnl_irq_map_info *)msg; + +if (vimi->num_vectors ==0 || vimi->num_vectors > +VIRTCHNL_OP_CONFIG_IRQ_MAP_MAX ) { + err_msg_format = true; +break ; + } + valid_len += (vimi->num_vectors *sizeof (struct virtchnl_vector_map )); -if (vimi->num_vectors ==0 ) - err_msg_format = true; }break ;case VIRTCHNL_OP_ENABLE_QUEUES :
@@ -681,10 +785,15 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,if (msglen >= valid_len) {struct virtchnl_ether_addr_list *veal = (struct virtchnl_ether_addr_list *)msg; + +if (veal->num_elements ==0 || veal->num_elements > +VIRTCHNL_OP_ADD_DEL_ETH_ADDR_MAX ) { + err_msg_format = true; +break ; + } + valid_len += veal->num_elements *sizeof (struct virtchnl_ether_addr ); -if (veal->num_elements ==0 ) - err_msg_format = true; }break ;case VIRTCHNL_OP_ADD_VLAN :
@@ -693,9 +802,14 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,if (msglen >= valid_len) {struct virtchnl_vlan_filter_list *vfl = (struct virtchnl_vlan_filter_list *)msg; - valid_len += vfl->num_elements *sizeof (u16); -if (vfl->num_elements ==0 ) + +if (vfl->num_elements ==0 || vfl->num_elements > +VIRTCHNL_OP_ADD_DEL_VLAN_MAX ) { err_msg_format = true; +break ; + } + + valid_len += vfl->num_elements *sizeof (u16); }break ;case VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE :
@@ -704,38 +818,17 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,case VIRTCHNL_OP_GET_STATS : valid_len =sizeof (struct virtchnl_queue_select );break ; -#ifdef VIRTCHNL_IWARP -case VIRTCHNL_OP_IWARP : -/* These messages are opaque to us and will be validated in -* the RDMA client code. We just need to check for nonzero -* length. The firmware will enforce max length restrictions. -*/ -if (msglen) - valid_len = msglen; -else - err_msg_format = true; -break ; -case VIRTCHNL_OP_RELEASE_IWARP_IRQ_MAP : -break ; -case VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP : - valid_len =sizeof (struct virtchnl_iwarp_qvlist_info ); -if (msglen >= valid_len) { -struct virtchnl_iwarp_qvlist_info *qv = - (struct virtchnl_iwarp_qvlist_info *)msg; -if (qv->num_vectors ==0 ) { - err_msg_format = true; -break ; - } - valid_len += ((qv->num_vectors -1 ) * -sizeof (struct virtchnl_iwarp_qv_info )); - } -break ; -#endif case VIRTCHNL_OP_CONFIG_RSS_KEY : valid_len =sizeof (struct virtchnl_rss_key );if (msglen >= valid_len) {struct virtchnl_rss_key *vrk = (struct virtchnl_rss_key *)msg; + +if (vrk->key_len ==0 ) { +/* zero length is allowed as input */ +break ; + } + valid_len += vrk->key_len -1 ; }break ;
@@ -744,6 +837,12 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,if (msglen >= valid_len) {struct virtchnl_rss_lut *vrl = (struct virtchnl_rss_lut *)msg; + +if (vrl->lut_entries ==0 ) { +/* zero entries is allowed as input */ +break ; + } + valid_len += vrl->lut_entries -1 ; }break ;
@@ -758,11 +857,33 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,case VIRTCHNL_OP_REQUEST_QUEUES : valid_len =sizeof (struct virtchnl_vf_res_request );break ; +case VIRTCHNL_OP_ENABLE_CHANNELS : + valid_len =sizeof (struct virtchnl_tc_info ); +if (msglen >= valid_len) { +struct virtchnl_tc_info *vti = + (struct virtchnl_tc_info *)msg; + +if (vti->num_tc ==0 || vti->num_tc > +VIRTCHNL_OP_ENABLE_CHANNELS_MAX ) { + err_msg_format = true; +break ; + } + + valid_len += (vti->num_tc -1 ) * +sizeof (struct virtchnl_channel_info ); + } +break ; +case VIRTCHNL_OP_DISABLE_CHANNELS : +break ; +case VIRTCHNL_OP_ADD_CLOUD_FILTER : +case VIRTCHNL_OP_DEL_CLOUD_FILTER : + valid_len =sizeof (struct virtchnl_filter ); +break ;/* These are always errors coming from the VF. */ case VIRTCHNL_OP_EVENT :case VIRTCHNL_OP_UNKNOWN :default : -return VIRTCHNL_ERR_PARAM ; +return VIRTCHNL_STATUS_ERR_PARAM ; }/* few more checks */ if (err_msg_format || valid_len != msglen)
Signature · 1 line
2.13.6
PATCH 9/17 net/iavf/base: adjust code indent
In reply to Qi ZhangAdjust the indent in function and macro defination.
--- drivers/net/iavf/base/iavf_alloc.h | 14 +++++++------- drivers/net/iavf/base/iavf_common.c | 22 +++++++++++----------- drivers/net/iavf/base/iavf_prototype.h | 16 ++++++++-------- drivers/net/iavf/base/iavf_type.h | 19 ++++++++++--------- 4 files changed, 36 insertions(+), 35 deletions(-)
drivers/net/iavf/base/iavf_alloc.h +7 -7
@@ -22,15 +22,15 @@ enum iavf_memory_type {/* prototype for functions used for dynamic memory allocation */ 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); +struct iavf_dma_mem *mem, +enum iavf_memory_type type, +u64 size,u32 alignment);enum iavf_status iavf_free_dma_mem (struct iavf_hw *hw, -struct iavf_dma_mem *mem); +struct iavf_dma_mem *mem);enum iavf_status iavf_allocate_virt_mem (struct iavf_hw *hw, -struct iavf_virt_mem *mem, -u32 size); +struct iavf_virt_mem *mem, +u32 size);enum iavf_status iavf_free_virt_mem (struct iavf_hw *hw, -struct iavf_virt_mem *mem); +struct iavf_virt_mem *mem);#endif /* _IAVF_ALLOC_H_ */
drivers/net/iavf/base/iavf_common.c +11 -11
@@ -346,7 +346,7 @@ bool iavf_check_asq_alive(struct iavf_hw *hw)* or not the driver is unloading as well. **/ enum iavf_status iavf_aq_queue_shutdown (struct iavf_hw *hw, -bool unloading) +bool unloading) {struct iavf_aq_desc desc; struct iavf_aqc_queue_shutdown *cmd =
@@ -375,9 +375,9 @@ enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw,* Internal function to get or set RSS look up table **/ 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) +u16 vsi_id,bool pf_lut, +u8 *lut,u16 lut_size, +bool set) {enum iavf_status status;struct iavf_aq_desc desc;
@@ -428,7 +428,7 @@ STATIC enum iavf_status iavf_aq_get_set_rss_lut(struct iavf_hw *hw,* get the RSS lookup table, PF or VSI type **/ enum iavf_status iavf_aq_get_rss_lut (struct iavf_hw *hw,u16 vsi_id, -bool pf_lut,u8 *lut,u16 lut_size) +bool pf_lut,u8 *lut,u16 lut_size) {return iavf_aq_get_set_rss_lut (hw, vsi_id, pf_lut, lut, lut_size, false);
@@ -445,7 +445,7 @@ enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id,* set the RSS lookup table, PF or VSI type **/ enum iavf_status iavf_aq_set_rss_lut (struct iavf_hw *hw,u16 vsi_id, -bool pf_lut,u8 *lut,u16 lut_size) +bool pf_lut,u8 *lut,u16 lut_size) {return iavf_aq_get_set_rss_lut (hw, vsi_id, pf_lut, lut, lut_size, true); }
@@ -500,8 +500,8 @@ STATIC enum iavf_status iavf_aq_get_set_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) +u16 vsi_id, +struct iavf_aqc_get_set_rss_key_data *key) {return iavf_aq_get_set_rss_key (hw, vsi_id, key, false); }
@@ -515,8 +515,8 @@ enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw,* set the RSS key per VSI **/ enum iavf_status iavf_aq_set_rss_key (struct iavf_hw *hw, -u16 vsi_id, -struct iavf_aqc_get_set_rss_key_data *key) +u16 vsi_id, +struct iavf_aqc_get_set_rss_key_data *key) {return iavf_aq_get_set_rss_key (hw, vsi_id, key, true); }
@@ -1012,7 +1012,7 @@ enum iavf_status iavf_vf_reset(struct iavf_hw *hw)* Get information for the reason of a Wake Up event **/ enum iavf_status iavf_aq_clear_all_wol_filters (struct iavf_hw *hw, -struct iavf_asq_cmd_details *cmd_details) +struct iavf_asq_cmd_details *cmd_details) {struct iavf_aq_desc desc;enum iavf_status status;
drivers/net/iavf/base/iavf_prototype.h +8 -8
@@ -31,8 +31,8 @@ void iavf_free_adminq_arq(struct iavf_hw *hw);enum iavf_status iavf_validate_mac_addr (u8 *mac_addr);void iavf_adminq_init_ring_data (struct iavf_hw *hw);enum iavf_status iavf_clean_arq_element (struct iavf_hw *hw, -struct iavf_arq_event_info *e, -u16 *events_pending); +struct iavf_arq_event_info *e, +u16 *events_pending); enum iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct iavf_aq_desc *desc, void *buff, /* can be NULL */
@@ -49,9 +49,9 @@ bool iavf_check_asq_alive(struct iavf_hw *hw);enum iavf_status iavf_aq_queue_shutdown (struct iavf_hw *hw,bool unloading);enum iavf_status iavf_aq_get_rss_lut (struct iavf_hw *hw,u16 seid, -bool pf_lut,u8 *lut,u16 lut_size); +bool pf_lut,u8 *lut,u16 lut_size);enum iavf_status iavf_aq_set_rss_lut (struct iavf_hw *hw,u16 seid, -bool pf_lut,u8 *lut,u16 lut_size); +bool pf_lut,u8 *lut,u16 lut_size);enum iavf_status iavf_aq_get_rss_key (struct iavf_hw *hw,u16 seid,struct iavf_aqc_get_set_rss_key_data *key);
@@ -85,10 +85,10 @@ enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw, u8 *msg, u16 msglen, struct iavf_asq_cmd_details *cmd_details);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); +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);enum iavf_status iavf_aq_clear_all_wol_filters (struct iavf_hw *hw,struct iavf_asq_cmd_details *cmd_details);#endif /* _IAVF_PROTOTYPE_H_ */
drivers/net/iavf/base/iavf_type.h +10 -9
@@ -11,7 +11,7 @@#include "iavf_adminq.h" #include "iavf_devids.h" -#define IAVF_RXQ_CTX_DBUFF_SHIFT 7 +#define IAVF_RXQ_CTX_DBUFF_SHIFT 7#define UNREFERENCED_XPARAMETER #define UNREFERENCED_1PARAMETER (_p) (_p);
@@ -467,20 +467,20 @@ enum iavf_rx_desc_status_bits {IAVF_RX_DESC_STATUS_FLTSTAT_SHIFT =12 ,/* 2 BITS */ IAVF_RX_DESC_STATUS_LPBK_SHIFT =14 ,IAVF_RX_DESC_STATUS_IPV6EXADD_SHIFT =15 , -IAVF_RX_DESC_STATUS_RESERVED2_SHIFT =16 ,/* 2 BITS */ +IAVF_RX_DESC_STATUS_RESERVED_SHIFT =16 ,/* 2 BITS */ IAVF_RX_DESC_STATUS_INT_UDP_0_SHIFT =18 , IAVF_RX_DESC_STATUS_LAST /* this entry must be last!!! */ };#define IAVF_RXD_QW1_STATUS_SHIFT 0 -#define IAVF_RXD_QW1_STATUS_MASK ((BIT(IAVF_RX_DESC_STATUS_LAST) - 1) << \ - IAVF_RXD_QW1_STATUS_SHIFT) +#define IAVF_RXD_QW1_STATUS_MASK ((BIT(IAVF_RX_DESC_STATUS_LAST) - 1) \ + << IAVF_RXD_QW1_STATUS_SHIFT) -#define IAVF_RXD_QW1_STATUS_TSYNINDX_SHIFT IAVF_RX_DESC_STATUS_TSYNINDX_SHIFT -#define IAVF_RXD_QW1_STATUS_TSYNINDX_MASK (0x3UL << \ - IAVF_RXD_QW1_STATUS_TSYNINDX_SHIFT) +#define IAVF_RXD_QW1_STATUS_TSYNINDX_SHIFT IAVF_RX_DESC_STATUS_TSYNINDX_SHIFT +#define IAVF_RXD_QW1_STATUS_TSYNINDX_MASK (0x3UL << \ + IAVF_RXD_QW1_STATUS_TSYNINDX_SHIFT) -#define IAVF_RXD_QW1_STATUS_TSYNVALID_SHIFT IAVF_RX_DESC_STATUS_TSYNVALID_SHIFT +#define IAVF_RXD_QW1_STATUS_TSYNVALID_SHIFT IAVF_RX_DESC_STATUS_TSYNVALID_SHIFT#define IAVF_RXD_QW1_STATUS_TSYNVALID_MASK BIT_ULL(IAVF_RXD_QW1_STATUS_TSYNVALID_SHIFT)#define IAVF_RXD_QW1_STATUS_UMBCAST_SHIFT IAVF_RX_DESC_STATUS_UMBCAST
@@ -892,7 +892,8 @@ enum iavf_tx_ctx_desc_eipt_offload {#define IAVF_TXD_CTX_GRE_TUNNELING (0x2ULL << IAVF_TXD_CTX_QW0_NATT_SHIFT)#define IAVF_TXD_CTX_QW0_EIP_NOINC_SHIFT 11 -#define IAVF_TXD_CTX_QW0_EIP_NOINC_MASK BIT_ULL(IAVF_TXD_CTX_QW0_EIP_NOINC_SHIFT) +#define IAVF_TXD_CTX_QW0_EIP_NOINC_MASK \ + BIT_ULL(IAVF_TXD_CTX_QW0_EIP_NOINC_SHIFT)#define IAVF_TXD_CTX_EIP_NOINC_IPID_CONST IAVF_TXD_CTX_QW0_EIP_NOINC_MASK
Signature · 1 line
2.13.6
PATCH 10/17 net/iavf/base: increase max VSI count for VFs
In reply to Qi ZhangChange max VSI per VF from 3 to 4.
--- drivers/net/iavf/base/iavf_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/iavf/base/iavf_type.h +1 -1
@@ -30,7 +30,7 @@#define IAVF_MAX_PF_VSI 64#define IAVF_MAX_PF_QP 128#define IAVF_MAX_VSI_QP 16 -#define IAVF_MAX_VF_VSI 3 +#define IAVF_MAX_VF_VSI 4#define IAVF_MAX_CHAINED_RX_BUFFERS 5/* something less than 1 minute */
Signature · 1 line
2.13.6
PATCH 11/17 net/iavf/base: fix command buffer memory free
In reply to Qi ZhangAllocated resources were not freed in the event of failure in iavf_init_asq function. This patch gracefully handles all failures.
--- drivers/net/iavf/base/iavf_adminq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/iavf/base/iavf_adminq.c +6 -1
@@ -82,6 +82,7 @@ enum iavf_status iavf_alloc_adminq_arq_ring(struct iavf_hw *hw)**/ void iavf_free_adminq_asq (struct iavf_hw *hw) { +iavf_free_virt_mem (hw, &hw->aq.asq.cmd_buf);iavf_free_dma_mem (hw, &hw->aq.asq.desc_buf); }
@@ -353,7 +354,7 @@ enum iavf_status iavf_init_asq(struct iavf_hw *hw)/* initialize base registers */ ret_code =iavf_config_asq_regs (hw);if (ret_code !=IAVF_SUCCESS ) - goto init_adminq_free_rings; + goto init_config_regs;/* success! */ hw->aq.asq.count = hw->aq.num_asq_entries;
@@ -361,6 +362,10 @@ enum iavf_status iavf_init_asq(struct iavf_hw *hw) init_adminq_free_rings:iavf_free_adminq_asq (hw); +return ret_code; + +init_config_regs: +iavf_free_asq_bufs (hw); init_adminq_exit:return ret_code;
Signature · 1 line
2.13.6
PATCH 12/17 net/iavf/base: update FW API version for X722
In reply to Qi ZhangUpdate FW API version from 1.5 to 1.6 for X722
Also added NVM update related APIs.
--- drivers/net/iavf/base/iavf_adminq_cmd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/iavf/base/iavf_adminq_cmd.h +3 -1
@@ -12,7 +12,7 @@*/ #define IAVF_FW_API_VERSION_MAJOR 0x0001 -#define IAVF_FW_API_VERSION_MINOR_X722 0x0005 +#define IAVF_FW_API_VERSION_MINOR_X722 0x0006#define IAVF_FW_API_VERSION_MINOR_X710 0x0007#define IAVF_FW_MINOR_VERSION (_h) ((_h)->mac.type == IAVF_MAC_XL710 ? \
@@ -21,6 +21,8 @@/* API version 1.7 implements additional link and PHY-specific APIs */ #define IAVF_MINOR_VER_GET_LINK_INFO_XL710 0x0007 +/* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */ +#define IAVF_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006struct iavf_aq_desc {__le16 flags;
Signature · 1 line
2.13.6
PATCH 13/17 net/iavf/base: add more link speed support
In reply to Qi ZhangAdd 2.5G and 5G link speed support.
--- drivers/net/iavf/base/iavf_adminq_cmd.h | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/iavf/base/iavf_adminq_cmd.h +4 -0
@@ -471,17 +471,21 @@ struct iavf_aqc_get_veb_parameters_completion {IAVF_CHECK_CMD_LENGTH (iavf_aqc_get_veb_parameters_completion); +#define IAVF_LINK_SPEED_2_5GB_SHIFT 0x0#define IAVF_LINK_SPEED_100MB_SHIFT 0x1#define IAVF_LINK_SPEED_1000MB_SHIFT 0x2#define IAVF_LINK_SPEED_10GB_SHIFT 0x3#define IAVF_LINK_SPEED_40GB_SHIFT 0x4#define IAVF_LINK_SPEED_20GB_SHIFT 0x5#define IAVF_LINK_SPEED_25GB_SHIFT 0x6 +#define IAVF_LINK_SPEED_5GB_SHIFT 0x7enum iavf_aq_link_speed {IAVF_LINK_SPEED_UNKNOWN =0 ,IAVF_LINK_SPEED_100MB = (1 <<IAVF_LINK_SPEED_100MB_SHIFT ),IAVF_LINK_SPEED_1GB = (1 <<IAVF_LINK_SPEED_1000MB_SHIFT ), +IAVF_LINK_SPEED_2_5GB = (1 <<IAVF_LINK_SPEED_2_5GB_SHIFT ), +IAVF_LINK_SPEED_5GB = (1 <<IAVF_LINK_SPEED_5GB_SHIFT ),IAVF_LINK_SPEED_10GB = (1 <<IAVF_LINK_SPEED_10GB_SHIFT ),IAVF_LINK_SPEED_40GB = (1 <<IAVF_LINK_SPEED_40GB_SHIFT ),IAVF_LINK_SPEED_20GB = (1 <<IAVF_LINK_SPEED_20GB_SHIFT ),
Signature · 1 line
2.13.6
PATCH 14/17 net/iavf/base: update copyright date
In reply to Qi ZhangUpdate copyright date to cover 2019.
--- drivers/net/iavf/base/iavf_adminq.c | 2 +- drivers/net/iavf/base/iavf_adminq.h | 2 +- drivers/net/iavf/base/iavf_adminq_cmd.h | 2 +- drivers/net/iavf/base/iavf_alloc.h | 2 +- drivers/net/iavf/base/iavf_common.c | 3 +-- drivers/net/iavf/base/iavf_devids.h | 2 +- drivers/net/iavf/base/iavf_prototype.h | 2 +- drivers/net/iavf/base/iavf_register.h | 2 +- drivers/net/iavf/base/iavf_status.h | 2 +- drivers/net/iavf/base/iavf_type.h | 2 +- drivers/net/iavf/base/virtchnl.h | 2 +- 11 files changed, 11 insertions(+), 12 deletions(-)
drivers/net/iavf/base/iavf_adminq.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #include "iavf_status.h"
drivers/net/iavf/base/iavf_adminq.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #ifndef _IAVF_ADMINQ_H_
drivers/net/iavf/base/iavf_adminq_cmd.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #ifndef _IAVF_ADMINQ_CMD_H_
drivers/net/iavf/base/iavf_alloc.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #ifndef _IAVF_ALLOC_H_
drivers/net/iavf/base/iavf_common.c +1 -2
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #include "iavf_type.h"
@@ -7,7 +7,6 @@#include "iavf_prototype.h" #include "virtchnl.h" -/** * iavf_set_mac_type - Sets MAC type * @hw: pointer to the HW structure
drivers/net/iavf/base/iavf_devids.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #ifndef _IAVF_DEVIDS_H_
drivers/net/iavf/base/iavf_prototype.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #ifndef _IAVF_PROTOTYPE_H_
drivers/net/iavf/base/iavf_register.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #ifndef _IAVF_REGISTER_H_
drivers/net/iavf/base/iavf_status.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #ifndef _IAVF_STATUS_H_
drivers/net/iavf/base/iavf_type.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #ifndef _IAVF_TYPE_H_
drivers/net/iavf/base/virtchnl.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2013 - 2015 Intel Corporation +* Copyright(c) 2001-2019 */ #ifndef _VIRTCHNL_H_
Signature · 1 line
2.13.6
PATCH 15/17 net/iavf/base: fix send adminq return value
In reply to Qi ZhangWhen send a adminq, if get IAVF_AQ_RC_BUSY, we should return IAVF_ERR_NOT_READY.
--- drivers/net/iavf/base/iavf_adminq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/iavf/base/iavf_adminq.c +2 -0
@@ -803,6 +803,8 @@ enum iavf_status iavf_asq_send_command(struct iavf_hw *hw, cmd_completed = true;if ((enum iavf_admin_queue_err )retval ==IAVF_AQ_RC_OK ) status =IAVF_SUCCESS ; +else if ((enum iavf_admin_queue_err )retval ==IAVF_AQ_RC_EBUSY ) + status =IAVF_ERR_NOT_READY ;else status =IAVF_ERR_ADMIN_QUEUE_ERROR ; hw->aq.asq_last_status = (enum iavf_admin_queue_err )retval;
Signature · 1 line
2.13.6
Re: [dpdk-dev] [PATCH 15/17] net/iavf/base: fix send adminq return value
Quoted 11 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Qi Zhang
Sent: Tuesday, December 3, 2019 3:03 PM
To: Ye, Xiaolong <[email protected]>
Cc: Wang, Haiyue <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>; Stillwell Jr, Paul M <[email protected]>
Subject: [dpdk-dev] [PATCH 15/17]net/iavf/base: fix send adminq return value
Quoted 5 lines
When send a adminq, if get
IAVF_AQ_RC_BUSY, we should returnIAVF_ERR_NOT_READY.Fixes e5b2a9e957e7 ("net/avf/base: add base code for avf PMD")
Lack of CC stable
Quoted 25 lines
Signed-off-by Paul M Stillwell Jr <[email protected]>Signed-off-by Qi Zhang <[email protected]>--- drivers/net/iavf/base/iavf_adminq.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/iavf/base/iavf_adminq.c +2
-0@@ -803,6 +803,8 @@ enum iavf_status iavf_asq_send_command(structiavf_hw *hw, cmd_completed = true;if ((enum iavf_admin_queue_err )retval ==IAVF_AQ_RC_OK ) status =IAVF_SUCCESS ; +else if ((enum iavf_admin_queue_err )retval ==IAVF_AQ_RC_EBUSY ) + status =IAVF_ERR_NOT_READY ;else drivers/net/iavf/base/iavf_adminq.c +0
-0status =IAVF_ERR_ADMIN_QUEUE_ERROR ; hw->aq.asq_last_status = (enumiavf_admin_queue_err)retval;
--
2.13.6
PATCH 16/17 net/iavf: move device state flag
In reply to Qi ZhangMove device state flag from ice_hw to ice_adatper since it should not be a part of base code.
--- drivers/net/iavf/base/iavf_type.h | 1 - drivers/net/iavf/iavf.h | 1 + drivers/net/iavf/iavf_ethdev.c | 13 +++++-------- 3 files changed, 6 insertions(+), 9 deletions(-)
drivers/net/iavf/base/iavf_type.h +0 -1
@@ -332,7 +332,6 @@ struct iavf_hw {u16 subsystem_device_id;u16 subsystem_vendor_id;u8 revision_id; -bool adapter_stopped;/* capabilities for entire device and PCI func */ struct iavf_hw_capabilities dev_caps;
drivers/net/iavf/iavf.h +1 -0
@@ -127,6 +127,7 @@ struct iavf_adapter {/* For vector PMD */ bool rx_vec_allowed;bool tx_vec_allowed; +bool stopped; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +5 -8
@@ -421,12 +421,11 @@ iavf_dev_start(struct rte_eth_dev *dev)struct iavf_adapter *adapter =IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private);struct iavf_info *vf =IAVF_DEV_PRIVATE_TO_VF (dev->data->dev_private); -struct iavf_hw *hw =IAVF_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct rte_intr_handle *intr_handle = dev->intr_handle;PMD_INIT_FUNC_TRACE (); - hw->adapter_stopped =0 ; + adapter->stopped =0 ; vf->max_pkt_len = dev->data->dev_conf.rxmode.max_rx_pkt_len; vf->num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues,
@@ -481,12 +480,11 @@ iavf_dev_stop(struct rte_eth_dev *dev) {struct iavf_adapter *adapter =IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private); -struct iavf_hw *hw =IAVF_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct rte_intr_handle *intr_handle = dev->intr_handle;PMD_INIT_FUNC_TRACE (); -if (hw->adapter_stopped ==1 ) +if (adapter->stopped ==1 )return ;iavf_stop_queues (dev);
@@ -501,7 +499,7 @@ iavf_dev_stop(struct rte_eth_dev *dev)/* remove all mac addrs */ iavf_add_del_all_mac_addr (adapter, FALSE); - hw->adapter_stopped =1 ; + adapter->stopped =1 ; } static int
@@ -1333,6 +1331,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev) hw->hw_addr = (void *)pci_dev->mem_resource[0 ].addr; hw->back =IAVF_DEV_PRIVATE_TO_ADAPTER (eth_dev->data->dev_private); adapter->eth_dev = eth_dev; + adapter->stopped =1 ;if (iavf_init_vf (eth_dev) !=0 ) {PMD_INIT_LOG (ERR ,"Init vf failed" );
@@ -1393,7 +1392,6 @@ static int iavf_dev_uninit(struct rte_eth_dev *dev) {struct iavf_info *vf =IAVF_DEV_PRIVATE_TO_VF (dev->data->dev_private); -struct iavf_hw *hw =IAVF_DEV_PRIVATE_TO_HW (dev->data->dev_private);if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return -EPERM ;
@@ -1401,8 +1399,7 @@ iavf_dev_uninit(struct rte_eth_dev *dev) dev->dev_ops =NULL ; dev->rx_pkt_burst =NULL ; dev->tx_pkt_burst =NULL ; -if (hw->adapter_stopped ==0 ) -iavf_dev_close (dev); +iavf_dev_close (dev);rte_free (vf->vf_res); vf->vsi_res =NULL ;
Signature · 1 line
2.13.6
PATCH 17/17 net/ice/base: update version info
In reply to Qi ZhangUpdate base code version info in readme.
--- drivers/net/iavf/base/README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/iavf/base/README +2 -2
@@ -1,12 +1,12 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2017 Intel Corporation + * Copyright(c) 2019 Intel Corporation */ Intel® IAVF driver ================= This directory contains source code of FreeBSD IAVF driver of version -cid-avf.2018.01.02.tar.gz released by the team which develops +cid-avf.2019.08.19.tar.gz released by the team which develops basic drivers for any IAVF NIC. The directory of base/ contains the original source package.
Signature · 1 line
2.13.6
Quoted 56 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Qi Zhang
Sent: Tuesday, December 3, 2019 3:03 PM
To: Ye, Xiaolong <[email protected]>
Cc: Wang, Haiyue <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Subject: [dpdk-dev] [PATCH 00/17] iavf base code updateUpdate iavf base code to latest.
main changes
1) Add more supported device ID
2) update virtual channel to latest AVF spec.
3) code clean.
4) couple bug fixesQi Zhang (17):
net/iavf/base: remove unnecessary header filenet/iavf/base: rename error code enumnet/iavf/base: rename register macronet/iavf/base: update device idnet/iavf/base: remove unused codenet/iavf/base: remove unnecessary compile optionnet/iavf/base: rename functionsnet/iavf/base: update virtual channelnet/iavf/base: adjust code indentnet/iavf/base: increase max VSI count for VFsnet/iavf/base: fix command buffer memory freenet/iavf/base: update FW API version for X722net/iavf/base: add more link speed supportnet/iavf/base: update copyright datenet/iavf/base: fix send adminq return value net/iavf: move device state flagnet/ice/base: update version infodrivers/net/iavf/base/README | 4 +- drivers/net/iavf/base/iavf_adminq.c | 121 +- drivers/net/iavf/base/iavf_adminq.h | 45 +- drivers/net/iavf/base/iavf_adminq_cmd.h | 2354 ++----------------------------- drivers/net/iavf/base/iavf_alloc.h | 24 +- drivers/net/iavf/base/iavf_common.c | 879 +----------- drivers/net/iavf/base/iavf_devids.h | 7 +- drivers/net/iavf/base/iavf_hmc.h | 216 --- drivers/net/iavf/base/iavf_lan_hmc.h | 171 --- drivers/net/iavf/base/iavf_osdep.h | 2 +- drivers/net/iavf/base/iavf_prototype.h | 149 +- drivers/net/iavf/base/iavf_register.h | 390 ++--- drivers/net/iavf/base/iavf_status.h | 4 +- drivers/net/iavf/base/iavf_type.h | 1144 ++------------- drivers/net/iavf/base/virtchnl.h | 345 +++-- drivers/net/iavf/iavf.h | 1 + drivers/net/iavf/iavf_ethdev.c | 80 +- drivers/net/iavf/iavf_vchnl.c | 10 +- 18 files changed, 692 insertions(+), 5254 deletions(-) delete mode 100644
Quoted 5 lines
drivers/net/iavf/base/iavf_hmc.hdelete mode 100644drivers/net/iavf/base/iavf_lan_hmc.h--
2.13.6
Only one small comments for patch 15/17.
Quoted 59 lines · Qiming
Quoted 59 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Qi Zhang
Sent: Tuesday, December 3, 2019 3:03 PM
To: Ye, Xiaolong <[email protected]>
Cc: Wang, Haiyue <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Subject: [dpdk-dev] [PATCH 00/17] iavf base code updateUpdate iavf base code to latest.
main changes
1) Add more supported device ID
2) update virtual channel to latest AVF spec.
3) code clean.
4) couple bug fixesQi Zhang (17):
net/iavf/base: remove unnecessary header filenet/iavf/base: rename error code enumnet/iavf/base: rename register macronet/iavf/base: update device idnet/iavf/base: remove unused codenet/iavf/base: remove unnecessary compile optionnet/iavf/base: rename functionsnet/iavf/base: update virtual channelnet/iavf/base: adjust code indentnet/iavf/base: increase max VSI count for VFsnet/iavf/base: fix command buffer memory freenet/iavf/base: update FW API version for X722net/iavf/base: add more link speed supportnet/iavf/base: update copyright datenet/iavf/base: fix send adminq return value net/iavf: move device state flagnet/ice/base: update version infodrivers/net/iavf/base/README | 4 +- drivers/net/iavf/base/iavf_adminq.c | 121 +- drivers/net/iavf/base/iavf_adminq.h | 45 +- drivers/net/iavf/base/iavf_adminq_cmd.h | 2354 ++----------------------------- drivers/net/iavf/base/iavf_alloc.h | 24 +- drivers/net/iavf/base/iavf_common.c | 879 +----------- drivers/net/iavf/base/iavf_devids.h | 7 +- drivers/net/iavf/base/iavf_hmc.h | 216 --- drivers/net/iavf/base/iavf_lan_hmc.h | 171 --- drivers/net/iavf/base/iavf_osdep.h | 2 +- drivers/net/iavf/base/iavf_prototype.h | 149 +- drivers/net/iavf/base/iavf_register.h | 390 ++--- drivers/net/iavf/base/iavf_status.h | 4 +- drivers/net/iavf/base/iavf_type.h | 1144 ++------------- drivers/net/iavf/base/virtchnl.h | 345 +++-- drivers/net/iavf/iavf.h | 1 + drivers/net/iavf/iavf_ethdev.c | 80 +- drivers/net/iavf/iavf_vchnl.c | 10 +- 18 files changed, 692 insertions(+), 5254 deletions(-) delete mode 100644
drivers/net/iavf/base/iavf_hmc.hdelete mode 100644drivers/net/iavf/base/iavf_lan_hmc.h
Quoted 4 lines
Quoted 2 lines
--
2.13.6Only one small comments for patch 15/17.
Fixed it while merging.
Quoted 2 lines
Acked-by Qiming Yang <[email protected]>
Series applied to dpdk-next-net-intel, Thanks.