Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2296825imc; Tue, 12 Mar 2019 10:50:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0MunCg++wuNAlctfUb9nQH2qHMV21lQ8Gjlhpm/c2ZV+wSUrW18OQjg0Pfb7Hcgg+RmO0 X-Received: by 2002:a17:902:ba84:: with SMTP id k4mr41592950pls.103.1552413019027; Tue, 12 Mar 2019 10:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552413019; cv=none; d=google.com; s=arc-20160816; b=kPidTqyeKR7oiHa0KK2f4bHxEIsI/+I2X+CIhDVwJRsGEfFBhCCuWPffnVrzGrnzOJ rYcNFIWGhdPYFUT/rIN3OS9qWErQaZ1oDQS72u5L+eAF9qlUldv5Des2cQLsfVXPmYEX WmWmJzvZ2g3ux+RxeAFPkP41pRoH/JZNs8bRDfHxct4uZgfc0RgE1MuPlU6rk8DisqAV 2RvJsKrYlJ24k90K9Ywdw9X4ZXaPAGrr125Zof5OK0OcZwtCY9aPLLGd+/i2/olCn6+x BCC2CgpznFQ7GTsRB3zYkNO4edcePe3EYzQAwQ7WnK78P0L2niQ/RAgd/jzq547zQS7O JGTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HzpPg27EY9kWKlwwsog6+rSjMSslkxyEc9p2NNTi9nQ=; b=qNJjlEtk/8xEVKqqvDeSnO9WK9JX4x1Xl0v1zoe1HBHBqxY09JpKblLQDgUVwKmTDz /HHdRufiSL7Q/HfgDpJu0ufO5HSNYK0q+zm45MXCGImtYWny3HeZ34HvsAWhUWh82jXG FIIgd/yXoa6AtxVghlMEOJBZV2Reb/aMGNmdiZud5Zef6j40fhsV6fDfsnywV8BlZDW8 fGqRrn5bEswXFXzH2p1CKXZMXkEexlsk2A0Gw1gwlk2knrUF7/aoL8xWlRsci1ql2y98 TzsOVNlDkM5NPlRwPOcoQkV13iTOAvBlQWmmLUNLFVfdXmiRIK2pXsX7w+7wqQ3pX2oG 4N6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IZLrHSW0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y4si9243601plb.370.2019.03.12.10.50.03; Tue, 12 Mar 2019 10:50:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IZLrHSW0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728919AbfCLRr6 (ORCPT + 99 others); Tue, 12 Mar 2019 13:47:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:54986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727831AbfCLRPG (ORCPT ); Tue, 12 Mar 2019 13:15:06 -0400 Received: from localhost (unknown [104.133.8.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9D43421850; Tue, 12 Mar 2019 17:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552410905; bh=u2Hna3psmcdZkObRQbggNBCen6njNp703kbIceJfHwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IZLrHSW0xTs7w30HGQnBUlqu2zC514fQhRxnUkR5MQglqSC54gBGx7Pha110qqq/e Nmw9aL5jZASOoava7Nt5jjkyo2HYSciOUyuzLaDwSJUEGHwu+zr2QSMMf6Ep5TIFC2 D06cjvdJ9X6wn0jnZdlttdpUISrFShRjARDJW8Zc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sudarsana Reddy Kalluru , Ariel Elior , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 119/149] qed: Consider TX tcs while deriving the max num_queues for PF. Date: Tue, 12 Mar 2019 10:08:57 -0700 Message-Id: <20190312170359.425986607@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190312170349.421581206@linuxfoundation.org> References: <20190312170349.421581206@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit fb1faab74ddef9ec2d841d54e5d0912a097b3abe ] Max supported queues is derived incorrectly in the case of multi-CoS. Need to consider TCs while calculating num_queues for PF. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed_l2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c index e68ca83ae915..64ac95ca4df2 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c @@ -2216,7 +2216,7 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev, u16 num_queues = 0; /* Since the feature controls only queue-zones, - * make sure we have the contexts [rx, tx, xdp] to + * make sure we have the contexts [rx, xdp, tcs] to * match. */ for_each_hwfn(cdev, i) { @@ -2226,7 +2226,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev, u16 cids; cids = hwfn->pf_params.eth_pf_params.num_cons; - num_queues += min_t(u16, l2_queues, cids / 3); + cids /= (2 + info->num_tc); + num_queues += min_t(u16, l2_queues, cids); } /* queues might theoretically be >256, but interrupts' -- 2.19.1