From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] net/i40e: no more initial VF MAC address Date: Fri, 20 Jan 2017 17:39:06 +0000 Message-ID: References: <1484703940-2967-1-git-send-email-qi.z.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org To: Qi Zhang , jingjing.wu@intel.com, helin.zhang@intel.com Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 963B02B83 for ; Fri, 20 Jan 2017 18:39:09 +0100 (CET) In-Reply-To: <1484703940-2967-1-git-send-email-qi.z.zhang@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/18/2017 1:45 AM, Qi Zhang wrote: > During PF initialization, PF will generate an initial mac > address for VFs, the purpose is to help VF keep a constant > mac address between startup/shutdown cycles. I believe below does not provide permanent MAC address, PF assign a random mac address to its VFs on each PF initialization. > Now this is not > necessary, since we already provide an API to set VF mac > address from PF side (rte_pmd_i40e_set_vf_addr). rte_pmd_i40e_set_vf_mac_addr? > Application > can use this API to lock down VF's mac address. As far as I can see how it was (before this patch): 1- During PF init, assign random MAC to VFs. 2- Application can overwrite VF MAC address with above API. 3- During VF init, if there is a valid MAC assigned by PF use it. 4- During VF init, if PF not assigned MAC, assign a random one. So this patch removes above step 1. Overall even if application will explicitly assign a MAC to VF or not, VF will have a valid MAC address. So patch looks good, just please reword commit log to describe above. > This change also sync DPDK PF's behavior with kernel driver. > > Signed-off-by: Qi Zhang > --- > drivers/net/i40e/i40e_pf.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c > index ddfc140..4e05dca 100644 > --- a/drivers/net/i40e/i40e_pf.c > +++ b/drivers/net/i40e/i40e_pf.c > @@ -1053,7 +1053,6 @@ i40e_pf_host_init(struct rte_eth_dev *dev) > ret = i40e_pf_host_vf_reset(&pf->vfs[i], 0); > if (ret != I40E_SUCCESS) > goto fail; > - eth_random_addr(pf->vfs[i].mac_addr.addr_bytes); > } > > /* restore irq0 */ >