From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id AAE2B1DB1 for ; Mon, 30 Nov 2015 04:54:29 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 29 Nov 2015 19:54:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,363,1444719600"; d="scan'208";a="830566332" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 29 Nov 2015 19:54:16 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id tAU3sDOq021500; Mon, 30 Nov 2015 11:54:14 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tAU3sA56024751; Mon, 30 Nov 2015 11:54:12 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id tAU3sAX4024747; Mon, 30 Nov 2015 11:54:10 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Mon, 30 Nov 2015 11:54:09 +0800 Message-Id: <1448855649-24658-1-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2015 03:54:30 -0000 When dev_stop is called in i40evf pmd driver, queues are switched off to stop receiving and transmitting. But the mac address of this VF still exists in VEB switch. To stop the traffic from VSI level, the mac address need to be removed too. Then the bandwidth for this SRIOV VSI can be freed. This patch fix this issue. Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Jingjing Wu --- drivers/net/i40e/i40e_ethdev_vf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 5c554f2..14d2a50 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1878,7 +1878,9 @@ err_queue: static void i40evf_dev_stop(struct rte_eth_dev *dev) { + struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle; + struct ether_addr mac_addr; PMD_INIT_FUNC_TRACE(); @@ -1892,6 +1894,11 @@ i40evf_dev_stop(struct rte_eth_dev *dev) rte_free(intr_handle->intr_vec); intr_handle->intr_vec = NULL; } + /* Set mac addr */ + (void)rte_memcpy(mac_addr.addr_bytes, hw->mac.addr, + sizeof(mac_addr.addr_bytes)); + /* Delete mac addr of this vf */ + i40evf_del_mac_addr(dev, &mac_addr); } static int -- 2.4.0