DPDK: Data Plane Development Kit

18.02.0-rc0
rte_cryptodev_scheduler.h File Reference
#include <stdint.h>
#include "rte_cryptodev_scheduler_operations.h"

Go to the source code of this file.

Data Structures

struct  rte_cryptodev_scheduler_threshold_option
struct  rte_cryptodev_scheduler

Macros

#define RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES   (8)
#define RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES   (64)
#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

Enumerations

enum  rte_cryptodev_scheduler_mode { ,
  CDEV_SCHED_MODE_USERDEFINED, CDEV_SCHED_MODE_ROUNDROBIN, CDEV_SCHED_MODE_PKT_SIZE_DISTR, CDEV_SCHED_MODE_FAILOVER,
  CDEV_SCHED_MODE_MULTICORE, CDEV_SCHED_MODE_COUNT
}
enum  rte_cryptodev_schedule_option_type

Functions

int rte_cryptodev_scheduler_load_user_scheduler (uint8_t scheduler_id, struct rte_cryptodev_scheduler *scheduler)
int 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)
int rte_cryptodev_scheduler_mode_set (uint8_t scheduler_id, enum rte_cryptodev_scheduler_mode mode)
enum rte_cryptodev_scheduler_mode rte_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_slaves_get (uint8_t scheduler_id, uint8_t *slaves)
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_schedulerroundrobin_scheduler
struct rte_cryptodev_schedulerpkt_size_based_distr_scheduler
struct rte_cryptodev_schedulerfailover_scheduler
struct rte_cryptodev_schedulermulticore_scheduler

Detailed Description

RTE Cryptodev Scheduler Device

The RTE Cryptodev Scheduler Device allows the aggregation of multiple (slave) Cryptodevs into a single logical crypto device, and the scheduling the crypto operations to the slaves 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.

Macro Definition Documentation

#define RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES   (8)

Maximum number of bonded devices per device

Definition at line 58 of file rte_cryptodev_scheduler.h.

#define RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES   (64)

Maximum number of multi-core worker cores

Definition at line 62 of file rte_cryptodev_scheduler.h.

#define SCHEDULER_MODE_NAME_ROUND_ROBIN   round-robin

Round-robin scheduling mode string

Definition at line 65 of file rte_cryptodev_scheduler.h.

#define SCHEDULER_MODE_NAME_PKT_SIZE_DISTR   packet-size-distr

Packet-size based distribution scheduling mode string

Definition at line 67 of file rte_cryptodev_scheduler.h.

#define SCHEDULER_MODE_NAME_FAIL_OVER   fail-over

Fail-over scheduling mode string

Definition at line 69 of file rte_cryptodev_scheduler.h.

#define SCHEDULER_MODE_NAME_MULTI_CORE   multi-core

multi-core scheduling mode string

Definition at line 71 of file rte_cryptodev_scheduler.h.

Enumeration Type Documentation

Crypto scheduler PMD operation modes

Enumerator:
CDEV_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 76 of file rte_cryptodev_scheduler.h.

Crypto scheduler option types

Definition at line 98 of file rte_cryptodev_scheduler.h.

Function Documentation

int rte_cryptodev_scheduler_load_user_scheduler ( uint8_t  scheduler_id,
struct rte_cryptodev_scheduler scheduler 
)

Load a user defined scheduler

Parameters
scheduler_idThe target scheduler device ID
schedulerPointer 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.
int rte_cryptodev_scheduler_slave_attach ( uint8_t  scheduler_id,
uint8_t  slave_id 
)

Attach a crypto device to the scheduler

Parameters
scheduler_idThe target scheduler device ID
slave_idCrypto device ID to be attached
Returns
  • 0 if the slave is attached.
  • -ENOTSUP if the operation is not supported.
  • -EBUSY if device is started.
  • -ENOMEM if the scheduler's slave list is full.
int rte_cryptodev_scheduler_slave_detach ( uint8_t  scheduler_id,
uint8_t  slave_id 
)

Detach a crypto device from the scheduler

Parameters
scheduler_idThe target scheduler device ID
slave_idCrypto device ID to be detached
Returns
  • 0 if the slave is detached.
  • -ENOTSUP if the operation is not supported.
  • -EBUSY if device is started.
int rte_cryptodev_scheduler_mode_set ( uint8_t  scheduler_id,
enum rte_cryptodev_scheduler_mode  mode 
)

Set the scheduling mode

Parameters
scheduler_idThe target scheduler device ID
modeThe scheduling mode
Returns
  • 0 if the mode is set.
  • -ENOTSUP if the operation is not supported.
  • -EBUSY if device is started.
enum rte_cryptodev_scheduler_mode rte_cryptodev_scheduler_mode_get ( uint8_t  scheduler_id)

Get the current scheduling mode

Parameters
scheduler_idThe target scheduler device ID
Returns
mode
  • non-negative enumerate value: the scheduling mode
  • -ENOTSUP if the operation is not supported.
int rte_cryptodev_scheduler_ordering_set ( uint8_t  scheduler_id,
uint32_t  enable_reorder 
)

Set the crypto ops reordering feature on/off

Parameters
scheduler_idThe target scheduler device ID
enable_reorderSet 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.
int rte_cryptodev_scheduler_ordering_get ( uint8_t  scheduler_id)

Get the current crypto ops reordering feature

Parameters
scheduler_idThe target scheduler device ID
Returns
  • 0 if reordering is disabled
  • 1 if reordering is enabled
  • -ENOTSUP if the operation is not supported.
int rte_cryptodev_scheduler_slaves_get ( uint8_t  scheduler_id,
uint8_t *  slaves 
)

Get the the attached slaves' count and/or ID

Parameters
scheduler_idThe target scheduler device ID
slavesIf successful, the function will write back all slaves' device IDs to it. This parameter will either be an uint8_t array of RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES elements or NULL.
Returns
  • non-negative number: the number of slaves attached
  • -ENOTSUP if the operation is not supported.
int rte_cryptodev_scheduler_option_set ( uint8_t  scheduler_id,
enum rte_cryptodev_schedule_option_type  option_type,
void *  option 
)

Set the mode specific option

Parameters
scheduler_idThe target scheduler device ID
option_typeThe option type enumerate
optionThe specific mode's option structure
Returns
  • 0 if successful
  • negative integer if otherwise.
int rte_cryptodev_scheduler_option_get ( uint8_t  scheduler_id,
enum rte_cryptodev_schedule_option_type  option_type,
void *  option 
)

Set the mode specific option

Parameters
scheduler_idThe target scheduler device ID
option_typeThe option type enumerate
optionIf successful, the function will write back the current
Returns
  • 0 if successful
  • negative integer if otherwise.

Variable Documentation

struct rte_cryptodev_scheduler* roundrobin_scheduler

Round-robin mode scheduler

struct rte_cryptodev_scheduler* pkt_size_based_distr_scheduler

Packet-size based distribution mode scheduler

struct rte_cryptodev_scheduler* failover_scheduler

Fail-over mode scheduler

struct rte_cryptodev_scheduler* multicore_scheduler

multi-core mode scheduler