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 285C89267 for ; Thu, 22 Oct 2015 03:24:04 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 21 Oct 2015 18:24:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,180,1444719600"; d="scan'208";a="669210784" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 21 Oct 2015 18:24:01 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 21 Oct 2015 18:24:01 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.47]) with mapi id 14.03.0248.002; Thu, 22 Oct 2015 09:23:51 +0800 From: "Qiu, Michael" To: "He, Shaopeng" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/3] fm10k: add multi-queue checking Thread-Index: AQHQ+1HP+tjvCpcJ3UusvlS+opgzFw== Date: Thu, 22 Oct 2015 01:23:50 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028621B501A8@SHSMSX101.ccr.corp.intel.com> References: <1443598134-11510-1-git-send-email-shaopeng.he@intel.com> <1443598134-11510-2-git-send-email-shaopeng.he@intel.com> <533710CFB86FA344BFBF2D6802E6028621B49E9A@SHSMSX101.ccr.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 1/3] fm10k: add multi-queue checking 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: Thu, 22 Oct 2015 01:24:04 -0000 On 2015/10/15 19:07, He, Shaopeng wrote:=0A= > Hi, Michael=0A= >=0A= >> -----Original Message-----=0A= >> From: Qiu, Michael=0A= >> Sent: Thursday, October 15, 2015 2:28 PM=0A= >> To: He, Shaopeng; dev@dpdk.org=0A= >> Subject: Re: [dpdk-dev] [PATCH 1/3] fm10k: add multi-queue checking=0A= >>=0A= >> On 2015/9/30 15:29, Shaopeng He wrote:=0A= >>> Add multi-queue checking in device configure process.=0A= >>> Currently, VMDQ and RSS are supported.=0A= >>>=0A= >>> Signed-off-by: Shaopeng He =0A= >>> ---=0A= >>> drivers/net/fm10k/fm10k_ethdev.c | 44=0A= >>> ++++++++++++++++++++++++++++++++++++++++=0A= >>> 1 file changed, 44 insertions(+)=0A= >>>=0A= >>> diff --git a/drivers/net/fm10k/fm10k_ethdev.c=0A= >>> b/drivers/net/fm10k/fm10k_ethdev.c=0A= >>> index a69c990..082937d 100644=0A= >>> --- a/drivers/net/fm10k/fm10k_ethdev.c=0A= >>> +++ b/drivers/net/fm10k/fm10k_ethdev.c=0A= >>> @@ -283,12 +283,56 @@ tx_queue_disable(struct fm10k_hw *hw,=0A= >> uint16_t=0A= >>> qnum) }=0A= >>>=0A= >>> static int=0A= >>> +fm10k_check_mq_mode(struct rte_eth_dev *dev) {=0A= >>> + enum rte_eth_rx_mq_mode rx_mq_mode =3D dev->data-=0A= >>> dev_conf.rxmode.mq_mode;=0A= >>> + struct fm10k_hw *hw =3D FM10K_DEV_PRIVATE_TO_HW(dev->data-=0A= >>> dev_private);=0A= >>> + struct rte_eth_vmdq_rx_conf *vmdq_conf;=0A= >>> + uint16_t nb_rx_q =3D dev->data->nb_rx_queues;=0A= >>> +=0A= >>> + vmdq_conf =3D &dev->data->dev_conf.rx_adv_conf.vmdq_rx_conf;=0A= >>> +=0A= >>> + if (rx_mq_mode & ETH_MQ_RX_DCB_FLAG) {=0A= >>> + PMD_INIT_LOG(ERR, "DCB mode is not supported.");=0A= >>> + return -EINVAL;=0A= >>> + }=0A= >>> +=0A= >>> + if (!(rx_mq_mode & ETH_MQ_RX_VMDQ_FLAG))=0A= >>> + return 0;=0A= >>> +=0A= >>> + if (hw->mac.type =3D=3D fm10k_mac_vf) {=0A= >>> + PMD_INIT_LOG(ERR, "VMDQ mode is not supported in VF.");=0A= >>> + return -EINVAL;=0A= >>> + }=0A= >> I think vf check should be the first one, then we do not need check dcb = and=0A= >> VMDq flag.=0A= >>=0A= >> Thanks,=0A= >> Michael=0A= > Thanks for the comments. There is a case of RSS support on VF, if vf chec= k be =0A= > the first one, it will return fail, which is not correct.=0A= =0A= OK, you are right.=0A= =0A= Thanks,=0A= Michael=0A= > Thanks,=0A= > --Shaopeng=0A= >>> +=0A= >>> + /* Check VMDQ queue pool number */=0A= >>> + if (vmdq_conf->nb_queue_pools >=0A= >>> + sizeof(vmdq_conf->pool_map[0].pools) * CHAR_BIT=0A= >> ||=0A= >>> + vmdq_conf->nb_queue_pools > nb_rx_q) {=0A= >>> + PMD_INIT_LOG(ERR, "Too many of queue pools: %d",=0A= >>> + vmdq_conf->nb_queue_pools);=0A= >>> + return -EINVAL;=0A= >>> + }=0A= >>> +=0A= >>> + return 0;=0A= >>> +}=0A= >>> +=0A= >>> +static int=0A= >>> fm10k_dev_configure(struct rte_eth_dev *dev) {=0A= >>> + int ret;=0A= >>> +=0A= >>> PMD_INIT_FUNC_TRACE();=0A= >>>=0A= >>> if (dev->data->dev_conf.rxmode.hw_strip_crc =3D=3D 0)=0A= >>> PMD_INIT_LOG(WARNING, "fm10k always strip CRC");=0A= >>> + /* multipe queue mode checking */=0A= >>> + ret =3D fm10k_check_mq_mode(dev);=0A= >>> + if (ret !=3D 0) {=0A= >>> + PMD_DRV_LOG(ERR, "fm10k_check_mq_mode fails=0A= >> with %d.",=0A= >>> + ret);=0A= >>> + return ret;=0A= >>> + }=0A= >>>=0A= >>> return 0;=0A= >>> }=0A= >=0A= =0A=