This patch enables the packet size based scheduling mode in scheduler PMD. Signed-off-by: Fan Zhang <roy.fan.zh...@intel.com> --- drivers/crypto/scheduler/Makefile | 1 + drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 7 +++++++ drivers/crypto/scheduler/rte_cryptodev_scheduler.h | 3 +++ 3 files changed, 11 insertions(+)
diff --git a/drivers/crypto/scheduler/Makefile b/drivers/crypto/scheduler/Makefile index 0cce6f2..93e135f 100644 --- a/drivers/crypto/scheduler/Makefile +++ b/drivers/crypto/scheduler/Makefile @@ -54,6 +54,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += scheduler_pmd.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += scheduler_pmd_ops.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += rte_cryptodev_scheduler.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += scheduler_roundrobin.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += scheduler_pkt_size_distr.c # library dependencies DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += lib/librte_cryptodev diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c index 11e8143..eab1906 100644 --- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c +++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c @@ -336,6 +336,13 @@ rte_crpytodev_scheduler_mode_set(uint8_t scheduler_id, 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) { + CS_LOG_ERR("Failed to load scheduler"); + return -1; + } + break; default: CS_LOG_ERR("Not yet supported"); return -ENOTSUP; diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h index 7ef44e7..a1d4c14 100644 --- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h +++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h @@ -47,6 +47,8 @@ enum rte_cryptodev_scheduler_mode { CDEV_SCHED_MODE_NOT_SET = 0, CDEV_SCHED_MODE_USERDEFINED, CDEV_SCHED_MODE_ROUNDROBIN, + /** packet-size based distribution mode */ + CDEV_SCHED_MODE_PKT_SIZE_DISTR, CDEV_SCHED_MODE_COUNT /* number of modes */ }; @@ -158,6 +160,7 @@ struct rte_cryptodev_scheduler { }; extern struct rte_cryptodev_scheduler *roundrobin_scheduler; +extern struct rte_cryptodev_scheduler *pkt_size_based_distr_scheduler; #ifdef __cplusplus } -- 2.7.4