From patchwork Tue Feb 20 23:03:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13564710 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72DC66BB28 for ; Tue, 20 Feb 2024 23:03:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708470232; cv=none; b=gr7z4wHIclNg2XpYsKA35dbPzMOBTBi1EKmJPS4XgTfD5EY+Xj61fpOoA2qaQARsRBsh9M4Wj7XU1YoAT7IqGjEoxQHlaoSbfLE8o62gLdXsIpBH0vblZnG9l4ipXepn43Dx/Ip3dOHiMsi5P8knbyakbfASDu36Lna+sFuy61A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708470232; c=relaxed/simple; bh=NtBRVeCYJcmsQJCib9PwFJX9JAQb2gYlB1qos6zxaFY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Q2hCVL7Glexcz6+INYj0BjZM2f08e+hH+EG9gRBwRSV9DanLh5NG5htWmKz108DH/lp71YtfE0cpZiS0u9gACprZ/QIlMzkoFV0OgwdlHcST7IFFNSP9EEvoAVxHGVLD3f5zVrCZ8WgWBWlZrALO6SF4B3dJX0QA91kdKoXRiAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=P0M4Dftl; arc=none smtp.client-ip=209.85.160.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="P0M4Dftl" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-42a4516ec46so63796221cf.0 for ; Tue, 20 Feb 2024 15:03:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708470229; x=1709075029; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=URqzSXs7hnPwCNK5ifvP8Gh9oaT8HqiFZnjoaBsyYsc=; b=P0M4DftlP1WMsvmH3qCbnhX2IqhDNt+1kGnyBioRAJAJS/KhRq+lUKctSFl53Cm6Kp m1cgm3SwHq50B+HkkSeRKF22qm2Qmx9YXE2zvUxiXLyVg2BoAC9XbgPuiPuKqJWnuY+P n4s0bgSspuDxTz7+bOvnqaJjXqD+XH0rk4E7o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708470229; x=1709075029; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=URqzSXs7hnPwCNK5ifvP8Gh9oaT8HqiFZnjoaBsyYsc=; b=G0G9544bfSHxD3X2dg8fEIsYwajwEw3i1EeCr0Jk7wu5dd4UR+cLzanw3+pieygiuz 5OWqe1Uc+fXVoYZ55gVj8Qm9eqjYH7B4SH2sJ7VrVvxVlYuyf3Ropb/imUTZlMOSqxfz nd1qzKLuMLWNa9TJ7o+1MqJlI+0lD7Lbo8ao4T6+MG5EVWZQmXMDQXpFN3azjDjeNShj Btf1TNjw4ss5TKHUf1N4AC3uCr7sg3r2ae52biWEhaayvP+59UEd4IZpSukvogXYeecP SfdHeZ4bnbjNx61y5qZX/xXe83wNwjSbAcjHr3+6EMRa7+lqQR/dYYAy0SSINNSDYYet 9gbA== X-Gm-Message-State: AOJu0YyrK5wu6OKJksgm1N2yx5BKfiVz2zCGVJJj2pGGDS+tXCVJpcGH j4x8BtRJsLhyEY7Ubk96N5Zxa/s9itDb1H1pMitSfWVGXb0BuFqLTEAl7X74ZA== X-Google-Smtp-Source: AGHT+IFYiVWarQl0XhvTAm3cdAbIk52Ls4GzgX2nW6YjxygA+J5K2PjEUrUCBSSsSbAQU0+G405NhQ== X-Received: by 2002:a05:622a:15d3:b0:42d:adb9:a72f with SMTP id d19-20020a05622a15d300b0042dadb9a72fmr34344005qty.20.1708470229195; Tue, 20 Feb 2024 15:03:49 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id g10-20020ae9e10a000000b00785d7dda9easm3797966qkm.28.2024.02.20.15.03.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2024 15:03:48 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, Somnath Kotur Subject: [PATCH net-next 04/10] bnxt_en: Check additional resources in bnxt_check_rings() Date: Tue, 20 Feb 2024 15:03:11 -0800 Message-Id: <20240220230317.96341-5-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240220230317.96341-1-michael.chan@broadcom.com> References: <20240220230317.96341-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org bnxt_check_rings() is called to check if we have enough resource assets to satisfy the new number of ethtool channels. If the asset test fails, the ethtool operation will fail gracefully. Otherwise we will proceed and commit to use the new number of channels. If it fails to allocate any resources, the chip will fail to come up. For completeness, check all possible resources before committing to the new settings. Add the missing ring group and RSS context asset tests in bnxt_check_rings(). Reviewed-by: Pavan Chebbi Reviewed-by: Somnath Kotur Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index e6fad2a8b817..71ac165dfb52 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -13339,6 +13339,8 @@ int bnxt_check_rings(struct bnxt *bp, int tx, int rx, bool sh, int tcs, if (BNXT_NEW_RM(bp)) { hwr.cp += bnxt_get_ulp_msix_num(bp); hwr.stat += bnxt_get_ulp_stat_ctxs(bp); + hwr.grp = rx; + hwr.rss_ctx = bnxt_get_total_rss_ctxs(bp, &hwr); } if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) hwr.cp_p5 = hwr.tx + rx;