Skip to contentSkip to conversation

crypto/scheduler: replace usage of master/slave

PATCH In review Adam Dybkowski 3 participants 3 messages Jul 22, 2020 – Jul 26, 2020 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/scheduler: replace usage of master/slave

This patch replaces the usage of master/slave in QAT PMD and Scheduler PMD as well as in their docs. Also the test app was modified to use the new wording.

---
 app/test/test_cryptodev.c                     |  16 +-
 doc/guides/cryptodevs/qat.rst                 |   2 +-
 doc/guides/cryptodevs/scheduler.rst           |  40 ++--
 doc/guides/rel_notes/deprecation.rst          |   7 +
 .../scheduler/rte_cryptodev_scheduler.c       | 135 +++++++-----
 .../scheduler/rte_cryptodev_scheduler.h       |  51 +++--
 .../rte_cryptodev_scheduler_operations.h      |  12 +-
 drivers/crypto/scheduler/scheduler_failover.c |  83 +++----
 .../crypto/scheduler/scheduler_multicore.c    |  54 ++---
 .../scheduler/scheduler_pkt_size_distr.c      | 142 ++++++------
 drivers/crypto/scheduler/scheduler_pmd.c      |  54 ++---
 drivers/crypto/scheduler/scheduler_pmd_ops.c  | 204 +++++++++---------
 .../crypto/scheduler/scheduler_pmd_private.h  |  12 +-
 .../crypto/scheduler/scheduler_roundrobin.c   |  87 ++++----
 14 files changed, 474 insertions(+), 425 deletions(-)
app/test/test_cryptodev.c +8 -8
index 70bf6fe2c..b64db456d 100644
@@ -479,29 +479,29 @@ testsuite_setup(void)
 	char vdev_args[VDEV_ARGS_SIZE] = {""};
 	char temp_str[VDEV_ARGS_SIZE] = {"mode=multi-core,"
 		"ordering=enable,name=cryptodev_test_scheduler,corelist="};
