From: Helin Zhang Date: Thu, 30 Apr 2015 15:03:23 +0000 (+0800) Subject: i40e/base: skip some hardware init for VF X-Git-Tag: spdx-start~9216 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c0273b42705c358ace52eee2935179a7193e1052;p=dpdk.git i40e/base: skip some hardware init for VF This patch is useful for future expansion when new VF MAC types get added. It also helps with cleaning up VF driver flow. Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html Signed-off-by: Helin Zhang Acked-by: Jijiang Liu Tested-by: Min Cao --- diff --git a/lib/librte_pmd_i40e/i40e/i40e_adminq.c b/lib/librte_pmd_i40e/i40e/i40e_adminq.c index bbc6b65b18..e76e0aff8f 100644 --- a/lib/librte_pmd_i40e/i40e/i40e_adminq.c +++ b/lib/librte_pmd_i40e/i40e/i40e_adminq.c @@ -58,7 +58,7 @@ STATIC INLINE bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc) STATIC void i40e_adminq_init_regs(struct i40e_hw *hw) { /* set head and tail registers in our local struct */ - if (hw->mac.type == I40E_MAC_VF) { + if (i40e_is_vf(hw)) { hw->aq.asq.tail = I40E_VF_ATQT1; hw->aq.asq.head = I40E_VF_ATQH1; hw->aq.asq.len = I40E_VF_ATQLEN1; @@ -594,6 +594,11 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) goto init_adminq_free_asq; #ifdef PF_DRIVER +#ifdef INTEGRATED_VF + /* VF has no need of firmware */ + if (i40e_is_vf(hw)) + goto init_adminq_exit; +#endif /* There are some cases where the firmware may not be quite ready * for AdminQ operations, so we retry the AdminQ setup a few times * if we see timeouts in this first AQ call. diff --git a/lib/librte_pmd_i40e/i40e/i40e_type.h b/lib/librte_pmd_i40e/i40e/i40e_type.h index 7d9da30419..916f79af1d 100644 --- a/lib/librte_pmd_i40e/i40e/i40e_type.h +++ b/lib/librte_pmd_i40e/i40e/i40e_type.h @@ -555,6 +555,11 @@ struct i40e_hw { u32 debug_mask; }; +static inline bool i40e_is_vf(struct i40e_hw *hw) +{ + return hw->mac.type == I40E_MAC_VF; +} + struct i40e_driver_version { u8 major_version; u8 minor_version;