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 DDAA75A6F for ; Tue, 20 Jan 2015 02:04:03 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 19 Jan 2015 17:00:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,430,1418112000"; d="scan'208";a="514578382" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by orsmga003.jf.intel.com with ESMTP; 19 Jan 2015 16:56:53 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 20 Jan 2015 09:03:26 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.238]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.92]) with mapi id 14.03.0195.001; Tue, 20 Jan 2015 09:03:25 +0800 From: "Ouyang, Changchun" To: "Wodkowski, PawelX" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v6 4/6] ether: Check VMDq RSS mode Thread-Index: AQHQLizuvd1lWhG140qrpQNeyJ7e9JzGw6uAgAF3nZA= Date: Tue, 20 Jan 2015 01:03:25 +0000 Message-ID: References: <1420612355-6666-1-git-send-email-changchun.ouyang@intel.com> <1421042352-22399-1-git-send-email-changchun.ouyang@intel.com> <1421042352-22399-5-git-send-email-changchun.ouyang@intel.com> In-Reply-To: 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 v6 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: Tue, 20 Jan 2015 01:04:04 -0000 > -----Original Message----- > From: Wodkowski, PawelX > Sent: Monday, January 19, 2015 6:31 PM > To: Ouyang, Changchun; dev@dpdk.org > Cc: Thomas Monjalon; Vlad Zolotarov > Subject: RE: [dpdk-dev] [PATCH v6 4/6] ether: Check VMDq RSS mode >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ouyang > Changchun > > Sent: Monday, January 12, 2015 6:59 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH v6 4/6] ether: Check VMDq RSS mode > > > > 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 > > > > changes in v6: > > - More clear error message when queue number is invalid. > > > > changes in v5: > > - Fix '<' issue, it should be '<=3D' to test rxq number; > > - Extract a function to remove the embeded switch-case statement. > > > > --- > > lib/librte_ether/rte_ethdev.c | 51 > > ++++++++++++++++++++++++++++++++++++++----- > > 1 file changed, 46 insertions(+), 5 deletions(-) > > > > diff --git a/lib/librte_ether/rte_ethdev.c > > b/lib/librte_ether/rte_ethdev.c index 95f2ceb..e9e3368 100644 > > --- a/lib/librte_ether/rte_ethdev.c > > +++ b/lib/librte_ether/rte_ethdev.c > > @@ -503,6 +503,31 @@ rte_eth_dev_tx_queue_config(struct > rte_eth_dev > > *dev, uint16_t nb_queues) } > > > > static int > > +rte_eth_dev_check_vf_rss_rxq_num(uint8_t port_id, uint16_t nb_rx_q) > { > > + struct rte_eth_dev *dev =3D &rte_eth_devices[port_id]; > > + 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: > > + 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; > > + > > + return 0; > > +} > > + > > +static int > > rte_eth_dev_check_mq_mode(uint8_t port_id, uint16_t nb_rx_q, > uint16_t > > nb_tx_q, > > const struct rte_eth_conf *dev_conf) { @@ -510,8 +535,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 +549,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 > > +557,26 @@ 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 <=3D > > RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool) > > + if > (rte_eth_dev_check_vf_rss_rxq_num(port_id, > > nb_rx_q) !=3D 0) { > > + PMD_DEBUG_TRACE("ethdev > > port_id=3D%d" > > + " SRIOV active, invalid queue" > > + " number for VMDQ RSS, > > allowed" > > + " value are 1, 2 or 4\n", > > + port_id); > > + return -EINVAL; > > + } > > + break; > > default: /* ETH_MQ_RX_VMDQ_ONLY or > ETH_MQ_RX_NONE */ > > /* if nothing mq mode configure, use default scheme > */ > > dev->data->dev_conf.rxmode.mq_mode =3D > ETH_MQ_RX_VMDQ_ONLY; @@ > > -553,8 +596,6 @@ rte_eth_dev_check_mq_mode(uint8_t port_id, > uint16_t > > nb_rx_q, uint16_t nb_tx_q, > > default: /* ETH_MQ_TX_VMDQ_ONLY or > ETH_MQ_TX_NONE */ > > /* if nothing mq mode configure, use default scheme > */ > > dev->data->dev_conf.txmode.mq_mode =3D > ETH_MQ_TX_VMDQ_ONLY; > > - if (RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool > 1) > > - RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =3D > 1; >=20 > Why you removed this completely? >=20 I have discuss this with Valid in previous email, The reason for removing it, is that when rxmode.mq_mode is ETH_MQ_RX_VMDQ_= RSS, and txmode.mq_mode is ETH_MQ_TX_NONE, The logic is incorrect, in such a case the nb_q_per_pool could be 1, or 2, = or 4, Forcedly set it into 1 will always disable the vf rss. I see you will split nb_q_per_pool into nb_rxq_per_pool and nb_txq_per_pool= , that's good way to meet rss, dcb different cases requirement, So you need consider such case, don't break anything.