From patchwork Tue May 23 19:49:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 127236 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2AEA42B83; Tue, 23 May 2023 21:50:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0343542D3D; Tue, 23 May 2023 21:50:03 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id A133742D3D for ; Tue, 23 May 2023 21:50:01 +0200 (CEST) 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 34NHu0VI011786; Tue, 23 May 2023 12:49:58 -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=/te6SjN+49DdP6sPClyO7QlARO0aWlJ/UKPWoUWMVa0=; b=QMXVCU8rnz0BlxAg5BBrQydxEG4jhlTR/QTBZUjAVaLOjE8IFCpLAp1NC4ZZ5By/q596 o3+r6kuqnon/LSinpMdTesSPhenYicV91ENrS+PP+1J7zr/JF9d1bOXwZxkDTvgut0sA rOCp+OrgWz/B8Fy9qXI1/ZM7dlMa/BsAsD5AAcgHBRDGVFf+ZmI/ixUAuMWvdn8MPouX wF4F8fSgiXmd33YwkyISHwEuNJDK9xjDYRMJlrKV43haRhHMJ4SgA2/rYMnf3Ma6ZVva bscLGiwtLsMt3sorMP4NJY6uRdhWcxgQDQML6ZDb1mTToae3CQ12mSNmcoonR0vX6Vpb Ew== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3qpwqk30up-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 23 May 2023 12:49:58 -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; Tue, 23 May 2023 12:49:56 -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; Tue, 23 May 2023 12:49:55 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id B1A493F70A9; Tue, 23 May 2023 12:49:52 -0700 (PDT) From: Akhil Goyal To: , Akhil Goyal CC: , , , , , , , , Subject: [PATCH 02/13] security: add MACsec packet number threshold Date: Wed, 24 May 2023 01:19:07 +0530 Message-ID: <20230523194918.1940212-3-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230523194918.1940212-1-gakhil@marvell.com> References: <20220928124516.93050-5-gakhil@marvell.com> <20230523194918.1940212-1-gakhil@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: eYk08Ry4xg76x_KB5gz10IBVldo3JE-4 X-Proofpoint-GUID: eYk08Ry4xg76x_KB5gz10IBVldo3JE-4 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-05-23_12,2023-05-23_02,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Added Packet number threshold parameter in MACsec SC configuration to identify the maximum allowed threshold for packet number field in the packet. A field is_xpn is also added to identify if the SAs are configured for extended packet number or not so that packet number threshold can be configured accordingly. Signed-off-by: Akhil Goyal --- lib/security/rte_security.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h index c7a523b6d6..30bac4e25a 100644 --- a/lib/security/rte_security.h +++ b/lib/security/rte_security.h @@ -399,6 +399,8 @@ struct rte_security_macsec_sa { struct rte_security_macsec_sc { /** Direction of SC */ enum rte_security_macsec_direction dir; + /** Packet number threshold */ + uint64_t pn_threshold; union { struct { /** SAs for each association number */ @@ -407,8 +409,10 @@ struct rte_security_macsec_sc { uint8_t sa_in_use[RTE_SECURITY_MACSEC_NUM_AN]; /** Channel is active */ uint8_t active : 1; + /** Extended packet number is enabled for SAs */ + uint8_t is_xpn : 1; /** Reserved bitfields for future */ - uint8_t reserved : 7; + uint8_t reserved : 6; } sc_rx; struct { uint16_t sa_id; /**< SA ID to be used for encryption */ @@ -416,8 +420,10 @@ struct rte_security_macsec_sc { uint64_t sci; /**< SCI value to be used if send_sci is set */ uint8_t active : 1; /**< Channel is active */ uint8_t re_key_en : 1; /**< Enable Rekeying */ + /** Extended packet number is enabled for SAs */ + uint8_t is_xpn : 1; /** Reserved bitfields for future */ - uint8_t reserved : 6; + uint8_t reserved : 5; } sc_tx; }; };