From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9693C4360F for ; Tue, 12 Mar 2019 18:01:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8931721734 for ; Tue, 12 Mar 2019 18:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552413709; bh=Q5oIS3rmWG5yPufoSNTjShYOdEbmq9dK06BBOVuJbLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mbtjdYIHvlF9lzaZv5bQ27naPhwBQuUEWjjHixUm5heAc3epfC/gRfxqkja2yrpcx yGJQzweKQ/hPOmIh2oMcMWqLmQ5KuXaO4kpU/tb3AbwtZoQAGTboOX029FxfZ1Fw3p uqg2HJwtaeaxGa9svlqupW74n3wQtx9lOKfzyRaY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728061AbfCLSAp (ORCPT ); Tue, 12 Mar 2019 14:00:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:49898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727869AbfCLRNR (ORCPT ); Tue, 12 Mar 2019 13:13:17 -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 DA69D2173C; Tue, 12 Mar 2019 17:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552410797; bh=Q5oIS3rmWG5yPufoSNTjShYOdEbmq9dK06BBOVuJbLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HCYM1KR/rHmzY9Um/tsUlYINBa7h1LnSFd4oXOQgZxPf/zwWkvNLoMamOC/MmVK8R MY7o87Vg2mQkXk5u3bqNtCcRmlHobY7zHXYwYubIMUkbHqalcvWYXoS7WlktrBkiT3 OHr0urGXbx0xAQkJWf/42f0KQSpxGna/Rt6B02yY= 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.20 143/171] qed: Consider TX tcs while deriving the max num_queues for PF. Date: Tue, 12 Mar 2019 10:08:43 -0700 Message-Id: <20190312170359.947938673@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190312170347.868927101@linuxfoundation.org> References: <20190312170347.868927101@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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.20-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