From patchwork Wed Aug 9 07:05:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 133092 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2627560vqr; Wed, 9 Aug 2023 00:43:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IET1vs0WK7/HrVWRwyDnNWGLRqRIfWr2NYGxEMYTmzUmOR+DiSHZwDfBRYZ5BqCpUIflv0e X-Received: by 2002:a17:906:2ce:b0:99c:7301:4d69 with SMTP id 14-20020a17090602ce00b0099c73014d69mr1563864ejk.20.1691567019557; Wed, 09 Aug 2023 00:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691567019; cv=none; d=google.com; s=arc-20160816; b=cYxQj9tuFEMYorG8xTJ6UMr6T2bcoex1BuR/Dk3acGHJ2mdasVaHUbhytE9oFkQSQT W4ta9x7nSbJ80fPPrkaVa0142MprFDM2ND1TKV1dAMMQh/JhMP407Sd2RtyTix0wtH7p HcmLtu/Gs4SIfa5j1beyjvP2NcbzqLqmm2gmxhFfHAa5mmoBp0Tl3F1LWbHPBnbl8EOD uh3oBYQH7tMpQ8ycHkNc0M28VpnLVBAmuUpms8mp5d5WUMHI80b/DNzH/oTtwy6iFU1s e2zPcg22OjbiiYahciiEfhnwwzsW96haqovFVfmU29A1jd9nipykzErNsH4OjVBKL92R LD5Q== 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=xslIp8z7hUP5iZF3SUe9yWaF9DhbTpnOAZfqCpddnlA=; fh=zaZMevJusfEyKCjkBAg52tAXDoBEUdsdtBKhQ6uTJKI=; b=pkpmw29f4ZS+ZkzSRFD0RJt0wOayqWje1jetk5s++B1irNdIeYXtS3eY7OkiTngH1I ophwWNk1Vdj+kzjqkgrYjyNdZdI4wTlkmKs/M9BCQ8roVsInucP6ILmqOTrYqadS1Ui8 y2dgR8nZAkGUSn+YHO3E5WMcWyLfqx2Bd6mGEaZ8Krvs0VoBsAsTbBavAHiRzk+sY9ux DL0Lb/oL+6pN2ZcJ00JOgiduapo8c3m8wKrAemrJf4XmT8/r3es6oDkSw37IIbFd0R45 3/5y08FLpDIB6rP3Q2MZswHq7ioZNS5ANBWUl3GkRNfsIB+juXIOqotf8uSoRhmMkLxc fWMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=fY9y5arF; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g5-20020a17090613c500b00992c195b499si8016278ejc.765.2023.08.09.00.43.15; Wed, 09 Aug 2023 00:43:39 -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=fY9y5arF; 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 S231431AbjHIHGC (ORCPT + 99 others); Wed, 9 Aug 2023 03:06:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbjHIHGB (ORCPT ); Wed, 9 Aug 2023 03:06:01 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3A981FCD; Wed, 9 Aug 2023 00:05:59 -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 378NlZGL005941; Wed, 9 Aug 2023 00:05:54 -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=xslIp8z7hUP5iZF3SUe9yWaF9DhbTpnOAZfqCpddnlA=; b=fY9y5arFP3hqUcFmSbN7pxuV9CNTgZvSMcBft8w3y0KxEAxn7WtKG3jp/lNvZy9u/14c DIFxVvlq93Qin3BCI20QSxXEmGov0A0io5fjzuZ10j85G/TEumo/JZPXNuc2Hk8CX8Ki laBjn89qjUXVQYmesrao24DX6MzRmSWAnh38kruIF8/7MWeux/8zkyyl2nSbs6q2IILR V72ZGf/yx8qWmQeT5xmu5HIAC3wShGHx938hZODKXavCXPLTAjwQyJcfZm6lYk4yoC7I WX+FwnUf5MClrBmY6cpZeZgrI9R9pAJyFccRwppWlp7FMWUAd0N9o4ZbVC0M/CPhFKbE uQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3sbkntktrb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 09 Aug 2023 00:05:53 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 9 Aug 2023 00:05:51 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 9 Aug 2023 00:05:51 -0700 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id AB2B43F705B; Wed, 9 Aug 2023 00:05:47 -0700 (PDT) From: Suman Ghosh To: , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH V2 2/4] octeontx2-pf: Fix PFC TX scheduler free Date: Wed, 9 Aug 2023 12:35:30 +0530 Message-ID: <20230809070532.3252464-3-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230809070532.3252464-1-sumang@marvell.com> References: <20230809070532.3252464-1-sumang@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: SNEZr1FjhnZKxNW0jSorBKDAmC91V7db X-Proofpoint-ORIG-GUID: SNEZr1FjhnZKxNW0jSorBKDAmC91V7db X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-09_05,2023-08-08_01,2023-05-22_02 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773736579568309437 X-GMAIL-MSGID: 1773736579568309437 During PFC TX schedulers free, flag TXSCHQ_FREE_ALL was being set which caused free up all schedulers other than the PFC schedulers. This patch fixes that to free only the PFC Tx schedulers. Fixes: 99c969a83d82 ("octeontx2-pf: Add egress PFC support") Signed-off-by: Suman Ghosh --- .../ethernet/marvell/octeontx2/nic/otx2_common.c | 1 + .../ethernet/marvell/octeontx2/nic/otx2_dcbnl.c | 15 ++++----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c index 77c8f650f7ac..289371b8ce4f 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -804,6 +804,7 @@ void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq) mutex_unlock(&pfvf->mbox.lock); } +EXPORT_SYMBOL(otx2_txschq_free_one); void otx2_txschq_stop(struct otx2_nic *pfvf) { diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c index d54edfa8fcc9..c75435bab411 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c @@ -125,19 +125,12 @@ int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf) static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio) { - struct nix_txsch_free_req *free_req; + int lvl; - mutex_lock(&pfvf->mbox.lock); /* free PFC TLx nodes */ - free_req = otx2_mbox_alloc_msg_nix_txsch_free(&pfvf->mbox); - if (!free_req) { - mutex_unlock(&pfvf->mbox.lock); - return -ENOMEM; - } - - free_req->flags = TXSCHQ_FREE_ALL; - otx2_sync_mbox_msg(&pfvf->mbox); - mutex_unlock(&pfvf->mbox.lock); + for (lvl = 0; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++) + otx2_txschq_free_one(pfvf, lvl, + pfvf->pfc_schq_list[lvl][prio]); pfvf->pfc_alloc_status[prio] = false; return 0;