From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 84537231C for ; Thu, 15 Oct 2015 08:28:42 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 14 Oct 2015 23:28:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,684,1437462000"; d="scan'208";a="827114792" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 14 Oct 2015 23:28:21 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 14 Oct 2015 23:28:20 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 14 Oct 2015 23:28:20 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by shsmsx102.ccr.corp.intel.com ([169.254.2.253]) with mapi id 14.03.0248.002; Thu, 15 Oct 2015 14:27:53 +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, 15 Oct 2015 06:27:52 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028621B49E9A@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> 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, 15 Oct 2015 06:28:43 -0000 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= > 1 file changed, 44 insertions(+)=0A= >=0A= > diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_e= thdev.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, uint16_t qnum= )=0A= > }=0A= > =0A= > static int=0A= > +fm10k_check_mq_mode(struct rte_eth_dev *dev)=0A= > +{=0A= > + enum rte_eth_rx_mq_mode rx_mq_mode =3D dev->data->dev_conf.rxmode.mq_mo= de;=0A= > + struct fm10k_hw *hw =3D FM10K_DEV_PRIVATE_TO_HW(dev->data->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= =0A= I think vf check should be the first one, then we do not need check dcb=0A= and VMDq flag.=0A= =0A= Thanks,=0A= Michael=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= > + 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= > {=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 with %d.",=0A= > + ret);=0A= > + return ret;=0A= > + }=0A= > =0A= > return 0;=0A= > }=0A= =0A=