From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6AA942A66 for ; Mon, 30 Nov 2015 06:17:07 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 29 Nov 2015 21:17:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,363,1444719600"; d="scan'208";a="696411087" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 29 Nov 2015 21:17:06 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 29 Nov 2015 21:17:05 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 29 Nov 2015 21:17:05 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.223]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.138]) with mapi id 14.03.0248.002; Mon, 30 Nov 2015 13:17:03 +0800 From: "Zhang, Helin" To: "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [PATCH] i40evf: fix mac deletion when stop dev Thread-Index: AQHRKyLS745ESkCfdEiXMHubyJQ2cJ60BdYg Date: Mon, 30 Nov 2015 05:17:03 +0000 Message-ID: References: <1448855649-24658-1-git-send-email-jingjing.wu@intel.com> In-Reply-To: <1448855649-24658-1-git-send-email-jingjing.wu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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 05:17:07 -0000 > -----Original Message----- > From: Wu, Jingjing > Sent: Monday, November 30, 2015 11:54 AM > To: dev@dpdk.org > Cc: Wu, Jingjing; Zhang, Helin; Pei, Yulong > Subject: [PATCH] i40evf: fix mac deletion when stop dev >=20 > 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 exi= sts in > VEB switch. > To stop the traffic from VSI level, the mac address need to be removed to= o. > Then the bandwidth for this SRIOV VSI can be freed. > This patch fix this issue. >=20 > Fixes: 4861cde46116 ("i40e: new poll mode driver") >=20 > Signed-off-by: Jingjing Wu > --- > drivers/net/i40e/i40e_ethdev_vf.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > 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 =3D I40E_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > struct rte_intr_handle *intr_handle =3D &dev->pci_dev->intr_handle; > + struct ether_addr mac_addr; >=20 > PMD_INIT_FUNC_TRACE(); >=20 > @@ -1892,6 +1894,11 @@ i40evf_dev_stop(struct rte_eth_dev *dev) > rte_free(intr_handle->intr_vec); > intr_handle->intr_vec =3D NULL; > } > + /* Set mac addr */ > + (void)rte_memcpy(mac_addr.addr_bytes, hw->mac.addr, > + sizeof(mac_addr.addr_bytes)); Use ether_addr_copy() instead. /Helin > + /* Delete mac addr of this vf */ > + i40evf_del_mac_addr(dev, &mac_addr); > } >=20 > static int > -- > 2.4.0