DPDK
20.05.0
|
Go to the source code of this file.
Data Structures | |
struct | rte_sched_subport_stats |
struct | rte_sched_queue_stats |
struct | rte_sched_port_params |
Macros | |
#define | RTE_SCHED_QUEUES_PER_PIPE 16 |
#define | RTE_SCHED_BE_QUEUES_PER_PIPE 4 |
#define | RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE (RTE_SCHED_QUEUES_PER_PIPE - RTE_SCHED_BE_QUEUES_PER_PIPE + 1) |
#define | RTE_SCHED_TRAFFIC_CLASS_BE (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1) |
Functions | |
struct rte_sched_port * | rte_sched_port_config (struct rte_sched_port_params *params) |
void | rte_sched_port_free (struct rte_sched_port *port) |
__rte_experimental int | rte_sched_subport_pipe_profile_add (struct rte_sched_port *port, uint32_t subport_id, struct rte_sched_pipe_params *params, uint32_t *pipe_profile_id) |
int | rte_sched_subport_config (struct rte_sched_port *port, uint32_t subport_id, struct rte_sched_subport_params *params) |
int | rte_sched_pipe_config (struct rte_sched_port *port, uint32_t subport_id, uint32_t pipe_id, int32_t pipe_profile) |
uint32_t | rte_sched_port_get_memory_footprint (struct rte_sched_port_params *port_params, struct rte_sched_subport_params **subport_params) |
int | rte_sched_subport_read_stats (struct rte_sched_port *port, uint32_t subport_id, struct rte_sched_subport_stats *stats, uint32_t *tc_ov) |
int | rte_sched_queue_read_stats (struct rte_sched_port *port, uint32_t queue_id, struct rte_sched_queue_stats *stats, uint16_t *qlen) |
void | rte_sched_port_pkt_write (struct rte_sched_port *port, struct rte_mbuf *pkt, uint32_t subport, uint32_t pipe, uint32_t traffic_class, uint32_t queue, enum rte_color color) |
void | rte_sched_port_pkt_read_tree_path (struct rte_sched_port *port, const struct rte_mbuf *pkt, uint32_t *subport, uint32_t *pipe, uint32_t *traffic_class, uint32_t *queue) |
int | rte_sched_port_enqueue (struct rte_sched_port *port, struct rte_mbuf **pkts, uint32_t n_pkts) |
int | rte_sched_port_dequeue (struct rte_sched_port *port, struct rte_mbuf **pkts, uint32_t n_pkts) |
RTE Hierarchical Scheduler
The hierarchical scheduler prioritizes the transmission of packets from different users and traffic classes according to the Service Level Agreements (SLAs) defined for the current network node.
The scheduler supports thousands of packet queues grouped under a 5-level hierarchy:
Definition in file rte_sched.h.
#define RTE_SCHED_QUEUES_PER_PIPE 16 |
Random Early Detection (RED) Maximum number of queues per pipe. Note that the multiple queues (power of 2) can only be assigned to lowest priority (best-effort) traffic class. Other higher priority traffic classes can only have one queue. Can not change.
Definition at line 77 of file rte_sched.h.
#define RTE_SCHED_BE_QUEUES_PER_PIPE 4 |
Number of WRR queues for best-effort traffic class per pipe.
Definition at line 83 of file rte_sched.h.
#define RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE (RTE_SCHED_QUEUES_PER_PIPE - RTE_SCHED_BE_QUEUES_PER_PIPE + 1) |
Number of traffic classes per pipe (as well as subport).
Definition at line 89 of file rte_sched.h.
#define RTE_SCHED_TRAFFIC_CLASS_BE (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1) |
Best-effort traffic class ID Can not change.
Definition at line 95 of file rte_sched.h.
struct rte_sched_port* rte_sched_port_config | ( | struct rte_sched_port_params * | params | ) |
Hierarchical scheduler port configuration
params | Port scheduler configuration parameter structure |
void rte_sched_port_free | ( | struct rte_sched_port * | port | ) |
Hierarchical scheduler port free
port | Handle to port scheduler instance |
__rte_experimental int rte_sched_subport_pipe_profile_add | ( | struct rte_sched_port * | port, |
uint32_t | subport_id, | ||
struct rte_sched_pipe_params * | params, | ||
uint32_t * | pipe_profile_id | ||
) |
Hierarchical scheduler pipe profile add
port | Handle to port scheduler instance |
subport_id | Subport ID |
params | Pipe profile parameters |
pipe_profile_id | Set to valid profile id when profile is added successfully. |
int rte_sched_subport_config | ( | struct rte_sched_port * | port, |
uint32_t | subport_id, | ||
struct rte_sched_subport_params * | params | ||
) |
Hierarchical scheduler subport configuration
port | Handle to port scheduler instance |
subport_id | Subport ID |
params | Subport configuration parameters |
int rte_sched_pipe_config | ( | struct rte_sched_port * | port, |
uint32_t | subport_id, | ||
uint32_t | pipe_id, | ||
int32_t | pipe_profile | ||
) |
Hierarchical scheduler pipe configuration
port | Handle to port scheduler instance |
subport_id | Subport ID |
pipe_id | Pipe ID within subport |
pipe_profile | ID of subport-level pre-configured pipe profile |
uint32_t rte_sched_port_get_memory_footprint | ( | struct rte_sched_port_params * | port_params, |
struct rte_sched_subport_params ** | subport_params | ||
) |
Hierarchical scheduler memory footprint size per port
port_params | Port scheduler configuration parameter structure |
subport_params | Array of subport parameter structures |
int rte_sched_subport_read_stats | ( | struct rte_sched_port * | port, |
uint32_t | subport_id, | ||
struct rte_sched_subport_stats * | stats, | ||
uint32_t * | tc_ov | ||
) |
Hierarchical scheduler subport statistics read
port | Handle to port scheduler instance |
subport_id | Subport ID |
stats | Pointer to pre-allocated subport statistics structure where the statistics counters should be stored |
tc_ov | Pointer to pre-allocated RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE-entry array where the oversubscription status for each of the subport traffic classes should be stored. |
int rte_sched_queue_read_stats | ( | struct rte_sched_port * | port, |
uint32_t | queue_id, | ||
struct rte_sched_queue_stats * | stats, | ||
uint16_t * | qlen | ||
) |
Hierarchical scheduler queue statistics read
port | Handle to port scheduler instance |
queue_id | Queue ID within port scheduler |
stats | Pointer to pre-allocated subport statistics structure where the statistics counters should be stored |
qlen | Pointer to pre-allocated variable where the current queue length should be stored. |
void rte_sched_port_pkt_write | ( | struct rte_sched_port * | port, |
struct rte_mbuf * | pkt, | ||
uint32_t | subport, | ||
uint32_t | pipe, | ||
uint32_t | traffic_class, | ||
uint32_t | queue, | ||
enum rte_color | color | ||
) |
Scheduler hierarchy path write to packet descriptor. Typically called by the packet classification stage.
port | Handle to port scheduler instance |
pkt | Packet descriptor handle |
subport | Subport ID |
pipe | Pipe ID within subport |
traffic_class | Traffic class ID within pipe (0 .. RTE_SCHED_TRAFFIC_CLASS_BE) |
queue | Queue ID within pipe traffic class, 0 for high priority TCs, and 0 .. (RTE_SCHED_BE_QUEUES_PER_PIPE - 1) for best-effort TC |
color | Packet color set |
void rte_sched_port_pkt_read_tree_path | ( | struct rte_sched_port * | port, |
const struct rte_mbuf * | pkt, | ||
uint32_t * | subport, | ||
uint32_t * | pipe, | ||
uint32_t * | traffic_class, | ||
uint32_t * | queue | ||
) |
Scheduler hierarchy path read from packet descriptor (struct rte_mbuf). Typically called as part of the hierarchical scheduler enqueue operation. The subport, pipe, traffic class and queue parameters need to be pre-allocated by the caller.
port | Handle to port scheduler instance |
pkt | Packet descriptor handle |
subport | Subport ID |
pipe | Pipe ID within subport |
traffic_class | Traffic class ID within pipe (0 .. RTE_SCHED_TRAFFIC_CLASS_BE) |
queue | Queue ID within pipe traffic class, 0 for high priority TCs, and 0 .. (RTE_SCHED_BE_QUEUES_PER_PIPE - 1) for best-effort TC |
int rte_sched_port_enqueue | ( | struct rte_sched_port * | port, |
struct rte_mbuf ** | pkts, | ||
uint32_t | n_pkts | ||
) |
Hierarchical scheduler port enqueue. Writes up to n_pkts to port scheduler and returns the number of packets actually written. For each packet, the port scheduler queue to write the packet to is identified by reading the hierarchy path from the packet descriptor; if the queue is full or congested and the packet is not written to the queue, then the packet is automatically dropped without any action required from the caller.
port | Handle to port scheduler instance |
pkts | Array storing the packet descriptor handles |
n_pkts | Number of packets to enqueue from the pkts array into the port scheduler |
int rte_sched_port_dequeue | ( | struct rte_sched_port * | port, |
struct rte_mbuf ** | pkts, | ||
uint32_t | n_pkts | ||
) |
Hierarchical scheduler port dequeue. Reads up to n_pkts from the port scheduler and stores them in the pkts array and returns the number of packets actually read. The pkts array needs to be pre-allocated by the caller with at least n_pkts entries.
port | Handle to port scheduler instance |
pkts | Pre-allocated packet descriptor array where the packets dequeued from the port scheduler should be stored |
n_pkts | Number of packets to dequeue from the port scheduler |