From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B1883A00C5; Fri, 8 May 2020 10:19:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4A9061DB24; Fri, 8 May 2020 10:19:13 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 058321DB21 for ; Fri, 8 May 2020 10:19:11 +0200 (CEST) IronPort-SDR: Zw8jeuYVAN/djujCfxkKCHngneKd46s3v7v95cCmBZQK7wmtW60Is1N5nOlzcXRgIsrjuCvhk2 vg5y0Msc/KiQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 01:19:10 -0700 IronPort-SDR: LAosuf02g6FuhGCXE/+kVEdi7ubHxC+QN0YZl34FFOt+XitQk67DwR+C9MIfA7CKqtOqBrUcdP BR9dF8b7Ja3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="370377626" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 08 May 2020 01:19:10 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 8 May 2020 01:19:10 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 8 May 2020 01:19:09 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.225]) by shsmsx102.ccr.corp.intel.com ([169.254.2.38]) with mapi id 14.03.0439.000; Fri, 8 May 2020 16:19:07 +0800 From: "Sun, GuinanX" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Yang, Qiming" , "Guo, Jia" Thread-Topic: [dpdk-dev] [PATCH v3] net/ixgbe: add support for VF MAC address add and remove Thread-Index: AQHVugoKCDs1D6psCUSexxpRCOENy6ielO+wgAAN9IA= Date: Fri, 8 May 2020 08:19:06 +0000 Message-ID: <05758BDAD7FC8E4BAED63D0390A8A955847821@SHSMSX101.ccr.corp.intel.com> References: <20191203145457.72154-1-guinanx.sun@intel.com> <20191224032357.3317-1-guinanx.sun@intel.com> In-Reply-To: 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 v3] net/ixgbe: add support for VF MAC address add and remove X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi zhaowei > -----Original Message----- > From: Zhao1, Wei > Sent: Friday, May 8, 2020 2:58 PM > To: Sun, GuinanX ; dev@dpdk.org > Cc: Lu, Wenzhuo ; Yang, Qiming > ; Sun, GuinanX ; Guo, Jia > > Subject: RE: [dpdk-dev] [PATCH v3] net/ixgbe: add support for VF MAC addr= ess > add and remove >=20 > Hi, Guinan >=20 > There is a bug for this patch: > The second input parameter of function hw->mac.ops.set_rar() should be in= dex > of MAC address register IXGBE_RAL/H. > This index should be management by pf host for all the vf, not only index= for one > vf, or vf1 maybe overwrite this MAC address of vf0. > Although this patch has been merged, please commit fix patch for it. >=20 I will double check for this function. Thank you very much. >=20 > > -----Original Message----- > > From: dev On Behalf Of Guinan Sun > > Sent: Tuesday, December 24, 2019 11:24 AM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo ; Yang, Qiming > > ; Sun, GuinanX > > Subject: [dpdk-dev] [PATCH v3] net/ixgbe: add support for VF MAC > > address add and remove > > > > Ixgbe PMD pf host code needs to support ixgbevf mac address add and rem= ove. > > For this purpose, a response was added between pf and vf to update the > > mac address. > > > > Signed-off-by: Guinan Sun > > --- > > v3: > > * Changed from `RTE_LOG` to `PMD_DRV_LOG`. > > v2: > > * Changed the title of commit message. > > * Checked null in front of valid ether addr check. > > --- > > drivers/net/ixgbe/ixgbe_ethdev.h | 1 + > > drivers/net/ixgbe/ixgbe_pf.c | 35 > > ++++++++++++++++++++++++++++++++ > > 2 files changed, 36 insertions(+) > > > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h > > b/drivers/net/ixgbe/ixgbe_ethdev.h > > index 76a1b9d18..e1cd8fd16 100644 > > --- a/drivers/net/ixgbe/ixgbe_ethdev.h > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.h > > @@ -270,6 +270,7 @@ struct ixgbe_vf_info { uint8_t api_version; > > uint16_t switch_domain_id; uint16_t xcast_mode; > > +uint16_t mac_count; > > }; > > > > /* > > diff --git a/drivers/net/ixgbe/ixgbe_pf.c > > b/drivers/net/ixgbe/ixgbe_pf.c index > > d0d85e138..c93c0fdc2 100644 > > --- a/drivers/net/ixgbe/ixgbe_pf.c > > +++ b/drivers/net/ixgbe/ixgbe_pf.c > > @@ -748,6 +748,37 @@ ixgbe_set_vf_mc_promisc(struct rte_eth_dev *dev, > > uint32_t vf, uint32_t *msgbuf) return 0; } > > > > +static int > > +ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, > > +uint32_t > > +*msgbuf) { > > +struct ixgbe_hw *hw =3D > > IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > +struct ixgbe_vf_info *vf_info =3D > > +*(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); > > +uint8_t *new_mac =3D (uint8_t *)(&msgbuf[1]); int index =3D (msgbuf[0]= & > > +IXGBE_VT_MSGINFO_MASK) >> > > + IXGBE_VT_MSGINFO_SHIFT; > > + > > +if (index) { > > +if (new_mac =3D=3D NULL) > > +return -1; > > + > > +if (!rte_is_valid_assigned_ether_addr( > > +(struct rte_ether_addr *)new_mac)) { > > +PMD_DRV_LOG(ERR, "set invalid mac vf:%d\n", vf); return -1; } > > + > > +vf_info[vf].mac_count++; > > + > > +hw->mac.ops.set_rar(hw, vf_info[vf].mac_count, > > +new_mac, vf, IXGBE_RAH_AV); > > +} else { > > +hw->mac.ops.clear_rar(hw, vf_info[vf].mac_count); > > +vf_info[vf].mac_count =3D 0; > > +} > > +return 0; > > +} > > + > > static int > > ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) { @@ > > -835,6 > > +866,10 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) > > if (retval =3D=3D RTE_PMD_IXGBE_MB_EVENT_PROCEED) retval =3D > > ixgbe_set_vf_mc_promisc(dev, vf, msgbuf); break; > > +case IXGBE_VF_SET_MACVLAN: > > +if (retval =3D=3D RTE_PMD_IXGBE_MB_EVENT_PROCEED) retval =3D > > +ixgbe_set_vf_macvlan_msg(dev, vf, msgbuf); break; > > default: > > PMD_DRV_LOG(DEBUG, "Unhandled Msg %8.8x", (unsigned)msgbuf[0]); > > retval =3D IXGBE_ERR_MBX; > > -- > > 2.17.1 >=20