crypto/scheduler: deprecate get/set mode functions
authorFan Zhang <roy.fan.zhang@intel.com>
Wed, 5 Apr 2017 16:03:23 +0000 (17:03 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 5 Apr 2017 22:17:44 +0000 (00:17 +0200)
This patch deprecates the following functions in 17.05,
which will be removed in 17.08.
- rte_crpytodev_scheduler_mode_get()
- rte_crpytodev_scheduler_mode_set()

These two new functions replace them, fixing the typo in their names.
- rte_cryptodev_scheduler_mode_get()
- rte_cryptodev_scheduler_mode_set()

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
doc/guides/rel_notes/deprecation.rst
drivers/crypto/scheduler/rte_cryptodev_scheduler.c
drivers/crypto/scheduler/rte_cryptodev_scheduler.h
drivers/crypto/scheduler/rte_pmd_crypto_scheduler_version.map
drivers/crypto/scheduler/scheduler_pmd.c
test/test/test_cryptodev.c

index 7d73019..20e23eb 100644 (file)
@@ -75,3 +75,9 @@ Deprecation Notices
   PMDs that implement the latter.
   Target release for removal of the legacy API will be defined once most
   PMDs have switched to rte_flow.
+
+* crypto/scheduler: the following two functions are deprecated starting
+  from 17.05 and will be removed in 17.08:
+
+  - ``rte_crpytodev_scheduler_mode_get``, replaced by ``rte_cryptodev_scheduler_mode_get``
+  - ``rte_crpytodev_scheduler_mode_set``, replaced by ``rte_cryptodev_scheduler_mode_set``
index 6018857..3befb81 100644 (file)
@@ -303,7 +303,7 @@ rte_cryptodev_scheduler_slave_detach(uint8_t scheduler_id, uint8_t slave_id)
 }
 
 int
-rte_crpytodev_scheduler_mode_set(uint8_t scheduler_id,
+rte_cryptodev_scheduler_mode_set(uint8_t scheduler_id,
                enum rte_cryptodev_scheduler_mode mode)
 {
        struct rte_cryptodev *dev = rte_cryptodev_pmd_get_dev(scheduler_id);
@@ -359,8 +359,15 @@ rte_crpytodev_scheduler_mode_set(uint8_t scheduler_id,
        return 0;
 }
 
+int
+rte_crpytodev_scheduler_mode_set(uint8_t scheduler_id,
+               enum rte_cryptodev_scheduler_mode mode)
+{
+       return rte_cryptodev_scheduler_mode_set(scheduler_id, mode);
+}
+
 enum rte_cryptodev_scheduler_mode
-rte_crpytodev_scheduler_mode_get(uint8_t scheduler_id)
+rte_cryptodev_scheduler_mode_get(uint8_t scheduler_id)
 {
        struct rte_cryptodev *dev = rte_cryptodev_pmd_get_dev(scheduler_id);
        struct scheduler_ctx *sched_ctx;
@@ -380,6 +387,12 @@ rte_crpytodev_scheduler_mode_get(uint8_t scheduler_id)
        return sched_ctx->mode;
 }
 
+enum rte_cryptodev_scheduler_mode
+rte_crpytodev_scheduler_mode_get(uint8_t scheduler_id)
+{
+       return rte_cryptodev_scheduler_mode_get(scheduler_id);
+}
+
 int
 rte_cryptodev_scheduler_ordering_set(uint8_t scheduler_id,
                uint32_t enable_reorder)
index 1da096b..3b816d3 100644 (file)
@@ -109,7 +109,31 @@ rte_cryptodev_scheduler_slave_attach(uint8_t scheduler_id, uint8_t slave_id);
 int
 rte_cryptodev_scheduler_slave_detach(uint8_t scheduler_id, uint8_t slave_id);
 
+
+/**
+ * Set the scheduling mode
+ *
+ * @param      scheduler_id    The target scheduler device ID
+ *             mode            The scheduling mode
+ *
+ * @return
+ *     0 if attaching successful, negative integer if otherwise.
+ */
+int
+rte_cryptodev_scheduler_mode_set(uint8_t scheduler_id,
+               enum rte_cryptodev_scheduler_mode mode);
+
+/**
+ * Get the current scheduling mode
+ *
+ * @param      scheduler_id    The target scheduler device ID
+ *             mode            Pointer to write the scheduling mode
+ */
+enum rte_cryptodev_scheduler_mode
+rte_cryptodev_scheduler_mode_get(uint8_t scheduler_id);
+
 /**
+ * @deprecated
  * Set the scheduling mode
  *
  * @param      scheduler_id    The target scheduler device ID
@@ -118,16 +142,19 @@ rte_cryptodev_scheduler_slave_detach(uint8_t scheduler_id, uint8_t slave_id);
  * @return
  *     0 if attaching successful, negative integer if otherwise.
  */
+__rte_deprecated
 int
 rte_crpytodev_scheduler_mode_set(uint8_t scheduler_id,
                enum rte_cryptodev_scheduler_mode mode);
 
 /**
+ * @deprecated
  * Get the current scheduling mode
  *
  * @param      scheduler_id    The target scheduler device ID
  *             mode            Pointer to write the scheduling mode
  */
+__rte_deprecated
 enum rte_cryptodev_scheduler_mode
 rte_crpytodev_scheduler_mode_get(uint8_t scheduler_id);
 
index 69cf0c6..de2a554 100644 (file)
@@ -14,6 +14,8 @@ DPDK_17.02 {
 DPDK_17.05 {
        global:
 
+       rte_cryptodev_scheduler_mode_get;
+       rte_cryptodev_scheduler_mode_set;
        rte_cryptodev_scheduler_slaves_get;
 
 } DPDK_17.02;
index f117ed8..b189fbd 100644 (file)
@@ -159,7 +159,7 @@ cryptodev_scheduler_create(const char *name,
 
        if (init_params->mode > CDEV_SCHED_MODE_USERDEFINED &&
                        init_params->mode < CDEV_SCHED_MODE_COUNT) {
-               ret = rte_crpytodev_scheduler_mode_set(dev->data->dev_id,
+               ret = rte_cryptodev_scheduler_mode_set(dev->data->dev_id,
                        init_params->mode);
                if (ret < 0) {
                        rte_cryptodev_pmd_release_device(dev);
index a29c019..63d71c0 100644 (file)
@@ -7846,11 +7846,11 @@ test_scheduler_mode_op(void)
                "Failed to set cdev %u to user defined mode", sched_id);
 
        /* set round robin mode */
-       ret = rte_crpytodev_scheduler_mode_set(sched_id,
+       ret = rte_cryptodev_scheduler_mode_set(sched_id,
                        CDEV_SCHED_MODE_ROUNDROBIN);
        TEST_ASSERT(ret == 0,
                "Failed to set cdev %u to round-robin mode", sched_id);
-       TEST_ASSERT(rte_crpytodev_scheduler_mode_get(sched_id) ==
+       TEST_ASSERT(rte_cryptodev_scheduler_mode_get(sched_id) ==
                        CDEV_SCHED_MODE_ROUNDROBIN, "Scheduling Mode "
                                        "not match");