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 3269642C5A; Thu, 8 Jun 2023 08:55:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A1D142D13; Thu, 8 Jun 2023 08:55:34 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 672F240EE3 for ; Thu, 8 Jun 2023 08:55:29 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 357LwAdY023531; Wed, 7 Jun 2023 23:55:26 -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=U1wtuqs0uQIJVTTth0OGRHqCuskhjA81tRkticd2Rvw=; b=f3NaX+Caew2SIdv9w5O5/zHIvEznwlwKEE0G916emSMEPi3249buSPhuU7wZVI9/QStJ kHrv1OS1sy6domAKALrkoJRUJcQBlfWgEP/5Bt7GFFWlGF6yTC0t6sqIvRaxXzLWWhbr 5Vp3ovk2kfABEtX1mGiKJMMKn0+Gd51quGJXh1OTpQy2PMv7hkz4I2wIuostrTHVE5YN GfsWheo3ta+Y1GwCdJtf4Z/b8QlwlqxMD1FYo9FioyQXmJSdidTPa379U0522ZyI8BtD aAsCoWsiVx2oUKzb1vaGkRBCC+pJdMs8EmaLiQWAjGg6SfXMU4Rgp0X5OL5UKhY9XnjN Ww== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3r329c1jsf-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 07 Jun 2023 23:55:26 -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; Wed, 7 Jun 2023 23:55:07 -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; Wed, 7 Jun 2023 23:55:07 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id 7DFA73F7055; Wed, 7 Jun 2023 23:55:04 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , Akhil Goyal Subject: [PATCH v3 01/13] security: add direction in SA/SC configuration Date: Thu, 8 Jun 2023 12:24:46 +0530 Message-ID: <20230608065458.333670-2-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608065458.333670-1-gakhil@marvell.com> References: <20230607151940.223417-1-gakhil@marvell.com> <20230608065458.333670-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: BXPnlHL0p7r2Lk64dkfH2nxauqkdpuA2 X-Proofpoint-ORIG-GUID: BXPnlHL0p7r2Lk64dkfH2nxauqkdpuA2 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-06-08_04,2023-06-07_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 MACsec SC/SA ids are created based on direction of the flow. Hence, added the missing field for configuration and cleanup of the SCs and SAs. Signed-off-by: Akhil Goyal --- devtools/libabigail.abignore | 4 ++++ lib/security/rte_security.c | 16 ++++++++++------ lib/security/rte_security.h | 14 ++++++++++---- lib/security/rte_security_driver.h | 12 ++++++++++-- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore index c0361bfc7b..03bfbce259 100644 --- a/devtools/libabigail.abignore +++ b/devtools/libabigail.abignore @@ -41,3 +41,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Temporary exceptions till next major ABI version ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Ignore changes to rte_security_ops which are internal to PMD. +[suppress_type] + name = rte_security_ops diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c index e102c55e55..c4d64bb8e9 100644 --- a/lib/security/rte_security.c +++ b/lib/security/rte_security.c @@ -164,13 +164,14 @@ rte_security_macsec_sa_create(struct rte_security_ctx *instance, } int -rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id) +rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id, + enum rte_security_macsec_direction dir) { int ret; RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sc_destroy, -EINVAL, -ENOTSUP); - ret = instance->ops->macsec_sc_destroy(instance->device, sc_id); + ret = instance->ops->macsec_sc_destroy(instance->device, sc_id, dir); if (ret != 0) return ret; @@ -181,13 +182,14 @@ rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id } int -rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id) +rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id, + enum rte_security_macsec_direction dir) { int ret; RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sa_destroy, -EINVAL, -ENOTSUP); - ret = instance->ops->macsec_sa_destroy(instance->device, sa_id); + ret = instance->ops->macsec_sa_destroy(instance->device, sa_id, dir); if (ret != 0) return ret; @@ -199,22 +201,24 @@ rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id int rte_security_macsec_sc_stats_get(struct rte_security_ctx *instance, uint16_t sc_id, + enum rte_security_macsec_direction dir, struct rte_security_macsec_sc_stats *stats) { RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sc_stats_get, -EINVAL, -ENOTSUP); RTE_PTR_OR_ERR_RET(stats, -EINVAL); - return instance->ops->macsec_sc_stats_get(instance->device, sc_id, stats); + return instance->ops->macsec_sc_stats_get(instance->device, sc_id, dir, stats); } int rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance, uint16_t sa_id, + enum rte_security_macsec_direction dir, struct rte_security_macsec_sa_stats *stats) { RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sa_stats_get, -EINVAL, -ENOTSUP); RTE_PTR_OR_ERR_RET(stats, -EINVAL); - return instance->ops->macsec_sa_stats_get(instance->device, sa_id, stats); + return instance->ops->macsec_sa_stats_get(instance->device, sa_id, dir, stats); } int diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h index 4bacf9fcd9..c7a523b6d6 100644 --- a/lib/security/rte_security.h +++ b/lib/security/rte_security.h @@ -761,6 +761,7 @@ rte_security_macsec_sc_create(struct rte_security_ctx *instance, * * @param instance security instance * @param sc_id SC ID to be destroyed + * @param dir direction of the SC * @return * - 0 if successful. * - -EINVAL if sc_id is invalid or instance is NULL. @@ -768,7 +769,8 @@ rte_security_macsec_sc_create(struct rte_security_ctx *instance, */ __rte_experimental int -rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id); +rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id, + enum rte_security_macsec_direction dir); /** * @warning @@ -798,6 +800,7 @@ rte_security_macsec_sa_create(struct rte_security_ctx *instance, * * @param instance security instance * @param sa_id SA ID to be destroyed + * @param dir direction of the SA * @return * - 0 if successful. * - -EINVAL if sa_id is invalid or instance is NULL. @@ -805,7 +808,8 @@ rte_security_macsec_sa_create(struct rte_security_ctx *instance, */ __rte_experimental int -rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id); +rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id, + enum rte_security_macsec_direction dir); /** Device-specific metadata field type */ typedef uint64_t rte_security_dynfield_t; @@ -1077,6 +1081,7 @@ rte_security_session_stats_get(struct rte_security_ctx *instance, * * @param instance security instance * @param sa_id SA ID for which stats are needed + * @param dir direction of the SA * @param stats statistics * @return * - On success, return 0. @@ -1085,7 +1090,7 @@ rte_security_session_stats_get(struct rte_security_ctx *instance, __rte_experimental int rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance, - uint16_t sa_id, + uint16_t sa_id, enum rte_security_macsec_direction dir, struct rte_security_macsec_sa_stats *stats); /** @@ -1096,6 +1101,7 @@ rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance, * * @param instance security instance * @param sc_id SC ID for which stats are needed + * @param dir direction of the SC * @param stats SC statistics * @return * - On success, return 0. @@ -1104,7 +1110,7 @@ rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance, __rte_experimental int rte_security_macsec_sc_stats_get(struct rte_security_ctx *instance, - uint16_t sc_id, + uint16_t sc_id, enum rte_security_macsec_direction dir, struct rte_security_macsec_sc_stats *stats); /** diff --git a/lib/security/rte_security_driver.h b/lib/security/rte_security_driver.h index 421e6f7780..677c7d1f91 100644 --- a/lib/security/rte_security_driver.h +++ b/lib/security/rte_security_driver.h @@ -106,8 +106,10 @@ typedef int (*security_macsec_sc_create_t)(void *device, struct rte_security_mac * * @param device Crypto/eth device pointer * @param sc_id MACsec SC ID + * @param dir Direction of SC */ -typedef int (*security_macsec_sc_destroy_t)(void *device, uint16_t sc_id); +typedef int (*security_macsec_sc_destroy_t)(void *device, uint16_t sc_id, + enum rte_security_macsec_direction dir); /** * Configure a MACsec security Association (SA) on a device. @@ -128,8 +130,10 @@ typedef int (*security_macsec_sa_create_t)(void *device, struct rte_security_mac * * @param device Crypto/eth device pointer * @param sa_id MACsec SA ID + * @param dir Direction of SA */ -typedef int (*security_macsec_sa_destroy_t)(void *device, uint16_t sa_id); +typedef int (*security_macsec_sa_destroy_t)(void *device, uint16_t sa_id, + enum rte_security_macsec_direction dir); /** * Get the size of a security session @@ -162,6 +166,7 @@ typedef int (*security_session_stats_get_t)(void *device, * * @param device Crypto/eth device pointer * @param sc_id secure channel ID created by rte_security_macsec_sc_create() + * @param dir direction of SC * @param stats SC stats of the driver * * @return @@ -169,6 +174,7 @@ typedef int (*security_session_stats_get_t)(void *device, * - -EINVAL if sc_id or device is invalid. */ typedef int (*security_macsec_sc_stats_get_t)(void *device, uint16_t sc_id, + enum rte_security_macsec_direction dir, struct rte_security_macsec_sc_stats *stats); /** @@ -176,6 +182,7 @@ typedef int (*security_macsec_sc_stats_get_t)(void *device, uint16_t sc_id, * * @param device Crypto/eth device pointer * @param sa_id secure channel ID created by rte_security_macsec_sc_create() + * @param dir direction of SA * @param stats SC stats of the driver * * @return @@ -183,6 +190,7 @@ typedef int (*security_macsec_sc_stats_get_t)(void *device, uint16_t sc_id, * - -EINVAL if sa_id or device is invalid. */ typedef int (*security_macsec_sa_stats_get_t)(void *device, uint16_t sa_id, + enum rte_security_macsec_direction dir, struct rte_security_macsec_sa_stats *stats); -- 2.25.1