cryptodev: move user callback initialization
authorJan Blunck <jblunck@infradead.org>
Fri, 6 Oct 2017 08:39:32 +0000 (10:39 +0200)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 25 Oct 2017 16:11:01 +0000 (18:11 +0200)
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
lib/librte_cryptodev/rte_cryptodev.c
lib/librte_cryptodev/rte_cryptodev_pmd.c

index e48d562..21da40e 100644 (file)
@@ -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++;
index a57faad..ec6eeff 100644 (file)
@@ -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);