From 3fb45fdb66412063a5fe249db858638ce619aceb Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Wed, 5 Apr 2017 17:03:23 +0100 Subject: [PATCH] crypto/scheduler: deprecate get/set mode functions 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 Acked-by: Pablo de Lara --- doc/guides/rel_notes/deprecation.rst | 6 +++++ .../scheduler/rte_cryptodev_scheduler.c | 17 ++++++++++-- .../scheduler/rte_cryptodev_scheduler.h | 27 +++++++++++++++++++ .../rte_pmd_crypto_scheduler_version.map | 2 ++ drivers/crypto/scheduler/scheduler_pmd.c | 2 +- test/test/test_cryptodev.c | 4 +-- 6 files changed, 53 insertions(+), 5 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 7d730192f2..20e23ebd93 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -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`` diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c index 6018857bfb..3befb81cd0 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 1da096ba21..3b816d3e2e 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 69cf0c61d1..de2a554ecd 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 f117ed8980..b189fbdeca 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 a29c019a43..63d71c0704 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.20.1