Message ID | 20230426062528.20575-8-gakula@marvell.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp42212vqo; Tue, 25 Apr 2023 23:37:18 -0700 (PDT) X-Google-Smtp-Source: AKy350arwoRJYvHVWqbgAdn8UTRWqgMRU9/P8aSH8DCusUsaGnpV0lVO7RtIwXA7KgLVavC/HnTE X-Received: by 2002:a17:90a:9a97:b0:247:862d:a224 with SMTP id e23-20020a17090a9a9700b00247862da224mr19688049pjp.27.1682491038284; Tue, 25 Apr 2023 23:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682491038; cv=none; d=google.com; s=arc-20160816; b=oZcqp8LggaBLhzwpRsF69m2jWdYaH3tRrelhzkT4dukSQnj+RC9GbWhw4muJ6Re6jv sPMRtkmdCWKSIn02PUIgnBz+0aUTCrtokToBplG4j4OWfdK2+rSVv0FV+56AIYk3s9RP 8g87gj6zs21vJDdhnOMyIdHoo94hzjGrQDcujliWUIid2j9uwvnImxtYjNKfk4RhFwwl RUE/nsvQz7My/3iEjKHAh+smdLbjt+pI6aonxfqZ20YjEtqQblq5bStDpMx7dnbVDer2 nR0g2GuHibGk38xKUb9qqxBZ31QbaXaWjzSrta3+zjUeTL0s9IGYaVhqqJqU5LX+ETsm fiWw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a631015000000b0050b51e62c1asi16929021pgl.63.2023.04.25.23.37.03; Tue, 25 Apr 2023 23:37:18 -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 S239564AbjDZG1B (ORCPT <rfc822;zxc52fgh@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <gakula@marvell.com> To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: <kuba@kernel.org>, <davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>, <richardcochran@gmail.com>, <sgoutham@marvell.com>, <gakula@marvell.com>, <sbhatta@marvell.com>, <hkelam@marvell.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764219723002803787?= X-GMAIL-MSGID: =?utf-8?q?1764219723002803787?= |
Series |
Macsec fixes for CN10KB
|
|
Commit Message
Geetha sowjanya
April 26, 2023, 6:25 a.m. UTC
From: Subbaraya Sundeep <sbhatta@marvell.com> 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 <sbhatta@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> --- .../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;