From a51bb9d8b4d8f327ab58a1258a3487ad3386c5e6 Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Fri, 6 Oct 2017 10:39:32 +0200 Subject: [PATCH] cryptodev: move user callback initialization Signed-off-by: Jan Blunck Acked-by: Pablo de Lara --- lib/librte_cryptodev/rte_cryptodev.c | 3 +++ lib/librte_cryptodev/rte_cryptodev_pmd.c | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index e48d562b44..21da40ee8f 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -583,6 +583,9 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id) cryptodev->data->socket_id = socket_id; cryptodev->data->dev_started = 0; + /* init user callbacks */ + TAILQ_INIT(&(cryptodev->link_intr_cbs)); + cryptodev->attached = RTE_CRYPTODEV_ATTACHED; cryptodev_globals.nb_devs++; diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c index a57faadcf3..ec6eeffa10 100644 --- a/lib/librte_cryptodev/rte_cryptodev_pmd.c +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c @@ -101,9 +101,6 @@ rte_cryptodev_vdev_pmd_init(const char *name, size_t dev_private_size, cryptodev->device = &vdev->device; - /* initialise user call-back tail queue */ - TAILQ_INIT(&(cryptodev->link_intr_cbs)); - return cryptodev; } @@ -188,9 +185,6 @@ rte_cryptodev_pci_generic_probe(struct rte_pci_device *pci_dev, cryptodev->device = &pci_dev->device; - /* init user callbacks */ - TAILQ_INIT(&(cryptodev->link_intr_cbs)); - /* Invoke PMD device initialization function */ RTE_FUNC_PTR_OR_ERR_RET(*dev_init, -EINVAL); retval = dev_init(cryptodev); -- 2.20.1