From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 10BBE56B7 for ; Mon, 15 Feb 2016 09:09:46 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 15 Feb 2016 00:09:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,449,1449561600"; d="scan'208";a="902754633" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2016 00:09:45 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 15 Feb 2016 00:09:45 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.249]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.84]) with mapi id 14.03.0248.002; Mon, 15 Feb 2016 16:09:44 +0800 From: "Wang, Xiao W" To: "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] ixgbe: support multicast promiscuous mode on VF Thread-Index: AQHRZvB1e81EZF56p0SMEC8tTVVmt58svQGg Date: Mon, 15 Feb 2016 08:09:42 +0000 Message-ID: References: <1451894836-27569-1-git-send-email-wenzhuo.lu@intel.com> <1455431087-27509-1-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1455431087-27509-1-git-send-email-wenzhuo.lu@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] ixgbe: support multicast promiscuous mode on 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: Mon, 15 Feb 2016 08:09:47 -0000 Hi, Best Regards, Wang, Xiao > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > Sent: Sunday, February 14, 2016 2:25 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v2] ixgbe: support multicast promiscuous mode = on > VF >=20 > Add multicast promiscuous mode support on ixgbe VF driver. >=20 > Please note if we want to use this promiscuous mode, we need both PF and = VF > driver to support it. The reason is this VF feature is configged on PF. > If use kernel PF driver + dpdk VF driver, make sure kernel PF driver supp= ort VF > multicast promiscuous mode. If use dpdk PF + dpdk VF, better make sure PF > driver is the same version as VF. >=20 > V2: > Update release note. Maybe it's better to put change log below the "---" >=20 > Signed-off-by: Wenzhuo Lu > Acked-by: Shaopeng He > --- > doc/guides/rel_notes/release_16_04.rst | 11 ++++++ > drivers/net/ixgbe/base/ixgbe_mbx.h | 4 +++ > drivers/net/ixgbe/ixgbe_ethdev.c | 66 > ++++++++++++++++++++++++++++++++++ > drivers/net/ixgbe/ixgbe_pf.c | 65 > +++++++++++++++++++++++++++++++++ > 4 files changed, 146 insertions(+) >=20 > diff --git a/doc/guides/rel_notes/release_16_04.rst > b/doc/guides/rel_notes/release_16_04.rst > index 27fc624..e71d316 100644 > --- a/doc/guides/rel_notes/release_16_04.rst > +++ b/doc/guides/rel_notes/release_16_04.rst > @@ -39,6 +39,17 @@ This section should contain new features added in this > release. Sample format: >=20 > Enabled virtio 1.0 support for virtio pmd driver. >=20 > +* **Added multicast promiscuous mode support on VF for ixgbe.** > + > + Added multicast promiscuous mode support on ixgbe VF driver. So all > + the VFs can receive the multicast packets. > + > + Please note if we want to use this promiscuous mode, we need both PF > + and VF driver to support it. The reason is this VF feature is configge= d on PF. > + If use kernel PF driver + dpdk VF driver, make sure kernel PF driver > + support VF multicast promiscuous mode. If use dpdk PF + dpdk VF, > + better make sure PF driver is the same version as VF. > + >=20 > Resolved Issues > --------------- > diff --git a/drivers/net/ixgbe/base/ixgbe_mbx.h > b/drivers/net/ixgbe/base/ixgbe_mbx.h > index 445df10..4a120a3 100644 > --- a/drivers/net/ixgbe/base/ixgbe_mbx.h > +++ b/drivers/net/ixgbe/base/ixgbe_mbx.h > @@ -89,6 +89,7 @@ enum ixgbe_pfvf_api_rev { > ixgbe_mbox_api_10, /* API version 1.0, linux/freebsd VF driver */ > ixgbe_mbox_api_20, /* API version 2.0, solaris Phase1 VF driver */ > ixgbe_mbox_api_11, /* API version 1.1, linux/freebsd VF driver */ > + ixgbe_mbox_api_12, /* API version 1.2, linux/freebsd VF driver */ > /* This value should always be last */ > ixgbe_mbox_api_unknown, /* indicates that API version is not > known */ > }; > @@ -107,6 +108,9 @@ enum ixgbe_pfvf_api_rev { > /* mailbox API, version 1.1 VF requests */ > #define IXGBE_VF_GET_QUEUES 0x09 /* get queue configuration */ >=20 > +/* mailbox API, version 1.2 VF requests */ > +#define IXGBE_VF_UPDATE_XCAST_MODE 0x0C > + > /* GET_QUEUES return data indices within the mailbox */ > #define IXGBE_VF_TX_QUEUES 1 /* number of Tx queues supported */ > #define IXGBE_VF_RX_QUEUES 2 /* number of Rx queues supported */ > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > b/drivers/net/ixgbe/ixgbe_ethdev.c > index 3e6fe86..82ba755 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -138,6 +138,12 @@ >=20 > #define IXGBE_CYCLECOUNTER_MASK 0xffffffffffffffffULL >=20 > +enum ixgbevf_xcast_modes { > + IXGBEVF_XCAST_MODE_NONE =3D 0, > + IXGBEVF_XCAST_MODE_MULTI, > + IXGBEVF_XCAST_MODE_ALLMULTI, > +}; > + > static int eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev); static int > eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev); static int > ixgbe_dev_configure(struct rte_eth_dev *dev); @@ -237,6 +243,8 @@ static > int ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, static vo= id > ixgbevf_set_ivar_map(struct ixgbe_hw *hw, int8_t direction, > uint8_t queue, uint8_t msix_vector); static > void ixgbevf_configure_msix(struct rte_eth_dev *dev); > +static void ixgbevf_dev_allmulticast_enable(struct rte_eth_dev *dev); > +static void ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev); >=20 > /* For Eth VMDQ APIs support */ > static int ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct @@ -5= 11,6 > +519,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops =3D { > .stats_reset =3D ixgbevf_dev_stats_reset, > .xstats_reset =3D ixgbevf_dev_stats_reset, > .dev_close =3D ixgbevf_dev_close, > + .allmulticast_enable =3D ixgbevf_dev_allmulticast_enable, > + .allmulticast_disable =3D ixgbevf_dev_allmulticast_disable, > .dev_infos_get =3D ixgbevf_dev_info_get, > .mtu_set =3D ixgbevf_dev_set_mtu, > .vlan_filter_set =3D ixgbevf_vlan_filter_set, > @@ -1224,6 +1234,7 @@ ixgbevf_negotiate_api(struct ixgbe_hw *hw) >=20 > /* start with highest supported, proceed down */ > static const enum ixgbe_pfvf_api_rev sup_ver[] =3D { > + ixgbe_mbox_api_12, > ixgbe_mbox_api_11, > ixgbe_mbox_api_10, > }; > @@ -6191,6 +6202,61 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev, > return 0; > } >=20 > +/* ixgbevf_update_xcast_mode - Update Multicast mode > + * @hw: pointer to the HW structure > + * @netdev: pointer to net device structure > + * @xcast_mode: new multicast mode > + * > + * Updates the Multicast Mode of VF. > + */ > +static int ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, > + int xcast_mode) > +{ > + struct ixgbe_mbx_info *mbx =3D &hw->mbx; > + u32 msgbuf[2]; > + s32 err; > + > + switch (hw->api_version) { > + case ixgbe_mbox_api_12: > + break; > + default: > + return -EOPNOTSUPP; > + } > + > + msgbuf[0] =3D IXGBE_VF_UPDATE_XCAST_MODE; > + msgbuf[1] =3D xcast_mode; > + > + err =3D mbx->ops.write_posted(hw, msgbuf, 2, 0); > + if (err) > + return err; > + > + err =3D mbx->ops.read_posted(hw, msgbuf, 2, 0); Is it more reasonable to read a message of size 1 than 2? Pf side only writ= e 1 word into mbx. > + if (err) > + return err;