Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751697AbcLEEMb (ORCPT ); Sun, 4 Dec 2016 23:12:31 -0500 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:52367 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751320AbcLEEM3 (ORCPT ); Sun, 4 Dec 2016 23:12:29 -0500 X-IronPort-AV: E=Sophos;i="5.33,302,1477958400"; d="scan'208";a="663426594" Date: Sun, 4 Dec 2016 20:11:30 -0800 From: Matt Wilson To: Netanel Belgazal CC: , , , , , , , , , Subject: Re: [PATCH V2 net 03/20] net/ena: fix queues number calculation Message-ID: <20161205041130.GD4310@u54ee753d2d1854bda401.ant.amazon.com> References: <1480857578-5065-1-git-send-email-netanel@annapurnalabs.com> <1480857578-5065-4-git-send-email-netanel@annapurnalabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1480857578-5065-4-git-send-email-netanel@annapurnalabs.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1223 Lines: 28 On Sun, Dec 04, 2016 at 03:19:21PM +0200, Netanel Belgazal wrote: > The ENA driver tries to open a queue per vCPU. > To determine how many vCPUs the instance have it uses num_possible_cpus > while it should have use num_online_cpus instead. use () when referring to functions: num_possible_cpus(), num_online_cpus(). > Signed-off-by: Netanel Belgazal Reviewed-by: Matt Wilson > --- > drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c > index 397c9bc..224302c 100644 > --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c > +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c > @@ -2667,7 +2667,7 @@ static int ena_calc_io_queue_num(struct pci_dev *pdev, > io_sq_num = get_feat_ctx->max_queues.max_sq_num; > } > > - io_queue_num = min_t(int, num_possible_cpus(), ENA_MAX_NUM_IO_QUEUES); > + io_queue_num = min_t(int, num_online_cpus(), ENA_MAX_NUM_IO_QUEUES); > io_queue_num = min_t(int, io_queue_num, io_sq_num); > io_queue_num = min_t(int, io_queue_num, > get_feat_ctx->max_queues.max_cq_num);