From patchwork Tue Sep 19 13:54: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: 131633 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 22E8442606; Tue, 19 Sep 2023 15:54:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A68040C35; Tue, 19 Sep 2023 15:54:24 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id EB428406FF for ; Tue, 19 Sep 2023 15:54:22 +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 38J66Jpc023472 for ; Tue, 19 Sep 2023 06:54:22 -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=Dd7JqVtz3uFFGe+cdTdKMpqKnUxr1ghAJs53Ny67QDc=; b=LQoqIKw6nSO/q/Yi74Whscj40AmLKROkvuJEV7dejNKHI5jw9Bv2VNP9aSNyP1/o6iXO KG+J/8qXGvkWJM2+VvP49J1yoGR0hZl+ADYr2di1JBmCcouh4S1RF160kN5yTK9ooj5t sIr67A4LhKET3CeBTh836rUObotbMqR2vxJEz/AlhvdTF8vGqH5/s+o72y7DaP9hW5W5 bir7gqEkhAYLTdFBvL19v63c7yDwAdMjcASGHi1mzHXosFrxJewJxos7Xb1StoM5LYTk xk9V/vJN8yd0X1BYDx+srEAj50nIFjJ7tWeeUnBuxct5INN74RPUvXz0YF3qkV7kut52 ZQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3t5bvkrmn2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 19 Sep 2023 06:54:22 -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, 19 Sep 2023 06:54:20 -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, 19 Sep 2023 06:54:19 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id 3D0383F70AA; Tue, 19 Sep 2023 06:54:16 -0700 (PDT) From: Akhil Goyal To: CC: , , , Akhil Goyal Subject: [PATCH v2 1/3] security: add MACsec algo in capability index Date: Tue, 19 Sep 2023 19:24:07 +0530 Message-ID: <20230919135409.2544309-2-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230919135409.2544309-1-gakhil@marvell.com> References: <20230731034447.929506-1-gakhil@marvell.com> <20230919135409.2544309-1-gakhil@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: goNc0g4PLLcA9BVaujdBlVEVHOIyXky5 X-Proofpoint-ORIG-GUID: goNc0g4PLLcA9BVaujdBlVEVHOIyXky5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-19_06,2023-09-19_01,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 From: Ankur Dwivedi This patch adds the MACsec algorithm field in security capability index structure. This field is compared against the MACsec alg to return the correct capability. Signed-off-by: Ankur Dwivedi Acked-by: Akhil Goyal --- lib/security/rte_security.c | 4 ++++ lib/security/rte_security.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c index c4d64bb8e9..2d729b735b 100644 --- a/lib/security/rte_security.c +++ b/lib/security/rte_security.c @@ -282,6 +282,10 @@ rte_security_capability_get(struct rte_security_ctx *instance, if (capability->docsis.direction == idx->docsis.direction) return capability; + } else if (idx->protocol == + RTE_SECURITY_PROTOCOL_MACSEC) { + if (idx->macsec.alg == capability->macsec.alg) + return capability; } } } diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h index c6550f4d8d..439bbb957f 100644 --- a/lib/security/rte_security.h +++ b/lib/security/rte_security.h @@ -1252,6 +1252,9 @@ struct rte_security_capability_idx { struct { enum rte_security_docsis_direction direction; } docsis; + struct { + enum rte_security_macsec_alg alg; + } macsec; }; };