From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 34BE6AA37 for ; Tue, 16 Feb 2016 01:43:42 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 15 Feb 2016 16:43:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,453,1449561600"; d="scan'208";a="746933629" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 15 Feb 2016 16:43:41 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 15 Feb 2016 16:43:41 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 15 Feb 2016 16:43:40 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.172]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.249]) with mapi id 14.03.0248.002; Tue, 16 Feb 2016 08:43:38 +0800 From: "Lu, Wenzhuo" To: "Kylulin, Yury" , "dev@dpdk.org" Thread-Topic: [PATCH v2] e1000: enable promiscuous and allmulticast support for VF Thread-Index: AQHRYxmxaLs04IhK+0Sy4ka5fS/uvJ8sVMAAgAAasoCAAW+14A== Date: Tue, 16 Feb 2016 00:43:38 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09090342ADB2@shsmsx102.ccr.corp.intel.com> References: <1432824407-11415-1-git-send-email-yury.kylulin@intel.com> <1455008984-16507-1-git-send-email-yury.kylulin@intel.com> <6A0DE07E22DDAD4C9103DF62FEBC09090342A855@shsmsx102.ccr.corp.intel.com> <9F1BD2E92971394E9841FDE5E0047403673B30A5@IRSMSX102.ger.corp.intel.com> In-Reply-To: <9F1BD2E92971394E9841FDE5E0047403673B30A5@IRSMSX102.ger.corp.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 v2] e1000: enable promiscuous and allmulticast support for VF 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: Tue, 16 Feb 2016 00:43:43 -0000 Hi Yury, Acked-by: Wenzhuo Lu > -----Original Message----- > From: Kylulin, Yury > Sent: Monday, February 15, 2016 6:45 PM > To: Lu, Wenzhuo; dev@dpdk.org > Subject: RE: [PATCH v2] e1000: enable promiscuous and allmulticast suppor= t for > VF >=20 > Hi Wenzhuo, >=20 > > -----Original Message----- > > From: Lu, Wenzhuo > > Sent: Monday, February 15, 2016 4:14 AM > > To: Kylulin, Yury ; dev@dpdk.org > > Subject: RE: [PATCH v2] e1000: enable promiscuous and allmulticast > > support for VF > > > > Hi Yury, > > > > > -----Original Message----- > > > From: Kylulin, Yury > > > Sent: Tuesday, February 9, 2016 5:10 PM > > > To: dev@dpdk.org > > > Cc: Kylulin, Yury; Lu, Wenzhuo > > > Subject: [PATCH v2] e1000: enable promiscuous and allmulticast > > > support for VF > > > > > > Enable promiscuous and allmulticast mode control from the VF using > > > rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() and > > > rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable(). > > > > > > For promiscuous mode host/PF igb driver should be built with > > > IGB_ENABLE_VF_PROMISC. > > > > > > For allmulticast mode "allmulti" flag should be set for appropriate > > > PF ifconfig > > > eth0 allmulti > > > > > > Signed-off-by: Yury Kylulin > > > --- > > > v2 > > > * Added promiscuous mode control > > > * Switching logic is the same like in igb PF driver > > > > > > drivers/net/e1000/igb_ethdev.c | 49 > > > ++++++++++++++++++++++++++++++++++++++++ > > > 1 file changed, 49 insertions(+) > > > > > > diff --git a/drivers/net/e1000/igb_ethdev.c > > > b/drivers/net/e1000/igb_ethdev.c index d1bbcda..677f9a2 100644 > > > --- a/drivers/net/e1000/igb_ethdev.c > > > +++ b/drivers/net/e1000/igb_ethdev.c > > > @@ -152,6 +152,10 @@ static int igbvf_dev_configure(struct > > > rte_eth_dev *dev); static int igbvf_dev_start(struct rte_eth_dev > > > *dev); static void igbvf_dev_stop(struct rte_eth_dev *dev); static > > > void igbvf_dev_close(struct rte_eth_dev *dev); > > > +static void igbvf_promiscuous_enable(struct rte_eth_dev *dev); > > > +static void igbvf_promiscuous_disable(struct rte_eth_dev *dev); > > > +static void igbvf_allmulticast_enable(struct rte_eth_dev *dev); > > > +static void igbvf_allmulticast_disable(struct rte_eth_dev *dev); > > > static int eth_igbvf_link_update(struct e1000_hw *hw); static void > > > eth_igbvf_stats_get(struct rte_eth_dev *dev, > > > struct rte_eth_stats *rte_stats); @@ -369,6 > > +373,10 @@ static > > > const struct eth_dev_ops igbvf_eth_dev_ops =3D { > > > .dev_start =3D igbvf_dev_start, > > > .dev_stop =3D igbvf_dev_stop, > > > .dev_close =3D igbvf_dev_close, > > > + .promiscuous_enable =3D igbvf_promiscuous_enable, > > > + .promiscuous_disable =3D igbvf_promiscuous_disable, > > > + .allmulticast_enable =3D igbvf_allmulticast_enable, > > > + .allmulticast_disable =3D igbvf_allmulticast_disable, > > > .link_update =3D eth_igb_link_update, > > > .stats_get =3D eth_igbvf_stats_get, > > > .xstats_get =3D eth_igbvf_xstats_get, > > > @@ -2829,6 +2837,47 @@ igbvf_dev_close(struct rte_eth_dev *dev) > > > igb_dev_free_queues(dev); > > > } > > > > > > +static void > > > +igbvf_promiscuous_enable(struct rte_eth_dev *dev) { > > > + struct e1000_hw *hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data- > > > >dev_private); > > > + > > > + /* Set both unicast and multicast promisc */ > > > + e1000_promisc_set_vf(hw, e1000_promisc_enabled); } > > > + > > > +static void > > > +igbvf_promiscuous_disable(struct rte_eth_dev *dev) { > > > + struct e1000_hw *hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data- > > > >dev_private); > > > + > > > + /* If in allmulticast mode leave multicast promisc */ > > > + if (dev->data->all_multicast =3D=3D 1) > > > + e1000_promisc_set_vf(hw, e1000_promisc_multicast); > > > + else > > > + e1000_promisc_set_vf(hw, e1000_promisc_disabled); } > > > + > > > +static void > > > +igbvf_allmulticast_enable(struct rte_eth_dev *dev) { > > > + struct e1000_hw *hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data- > > > >dev_private); > > > + > > > + /* In promiscuous mode multicast promisc already set */ > > > + if (dev->data->promiscuous =3D=3D 0) > > > + e1000_promisc_set_vf(hw, e1000_promisc_multicast); } > > Comparing with PF, I think PF will enable multicast promiscuous mode > > no matter dev->data->promiscuous is 0 or not. > > Should the VF have the same behavior? > In case of PF to alter these settings you need to change the value of the= register, > but for VF we need to send message via mailbox. Assuming that in promiscu= ous > mode we already set both allmulticast and unicast promiscuous I tried to > exclude and avoid useless messages via mailbox between PF and VF. Thanks for the explanation. I think you're right:) > > > > > + > > > +static void > > > +igbvf_allmulticast_disable(struct rte_eth_dev *dev) { > > > + struct e1000_hw *hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data- > > > >dev_private); > > > + > > > + /* In promiscuous mode leave multicast promisc enabled */ > > > + if (dev->data->promiscuous =3D=3D 0) > > > + e1000_promisc_set_vf(hw, e1000_promisc_disabled); } > > > + > > > static int igbvf_set_vfta(struct e1000_hw *hw, uint16_t vid, bool on= ) { > > > struct e1000_mbx_info *mbx =3D &hw->mbx; > > > -- > > > 1.7.9.5