Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp341339rwr; Tue, 25 Apr 2023 23:28:24 -0700 (PDT) X-Google-Smtp-Source: AKy350ZpfVZLaRdC97yVyAqLEtFqCoObn/Faf+gd9vxkMmh4ST3zyv6LWdZNYq+alppgAI25nnW7 X-Received: by 2002:a17:90a:ee86:b0:247:90ea:1a81 with SMTP id i6-20020a17090aee8600b0024790ea1a81mr20388241pjz.37.1682490503975; Tue, 25 Apr 2023 23:28:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682490503; cv=none; d=google.com; s=arc-20160816; b=ON/4fvplcJAMYAGpaleRDd52t9QwhXdEVZniYyKXQS7POHe5tYWnmonTLg8P02dUOf 1luhpPRkYacOR3HTIgLr5R/M+bMoFMC7CsDYUT69VjSWGq4mo3+Pkx/RKuuO37txoh9c CFnzlbzj27+SToWh30tGOjQ2gDkdVr/6Ttvf8FZZJctUIvfohPRSTehuk3bIbZLPW6Ii 6i0NQpp1WmYxE3nbr0+Q2vakrm8dOnKF7ebRax4km60F9wec8LLiaFVcCMpLL5O3z8Ds dHAKZAbdgPpOdTYPyhc0V03gWSjjc930PPGeBKlksxeVkmHIJrrIoHCvg6A4QKw0OM/a +E/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NWsnQRhNbAbCrxriJEWKZKo2iGRKkBo88RVoqcfstf4=; b=w7YMNvaWLyuzjXNgAzGeHj+Hy8+x+HjmxFxtYJudmHuh1Nl2BhxA4xn0nniOYuq6L2 scwoIHmepppomBVrUDaanXm9g5tEZ1+gN0FPbzPspqYpfuovY09DhsNftf8NKIWio24S MJi8iIfmyoI9MYv+FAj3AsNAWR8g4ocAEzKVy32Y50eta9bpzKSdCUS2Y0fF4Z8ufoJC EIatdqrL7kRKwDUNbpyt7z9bg9/Pc9ViGz4nU7DaEhhO54CuVQgLXFUzpWc9fZpcSa81 kO3qIpXC6bDTh2MR4v19rMpiUNuX7UJz9wz+Zz5GxSPNF7/j1IUrGwCAAiqwNyZ2qtwP 6DdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=OL4TIPht; 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 a11-20020a17090a8c0b00b0024697d37bd2si17790552pjo.171.2023.04.25.23.28.10; Tue, 25 Apr 2023 23:28:23 -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=OL4TIPht; 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 S239608AbjDZG1B (ORCPT + 99 others); Wed, 26 Apr 2023 02:27:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239587AbjDZG0p (ORCPT ); Wed, 26 Apr 2023 02:26:45 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BB3630E0; Tue, 25 Apr 2023 23:26:14 -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 33Q64BPN000628; Tue, 25 Apr 2023 23:26:00 -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-type; s=pfpt0220; bh=NWsnQRhNbAbCrxriJEWKZKo2iGRKkBo88RVoqcfstf4=; b=OL4TIPhtk+Ln+aQNzUTbmjgGfheT5xwlmc/EKI6KU+Un8AwhHxJeNhEDhzTu9Iev/5vY 5Ird6TbP33Kt8rEgNPecNZgc7M6IybIYJS9ADfgWRbiG/1AW7j/uY/GwAWNOI7U5UlB4 PFwSULURCAuiTnTD2+jvEIUDsPKvrwgy5dUnIVL5L0dHGp6gV4Nd/bHn38zfdfrIxmiT J63GFmv3v41kFyEqLkfeCUVhKavpW7AUZ01MHujySq1/9s1j3EHSLESzD/XjC8FLZdWH Sn+WSGcQHmxXKt3jjqt2UuyuXZaCbrtPQAzcMiib0RcKBr05IiqvRRxUehZUe4vLG298 Xw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q4f3pdcwx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 25 Apr 2023 23:26:00 -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; Tue, 25 Apr 2023 23:25:58 -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; Tue, 25 Apr 2023 23:25:58 -0700 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id 22A2B3F703F; Tue, 25 Apr 2023 23:25:54 -0700 (PDT) From: Geetha sowjanya To: , CC: , , , , , , , , Subject: [net PATCH v2 7/9] octeontx2-pf: mcs: Clear stats before freeing resource Date: Wed, 26 Apr 2023 11:55:26 +0530 Message-ID: <20230426062528.20575-8-gakula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230426062528.20575-1-gakula@marvell.com> References: <20230426062528.20575-1-gakula@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-ORIG-GUID: o59QDe_AVULKCUDE6NTxpSzbOHjb0mBv X-Proofpoint-GUID: o59QDe_AVULKCUDE6NTxpSzbOHjb0mBv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-26_02,2023-04-25_01,2023-02-09_01 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_NONE,T_SCC_BODY_TEXT_LINE,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 From: Subbaraya Sundeep When freeing MCS hardware resources like SecY, SC and SA the corresponding stats needs to be cleared. Otherwise previous stats are shown in newly created macsec interfaces. Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: Geetha sowjanya Reviewed-by: Leon Romanovsky --- .../net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c index f3140f466b37..a108f986be50 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c @@ -150,11 +150,20 @@ static void cn10k_mcs_free_rsrc(struct otx2_nic *pfvf, enum mcs_direction dir, enum mcs_rsrc_type type, u16 hw_rsrc_id, bool all) { + struct mcs_clear_stats *clear_req; struct mbox *mbox = &pfvf->mbox; struct mcs_free_rsrc_req *req; mutex_lock(&mbox->lock); + clear_req = otx2_mbox_alloc_msg_mcs_clear_stats(mbox); + if (!clear_req) + goto fail; + + clear_req->id = hw_rsrc_id; + clear_req->type = type; + clear_req->dir = dir; + req = otx2_mbox_alloc_msg_mcs_free_resources(mbox); if (!req) goto fail; -- 2.25.1