From patchwork Thu Apr 21 14:37:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 109998 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 ED394A0093; Thu, 21 Apr 2022 16:37:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D02AB40042; Thu, 21 Apr 2022 16:37:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 9D1F240040 for ; Thu, 21 Apr 2022 16:37:28 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23LCeLfN027292; Thu, 21 Apr 2022 07:37:27 -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=fHpTtl72rGJMNh+Zpz4NPwAFj/z32QR8EcAtkSwWxL0=; b=BFUaLQyIeukanppy3G0n/VvJiICzqOFXX9QLLCTCxBjPL2hSTUUPLPRRt7iomBNKeM/G GUDqS2obnLdqnOOHmpuxrZDCLroQhTFPKW7GjF51+H919a1kp1I6vKZ6d3RXCXPHJgxm dpYWZcO12NulneVW2o4THSCk2oqzSiRVfQWiOU0cfwNFesR5hXs7KrS+yeiZk3aHDUPE GunSsvj5aHrDZMcpLAAwS9wx/0DWSH8W0XN3QwHB11sRbScndbTJwSYr/ebRPPxZctY/ xCHVUslTee113AlPl8VRU7P+qrbqBd8HbCNb94IvKISfHOcQVaRE3x9jIyR4/AMwWhYR Ag== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3fhtapjc9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 21 Apr 2022 07:37:27 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 21 Apr 2022 07:37:25 -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.18 via Frontend Transport; Thu, 21 Apr 2022 07:37:25 -0700 Received: from localhost.localdomain (unknown [10.28.48.55]) by maili.marvell.com (Postfix) with ESMTP id 0218C3F7059; Thu, 21 Apr 2022 07:37:22 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , Akhil Goyal Subject: [PATCH v3 0/7] Add new cryptodev op for event metadata Date: Thu, 21 Apr 2022 20:07:13 +0530 Message-ID: <20220421143720.1583062-1-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220418193325.368313-1-gakhil@marvell.com> References: <20220418193325.368313-1-gakhil@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: CE3PTf9QcxioC7_WtOB6OqH_Nkun5J1I X-Proofpoint-ORIG-GUID: CE3PTf9QcxioC7_WtOB6OqH_Nkun5J1I X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-21_01,2022-04-21_01,2022-02-23_01 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 For using event crypto metadata, event metadata need to be set in session. For this session user data was used for symmetric crypto sessions and no support was present for asymmetric and security sessions. The use of userdata to store event metadata (which is dereferenced in PMD) is not correct as it is meant for the application to use it. Hence, a new API is created to set and get event crypto metadata which is scalable to all sessions supported by the crypto PMD. The application can use the set API to set event metadata and the PMD may store that inside the session private data and PMD need not use the get API as it would be internal to the PMD. For the software event crypto adapter implementation, the eventdev library can use the get API to get the event metadata stored inside the session structure. For Asymmetric sessions, a new field is added inside the session struct which is internal to library. For symmetric and security sessions, new field cannot be added as it would be ABI break. Hence, session userdata is being used to store that as it was used earlier. In next ABI break release this would be fixed similar to asymmetric crypto case. The patchset also add support for asymmetric crypto adapter in the test applications and the crypto/cnxk implementation of the new cryptodev op and corresponding changes in the eventdev lib. Changes in v3: - fix SW adapter case of memory allocation/free of mdata. mdata is allocated in set API and freed in session clear/destroy. - mark rte_cryptodev_session_event_mdata_get as internal API as it is only needed for the app or the PMD. changes in v2: - v1 patchset only fixed security sessions and also caused ABI breakage. This is fixed in v2. - added new API for setting event metadata. - added new cryptodev op which can handle all sessions Akhil Goyal (5): crypto/octeontx: use new API for event metadata test/event: use new API to set event crypto metadata eventdev: use new API to get event crypto metadata test/event: add asymmetric cases for crypto adapter test-eventdev: support asym ops for crypto adapter Volodymyr Fialko (2): cryptodev: add APIs to get/set event metadata crypto/cnxk: add event metadata set operation app/test-eventdev/evt_common.h | 2 + app/test-eventdev/evt_options.c | 17 + app/test-eventdev/evt_options.h | 4 + app/test-eventdev/test_perf_atq.c | 12 +- app/test-eventdev/test_perf_common.c | 254 ++++++++-- app/test-eventdev/test_perf_common.h | 45 +- app/test-eventdev/test_perf_queue.c | 12 +- app/test/test_event_crypto_adapter.c | 503 +++++++++++++++++++- doc/guides/tools/testeventdev.rst | 5 + drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 144 +++++- drivers/crypto/cnxk/cn10k_ipsec.h | 2 + drivers/crypto/cnxk/cn9k_cryptodev_ops.c | 138 +++++- drivers/crypto/cnxk/cn9k_ipsec.h | 2 + drivers/crypto/cnxk/cnxk_ae.h | 2 + drivers/crypto/cnxk/cnxk_cryptodev_ops.h | 18 - drivers/crypto/cnxk/cnxk_se.h | 2 + drivers/crypto/octeontx/otx_cryptodev_ops.c | 20 +- lib/cryptodev/cryptodev_pmd.c | 16 + lib/cryptodev/cryptodev_pmd.h | 36 ++ lib/cryptodev/rte_cryptodev.c | 41 ++ lib/cryptodev/rte_cryptodev.h | 22 + lib/cryptodev/version.map | 4 + lib/eventdev/rte_event_crypto_adapter.c | 55 +-- 23 files changed, 1168 insertions(+), 188 deletions(-) Acked-by: Abhinandan Gujjar