[dpdk-dev] [PATCH v2 5/5] cryptodev: move device specific structures
Zhang, Roy Fan
roy.fan.zhang at intel.com
Mon Oct 11 17:05:45 CEST 2021
Hi Akhil,
> -----Original Message-----
> From: Akhil Goyal <gakhil at marvell.com>
> Sent: Monday, October 11, 2021 1:43 PM
> To: dev at dpdk.org
> Cc: thomas at monjalon.net; david.marchand at redhat.com;
> hemant.agrawal at nxp.com; anoobj at marvell.com; De Lara Guarch, Pablo
> <pablo.de.lara.guarch at intel.com>; Trahe, Fiona <fiona.trahe at intel.com>;
> Doherty, Declan <declan.doherty at intel.com>; matan at nvidia.com;
> g.singh at nxp.com; Zhang, Roy Fan <roy.fan.zhang at intel.com>;
> jianjay.zhou at huawei.com; asomalap at amd.com; ruifeng.wang at arm.com;
> Ananyev, Konstantin <konstantin.ananyev at intel.com>; Nicolau, Radu
> <radu.nicolau at intel.com>; ajit.khaparde at broadcom.com;
> rnagadheeraj at marvell.com; adwivedi at marvell.com; Power, Ciara
> <ciara.power at intel.com>; Akhil Goyal <gakhil at marvell.com>
> Subject: [PATCH v2 5/5] cryptodev: move device specific structures
>
> 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 at marvell.com>
> ---
...
> diff --git a/lib/cryptodev/cryptodev_pmd.h
> b/lib/cryptodev/cryptodev_pmd.h
> index a71edbb991..0d1bef0e67 100644
> --- a/lib/cryptodev/cryptodev_pmd.h
> +++ b/lib/cryptodev/cryptodev_pmd.h
> @@ -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;
Looks like we never used this pool ever - shall we take this chance to remove it?
> + /** Array of pointers to queue pairs. */
> + void **queue_pairs;
> + /** Number of device queue pairs. */
> + uint16_t nb_queue_pairs;
queue_pairs are likely the only item we use rte_cryptodev_data in the fast-path.
Also take this chance to move it to the beginning of the structure?
> +
> + /** PMD-specific private data */
> + void *dev_private;
> +} __rte_cache_aligned;
> +
Not really comments but some suggestions - could be done in the future as the
structure is moved to internal in this patchset.
Acked-by: Fan Zhang <roy.fan.zhang at intel.com>
More information about the dev
mailing list