From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 16EFC1150 for ; Thu, 24 Jan 2019 01:54:08 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2019 16:54:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,513,1539673200"; d="scan'208";a="312962032" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 23 Jan 2019 16:54:07 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 23 Jan 2019 16:54:07 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 23 Jan 2019 16:54:07 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.63]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.224]) with mapi id 14.03.0415.000; Thu, 24 Jan 2019 08:54:05 +0800 From: "Lu, Wenzhuo" To: "Yang, Qiming" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] net/ice: add promiscuous mode support Thread-Index: AQHUssPWI++yVWv6VE+OHcyEquqphKW72+4AgAG8GGA= Date: Thu, 24 Jan 2019 00:54:04 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC0909407D6266@shsmsx102.ccr.corp.intel.com> References: <1548146542-69346-1-git-send-email-wenzhuo.lu@intel.com> <1548211021-77330-1-git-send-email-wenzhuo.lu@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 v2] net/ice: add promiscuous mode support 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: Thu, 24 Jan 2019 00:54:09 -0000 Hi Qiming, > -----Original Message----- > From: Yang, Qiming > Sent: Wednesday, January 23, 2019 2:21 PM > To: Lu, Wenzhuo ; dev@dpdk.org > Cc: Lu, Wenzhuo > Subject: RE: [dpdk-dev] [PATCH v2] net/ice: add promiscuous mode support >=20 > Hi, wenzhuo >=20 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > Sent: Wednesday, January 23, 2019 10:37 AM > To: dev@dpdk.org > Cc: Lu, Wenzhuo > Subject: [dpdk-dev] [PATCH v2] net/ice: add promiscuous mode support >=20 > Enable the APIs for unicast and multicast promiscuous mode setting. >=20 > Signed-off-by: Wenzhuo Lu > --- > doc/guides/nics/features/ice.ini | 2 + > doc/guides/nics/ice.rst | 14 ------- > drivers/net/ice/ice_ethdev.c | 86 > ++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 88 insertions(+), 14 deletions(-) >=20 > diff --git a/doc/guides/nics/features/ice.ini > b/doc/guides/nics/features/ice.ini > index 8b1e22e..5e6cb4b 100644 > --- a/doc/guides/nics/features/ice.ini > +++ b/doc/guides/nics/features/ice.ini > @@ -14,6 +14,8 @@ MTU update =3D Y > Jumbo frame =3D Y > Scattered Rx =3D Y > TSO =3D Y > +Promiscuous mode =3D Y > +Allmulticast mode =3D Y > Unicast MAC filter =3D Y > Multicast MAC filter =3D Y > RSS hash =3D Y > diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst index > 466af55..3998d5e 100644 > --- a/doc/guides/nics/ice.rst > +++ b/doc/guides/nics/ice.rst > @@ -88,17 +88,3 @@ Limitations or Known issues ~~~~~~~~~~~~~~~~ >=20 > Ice code released in 19.02 is for evaluation only. > - > - > -Promiscuous mode not supported > -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > -As promiscuous mode is not supported as this stage, a port can only rece= ive > the -packets which destination MAC address is this port's own. > - > - > -TX anti-spoofing cannot be disabled > -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > -TX anti-spoofing is enabled by default. At this stage it's not supported= to - > disable it. So any TX packet which source MAC address is not this port's = own > -will be dropped by HW. It means io-fwd is not supported now. Recommand > to use -MAC-fwd for evaluation. > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c = index > b145d9c..b450115 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -38,6 +38,10 @@ static int ice_rss_hash_update(struct rte_eth_dev > *dev, > struct rte_eth_rss_conf *rss_conf); static int > ice_rss_hash_conf_get(struct rte_eth_dev *dev, > struct rte_eth_rss_conf *rss_conf); > +static void ice_promisc_enable(struct rte_eth_dev *dev); static void > +ice_promisc_disable(struct rte_eth_dev *dev); static void > +ice_allmulti_enable(struct rte_eth_dev *dev); static void > +ice_allmulti_disable(struct rte_eth_dev *dev); > static int ice_vlan_filter_set(struct rte_eth_dev *dev, > uint16_t vlan_id, > int on); > @@ -103,6 +107,10 @@ static int ice_xstats_get_names(struct rte_eth_dev > *dev, > .reta_query =3D ice_rss_reta_query, > .rss_hash_update =3D ice_rss_hash_update, > .rss_hash_conf_get =3D ice_rss_hash_conf_get, > + .promiscuous_enable =3D ice_promisc_enable, > + .promiscuous_disable =3D ice_promisc_disable, > + .allmulticast_enable =3D ice_allmulti_enable, > + .allmulticast_disable =3D ice_allmulti_disable, > .rx_queue_intr_enable =3D ice_rx_queue_intr_enable, > .rx_queue_intr_disable =3D ice_rx_queue_intr_disable, > .fw_version_get =3D ice_fw_version_get, > @@ -1709,6 +1717,7 @@ static int ice_init_rss(struct ice_pf *pf) > struct rte_eth_dev_data *data =3D dev->data; > struct ice_hw *hw =3D ICE_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data- > >dev_private); > + struct ice_vsi *vsi =3D pf->main_vsi; > uint16_t nb_rxq =3D 0; > uint16_t nb_txq, i; > int ret; > @@ -1743,6 +1752,14 @@ static int ice_init_rss(struct ice_pf *pf) > if (ice_rxq_intr_setup(dev)) > return -EIO; >=20 > + /* Enable receiving broadcast packets and transmitting packets */ > + ret =3D ice_set_vsi_promisc(hw, vsi->idx, > + ICE_PROMISC_BCAST_RX | > ICE_PROMISC_BCAST_TX | > + ICE_PROMISC_UCAST_TX | > ICE_PROMISC_MCAST_TX, > + 0); > + if (ret !=3D ICE_SUCCESS) > + PMD_DRV_LOG(INFO, "fail to set vsi broadcast"); > + > ret =3D ice_aq_set_event_mask(hw, hw->port_info->lport, > ((u16)(ICE_AQ_LINK_EVENT_LINK_FAULT | > ICE_AQ_LINK_EVENT_PHY_TEMP_ALARM > | @@ -2556,6 +2573,75 @@ static int ice_macaddr_set(struct rte_eth_dev > *dev, > return 0; > } >=20 > +static void > +ice_promisc_enable(struct rte_eth_dev *dev) { >=20 > Should this '{' start on the next line? Interesting! I don't know what happened. I saw the same problem in the mail= . If you check the webpage, https://patches.dpdk.org/patch/50012/. It's good = and the same as the original patch. Could it be outlook that changes the context? TBH, I don't know.