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 0330A2BC9 for ; Tue, 22 Mar 2016 09:42:27 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 22 Mar 2016 01:42:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,376,1455004800"; d="scan'208";a="70949812" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 22 Mar 2016 01:42:26 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Mar 2016 01:42:26 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.18]) with mapi id 14.03.0248.002; Tue, 22 Mar 2016 16:42:24 +0800 From: "Qiu, Michael" To: "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] ixgbe: add TX queue number check Thread-Index: AQHRhBJReF56abNbVkSn862RBwiAmQ== Date: Tue, 22 Mar 2016 08:42:24 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028622F71201@SHSMSX101.ccr.corp.intel.com> References: <1458634121-1808-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] ixgbe: add TX queue number check 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, 22 Mar 2016 08:42:28 -0000 On 3/22/2016 4:10 PM, Wenzhuo Lu wrote:=0A= > Ixgbe supports at most 128 TX queues. But in none VT nor DCB mode=0A= > the queues 64 ~ 127 should not be used. Ixgbe doesn't do any check=0A= > about that. If a queue larger than 64 is used, the TX packets will=0A= > be dropped silently. It's hard to debug.=0A= > This check is added to forbid using queue number larger than 64=0A= > during device configuration, so the user can know the problem as=0A= > early as possible.=0A= >=0A= > Signed-off-by: Wenzhuo Lu =0A= > Reported-by: Antonio Fischetti =0A= > ---=0A= =0A= Acked-by: Michael Qiu =0A= =0A= > drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++++++-=0A= > drivers/net/ixgbe/ixgbe_ethdev.h | 1 +=0A= > 2 files changed, 11 insertions(+), 1 deletion(-)=0A= >=0A= > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.c=0A= > index 5371720..dd6d00e 100644=0A= > --- a/drivers/net/ixgbe/ixgbe_ethdev.c=0A= > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c=0A= > @@ -1862,7 +1862,7 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)=0A= > {=0A= > struct rte_eth_conf *dev_conf =3D &dev->data->dev_conf;=0A= > uint16_t nb_rx_q =3D dev->data->nb_rx_queues;=0A= > - uint16_t nb_tx_q =3D dev->data->nb_rx_queues;=0A= > + uint16_t nb_tx_q =3D dev->data->nb_tx_queues;=0A= > =0A= > if (RTE_ETH_DEV_SRIOV(dev).active !=3D 0) {=0A= > /* check multi-queue mode */=0A= > @@ -2002,6 +2002,15 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)=0A= > return -EINVAL;=0A= > }=0A= > }=0A= > +=0A= > + if (dev_conf->txmode.mq_mode =3D=3D ETH_MQ_TX_NONE) {=0A= > + if (nb_tx_q > IXGBE_NONE_VT_DCB_MAX_TXQ_NB) {=0A= > + PMD_INIT_LOG(ERR,=0A= > + "None VT nor DCB, nb_tx_q > %d.",=0A= > + IXGBE_NONE_VT_DCB_MAX_TXQ_NB);=0A= > + return -EINVAL;=0A= > + }=0A= > + }=0A= > }=0A= > return 0;=0A= > }=0A= > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_e= thdev.h=0A= > index 5c3aa16..50ee73f 100644=0A= > --- a/drivers/net/ixgbe/ixgbe_ethdev.h=0A= > +++ b/drivers/net/ixgbe/ixgbe_ethdev.h=0A= > @@ -61,6 +61,7 @@=0A= > #define IXGBE_MAX_RX_QUEUE_NUM 128=0A= > #define IXGBE_VMDQ_DCB_NB_QUEUES IXGBE_MAX_RX_QUEUE_NUM=0A= > #define IXGBE_DCB_NB_QUEUES IXGBE_MAX_RX_QUEUE_NUM=0A= > +#define IXGBE_NONE_VT_DCB_MAX_TXQ_NB 64=0A= > =0A= > #ifndef NBBY=0A= > #define NBBY 8 /* number of bits in a byte */=0A= =0A=