diff options
Diffstat (limited to 'drivers/crypto/scheduler')
-rw-r--r-- | drivers/crypto/scheduler/meson.build | 19 | ||||
-rw-r--r-- | drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 26 | ||||
-rw-r--r-- | drivers/crypto/scheduler/rte_cryptodev_scheduler.h | 8 | ||||
-rw-r--r-- | drivers/crypto/scheduler/scheduler_failover.c | 6 | ||||
-rw-r--r-- | drivers/crypto/scheduler/scheduler_multicore.c | 6 | ||||
-rw-r--r-- | drivers/crypto/scheduler/scheduler_pkt_size_distr.c | 6 | ||||
-rw-r--r-- | drivers/crypto/scheduler/scheduler_pmd.c | 8 | ||||
-rw-r--r-- | drivers/crypto/scheduler/scheduler_pmd_ops.c | 2 | ||||
-rw-r--r-- | drivers/crypto/scheduler/scheduler_pmd_private.h | 2 | ||||
-rw-r--r-- | drivers/crypto/scheduler/scheduler_roundrobin.c | 6 |
10 files changed, 54 insertions, 35 deletions
diff --git a/drivers/crypto/scheduler/meson.build b/drivers/crypto/scheduler/meson.build new file mode 100644 index 00000000..c5ba2d68 --- /dev/null +++ b/drivers/crypto/scheduler/meson.build @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Luca Boccassi <bluca@debian.org> + +deps += ['bus_vdev', 'reorder'] +name = 'crypto_scheduler' +sources = files( + 'rte_cryptodev_scheduler.c', + 'scheduler_failover.c', + 'scheduler_multicore.c', + 'scheduler_pkt_size_distr.c', + 'scheduler_pmd.c', + 'scheduler_pmd_ops.c', + 'scheduler_roundrobin.c', +) + +headers = files( + 'rte_cryptodev_scheduler.h', + 'rte_cryptodev_scheduler_operations.h', +) diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c index 6e4919c4..a2142860 100644 --- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c +++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c @@ -174,7 +174,7 @@ rte_cryptodev_scheduler_slave_attach(uint8_t scheduler_id, uint8_t slave_id) return -ENOTSUP; } - if (dev->driver_id != cryptodev_driver_id) { + if (dev->driver_id != cryptodev_scheduler_driver_id) { CR_SCHED_LOG(ERR, "Operation not supported"); return -ENOTSUP; } @@ -233,7 +233,7 @@ rte_cryptodev_scheduler_slave_detach(uint8_t scheduler_id, uint8_t slave_id) return -ENOTSUP; } - if (dev->driver_id != cryptodev_driver_id) { + if (dev->driver_id != cryptodev_scheduler_driver_id) { CR_SCHED_LOG(ERR, "Operation not supported"); return -ENOTSUP; } @@ -290,7 +290,7 @@ rte_cryptodev_scheduler_mode_set(uint8_t scheduler_id, return -ENOTSUP; } - if (dev->driver_id != cryptodev_driver_id) { + if (dev->driver_id != cryptodev_scheduler_driver_id) { CR_SCHED_LOG(ERR, "Operation not supported"); return -ENOTSUP; } @@ -308,28 +308,28 @@ rte_cryptodev_scheduler_mode_set(uint8_t scheduler_id, switch (mode) { case CDEV_SCHED_MODE_ROUNDROBIN: if (rte_cryptodev_scheduler_load_user_scheduler(scheduler_id, - roundrobin_scheduler) < 0) { + crypto_scheduler_roundrobin) < 0) { CR_SCHED_LOG(ERR, "Failed to load scheduler"); return -1; } break; case CDEV_SCHED_MODE_PKT_SIZE_DISTR: if (rte_cryptodev_scheduler_load_user_scheduler(scheduler_id, - pkt_size_based_distr_scheduler) < 0) { + crypto_scheduler_pkt_size_based_distr) < 0) { CR_SCHED_LOG(ERR, "Failed to load scheduler"); return -1; } break; case CDEV_SCHED_MODE_FAILOVER: if (rte_cryptodev_scheduler_load_user_scheduler(scheduler_id, - failover_scheduler) < 0) { + crypto_scheduler_failover) < 0) { CR_SCHED_LOG(ERR, "Failed to load scheduler"); return -1; } break; case CDEV_SCHED_MODE_MULTICORE: if (rte_cryptodev_scheduler_load_user_scheduler(scheduler_id, - multicore_scheduler) < 0) { + crypto_scheduler_multicore) < 0) { CR_SCHED_LOG(ERR, "Failed to load scheduler"); return -1; } @@ -353,7 +353,7 @@ rte_cryptodev_scheduler_mode_get(uint8_t scheduler_id) return -ENOTSUP; } - if (dev->driver_id != cryptodev_driver_id) { + if (dev->driver_id != cryptodev_scheduler_driver_id) { CR_SCHED_LOG(ERR, "Operation not supported"); return -ENOTSUP; } @@ -375,7 +375,7 @@ rte_cryptodev_scheduler_ordering_set(uint8_t scheduler_id, return -ENOTSUP; } - if (dev->driver_id != cryptodev_driver_id) { + if (dev->driver_id != cryptodev_scheduler_driver_id) { CR_SCHED_LOG(ERR, "Operation not supported"); return -ENOTSUP; } @@ -403,7 +403,7 @@ rte_cryptodev_scheduler_ordering_get(uint8_t scheduler_id) return -ENOTSUP; } - if (dev->driver_id != cryptodev_driver_id) { + if (dev->driver_id != cryptodev_scheduler_driver_id) { CR_SCHED_LOG(ERR, "Operation not supported"); return -ENOTSUP; } @@ -425,7 +425,7 @@ rte_cryptodev_scheduler_load_user_scheduler(uint8_t scheduler_id, return -ENOTSUP; } - if (dev->driver_id != cryptodev_driver_id) { + if (dev->driver_id != cryptodev_scheduler_driver_id) { CR_SCHED_LOG(ERR, "Operation not supported"); return -ENOTSUP; } @@ -498,7 +498,7 @@ rte_cryptodev_scheduler_slaves_get(uint8_t scheduler_id, uint8_t *slaves) return -ENOTSUP; } - if (dev->driver_id != cryptodev_driver_id) { + if (dev->driver_id != cryptodev_scheduler_driver_id) { CR_SCHED_LOG(ERR, "Operation not supported"); return -ENOTSUP; } @@ -566,7 +566,7 @@ rte_cryptodev_scheduler_option_get(uint8_t scheduler_id, return -EINVAL; } - if (dev->driver_id != cryptodev_driver_id) { + if (dev->driver_id != cryptodev_scheduler_driver_id) { CR_SCHED_LOG(ERR, "Operation not supported"); return -ENOTSUP; } diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h index 3faea409..9a72a90a 100644 --- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h +++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h @@ -270,13 +270,13 @@ struct rte_cryptodev_scheduler { }; /** Round-robin mode scheduler */ -extern struct rte_cryptodev_scheduler *roundrobin_scheduler; +extern struct rte_cryptodev_scheduler *crypto_scheduler_roundrobin; /** Packet-size based distribution mode scheduler */ -extern struct rte_cryptodev_scheduler *pkt_size_based_distr_scheduler; +extern struct rte_cryptodev_scheduler *crypto_scheduler_pkt_size_based_distr; /** Fail-over mode scheduler */ -extern struct rte_cryptodev_scheduler *failover_scheduler; +extern struct rte_cryptodev_scheduler *crypto_scheduler_failover; /** multi-core mode scheduler */ -extern struct rte_cryptodev_scheduler *multicore_scheduler; +extern struct rte_cryptodev_scheduler *crypto_scheduler_multicore; #ifdef __cplusplus } diff --git a/drivers/crypto/scheduler/scheduler_failover.c b/drivers/crypto/scheduler/scheduler_failover.c index ddfb5b81..3a023b8a 100644 --- a/drivers/crypto/scheduler/scheduler_failover.c +++ b/drivers/crypto/scheduler/scheduler_failover.c @@ -197,7 +197,7 @@ scheduler_create_private_ctx(__rte_unused struct rte_cryptodev *dev) return 0; } -struct rte_cryptodev_scheduler_ops scheduler_fo_ops = { +static struct rte_cryptodev_scheduler_ops scheduler_fo_ops = { slave_attach, slave_detach, scheduler_start, @@ -208,7 +208,7 @@ struct rte_cryptodev_scheduler_ops scheduler_fo_ops = { NULL /*option_get */ }; -struct rte_cryptodev_scheduler fo_scheduler = { +static struct rte_cryptodev_scheduler fo_scheduler = { .name = "failover-scheduler", .description = "scheduler which enqueues to the primary slave, " "and only then enqueues to the secondary slave " @@ -217,4 +217,4 @@ struct rte_cryptodev_scheduler fo_scheduler = { .ops = &scheduler_fo_ops }; -struct rte_cryptodev_scheduler *failover_scheduler = &fo_scheduler; +struct rte_cryptodev_scheduler *crypto_scheduler_failover = &fo_scheduler; diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c index d410e69d..7808e9a3 100644 --- a/drivers/crypto/scheduler/scheduler_multicore.c +++ b/drivers/crypto/scheduler/scheduler_multicore.c @@ -392,7 +392,7 @@ exit: return -1; } -struct rte_cryptodev_scheduler_ops scheduler_mc_ops = { +static struct rte_cryptodev_scheduler_ops scheduler_mc_ops = { slave_attach, slave_detach, scheduler_start, @@ -403,11 +403,11 @@ struct rte_cryptodev_scheduler_ops scheduler_mc_ops = { NULL /* option_get */ }; -struct rte_cryptodev_scheduler mc_scheduler = { +static struct rte_cryptodev_scheduler mc_scheduler = { .name = "multicore-scheduler", .description = "scheduler which will run burst across multiple cpu cores", .mode = CDEV_SCHED_MODE_MULTICORE, .ops = &scheduler_mc_ops }; -struct rte_cryptodev_scheduler *multicore_scheduler = &mc_scheduler; +struct rte_cryptodev_scheduler *crypto_scheduler_multicore = &mc_scheduler; diff --git a/drivers/crypto/scheduler/scheduler_pkt_size_distr.c b/drivers/crypto/scheduler/scheduler_pkt_size_distr.c index 74129b66..45c8dceb 100644 --- a/drivers/crypto/scheduler/scheduler_pkt_size_distr.c +++ b/drivers/crypto/scheduler/scheduler_pkt_size_distr.c @@ -398,7 +398,7 @@ scheduler_option_get(struct rte_cryptodev *dev, uint32_t option_type, return 0; } -struct rte_cryptodev_scheduler_ops scheduler_ps_ops = { +static struct rte_cryptodev_scheduler_ops scheduler_ps_ops = { slave_attach, slave_detach, scheduler_start, @@ -409,7 +409,7 @@ struct rte_cryptodev_scheduler_ops scheduler_ps_ops = { scheduler_option_get }; -struct rte_cryptodev_scheduler psd_scheduler = { +static struct rte_cryptodev_scheduler psd_scheduler = { .name = "packet-size-based-scheduler", .description = "scheduler which will distribute crypto op " "burst based on the packet size", @@ -417,4 +417,4 @@ struct rte_cryptodev_scheduler psd_scheduler = { .ops = &scheduler_ps_ops }; -struct rte_cryptodev_scheduler *pkt_size_based_distr_scheduler = &psd_scheduler; +struct rte_cryptodev_scheduler *crypto_scheduler_pkt_size_based_distr = &psd_scheduler; diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c index a9221a94..20198ccb 100644 --- a/drivers/crypto/scheduler/scheduler_pmd.c +++ b/drivers/crypto/scheduler/scheduler_pmd.c @@ -14,7 +14,7 @@ #include "rte_cryptodev_scheduler.h" #include "scheduler_pmd_private.h" -uint8_t cryptodev_driver_id; +uint8_t cryptodev_scheduler_driver_id; struct scheduler_init_params { struct rte_cryptodev_pmd_init_params def_p; @@ -38,7 +38,7 @@ struct scheduler_init_params { #define RTE_CRYPTODEV_VDEV_COREMASK ("coremask") #define RTE_CRYPTODEV_VDEV_CORELIST ("corelist") -const char *scheduler_valid_params[] = { +static const char * const scheduler_valid_params[] = { RTE_CRYPTODEV_VDEV_NAME, RTE_CRYPTODEV_VDEV_SLAVE, RTE_CRYPTODEV_VDEV_MODE, @@ -91,7 +91,7 @@ cryptodev_scheduler_create(const char *name, return -EFAULT; } - dev->driver_id = cryptodev_driver_id; + dev->driver_id = cryptodev_scheduler_driver_id; dev->dev_ops = rte_crypto_scheduler_pmd_ops; sched_ctx = dev->data->dev_private; @@ -569,4 +569,4 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SCHEDULER_PMD, "slave=<name>"); RTE_PMD_REGISTER_CRYPTO_DRIVER(scheduler_crypto_drv, cryptodev_scheduler_pmd_drv.driver, - cryptodev_driver_id); + cryptodev_scheduler_driver_id); diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c index 778071ca..939105aa 100644 --- a/drivers/crypto/scheduler/scheduler_pmd_ops.c +++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c @@ -522,7 +522,7 @@ scheduler_pmd_sym_session_clear(struct rte_cryptodev *dev, } } -struct rte_cryptodev_ops scheduler_pmd_ops = { +static struct rte_cryptodev_ops scheduler_pmd_ops = { .dev_configure = scheduler_pmd_config, .dev_start = scheduler_pmd_start, .dev_stop = scheduler_pmd_stop, diff --git a/drivers/crypto/scheduler/scheduler_pmd_private.h b/drivers/crypto/scheduler/scheduler_pmd_private.h index d5e602a2..3ed480c1 100644 --- a/drivers/crypto/scheduler/scheduler_pmd_private.h +++ b/drivers/crypto/scheduler/scheduler_pmd_private.h @@ -63,7 +63,7 @@ struct scheduler_qp_ctx { } __rte_cache_aligned; -extern uint8_t cryptodev_driver_id; +extern uint8_t cryptodev_scheduler_driver_id; static __rte_always_inline uint16_t get_max_enqueue_order_count(struct rte_ring *order_ring, uint16_t nb_ops) diff --git a/drivers/crypto/scheduler/scheduler_roundrobin.c b/drivers/crypto/scheduler/scheduler_roundrobin.c index c7082a64..9b891d97 100644 --- a/drivers/crypto/scheduler/scheduler_roundrobin.c +++ b/drivers/crypto/scheduler/scheduler_roundrobin.c @@ -190,7 +190,7 @@ scheduler_create_private_ctx(__rte_unused struct rte_cryptodev *dev) return 0; } -struct rte_cryptodev_scheduler_ops scheduler_rr_ops = { +static struct rte_cryptodev_scheduler_ops scheduler_rr_ops = { slave_attach, slave_detach, scheduler_start, @@ -201,7 +201,7 @@ struct rte_cryptodev_scheduler_ops scheduler_rr_ops = { NULL /* option_get */ }; -struct rte_cryptodev_scheduler scheduler = { +static struct rte_cryptodev_scheduler scheduler = { .name = "roundrobin-scheduler", .description = "scheduler which will round robin burst across " "slave crypto devices", @@ -209,4 +209,4 @@ struct rte_cryptodev_scheduler scheduler = { .ops = &scheduler_rr_ops }; -struct rte_cryptodev_scheduler *roundrobin_scheduler = &scheduler; +struct rte_cryptodev_scheduler *crypto_scheduler_roundrobin = &scheduler; |