From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE9D542F93; Mon, 31 Jul 2023 05:45:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E234643254; Mon, 31 Jul 2023 05:45:11 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D683740A89 for ; Mon, 31 Jul 2023 05:45:10 +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 36UNIcO5012062 for ; Sun, 30 Jul 2023 20:45:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=dHYaK053Ra/POhBOznoAQfA9lZusFtqgjAAF+J94Yk4=; b=ABGxSFL/ACOulxksBuLLsIX0ugd1179x6as6B4TlVj0HNOuD9WDVCJcN1QAkq3Cujtg/ acYN6TLlZA8Zj3hRKANS3zzHKP1zGnTb8BMqEd8aHVfe7brxDT5BuCQLXttNC2Sjg3M8 koeo+ksQ7QIs8QwzQafSwVft9tPQA9spFOUY0eqGXdiYChqFgBn9eVrwPHFHvujRPpuB EKvjEz7Ugz+fkMr4JLnwXhe0e+cD3UvxmelTBiTlMjDmJTobTePiCfgeGYdwdPT0qRmt tIlhhgZTi3JH/uiJfjYlmeX9JlQKKO5CiGyyKeZWQ02BVQoNBbz1kc5pOsxRICdkqj2I DQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3s529k3jvq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 30 Jul 2023 20:45:09 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sun, 30 Jul 2023 20:44:54 -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; Sun, 30 Jul 2023 20:44:54 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id E7DB53F70B7; Sun, 30 Jul 2023 20:44:52 -0700 (PDT) From: Akhil Goyal To: CC: , , Subject: [PATCH 1/3] security: add MACsec algo in capability index Date: Mon, 31 Jul 2023 09:14:45 +0530 Message-ID: <20230731034447.929506-1-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: vyFZmTTilq8WU3OftEq0E6QklmKOTt1f X-Proofpoint-ORIG-GUID: vyFZmTTilq8WU3OftEq0E6QklmKOTt1f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-27_10,2023-07-26_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 --- 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 3b2df526ba..5459002d43 100644 --- a/lib/security/rte_security.h +++ b/lib/security/rte_security.h @@ -1251,6 +1251,9 @@ struct rte_security_capability_idx { struct { enum rte_security_docsis_direction direction; } docsis; + struct { + enum rte_security_macsec_alg alg; + } macsec; }; }; -- 2.25.1