Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp593059rwd; Thu, 8 Jun 2023 05:21:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vG/kFJUsKTAzh2G6ozvDbJqqHeBxABLV5acDNXLcXbX22DZcT0k63BoAqM723UlUOhJ4p X-Received: by 2002:a17:90a:bb86:b0:258:d8fa:52cf with SMTP id v6-20020a17090abb8600b00258d8fa52cfmr3863051pjr.12.1686226896586; Thu, 08 Jun 2023 05:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686226896; cv=none; d=google.com; s=arc-20160816; b=rRvsad9bQKniK59yYZjOVh0+6hpOiEsQrtaJgqlpVm30I0J2pQcGRzyUBiprod9xKH YL5zv/JKt34ZL6S2oaC6hEj6sujCD42hh8PGU3DmpfAlqNi92TCoxP5e6aRsSf0vGloj XAdw51SxJATF5rDkpanOHT1F2rwJe9lgyG8tlk8mN0SYs+WccHlkESPoE3PTME+BM0HS VJfD0w07wQzG1qEN0dC4OXv0hTzvtu3o7Hk7xsyxYYp+qhNPvbhS7rOTN88uamV6zQfo xqWFnUbacdyuOfxhNskJfa9OPjkM7FBVpVivMdAhw/48p/vu8tDSFkcZdz296lpkOrH1 yxCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3CLAvGehOw6drICaAP9rNGWXuKYD45GJWFQlQxrZPwk=; b=B7YZQHOI8U/SH9b+1sypk4sm0oZ3xO9gMT67pOiPb8/GZh4NtU4aiwTbabPp+g+mL+ R2ofRK8Ku6S7u0gb8HMjelc0mpwms44P9EstuPKxvtpdK4NwKCkauHu9DqVdzxUn0/0B vN/gOYl03woy/6eWOPQ5PvGlTeEcf13m8ServNq/RTG18Ny7XbGOFP326MQCOEr9g6gZ 9xa9lJlBktI6G07kbkdpQWAIxQ2V4imO7U9v6TWbhE2crnlOo08vdT8JXqqHc8YpJHQU M3N8iSS1VPwCYpDwg7ThsEofZ+voVT5L1Z5bkJeFKN2V6KmYFjeaR2RF1QDr4kUgIS5C UuSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=H8xDgqAw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p14-20020a17090a348e00b002472cd8ded6si2674355pjb.103.2023.06.08.05.21.23; Thu, 08 Jun 2023 05:21:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=H8xDgqAw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236291AbjFHLm3 (ORCPT + 99 others); Thu, 8 Jun 2023 07:42:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236313AbjFHLm1 (ORCPT ); Thu, 8 Jun 2023 07:42:27 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6360D1FFE; Thu, 8 Jun 2023 04:42:20 -0700 (PDT) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3587PrOq031841; Thu, 8 Jun 2023 04:42:11 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=3CLAvGehOw6drICaAP9rNGWXuKYD45GJWFQlQxrZPwk=; b=H8xDgqAwghR063uwI0TwEpSqkJUuJyO4HIatAbGtFZNancxVfB+UmmjlgywTUgDe72zc 5G4q4T4gCpHucBqHuUpfA7GkGadJphEsYCfh4JQDbsO+CUZmkRUIlsfe97yQWRD7TrkR X/2cuRWy4IDhlsprsZtSYFZABjPksV4+V/zH1e4sGlLswCer3Q0feqSg4L9Yguajiz++ +JrORWFpkfWcKSg8mVOuUpVKrbgW0QJwczFJl27fCBcXMK3YeELMQjCC8H0vs+6gkxPV 740VPxQSqusMTo9wr46sN08rVPE/5u4t7zYV+bNJPCUOhQTjBTpjw0NccdtaKsQrRAsD yA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3r30eu2csd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 04:42:11 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 8 Jun 2023 04:42:08 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 8 Jun 2023 04:42:09 -0700 Received: from #hyd1583.marvell.com (unknown [10.29.37.44]) by maili.marvell.com (Postfix) with ESMTP id 687A83F704F; Thu, 8 Jun 2023 04:42:06 -0700 (PDT) From: Naveen Mamindlapalli To: , , , , , , CC: Satha Rao , Naveen Mamindlapalli Subject: [net PATCH 1/2] octeontx2-af: fixed resource availability check Date: Thu, 8 Jun 2023 17:12:00 +0530 Message-ID: <20230608114201.31112-2-naveenm@marvell.com> X-Mailer: git-send-email 2.39.0.198.ga38d39a4c5 In-Reply-To: <20230608114201.31112-1-naveenm@marvell.com> References: <20230608114201.31112-1-naveenm@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: cGF082epGDhcMHeoVTH1NS0sHtZ_aeDg X-Proofpoint-GUID: cGF082epGDhcMHeoVTH1NS0sHtZ_aeDg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_08,2023-06-08_01,2023-05-22_02 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Satha Rao txschq_alloc response have two different arrays to store continuous and non-continuous schedulers of each level. Requested count should be checked for each array separately. Fixes: 5d9b976d4480 ("octeontx2-af: Support fixed transmit scheduler topology") Signed-off-by: Satha Rao Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Naveen Mamindlapalli --- drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c index 26e639e57dae..967370c0a649 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -1864,7 +1864,8 @@ static int nix_check_txschq_alloc_req(struct rvu *rvu, int lvl, u16 pcifunc, free_cnt = rvu_rsrc_free_count(&txsch->schq); } - if (free_cnt < req_schq || req_schq > MAX_TXSCHQ_PER_FUNC) + if (free_cnt < req_schq || req->schq[lvl] > MAX_TXSCHQ_PER_FUNC || + req->schq_contig[lvl] > MAX_TXSCHQ_PER_FUNC) return NIX_AF_ERR_TLX_ALLOC_FAIL; /* If contiguous queues are needed, check for availability */ -- 2.39.0.198.ga38d39a4c5