cryptodev: move device-specific structures
authorAkhil Goyal <gakhil@marvell.com>
Wed, 20 Oct 2021 11:27:54 +0000 (16:57 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Wed, 20 Oct 2021 13:33:16 +0000 (15:33 +0200)
The device specific structures - rte_cryptodev
and rte_cryptodev_data are moved to cryptodev_pmd.h
to hide it from the applications.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
24 files changed:
doc/guides/rel_notes/release_21_11.rst
drivers/crypto/ccp/ccp_dev.h
drivers/crypto/cnxk/cn10k_ipsec.c
drivers/crypto/cnxk/cn9k_ipsec.c
drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
drivers/crypto/cnxk/cnxk_cryptodev_sec.c
drivers/crypto/nitrox/nitrox_sym_reqmgr.c
drivers/crypto/octeontx/otx_cryptodev.c
drivers/crypto/octeontx/otx_cryptodev_hw_access.c
drivers/crypto/octeontx/otx_cryptodev_hw_access.h
drivers/crypto/octeontx/otx_cryptodev_ops.h
drivers/crypto/octeontx2/otx2_cryptodev_mbox.c
drivers/crypto/scheduler/scheduler_failover.c
drivers/crypto/scheduler/scheduler_multicore.c
drivers/crypto/scheduler/scheduler_pkt_size_distr.c
drivers/crypto/scheduler/scheduler_roundrobin.c
drivers/event/cnxk/cnxk_eventdev.h
drivers/event/dpaa/dpaa_eventdev.c
drivers/event/dpaa2/dpaa2_eventdev.c
drivers/event/octeontx/ssovf_evdev.c
drivers/event/octeontx2/otx2_evdev_crypto_adptr.c
lib/cryptodev/cryptodev_pmd.h
lib/cryptodev/rte_cryptodev_core.h
lib/cryptodev/version.map

index 9f29238..7a25f11 100644 (file)
@@ -470,6 +470,12 @@ ABI Changes
   to be transparent for both users (no changes in user app is required) and
   PMD developers (no changes in PMD is required).
 
+* cryptodev: Made ``rte_cryptodev``, ``rte_cryptodev_data`` private
+  structures internal to DPDK. ``rte_cryptodevs`` can't be accessed directly
+  by user any more. While it is an ABI breakage, this change is intended
+  to be transparent for both users (no changes in user app is required) and
+  PMD developers (no changes in PMD is required).
+
 * security: ``rte_security_set_pkt_metadata`` and ``rte_security_get_userdata``
   routines used by inline outbound and inline inbound security processing were
   made inline and enhanced to do simple 64-bit set/get for PMDs that do not
index ca5145c..85c8fc4 100644 (file)
@@ -17,7 +17,7 @@
 #include <rte_pci.h>
 #include <rte_spinlock.h>
 #include <rte_crypto_sym.h>
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 
 /**< CCP sspecific */
 #define MAX_HW_QUEUES                   5
index defc792..27df1dc 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 #include <rte_malloc.h>
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_esp.h>
 #include <rte_ip.h>
 #include <rte_security.h>
index 9ca4d20..53fb793 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright(C) 2021 Marvell.
  */
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_ip.h>
 #include <rte_security.h>
 #include <rte_security_driver.h>
index a227e69..a53b489 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright(C) 2021 Marvell.
  */
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_security.h>
 
 #include "roc_api.h"
index 8d04d4b..2021d5c 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright(C) 2021 Marvell.
  */
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_malloc.h>
 #include <rte_security.h>
 #include <rte_security_driver.h>
index fe3ca25..9edb0cc 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 #include <rte_crypto.h>
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_cycles.h>
 #include <rte_errno.h>
 
index 05b7832..337d06a 100644 (file)
@@ -4,7 +4,6 @@
 
 #include <rte_bus_pci.h>
 #include <rte_common.h>
-#include <rte_cryptodev.h>
 #include <cryptodev_pmd.h>
 #include <rte_log.h>
 #include <rte_pci.h>
index 7b89a62..20b2883 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <rte_branch_prediction.h>
 #include <rte_common.h>
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_errno.h>
 #include <rte_mempool.h>
 #include <rte_memzone.h>
index 7c6b1e4..e48805f 100644 (file)
@@ -7,7 +7,7 @@
 #include <stdbool.h>
 
 #include <rte_branch_prediction.h>
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_cycles.h>
 #include <rte_io.h>
 #include <rte_memory.h>
index f234f16..83b82ea 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef _OTX_CRYPTODEV_OPS_H_
 #define _OTX_CRYPTODEV_OPS_H_
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 
 #define OTX_CPT_MIN_HEADROOM_REQ       (24)
 #define OTX_CPT_MIN_TAILROOM_REQ       (8)
index 1a8edae..f9e7b0b 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright (C) 2019 Marvell International Ltd.
  */
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_ethdev.h>
 
 #include "otx2_cryptodev.h"
index 844312d..5023577 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright(c) 2017 Intel Corporation
  */
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_malloc.h>
 
 #include "rte_cryptodev_scheduler_operations.h"
index 1e2e8db..900ab40 100644 (file)
@@ -3,7 +3,7 @@
  */
 #include <unistd.h>
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_malloc.h>
 
 #include "rte_cryptodev_scheduler_operations.h"
index 57e330a..933a5c6 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright(c) 2017 Intel Corporation
  */
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_malloc.h>
 
 #include "rte_cryptodev_scheduler_operations.h"
index bc4a632..ace2dec 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright(c) 2017 Intel Corporation
  */
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_malloc.h>
 
 #include "rte_cryptodev_scheduler_operations.h"
index 8a5c737..b57004c 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <string.h>
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_devargs.h>
 #include <rte_ethdev.h>
 #include <rte_event_eth_rx_adapter.h>
index 14ca341..eec4bc6 100644 (file)
@@ -28,7 +28,7 @@
 #include <rte_ethdev.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_event_eth_tx_adapter.h>
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_dpaa_bus.h>
 #include <rte_dpaa_logs.h>
 #include <rte_cycles.h>
index 1d3ad8f..710156a 100644 (file)
@@ -25,7 +25,7 @@
 #include <rte_pci.h>
 #include <rte_bus_vdev.h>
 #include <ethdev_driver.h>
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_event_eth_tx_adapter.h>
 
index 2245599..366b6d3 100644 (file)
@@ -5,7 +5,7 @@
 #include <inttypes.h>
 
 #include <rte_common.h>
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_debug.h>
 #include <rte_dev.h>
 #include <rte_eal.h>
index d9a0026..d59d6c5 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2020-2021 Marvell.
  */
 
-#include <rte_cryptodev.h>
+#include <cryptodev_pmd.h>
 #include <rte_eventdev.h>
 
 #include "otx2_cryptodev.h"
index 9bb1e47..89bf2af 100644 (file)
@@ -52,6 +52,71 @@ struct rte_cryptodev_pmd_init_params {
        unsigned int max_nb_queue_pairs;
 };
 
+/**
+ * @internal
+ * The data part, with no function pointers, associated with each device.
+ *
+ * This structure is safe to place in shared memory to be common among
+ * different processes in a multi-process configuration.
+ */
+struct rte_cryptodev_data {
+       /** Device ID for this instance */
+       uint8_t dev_id;
+       /** Socket ID where memory is allocated */
+       uint8_t socket_id;
+       /** Unique identifier name */
+       char name[RTE_CRYPTODEV_NAME_MAX_LEN];
+
+       __extension__
+       /** Device state: STARTED(1)/STOPPED(0) */
+       uint8_t dev_started : 1;
+
+       /** Session memory pool */
+       struct rte_mempool *session_pool;
+       /** Array of pointers to queue pairs. */
+       void **queue_pairs;
+       /** Number of device queue pairs. */
+       uint16_t nb_queue_pairs;
+
+       /** PMD-specific private data */
+       void *dev_private;
+} __rte_cache_aligned;
+
+/** @internal The data structure associated with each crypto device. */
+struct rte_cryptodev {
+       /** Pointer to PMD dequeue function. */
+       dequeue_pkt_burst_t dequeue_burst;
+       /** Pointer to PMD enqueue function. */
+       enqueue_pkt_burst_t enqueue_burst;
+
+       /** Pointer to device data */
+       struct rte_cryptodev_data *data;
+       /** Functions exported by PMD */
+       struct rte_cryptodev_ops *dev_ops;
+       /** Feature flags exposes HW/SW features for the given device */
+       uint64_t feature_flags;
+       /** Backing device */
+       struct rte_device *device;
+
+       /** Crypto driver identifier*/
+       uint8_t driver_id;
+
+       /** User application callback for interrupts if present */
+       struct rte_cryptodev_cb_list link_intr_cbs;
+
+       /** Context for security ops */
+       void *security_ctx;
+
+       __extension__
+       /** Flag indicating the device is attached */
+       uint8_t attached : 1;
+
+       /** User application callback for pre enqueue processing */
+       struct rte_cryptodev_cb_rcu *enq_cbs;
+       /** User application callback for post dequeue processing */
+       struct rte_cryptodev_cb_rcu *deq_cbs;
+} __rte_cache_aligned;
+
 /** Global structure used for maintaining state of allocated crypto devices */
 struct rte_cryptodev_global {
        struct rte_cryptodev *devs;     /**< Device information array */
index 2bb9a22..16832f6 100644 (file)
@@ -54,73 +54,6 @@ struct rte_crypto_fp_ops {
 
 extern struct rte_crypto_fp_ops rte_crypto_fp_ops[RTE_CRYPTO_MAX_DEVS];
 
-/**
- * @internal
- * The data part, with no function pointers, associated with each device.
- *
- * This structure is safe to place in shared memory to be common among
- * different processes in a multi-process configuration.
- */
-struct rte_cryptodev_data {
-       uint8_t dev_id;
-       /**< Device ID for this instance */
-       uint8_t socket_id;
-       /**< Socket ID where memory is allocated */
-       char name[RTE_CRYPTODEV_NAME_MAX_LEN];
-       /**< Unique identifier name */
-
-       __extension__
-       uint8_t dev_started : 1;
-       /**< Device state: STARTED(1)/STOPPED(0) */
-
-       struct rte_mempool *session_pool;
-       /**< Session memory pool */
-       void **queue_pairs;
-       /**< Array of pointers to queue pairs. */
-       uint16_t nb_queue_pairs;
-       /**< Number of device queue pairs. */
-
-       void *dev_private;
-       /**< PMD-specific private data */
-} __rte_cache_aligned;
-
-
-/** @internal The data structure associated with each crypto device. */
-struct rte_cryptodev {
-       dequeue_pkt_burst_t dequeue_burst;
-       /**< Pointer to PMD receive function. */
-       enqueue_pkt_burst_t enqueue_burst;
-       /**< Pointer to PMD transmit function. */
-
-       struct rte_cryptodev_data *data;
-       /**< Pointer to device data */
-       struct rte_cryptodev_ops *dev_ops;
-       /**< Functions exported by PMD */
-       uint64_t feature_flags;
-       /**< Feature flags exposes HW/SW features for the given device */
-       struct rte_device *device;
-       /**< Backing device */
-
-       uint8_t driver_id;
-       /**< Crypto driver identifier*/
-
-       struct rte_cryptodev_cb_list link_intr_cbs;
-       /**< User application callback for interrupts if present */
-
-       void *security_ctx;
-       /**< Context for security ops */
-
-       __extension__
-       uint8_t attached : 1;
-       /**< Flag indicating the device is attached */
-
-       struct rte_cryptodev_cb_rcu *enq_cbs;
-       /**< User application callback for pre enqueue processing */
-
-       struct rte_cryptodev_cb_rcu *deq_cbs;
-       /**< User application callback for post dequeue processing */
-} __rte_cache_aligned;
-
 /**
  * The pool of rte_cryptodev structures.
  */
index fd5edf1..c50745f 100644 (file)
@@ -44,7 +44,6 @@ DPDK_22 {
        rte_cryptodev_sym_session_create;
        rte_cryptodev_sym_session_free;
        rte_cryptodev_sym_session_init;
-       rte_cryptodevs;
 
        local: *;
 };
@@ -123,4 +122,5 @@ INTERNAL {
        rte_cryptodev_pmd_parse_input_args;
        rte_cryptodev_pmd_probing_finish;
        rte_cryptodev_pmd_release_device;
+       rte_cryptodevs;
 };