DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] crypto/scheduler: add mode set get API
@ 2017-04-05 16:03 Fan Zhang
  2017-04-05 18:25 ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 3+ messages in thread
From: Fan Zhang @ 2017-04-05 16:03 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, declan.doherty

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.zhang@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] crypto/scheduler: add mode set get API
  2017-04-05 16:03 [dpdk-dev] [PATCH] crypto/scheduler: add mode set get API Fan Zhang
@ 2017-04-05 18:25 ` De Lara Guarch, Pablo
  2017-04-05 18:41   ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 3+ messages in thread
From: De Lara Guarch, Pablo @ 2017-04-05 18:25 UTC (permalink / raw)
  To: Zhang, Roy Fan, dev; +Cc: Doherty, Declan



> -----Original Message-----
> From: Zhang, Roy Fan
> Sent: Wednesday, April 05, 2017 5:03 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo; Doherty, Declan
> Subject: [PATCH] crypto/scheduler: add mode set get API
> 
> 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.zhang@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] crypto/scheduler: add mode set get API
  2017-04-05 18:25 ` De Lara Guarch, Pablo
@ 2017-04-05 18:41   ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 3+ messages in thread
From: De Lara Guarch, Pablo @ 2017-04-05 18:41 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, Zhang, Roy Fan, dev; +Cc: Doherty, Declan



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of De Lara Guarch,
> Pablo
> Sent: Wednesday, April 05, 2017 7:26 PM
> To: Zhang, Roy Fan; dev@dpdk.org
> Cc: Doherty, Declan
> Subject: Re: [dpdk-dev] [PATCH] crypto/scheduler: add mode set get API
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Roy Fan
> > Sent: Wednesday, April 05, 2017 5:03 PM
> > To: dev@dpdk.org
> > Cc: De Lara Guarch, Pablo; Doherty, Declan
> > Subject: [PATCH] crypto/scheduler: add mode set get API
> >
> > 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.zhang@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied to dpdk-next-crypto with the following commit message change:

    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()

Thanks,
Pablo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-05 18:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 16:03 [dpdk-dev] [PATCH] crypto/scheduler: add mode set get API Fan Zhang
2017-04-05 18:25 ` De Lara Guarch, Pablo
2017-04-05 18:41   ` De Lara Guarch, Pablo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).