From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 5F6921B123; Wed, 13 Feb 2019 04:41:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2019 19:41:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,364,1544515200"; d="scan'208";a="274627250" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 12 Feb 2019 19:41:48 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 12 Feb 2019 19:41:48 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 12 Feb 2019 19:41:47 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.194]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.232]) with mapi id 14.03.0415.000; Wed, 13 Feb 2019 11:41:46 +0800 From: "Zhang, Qi Z" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "stable@dpdk.org" , "Lu, Wenzhuo" Thread-Topic: [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF host Thread-Index: AQHUrVw7j/VOWFj/R0eHg9PbupJsMKXdP7Dg Date: Wed, 13 Feb 2019 03:41:45 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153333BE7@SHSMSX103.ccr.corp.intel.com> References: <1547613775-58027-1-git-send-email-wei.zhao1@intel.com> <1547614920-59680-1-git-send-email-wei.zhao1@intel.com> <1547614920-59680-3-git-send-email-wei.zhao1@intel.com> In-Reply-To: <1547614920-59680-3-git-send-email-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDE4ZTVlNjMtOTdhZi00MjcwLWJkNjctOTU2NzE0N2RkZWMwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZlA4RDFzRVBmQmJnaHZ1ZnRYTXlqNkZDWTkzcXVcL3BsVXdWN1g4OW5xWEd5MWRqTXNcL1FGZjdxQWN0dTNSUlJIIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action 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 v2 2/3] net/ixgbe: enable promiscuous mode on PF host 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: , X-List-Received-Date: Wed, 13 Feb 2019 03:41:51 -0000 > -----Original Message----- > From: Zhao1, Wei > Sent: Wednesday, January 16, 2019 1:02 PM > To: dev@dpdk.org > Cc: stable@dpdk.org; Lu, Wenzhuo ; Zhang, Qi Z > ; Zhao1, Wei > Subject: [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF host >=20 The title is misleading, we are going to support VF's promiscuous mode but = not PF. How about "Add VF promiscuous mode support when PF as host" > There is need to PF host promiscuous mode enable. For ixgbe, in order to > support VF vlan promiscuous or unicast promiscuous, we need to set PF hos= t > register PFVML2FLT of bit UPE and VPE. > It also align to ixgbe kernel code version 5.5.3. >=20 > Fixes: 72dec9e37a84 ("ixgbe: support multicast promiscuous mode on VF") Same to previous patch, not a fix. >=20 > Signed-off-by: Wei Zhao > --- > drivers/net/ixgbe/ixgbe_ethdev.h | 1 + > drivers/net/ixgbe/ixgbe_pf.c | 78 > ++++++++++++++++++++++++++++------------ > 2 files changed, 57 insertions(+), 22 deletions(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h > b/drivers/net/ixgbe/ixgbe_ethdev.h > index d0b9396..e81f152 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.h > +++ b/drivers/net/ixgbe/ixgbe_ethdev.h > @@ -265,6 +265,7 @@ struct ixgbe_vf_info { > uint8_t spoofchk_enabled; > uint8_t api_version; > uint16_t switch_domain_id; > + uint16_t xcast_mode; > }; >=20 > /* > diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c = index > 4b833ff..c9d1a1c 100644 > --- a/drivers/net/ixgbe/ixgbe_pf.c > +++ b/drivers/net/ixgbe/ixgbe_pf.c > @@ -408,23 +408,6 @@ ixgbe_vf_reset_msg(struct rte_eth_dev *dev, uint16_t > vf) } >=20 > static int > -ixgbe_enable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf) -{ > - struct ixgbe_hw *hw =3D > IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > - uint32_t vmolr; > - > - vmolr =3D IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); > - > - RTE_LOG(INFO, PMD, "VF %u: enabling multicast promiscuous\n", vf); > - > - vmolr |=3D IXGBE_VMOLR_MPE; > - > - IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr); > - > - return 0; > -} > - > -static int > ixgbe_disable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf) { > struct ixgbe_hw *hw =3D > IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > @@ -688,19 +671,70 @@ ixgbe_set_vf_mc_promisc(struct rte_eth_dev *dev, > uint32_t vf, uint32_t *msgbuf) { > struct ixgbe_vf_info *vfinfo =3D > *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); > - bool enable =3D !!msgbuf[1]; /* msgbuf contains the flag to enable */ > + struct ixgbe_hw *hw =3D > IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + int xcast_mode =3D msgbuf[1]; /* msgbuf contains the flag to enable */ > + u32 vmolr, fctrl, disable, enable; >=20 > switch (vfinfo[vf].api_version) { > case ixgbe_mbox_api_12: > + /* promisc introduced in 1.3 version */ > + if (xcast_mode =3D=3D IXGBEVF_XCAST_MODE_PROMISC) > + return -EOPNOTSUPP; > + break; > + /* Fall threw */ > + case ixgbe_mbox_api_13: > break; > default: > return -1; > } >=20 > - if (enable) > - return ixgbe_enable_vf_mc_promisc(dev, vf); > - else > - return ixgbe_disable_vf_mc_promisc(dev, vf); > + if (vfinfo[vf].xcast_mode =3D=3D xcast_mode) > + goto out; > + > + switch (xcast_mode) { > + case IXGBEVF_XCAST_MODE_NONE: > + disable =3D IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | > + IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | > IXGBE_VMOLR_VPE; > + enable =3D 0; > + break; > + case IXGBEVF_XCAST_MODE_MULTI: > + disable =3D IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | > IXGBE_VMOLR_VPE; > + enable =3D IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE; > + break; > + case IXGBEVF_XCAST_MODE_ALLMULTI: > + disable =3D IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE; > + enable =3D IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | > IXGBE_VMOLR_MPE; > + break; > + case IXGBEVF_XCAST_MODE_PROMISC: > + if (hw->mac.type <=3D ixgbe_mac_82599EB) > + return -1; > + > + fctrl =3D IXGBE_READ_REG(hw, IXGBE_FCTRL); > + if (!(fctrl & IXGBE_FCTRL_UPE)) { > + /* VF promisc requires PF in promisc */ > + RTE_LOG(ERR, PMD, > + "Enabling VF promisc requires PF in promisc\n"); > + return -1; > + } > + > + disable =3D 0; > + enable =3D IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | > + IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | > IXGBE_VMOLR_VPE; > + break; > + default: > + return -1; > + } > + > + vmolr =3D IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); > + vmolr &=3D ~disable; > + vmolr |=3D enable; > + IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr); > + vfinfo[vf].xcast_mode =3D xcast_mode; > + > +out: > + msgbuf[1] =3D xcast_mode; > + > + return 0; > } >=20 > static int > -- > 2.7.5