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 A96A143C30; Sat, 2 Mar 2024 10:38:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F3B8427E6; Sat, 2 Mar 2024 10:38:44 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 669304067E for ; Sat, 2 Mar 2024 10:38:42 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4227HTuV029680; Sat, 2 Mar 2024 01:38:41 -0800 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=Zo88+aRjswIPfN7XYP4P8NUEroL1ovIXwtTDGggGhmc=; b=W0T 6g/5H/6bVPg3fy3HksTi9OyvtQd4ZnnHOqBNO3Ts00Ubb3BDKPFVIAYQMQT4BijS Axprrb/jixyb5cm3c0AWaOZzXRRZsDTpdq+MjpXZ9s2sH8jGkm7PM3mxpPPTKgbT YqGl8mJ9LcVkx+UVJSBUNA6lDG6qNoteLUaMKsqRoe7URqXwHFvLgypluCk/0v1N fH8tHRCFvw6HyXZrkMx7J+bXJ5dlAABoe8C6nwhszUzu+3c0S0tuCPZf/mncJ4kU 6HH0XrYMhWDCkTvLeAqh0gW+wr2fTWpKOCI7xJSX9uQ6SpYVhzxwro+3bdijRA01 DzI+K4IDNx5J9GHVw5A== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wjfayafp2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 02 Mar 2024 01:38:41 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Sat, 2 Mar 2024 01:38:40 -0800 Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 2 Mar 2024 01:38:37 -0800 Received: from hyd1399.caveonetworks.com.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Sat, 2 Mar 2024 01:38:35 -0800 From: Nagadheeraj Rottela To: , , CC: , Nagadheeraj Rottela Subject: [PATCH v5 1/7] crypto/nitrox: move common code Date: Sat, 2 Mar 2024 15:08:07 +0530 Message-ID: <20240302093813.14922-2-rnagadheeraj@marvell.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240302093813.14922-1-rnagadheeraj@marvell.com> References: <20240302093813.14922-1-rnagadheeraj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: j20hCWmCSvGi7DiBN2hXjXfBDFGxa2in X-Proofpoint-GUID: j20hCWmCSvGi7DiBN2hXjXfBDFGxa2in X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-02_04,2024-03-01_03,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 A new compressdev Nitrox PMD will be added in next few patches. This patch moves some of the common code which is shared across Nitrox crypto and compress drivers to drivers/common/nitrox folder. Signed-off-by: Nagadheeraj Rottela --- MAINTAINERS | 1 + drivers/common/nitrox/meson.build | 18 ++++++++++++++++++ drivers/{crypto => common}/nitrox/nitrox_csr.h | 0 .../{crypto => common}/nitrox/nitrox_device.c | 14 ++++++++++++++ .../{crypto => common}/nitrox/nitrox_device.h | 1 - drivers/{crypto => common}/nitrox/nitrox_hal.c | 0 drivers/{crypto => common}/nitrox/nitrox_hal.h | 0 .../{crypto => common}/nitrox/nitrox_logs.c | 0 .../{crypto => common}/nitrox/nitrox_logs.h | 0 drivers/{crypto => common}/nitrox/nitrox_qp.c | 2 +- drivers/{crypto => common}/nitrox/nitrox_qp.h | 11 ++++++++++- drivers/common/nitrox/version.map | 9 +++++++++ drivers/crypto/nitrox/meson.build | 11 +++++------ drivers/meson.build | 1 + 14 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 drivers/common/nitrox/meson.build rename drivers/{crypto => common}/nitrox/nitrox_csr.h (100%) rename drivers/{crypto => common}/nitrox/nitrox_device.c (92%) rename drivers/{crypto => common}/nitrox/nitrox_device.h (94%) rename drivers/{crypto => common}/nitrox/nitrox_hal.c (100%) rename drivers/{crypto => common}/nitrox/nitrox_hal.h (100%) rename drivers/{crypto => common}/nitrox/nitrox_logs.c (100%) rename drivers/{crypto => common}/nitrox/nitrox_logs.h (100%) rename drivers/{crypto => common}/nitrox/nitrox_qp.c (99%) rename drivers/{crypto => common}/nitrox/nitrox_qp.h (91%) create mode 100644 drivers/common/nitrox/version.map diff --git a/MAINTAINERS b/MAINTAINERS index 962c359cdd..d6abebc55c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1142,6 +1142,7 @@ Marvell Nitrox M: Nagadheeraj Rottela M: Srikanth Jampala F: drivers/crypto/nitrox/ +F: drivers/common/nitrox/ F: doc/guides/cryptodevs/nitrox.rst F: doc/guides/cryptodevs/features/nitrox.ini diff --git a/drivers/common/nitrox/meson.build b/drivers/common/nitrox/meson.build new file mode 100644 index 0000000000..99fadbbfc9 --- /dev/null +++ b/drivers/common/nitrox/meson.build @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2024 Marvell. + +if not is_linux + build = false + reason = 'only supported on Linux' +endif + +deps += ['bus_pci'] + +sources += files( + 'nitrox_device.c', + 'nitrox_hal.c', + 'nitrox_logs.c', + 'nitrox_qp.c', +) + +includes += include_directories('../../crypto/nitrox') diff --git a/drivers/crypto/nitrox/nitrox_csr.h b/drivers/common/nitrox/nitrox_csr.h similarity index 100% rename from drivers/crypto/nitrox/nitrox_csr.h rename to drivers/common/nitrox/nitrox_csr.h diff --git a/drivers/crypto/nitrox/nitrox_device.c b/drivers/common/nitrox/nitrox_device.c similarity index 92% rename from drivers/crypto/nitrox/nitrox_device.c rename to drivers/common/nitrox/nitrox_device.c index 5b319dd681..b2f638ec8a 100644 --- a/drivers/crypto/nitrox/nitrox_device.c +++ b/drivers/common/nitrox/nitrox_device.c @@ -120,5 +120,19 @@ static struct rte_pci_driver nitrox_pmd = { .remove = nitrox_pci_remove, }; +__rte_weak int +nitrox_sym_pmd_create(struct nitrox_device *ndev) +{ + RTE_SET_USED(ndev); + return 0; +} + +__rte_weak int +nitrox_sym_pmd_destroy(struct nitrox_device *ndev) +{ + RTE_SET_USED(ndev); + return 0; +} + RTE_PMD_REGISTER_PCI(nitrox, nitrox_pmd); RTE_PMD_REGISTER_PCI_TABLE(nitrox, pci_id_nitrox_map); diff --git a/drivers/crypto/nitrox/nitrox_device.h b/drivers/common/nitrox/nitrox_device.h similarity index 94% rename from drivers/crypto/nitrox/nitrox_device.h rename to drivers/common/nitrox/nitrox_device.h index 1ff7c59b63..b7c7ffd772 100644 --- a/drivers/crypto/nitrox/nitrox_device.h +++ b/drivers/common/nitrox/nitrox_device.h @@ -6,7 +6,6 @@ #define _NITROX_DEVICE_H_ #include -#include struct nitrox_sym_device; diff --git a/drivers/crypto/nitrox/nitrox_hal.c b/drivers/common/nitrox/nitrox_hal.c similarity index 100% rename from drivers/crypto/nitrox/nitrox_hal.c rename to drivers/common/nitrox/nitrox_hal.c diff --git a/drivers/crypto/nitrox/nitrox_hal.h b/drivers/common/nitrox/nitrox_hal.h similarity index 100% rename from drivers/crypto/nitrox/nitrox_hal.h rename to drivers/common/nitrox/nitrox_hal.h diff --git a/drivers/crypto/nitrox/nitrox_logs.c b/drivers/common/nitrox/nitrox_logs.c similarity index 100% rename from drivers/crypto/nitrox/nitrox_logs.c rename to drivers/common/nitrox/nitrox_logs.c diff --git a/drivers/crypto/nitrox/nitrox_logs.h b/drivers/common/nitrox/nitrox_logs.h similarity index 100% rename from drivers/crypto/nitrox/nitrox_logs.h rename to drivers/common/nitrox/nitrox_logs.h diff --git a/drivers/crypto/nitrox/nitrox_qp.c b/drivers/common/nitrox/nitrox_qp.c similarity index 99% rename from drivers/crypto/nitrox/nitrox_qp.c rename to drivers/common/nitrox/nitrox_qp.c index 5e85ccbd51..79a26f0024 100644 --- a/drivers/crypto/nitrox/nitrox_qp.c +++ b/drivers/common/nitrox/nitrox_qp.c @@ -2,7 +2,7 @@ * Copyright(C) 2019 Marvell International Ltd. */ -#include +#include #include #include "nitrox_qp.h" diff --git a/drivers/crypto/nitrox/nitrox_qp.h b/drivers/common/nitrox/nitrox_qp.h similarity index 91% rename from drivers/crypto/nitrox/nitrox_qp.h rename to drivers/common/nitrox/nitrox_qp.h index d42d53f92b..23dffd1268 100644 --- a/drivers/crypto/nitrox/nitrox_qp.h +++ b/drivers/common/nitrox/nitrox_qp.h @@ -22,6 +22,13 @@ struct rid { struct nitrox_softreq *sr; }; +struct nitrox_qp_stats { + uint64_t enqueued_count; + uint64_t dequeued_count; + uint64_t enqueue_err_count; + uint64_t dequeue_err_count; +}; + struct nitrox_qp { struct command_queue cmdq; struct rid *ridq; @@ -29,7 +36,7 @@ struct nitrox_qp { uint32_t head; uint32_t tail; struct rte_mempool *sr_mp; - struct rte_cryptodev_stats stats; + struct nitrox_qp_stats stats; uint16_t qno; rte_atomic16_t pending_count; }; @@ -96,9 +103,11 @@ nitrox_qp_dequeue(struct nitrox_qp *qp) rte_atomic16_dec(&qp->pending_count); } +__rte_internal int nitrox_qp_setup(struct nitrox_qp *qp, uint8_t *bar_addr, const char *dev_name, uint32_t nb_descriptors, uint8_t inst_size, int socket_id); +__rte_internal int nitrox_qp_release(struct nitrox_qp *qp, uint8_t *bar_addr); #endif /* _NITROX_QP_H_ */ diff --git a/drivers/common/nitrox/version.map b/drivers/common/nitrox/version.map new file mode 100644 index 0000000000..43295171e4 --- /dev/null +++ b/drivers/common/nitrox/version.map @@ -0,0 +1,9 @@ +INTERNAL { + global: + + nitrox_logtype; + nitrox_qp_release; + nitrox_qp_setup; + + local: *; +}; diff --git a/drivers/crypto/nitrox/meson.build b/drivers/crypto/nitrox/meson.build index 2cc47c4626..f8887713d2 100644 --- a/drivers/crypto/nitrox/meson.build +++ b/drivers/crypto/nitrox/meson.build @@ -6,13 +6,12 @@ if not is_linux reason = 'only supported on Linux' endif -deps += ['bus_pci'] -sources = files( - 'nitrox_device.c', - 'nitrox_hal.c', - 'nitrox_logs.c', +deps += ['common_nitrox', 'bus_pci', 'cryptodev'] + +sources += files( 'nitrox_sym.c', 'nitrox_sym_capabilities.c', 'nitrox_sym_reqmgr.c', - 'nitrox_qp.c', ) + +includes += include_directories('../../common/nitrox') diff --git a/drivers/meson.build b/drivers/meson.build index f2be71bc05..9fd66e3264 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -14,6 +14,7 @@ subdirs = [ 'common/cnxk', # depends on bus. 'common/mlx5', # depends on bus. 'common/nfp', # depends on bus. + 'common/nitrox', # depends on bus. 'common/qat', # depends on bus. 'common/sfc_efx', # depends on bus. 'mempool', # depends on common and bus. -- 2.42.0