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 43C5D58FF for ; Sun, 4 Jan 2015 09:58:15 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 04 Jan 2015 00:55:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="436272341" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by FMSMGA003.fm.intel.com with ESMTP; 04 Jan 2015 00:45:57 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 4 Jan 2015 16:58:11 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.216]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.110]) with mapi id 14.03.0195.001; Sun, 4 Jan 2015 16:58:10 +0800 From: "Ouyang, Changchun" To: Vlad Zolotarov , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 4/6] ether: Check VMDq RSS mode Thread-Index: AQHQJ+7Af2HXAdw//UuhL/WSKplfqpyvH4kAgACIdUA= Date: Sun, 4 Jan 2015 08:58:09 +0000 Message-ID: References: <1419398584-19520-1-git-send-email-changchun.ouyang@intel.com> <1420355937-18484-1-git-send-email-changchun.ouyang@intel.com> <1420355937-18484-5-git-send-email-changchun.ouyang@intel.com> <54A8FD9A.8040701@cloudius-systems.com> In-Reply-To: <54A8FD9A.8040701@cloudius-systems.com> Accept-Language: zh-CN, 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 v4 4/6] ether: Check VMDq RSS mode 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: Sun, 04 Jan 2015 08:58:15 -0000 > -----Original Message----- > From: Vlad Zolotarov [mailto:vladz@cloudius-systems.com] > Sent: Sunday, January 4, 2015 4:45 PM > To: Ouyang, Changchun; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 4/6] ether: Check VMDq RSS mode >=20 >=20 > On 01/04/15 09:18, Ouyang Changchun wrote: > > Check mq mode for VMDq RSS, handle it correctly instead of returning > > an error; Also remove the limitation of per pool queue number has max > > value of 1, because the per pool queue number could be 2 or 4 if it is > > VMDq RSS mode; > > > > The number of rxq specified in config will determine the mq mode for > VMDq RSS. > > > > Signed-off-by: Changchun Ouyang > > --- > > lib/librte_ether/rte_ethdev.c | 39 > ++++++++++++++++++++++++++++++++++----- > > 1 file changed, 34 insertions(+), 5 deletions(-) > > > > diff --git a/lib/librte_ether/rte_ethdev.c > > b/lib/librte_ether/rte_ethdev.c index 95f2ceb..59ff325 100644 > > --- a/lib/librte_ether/rte_ethdev.c > > +++ b/lib/librte_ether/rte_ethdev.c > > @@ -510,8 +510,7 @@ rte_eth_dev_check_mq_mode(uint8_t port_id, > > uint16_t nb_rx_q, uint16_t nb_tx_q, > > > > if (RTE_ETH_DEV_SRIOV(dev).active !=3D 0) { > > /* check multi-queue mode */ > > - if ((dev_conf->rxmode.mq_mode =3D=3D ETH_MQ_RX_RSS) || > > - (dev_conf->rxmode.mq_mode =3D=3D ETH_MQ_RX_DCB) || > > + if ((dev_conf->rxmode.mq_mode =3D=3D ETH_MQ_RX_DCB) || > > (dev_conf->rxmode.mq_mode =3D=3D ETH_MQ_RX_DCB_RSS) > || > > (dev_conf->txmode.mq_mode =3D=3D ETH_MQ_TX_DCB)) { > > /* SRIOV only works in VMDq enable mode */ @@ - > 525,7 +524,6 @@ > > rte_eth_dev_check_mq_mode(uint8_t port_id, uint16_t nb_rx_q, > uint16_t nb_tx_q, > > } > > > > switch (dev_conf->rxmode.mq_mode) { > > - case ETH_MQ_RX_VMDQ_RSS: > > case ETH_MQ_RX_VMDQ_DCB: > > case ETH_MQ_RX_VMDQ_DCB_RSS: > > /* DCB/RSS VMDQ in SRIOV mode, not implement > yet */ @@ -534,6 > > +532,39 @@ rte_eth_dev_check_mq_mode(uint8_t port_id, uint16_t > nb_rx_q, uint16_t nb_tx_q, > > "unsupported VMDQ mq_mode > rx %u\n", > > port_id, dev_conf- > >rxmode.mq_mode); > > return (-EINVAL); > > + case ETH_MQ_RX_RSS: > > + PMD_DEBUG_TRACE("ethdev port_id=3D%" PRIu8 > > + " SRIOV active, " > > + "Rx mq mode is changed from:" > > + "mq_mode %u into VMDQ > mq_mode %u\n", > > + port_id, > > + dev_conf->rxmode.mq_mode, > > + dev->data- > >dev_conf.rxmode.mq_mode); > > + case ETH_MQ_RX_VMDQ_RSS: > > + dev->data->dev_conf.rxmode.mq_mode =3D > ETH_MQ_RX_VMDQ_RSS; > > + if (nb_rx_q < > RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool) { > > + switch (nb_rx_q) { > > + case 1: > > + case 2: > > + RTE_ETH_DEV_SRIOV(dev).active =3D > > + ETH_64_POOLS; > > + break; > > + case 4: > > + RTE_ETH_DEV_SRIOV(dev).active =3D > > + ETH_32_POOLS; > > + break; > > + default: > > + PMD_DEBUG_TRACE("ethdev > port_id=3D%d" > > + " SRIOV active, " > > + "queue number invalid\n", > > + port_id); > > + return -EINVAL; > > + } > > + RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =3D > nb_rx_q; > > + RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =3D > > + dev->pci_dev->max_vfs * nb_rx_q; > > + } >=20 > Don't u need to return an error in the "else" here? Actually it has such a check after these code snippet, and it does return e= rror for the else case, Because it is original logic, I don't change any code around it, so it does= n't display here, you can check the codes. Thanks Changchun =20