This patch adds two APIs, "rte_cryptodev_scheduler_mode_set" and
"rte_cryptodev_scheduler_mode_get", to crypto scheduler PMD. These
two API provides same functionalities as "rte_crpytodev_scheduler_mode_get"
and "rte_crpytodev_scheduler_mode_set" and they are proposed to deprecated
in 17.08.

Signed-off-by: Fan Zhang <roy.fan.zh...@intel.com>
---
 doc/guides/rel_notes/deprecation.rst               |  5 ++++
 drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 17 ++++++++++++--
 drivers/crypto/scheduler/rte_cryptodev_scheduler.h | 27 ++++++++++++++++++++++
 .../scheduler/rte_pmd_crypto_scheduler_version.map |  2 ++
 drivers/crypto/scheduler/scheduler_pmd.c           |  2 +-
 test/test/test_cryptodev.c                         |  4 ++--
 6 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst 
b/doc/guides/rel_notes/deprecation.rst
index 469b3a5..500772a 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -113,3 +113,8 @@ Deprecation Notices
   to specify which type of instance to create (single or burst), and
   additional calls for ``rte_distributor_poll_pkt_burst`` and
   ``rte_distributor_return_pkt_burst``, among others.
+
+* crypto/scheduler: for 17.08 it is planned to deprecate the following two
+  functions, ``rte_crpytodev_scheduler_mode_get`` and
+  ``rte_crpytodev_scheduler_mode_set``. They are replaced by
+  ``rte_cryptodev_scheduler_mode_get`` and ``rte_cryptodev_scheduler_mode_set``
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c 
b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
index 6018857..3befb81 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
@@ -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)
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h 
b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h
index 1da096b..3b816d3 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h
@@ -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);
 
diff --git a/drivers/crypto/scheduler/rte_pmd_crypto_scheduler_version.map 
b/drivers/crypto/scheduler/rte_pmd_crypto_scheduler_version.map
index 69cf0c6..de2a554 100644
--- a/drivers/crypto/scheduler/rte_pmd_crypto_scheduler_version.map
+++ b/drivers/crypto/scheduler/rte_pmd_crypto_scheduler_version.map
@@ -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;
diff --git a/drivers/crypto/scheduler/scheduler_pmd.c 
b/drivers/crypto/scheduler/scheduler_pmd.c
index f117ed8..b189fbd 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -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);
diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index a29c019..63d71c0 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -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");
 
-- 
2.7.4

Reply via email to