From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 09B4412A8 for ; Thu, 24 Mar 2016 13:20:46 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 24 Mar 2016 05:20:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,385,1455004800"; d="scan'208";a="944138799" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.85]) by fmsmga002.fm.intel.com with SMTP; 24 Mar 2016 05:20:44 -0700 Received: by (sSMTP sendmail emulation); Thu, 24 Mar 2016 12:20:43 +0025 Date: Thu, 24 Mar 2016 12:20:43 +0000 From: Bruce Richardson To: Olivier Matz Cc: dev@dpdk.org, adrien.mazarguil@6wind.com Message-ID: <20160324122043.GC13728@bricha3-MOBL3> References: <1458576484-28211-1-git-send-email-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458576484-28211-1-git-send-email-olivier.matz@6wind.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] mlx4: use dummy rxqs when a non-pow2 number is requested 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, 24 Mar 2016 12:20:47 -0000 On Mon, Mar 21, 2016 at 05:08:04PM +0100, Olivier Matz wrote: > When using RSS, the number of rxqs has to be a power of two. > This is a problem because there is no API is dpdk that makes > the application aware of that. > > A good compromise is to allow the application to request a > number of rxqs that is not a power of 2, but having inactive > queues that will never receive packets. In this configuration, > a warning will be issued to users to let them know that > this is not an optimal configuration. > > Signed-off-by: Olivier Matz > --- > drivers/net/mlx4/mlx4.c | 27 +++++++++++++++++---------- > 1 file changed, 17 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c > index cc4e9aa..eaf06db 100644 > --- a/drivers/net/mlx4/mlx4.c > +++ b/drivers/net/mlx4/mlx4.c > @@ -698,7 +698,7 @@ txq_cleanup(struct txq *txq); > > static int > rxq_setup(struct rte_eth_dev *dev, struct rxq *rxq, uint16_t desc, > - unsigned int socket, const struct rte_eth_rxconf *conf, > + unsigned int socket, int inactive, const struct rte_eth_rxconf *conf, > struct rte_mempool *mp); > > static void > @@ -734,12 +734,12 @@ dev_configure(struct rte_eth_dev *dev) > } > if (rxqs_n == priv->rxqs_n) > return 0; > - if ((rxqs_n & (rxqs_n - 1)) != 0) { > - ERROR("%p: invalid number of RX queues (%u)," > - " must be a power of 2", > + if (!rte_is_power_of_2(rxqs_n)) { > + WARN("%p: number of RX queues (%u), must be a" > + " power of 2: remaining queues will be inactive", I'm not sure how clear this warning message is. To the reader there are no extra "remaining" queues referred to, as it's not stated that the driver is allocating extra queues. How about e.g.: WARN("%p: number of RX queues on device must by a power of 2. Allocating %u queues, of which %u will be active. Remaining queues will be inactive"...) /Bruce