rte_cryptodev_scheduler.h
Contents
Detailed Description
RTE Cryptodev Scheduler Device
The RTE Cryptodev Scheduler Device allows the aggregation of multiple worker Cryptodevs into a single
logical crypto device, and the scheduling the crypto operations to the workers based on the mode of the
specified mode of operation specified and supported. This implementation supports 3 modes of operation:
round robin, packet-size based, and fail-over.
Definition in file rte_cryptodev_scheduler.h.
Enumeration Type Documentation
enumrte_cryptodev_scheduler_mode
Crypto scheduler PMD operation modes
EnumeratorCDEV_SCHED_MODE_USERDEFINED
User defined mode
CDEV_SCHED_MODE_ROUNDROBIN
Round-robin mode
CDEV_SCHED_MODE_PKT_SIZE_DISTR
Packet-size based distribution mode
CDEV_SCHED_MODE_FAILOVER
Fail-over mode
CDEV_SCHED_MODE_MULTICORE
multi-core mode
CDEV_SCHED_MODE_COUNT
number of modes
Definition at line 47 of file rte_cryptodev_scheduler.h.
enumrte_cryptodev_schedule_option_type
Crypto scheduler option types
Definition at line 69 of file rte_cryptodev_scheduler.h.
Function Documentation
intrte_cryptodev_scheduler_load_user_scheduler(uint8_tscheduler_id,structrte_cryptodev_scheduler*scheduler)
Load a user defined scheduler
Parametersscheduler_id The target scheduler device ID
scheduler Pointer to the user defined scheduler
Returns
• 0 if the scheduler is successfully loaded
• -ENOTSUP if the operation is not supported.
• -EBUSY if device is started.
• -EINVAL if input values are invalid.
intrte_cryptodev_scheduler_worker_attach(uint8_tscheduler_id,uint8_tworker_id)
Attach a crypto device to the scheduler
Parametersscheduler_id The target scheduler device ID
worker_id Crypto device ID to be attached
Returns
• 0 if the worker is attached.
• -ENOTSUP if the operation is not supported.
• -EBUSY if device is started.
• -ENOMEM if the scheduler's worker list is full.
intrte_cryptodev_scheduler_worker_detach(uint8_tscheduler_id,uint8_tworker_id)
Detach a crypto device from the scheduler
Parametersscheduler_id The target scheduler device ID
worker_id Crypto device ID to be detached
Returns
• 0 if the worker is detached.
• -ENOTSUP if the operation is not supported.
• -EBUSY if device is started.
intrte_cryptodev_scheduler_mode_set(uint8_tscheduler_id,enumrte_cryptodev_scheduler_modemode)
Set the scheduling mode
Parametersscheduler_id The target scheduler device ID
mode The scheduling mode
Returns
• 0 if the mode is set.
• -ENOTSUP if the operation is not supported.
• -EBUSY if device is started.
enumrte_cryptodev_scheduler_moderte_cryptodev_scheduler_mode_get(uint8_tscheduler_id)
Get the current scheduling mode
Parametersscheduler_id The target scheduler device ID
Returns
mode
• non-negative enumerate value: the scheduling mode
• -ENOTSUP if the operation is not supported.
intrte_cryptodev_scheduler_ordering_set(uint8_tscheduler_id,uint32_tenable_reorder)
Set the crypto ops reordering feature on/off
Parametersscheduler_id The target scheduler device ID
enable_reorder Set the crypto op reordering feature
• 0: disable reordering
• 1: enable reordering
Returns
• 0 if the ordering is set.
• -ENOTSUP if the operation is not supported.
• -EBUSY if device is started.
intrte_cryptodev_scheduler_ordering_get(uint8_tscheduler_id)
Get the current crypto ops reordering feature
Parametersscheduler_id The target scheduler device ID
Returns
• 0 if reordering is disabled
• 1 if reordering is enabled
• -ENOTSUP if the operation is not supported.
intrte_cryptodev_scheduler_workers_get(uint8_tscheduler_id,uint8_t*workers)
Get the attached workers' count and/or ID
Parametersscheduler_id The target scheduler device ID
workers If successful, the function will write back all workers' device IDs to it. This parameter
will either be an uint8_t array of RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKERS elements or NULL.
Returns
• non-negative number: the number of workers attached
• -ENOTSUP if the operation is not supported.
intrte_cryptodev_scheduler_option_set(uint8_tscheduler_id,enumrte_cryptodev_schedule_option_typeoption_type,void*option)
Set the mode specific option
Parametersscheduler_id The target scheduler device ID
option_type The option type enumerate
option The specific mode's option structure
Returns
• 0 if successful
• negative integer if otherwise.
intrte_cryptodev_scheduler_option_get(uint8_tscheduler_id,enumrte_cryptodev_schedule_option_typeoption_type,void*option)
Set the mode specific option
Parametersscheduler_id The target scheduler device ID
option_type The option type enumerate
option If successful, the function will write back the current
Returns
• 0 if successful
• negative integer if otherwise.
Macro Definition Documentation
#defineRTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKERS(8)
Maximum number of bonding devices per device
Definition at line 29 of file rte_cryptodev_scheduler.h.
#defineRTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES(RTE_MAX_LCORE-1)
Maximum number of multi-core worker cores
Definition at line 33 of file rte_cryptodev_scheduler.h.
#defineSCHEDULER_MODE_NAME_ROUND_ROBINround-robin
Round-robin scheduling mode string
Definition at line 36 of file rte_cryptodev_scheduler.h.
#defineSCHEDULER_MODE_NAME_PKT_SIZE_DISTRpacket-size-distr
Packet-size based distribution scheduling mode string
Definition at line 38 of file rte_cryptodev_scheduler.h.
#defineSCHEDULER_MODE_NAME_FAIL_OVERfail-over
Fail-over scheduling mode string
Definition at line 40 of file rte_cryptodev_scheduler.h.
#defineSCHEDULER_MODE_NAME_MULTI_COREmulti-core
multi-core scheduling mode string
Definition at line 42 of file rte_cryptodev_scheduler.h.
#defineRTE_CRYPTODEV_SCHEDULER_PARAM_THRES'threshold'
Threshold option structure
Definition at line 79 of file rte_cryptodev_scheduler.h.
Name
rte_cryptodev_scheduler.h
Synopsis
#include <stdint.h>
#include 'rte_cryptodev_scheduler_operations.h'
DataStructures
struct rte_cryptodev_schedulerMacros
#define RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKERS (8)
#define RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES (RTE_MAX_LCORE - 1)
#define SCHEDULER_MODE_NAME_ROUND_ROBIN round-robin
#define SCHEDULER_MODE_NAME_PKT_SIZE_DISTR packet-size-distr
#define SCHEDULER_MODE_NAME_FAIL_OVER fail-over
#define SCHEDULER_MODE_NAME_MULTI_CORE multi-core
#define RTE_CRYPTODEV_SCHEDULER_PARAM_THRES 'threshold'
Enumerations
enum rte_cryptodev_scheduler_mode { }
enum rte_cryptodev_schedule_option_typeFunctions
int rte_cryptodev_scheduler_load_user_scheduler (uint8_t scheduler_id, struct rte_cryptodev_scheduler
*scheduler)
int rte_cryptodev_scheduler_worker_attach (uint8_t scheduler_id, uint8_t worker_id)
int rte_cryptodev_scheduler_worker_detach (uint8_t scheduler_id, uint8_t worker_id)
int rte_cryptodev_scheduler_mode_set (uint8_t scheduler_id, enum rte_cryptodev_scheduler_mode mode)
enum rte_cryptodev_scheduler_moderte_cryptodev_scheduler_mode_get (uint8_t scheduler_id)
int rte_cryptodev_scheduler_ordering_set (uint8_t scheduler_id, uint32_t enable_reorder)
int rte_cryptodev_scheduler_ordering_get (uint8_t scheduler_id)
int rte_cryptodev_scheduler_workers_get (uint8_t scheduler_id, uint8_t *workers)
int rte_cryptodev_scheduler_option_set (uint8_t scheduler_id, enum rte_cryptodev_schedule_option_type
option_type, void *option)
int rte_cryptodev_scheduler_option_get (uint8_t scheduler_id, enum rte_cryptodev_schedule_option_type
option_type, void *option)
Variables
struct rte_cryptodev_scheduler * crypto_scheduler_roundrobin
struct rte_cryptodev_scheduler * crypto_scheduler_pkt_size_based_distr
struct rte_cryptodev_scheduler * crypto_scheduler_failover
struct rte_cryptodev_scheduler * crypto_scheduler_multicoreVariable Documentation
structrte_cryptodev_scheduler*crypto_scheduler_roundrobin[extern]
Round-robin mode scheduler
structrte_cryptodev_scheduler*crypto_scheduler_pkt_size_based_distr[extern]
Packet-size based distribution mode scheduler
structrte_cryptodev_scheduler*crypto_scheduler_failover[extern]
Fail-over mode scheduler
structrte_cryptodev_scheduler*crypto_scheduler_multicore[extern]
multi-core mode scheduler
