cryptodev: uninline some functions
authorDeclan Doherty <declan.doherty@intel.com>
Mon, 23 Jan 2017 12:18:35 +0000 (12:18 +0000)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Mon, 30 Jan 2017 16:23:33 +0000 (17:23 +0100)
rte_cryptodev_pmd_get_dev, rte_cryptodev_pmd_get_named_dev,
rte_cryptodev_pmd_is_valid_dev were incorrectly marked as inline and
therefore not useable from crypto PMDs when built as shared
libraries as they accessed the global rte_cryptodev_globals device
structure.

Fixes: d11b0f30 ("cryptodev: introduce API and framework for crypto devices")

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
lib/librte_cryptodev/rte_cryptodev.c
lib/librte_cryptodev/rte_cryptodev_pmd.h
lib/librte_cryptodev/rte_cryptodev_version.map

index 6a51eec..e439796 100644 (file)
@@ -255,6 +255,48 @@ rte_cryptodev_create_vdev(const char *name, const char *args)
        return rte_eal_vdev_init(name, args);
 }
 
+struct rte_cryptodev *
+rte_cryptodev_pmd_get_dev(uint8_t dev_id)
+{
+       return &rte_cryptodev_globals->devs[dev_id];
+}
+
+struct rte_cryptodev *
+rte_cryptodev_pmd_get_named_dev(const char *name)
+{
+       struct rte_cryptodev *dev;
+       unsigned int i;
+
+       if (name == NULL)
+               return NULL;
+
+       for (i = 0; i < rte_cryptodev_globals->max_devs; i++) {
+               dev = &rte_cryptodev_globals->devs[i];
+
+               if ((dev->attached == RTE_CRYPTODEV_ATTACHED) &&
+                               (strcmp(dev->data->name, name) == 0))
+                       return dev;
+       }
+
+       return NULL;
+}
+
+unsigned int
+rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id)
+{
+       struct rte_cryptodev *dev = NULL;
+
+       if (dev_id >= rte_cryptodev_globals->nb_devs)
+               return 0;
+
+       dev = rte_cryptodev_pmd_get_dev(dev_id);
+       if (dev->attached != RTE_CRYPTODEV_ATTACHED)
+               return 0;
+       else
+               return 1;
+}
+
+
 int
 rte_cryptodev_get_dev_id(const char *name)
 {
index aabef41..1a417e2 100644 (file)
@@ -160,11 +160,8 @@ extern struct rte_cryptodev_global *rte_cryptodev_globals;
  * @return
  *   - The rte_cryptodev structure pointer for the given device ID.
  */
-static inline struct rte_cryptodev *
-rte_cryptodev_pmd_get_dev(uint8_t dev_id)
-{
-       return &rte_cryptodev_globals->devs[dev_id];
-}
+struct rte_cryptodev *
+rte_cryptodev_pmd_get_dev(uint8_t dev_id);
 
 /**
  * Get the rte_cryptodev structure device pointer for the named device.
@@ -174,25 +171,8 @@ rte_cryptodev_pmd_get_dev(uint8_t dev_id)
  * @return
  *   - The rte_cryptodev structure pointer for the given device ID.
  */
-static inline struct rte_cryptodev *
-rte_cryptodev_pmd_get_named_dev(const char *name)
-{
-       struct rte_cryptodev *dev;
-       unsigned i;
-
-       if (name == NULL)
-               return NULL;
-
-       for (i = 0; i < rte_cryptodev_globals->max_devs; i++) {
-               dev = &rte_cryptodev_globals->devs[i];
-
-               if ((dev->attached == RTE_CRYPTODEV_ATTACHED) &&
-                               (strcmp(dev->data->name, name) == 0))
-                       return dev;
-       }
-
-       return NULL;
-}
+struct rte_cryptodev *
+rte_cryptodev_pmd_get_named_dev(const char *name);
 
 /**
  * Validate if the crypto device index is valid attached crypto device.
@@ -202,20 +182,8 @@ rte_cryptodev_pmd_get_named_dev(const char *name)
  * @return
  *   - If the device index is valid (1) or not (0).
  */
-static inline unsigned
-rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id)
-{
-       struct rte_cryptodev *dev = NULL;
-
-       if (dev_id >= rte_cryptodev_globals->nb_devs)
-               return 0;
-
-       dev = rte_cryptodev_pmd_get_dev(dev_id);
-       if (dev->attached != RTE_CRYPTODEV_ATTACHED)
-               return 0;
-       else
-               return 1;
-}
+unsigned int
+rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id);
 
 /**
  * The pool of rte_cryptodev structures.
index c581eea..a92df62 100644 (file)
@@ -51,5 +51,8 @@ DPDK_17.02 {
        global:
 
        rte_cryptodev_pmd_create_dev_name;
+       rte_cryptodev_pmd_get_dev;
+       rte_cryptodev_pmd_get_named_dev;
+       rte_cryptodev_pmd_is_valid_dev;
 
 } DPDK_16.11;