-	uint16_t slave_core_count = 0;
+	uint16_t worker_core_count = 0;
 	uint16_t socket_id = 0;
 
 	if (gbl_driver_id == rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
 
-		/* Identify the Slave Cores
-		 * Use 2 slave cores for the device args
+		/* Identify the Worker Cores
+		 * Use 2 worker cores for the device args
 		 */
 		RTE_LCORE_FOREACH_SLAVE(i) {
-			if (slave_core_count > 1)
+			if (worker_core_count > 1)
 				break;
 			snprintf(vdev_args, sizeof(vdev_args),
 					"%s%d", temp_str, i);
 			strcpy(temp_str, vdev_args);
 			strlcat(temp_str, ";", sizeof(temp_str));
-			slave_core_count++;
+			worker_core_count++;
 			socket_id = rte_lcore_to_socket_id(i);
 		}
-		if (slave_core_count != 2) {
+		if (worker_core_count != 2) {
 			RTE_LOG(ERR, USER1,
 				"Cryptodev scheduler test require at least "
-				"two slave cores to run. "
+				"two worker cores to run. "
 				"Please use the correct coremask.\n");
 			return TEST_FAILED;
 		}
@@ -11712,7 +11712,7 @@ test_chacha20_poly1305_decrypt_test_case_rfc8439(void)
 
 #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
 
-/* global AESNI slave IDs for the scheduler test */
+/* global AESNI worker IDs for the scheduler test */
 uint8_t aesni_ids[2];
 
 static int
doc/guides/cryptodevs/qat.rst +1 -1
index 1803d5f38..666c414c6 100644
@@ -327,7 +327,7 @@ The "rte_cryptodev_devices_get()" returns the devices exposed by either of these
 
 	The cryptodev driver name is passed to the dpdk-test-crypto-perf tool in the "-devtype" parameter.
 
-	The qat crypto device name is in the format of the slave parameter passed to the crypto scheduler.
+	The qat crypto device name is in the format of the worker parameter passed to the crypto scheduler.
 
 * The qat compressdev driver name is "compress_qat".
   The rte_compressdev_devices_get() returns the devices exposed by this driver.
doc/guides/cryptodevs/scheduler.rst +20 -20
index 7004ca431..565de40f3 100644
@@ -16,12 +16,12 @@ crypto ops among them in a certain manner.
 The Cryptodev Scheduler PMD library (**librte_pmd_crypto_scheduler**) acts as
 a software crypto PMD and shares the same API provided by librte_cryptodev.
 The PMD supports attaching multiple crypto PMDs, software or hardware, as
-slaves, and distributes the crypto workload to them with certain behavior.
+workers, and distributes the crypto workload to them with certain behavior.
 The behaviors are categorizes as different "modes". Basically, a scheduling
-mode defines certain actions for scheduling crypto ops to its slaves.
+mode defines certain actions for scheduling crypto ops to its workers.
 
 The librte_pmd_crypto_scheduler library exports a C API which provides an API
-for attaching/detaching slaves, set/get scheduling modes, and enable/disable
+for attaching/detaching workers, set/get scheduling modes, and enable/disable
 crypto ops reordering.
 
 Limitations
@@ -62,7 +62,7 @@ two calls:
   created. This value may be overwritten internally if there are too
   many devices are attached.
 
-* slave: If a cryptodev has been initialized with specific name, it can be
+* worker: If a cryptodev has been initialized with specific name, it can be
   attached to the scheduler using this parameter, simply filling the name
   here. Multiple cryptodevs can be attached initially by presenting this
   parameter multiple times.
@@ -84,13 +84,13 @@ Example:
 
 .. code-block:: console
 
-    ... --vdev "crypto_aesni_mb0,name=aesni_mb_1" --vdev "crypto_aesni_mb1,name=aesni_mb_2" --vdev "crypto_scheduler,slave=aesni_mb_1,slave=aesni_mb_2" ...
+    ... --vdev "crypto_aesni_mb0,name=aesni_mb_1" --vdev "crypto_aesni_mb1,name=aesni_mb_2" --vdev "crypto_scheduler,worker=aesni_mb_1,worker=aesni_mb_2" ...
 
 .. note::
 
     * The scheduler cryptodev cannot be started unless the scheduling mode
-      is set and at least one slave is attached. Also, to configure the
-      scheduler in the run-time, like attach/detach slave(s), change
+      is set and at least one worker is attached. Also, to configure the
+      scheduler in the run-time, like attach/detach worker(s), change
       scheduling mode, or enable/disable crypto op ordering, one should stop
       the scheduler first, otherwise an error will be returned.
 
@@ -111,7 +111,7 @@ operation:
    *Initialization mode parameter*: **round-robin**
 
    Round-robin mode, which distributes the enqueued burst of crypto ops
-   among its slaves in a round-robin manner. This mode may help to fill
+   among its workers in a round-robin manner. This mode may help to fill
    the throughput gap between the physical core and the existing cryptodevs
    to increase the overall performance.
 
@@ -119,15 +119,15 @@ operation:
 
    *Initialization mode parameter*: **packet-size-distr**
 
-   Packet-size based distribution mode, which works with 2 slaves, the primary
-   slave and the secondary slave, and distributes the enqueued crypto
+   Packet-size based distribution mode, which works with 2 workers, the primary
+   worker and the secondary worker, and distributes the enqueued crypto
    operations to them based on their data lengths. A crypto operation will be
-   distributed to the primary slave if its data length is equal to or bigger
+   distributed to the primary worker if its data length is equal to or bigger
    than the designated threshold, otherwise it will be handled by the secondary
-   slave.
+   worker.
 
    A typical usecase in this mode is with the QAT cryptodev as the primary and
-   a software cryptodev as the secondary slave. This may help applications to
+   a software cryptodev as the secondary worker. This may help applications to
    process additional crypto workload than what the QAT cryptodev can handle on
    its own, by making use of the available CPU cycles to deal with smaller
    crypto workloads.
@@ -148,11 +148,11 @@ operation:
 
    *Initialization mode parameter*: **fail-over**
 
-   Fail-over mode, which works with 2 slaves, the primary slave and the
-   secondary slave. In this mode, the scheduler will enqueue the incoming
-   crypto operation burst to the primary slave. When one or more crypto
+   Fail-over mode, which works with 2 workers, the primary worker and the
+   secondary worker. In this mode, the scheduler will enqueue the incoming
+   crypto operation burst to the primary worker. When one or more crypto
    operations fail to be enqueued, then they will be enqueued to the secondary
-   slave.
+   worker.
 
 *   **CDEV_SCHED_MODE_MULTICORE:**
 
@@ -167,16 +167,16 @@ operation:
    For mixed traffic (IMIX) the optimal number of worker cores is around 2-3.
    For large packets (1.5 kbytes) scheduler shows linear scaling in performance
    up to eight cores.
-   Each worker uses its own slave cryptodev. Only software cryptodevs
+   Each worker uses its own cryptodev. Only software cryptodevs
    are supported. Only the same type of cryptodevs should be used concurrently.
 
    The multi-core mode uses one extra parameter:
 
    * corelist: Semicolon-separated list of logical cores to be used as workers.
-     The number of worker cores should be equal to the number of slave cryptodevs.
+     The number of worker cores should be equal to the number of worker cryptodevs.
      These cores should be present in EAL core list parameter and
      should not be used by the application or any other process.
 
    Example:
     ... --vdev "crypto_aesni_mb1,name=aesni_mb_1" --vdev "crypto_aesni_mb_pmd2,name=aesni_mb_2" \
-    --vdev "crypto_scheduler,slave=aesni_mb_1,slave=aesni_mb_2,mode=multi-core,corelist=23;24" ...
+    --vdev "crypto_scheduler,worker=aesni_mb_1,worker=aesni_mb_2,mode=multi-core,corelist=23;24" ...
doc/guides/rel_notes/deprecation.rst +7 -0
index a58a17946..7583327b6 100644
@@ -142,3 +142,10 @@ Deprecation Notices
   Python 2 support will be completely removed in 20.11.
   In 20.08, explicit deprecation warnings will be displayed when running
   scripts with Python 2.
+
+* scheduler: The functions ``rte_cryptodev_scheduler_slave_attach``,
+  ``rte_cryptodev_scheduler_slave_detach`` and
+  ``rte_cryptodev_scheduler_slaves_get`` will be replaced by
+  ``rte_cryptodev_scheduler_worker_attach``,
+  ``rte_cryptodev_scheduler_worker_detach`` and
+  ``rte_cryptodev_scheduler_workers_get`` accordingly.
drivers/crypto/scheduler/rte_cryptodev_scheduler.c +78 -57

268 lines not on this page · raw message

drivers/crypto/scheduler/rte_cryptodev_scheduler.h +34 -17

107 lines not on this page · raw message

drivers/crypto/scheduler/rte_cryptodev_scheduler_operations.h +6 -6
index c43695894..f8726c009 100644
@@ -11,10 +11,10 @@
 extern "C" {
 #endif
 
-typedef int (*rte_cryptodev_scheduler_slave_attach_t)(
-		struct rte_cryptodev *dev, uint8_t slave_id);
-typedef int (*rte_cryptodev_scheduler_slave_detach_t)(
-		struct rte_cryptodev *dev, uint8_t slave_id);
+typedef int (*rte_cryptodev_scheduler_worker_attach_t)(
+		struct rte_cryptodev *dev, uint8_t worker_id);
+typedef int (*rte_cryptodev_scheduler_worker_detach_t)(
+		struct rte_cryptodev *dev, uint8_t worker_id);
 
 typedef int (*rte_cryptodev_scheduler_start_t)(struct rte_cryptodev *dev);
 typedef int (*rte_cryptodev_scheduler_stop_t)(struct rte_cryptodev *dev);
@@ -36,8 +36,8 @@ typedef int (*rte_cryptodev_scheduler_config_option_get)(
 		void *option);
 
 struct rte_cryptodev_scheduler_ops {
-	rte_cryptodev_scheduler_slave_attach_t slave_attach;
-	rte_cryptodev_scheduler_slave_attach_t slave_detach;
+	rte_cryptodev_scheduler_worker_attach_t worker_attach;
+	rte_cryptodev_scheduler_worker_attach_t worker_detach;
 
 	rte_cryptodev_scheduler_start_t scheduler_start;
 	rte_cryptodev_scheduler_stop_t scheduler_stop;
drivers/crypto/scheduler/scheduler_failover.c +42 -41

161 lines not on this page · raw message

drivers/crypto/scheduler/scheduler_multicore.c +28 -26

127 lines not on this page · raw message

drivers/crypto/scheduler/scheduler_pkt_size_distr.c +71 -71

284 lines not on this page · raw message

drivers/crypto/scheduler/scheduler_pmd.c +27 -27

139 lines not on this page · raw message

drivers/crypto/scheduler/scheduler_pmd_ops.c +102 -102

370 lines not on this page · raw message

drivers/crypto/scheduler/scheduler_pmd_private.h +6 -6
index e1531d1da..adb4eb063 100644
@@ -10,7 +10,7 @@
 #define CRYPTODEV_NAME_SCHEDULER_PMD	crypto_scheduler
 /**< Scheduler Crypto PMD device name */
 
-#define PER_SLAVE_BUFF_SIZE			(256)
+#define PER_WORKER_BUFF_SIZE			(256)
 
 extern int scheduler_logtype_driver;
 
@@ -18,7 +18,7 @@ extern int scheduler_logtype_driver;
 	rte_log(RTE_LOG_ ## level, scheduler_logtype_driver,		\
 			"%s() line %u: "fmt "\n", __func__, __LINE__, ##args)
 
-struct scheduler_slave {
+struct scheduler_worker {
 	uint8_t dev_id;
 	uint16_t qp_id;
 	uint32_t nb_inflight_cops;
@@ -35,8 +35,8 @@ struct scheduler_ctx {
 
 	uint32_t max_nb_queue_pairs;
 
-	struct scheduler_slave slaves[RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES];
-	uint32_t nb_slaves;
+	struct scheduler_worker workers[RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKERS];
+	uint32_t nb_workers;
 
 	enum rte_cryptodev_scheduler_mode mode;
 
@@ -49,8 +49,8 @@ struct scheduler_ctx {
 	uint16_t wc_pool[RTE_MAX_LCORE];
 	uint16_t nb_wc;
 
-	char *init_slave_names[RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES];
-	int nb_init_slaves;
+	char *init_worker_names[RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKERS];
+	int nb_init_workers;
 } __rte_cache_aligned;
 
 struct scheduler_qp_ctx {
drivers/crypto/scheduler/scheduler_roundrobin.c +44 -43

159 lines not on this page · raw message

Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Adam Dybkowski
Sent: Wednesday, July 22, 2020 11:15 AM
To: [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: Dybkowski, AdamX <[email protected]>
Subject: [dpdk-dev] [PATCH] crypto/scheduler: replace usage of master/slave

Quoted 6 lines

This patch replaces the usage of master/slave in QAT PMD and Scheduler PMD as well as in their docs. Also the test app was modified to use the new wording.

---

#2 lore raw
In reply to Adam Dybkowski

Hi Adam,

Quoted 7 lines

This patch replaces the usage of master/slave in QAT PMD and Scheduler PMD as well as in their docs. Also the test app was modified to use the new wording.

---

This patch should be part of next release, as it is changing the user experience as well as stable PMD APIs.

Please submit a deprecation notice only in this release, and resend the patch in next release cycle to implement this and remove deprecation notice and update in release notes.