- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
- * * Neither the name of Intel Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* for the current network node.
*
* The scheduler supports thousands of packet queues grouped under a 5-level hierarchy:
* for the current network node.
*
* The scheduler supports thousands of packet queues grouped under a 5-level hierarchy:
* - Typical usage: output Ethernet port;
* - Multiple ports are scheduled in round robin order with equal priority;
* 2. Subport:
* - Typical usage: output Ethernet port;
* - Multiple ports are scheduled in round robin order with equal priority;
* 2. Subport:
* - Upper limit enforced per traffic class at subport level;
* - Lower priority traffic classes able to reuse subport bandwidth currently
* unused by higher priority traffic classes of the same subport;
* - Upper limit enforced per traffic class at subport level;
* - Lower priority traffic classes able to reuse subport bandwidth currently
* unused by higher priority traffic classes of the same subport;
- * - When any subport traffic class is oversubscribed (configuration time
- * event), the usage of subport member pipes with high demand for that
- * traffic class pipes is truncated to a dynamically adjusted value with no
+ * - When any subport traffic class is oversubscribed (configuration time
+ * event), the usage of subport member pipes with high demand for that
+ * traffic class pipes is truncated to a dynamically adjusted value with no
* - Typical usage: individual user/subscriber;
* - Traffic shaping using the token bucket algorithm (one bucket per pipe);
* 4. Traffic class:
* - Typical usage: individual user/subscriber;
* - Traffic shaping using the token bucket algorithm (one bucket per pipe);
* 4. Traffic class:
* - Lower priority traffic classes able to reuse pipe bandwidth currently
* unused by higher priority traffic classes of the same pipe;
* 5. Queue:
* - Lower priority traffic classes able to reuse pipe bandwidth currently
* unused by higher priority traffic classes of the same pipe;
* 5. Queue:
2. Start of Frame Delimiter (SFD): 1 byte;
3. Frame Check Sequence (FCS): 4 bytes;
4. Inter Frame Gap (IFG): 12 bytes.
2. Start of Frame Delimiter (SFD): 1 byte;
3. Frame Check Sequence (FCS): 4 bytes;
4. Inter Frame Gap (IFG): 12 bytes.
of struct rte_mbuf). */
#ifndef RTE_SCHED_FRAME_OVERHEAD_DEFAULT
#define RTE_SCHED_FRAME_OVERHEAD_DEFAULT 24
#endif
/** Subport configuration parameters. The period and credits_per_period parameters are measured
of struct rte_mbuf). */
#ifndef RTE_SCHED_FRAME_OVERHEAD_DEFAULT
#define RTE_SCHED_FRAME_OVERHEAD_DEFAULT 24
#endif
/** Subport configuration parameters. The period and credits_per_period parameters are measured
-in bytes, with one byte meaning the time duration associated with the transmission of one byte
-on the physical medium of the output port, with pipe or pipe traffic class rate (measured as
+in bytes, with one byte meaning the time duration associated with the transmission of one byte
+on the physical medium of the output port, with pipe or pipe traffic class rate (measured as
percentage of output port rate) determined as credits_per_period divided by period. One credit
represents one byte. */
struct rte_sched_subport_params {
/* Subport token bucket */
uint32_t tb_rate; /**< Subport token bucket rate (measured in bytes per second) */
uint32_t tb_size; /**< Subport token bucket size (measured in credits) */
percentage of output port rate) determined as credits_per_period divided by period. One credit
represents one byte. */
struct rte_sched_subport_params {
/* Subport token bucket */
uint32_t tb_rate; /**< Subport token bucket rate (measured in bytes per second) */
uint32_t tb_size; /**< Subport token bucket size (measured in credits) */
/* Subport traffic classes */
uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Subport traffic class rates (measured in bytes per second) */
uint32_t tc_period; /**< Enforcement period for traffic class rates (measured in milliseconds) */
/* Subport traffic classes */
uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Subport traffic class rates (measured in bytes per second) */
uint32_t tc_period; /**< Enforcement period for traffic class rates (measured in milliseconds) */
subport for each traffic class */
uint32_t n_pkts_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Number of packets dropped by the current
subport for each traffic class due to subport queues being full or congested*/
subport for each traffic class */
uint32_t n_pkts_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Number of packets dropped by the current
subport for each traffic class due to subport queues being full or congested*/
subport for each traffic class due to subport queues being full or congested */
};
/** Pipe configuration parameters. The period and credits_per_period parameters are measured
subport for each traffic class due to subport queues being full or congested */
};
/** Pipe configuration parameters. The period and credits_per_period parameters are measured
-in bytes, with one byte meaning the time duration associated with the transmission of one byte
-on the physical medium of the output port, with pipe or pipe traffic class rate (measured as
+in bytes, with one byte meaning the time duration associated with the transmission of one byte
+on the physical medium of the output port, with pipe or pipe traffic class rate (measured as
percentage of output port rate) determined as credits_per_period divided by period. One credit
represents one byte. */
struct rte_sched_pipe_params {
/* Pipe token bucket */
uint32_t tb_rate; /**< Pipe token bucket rate (measured in bytes per second) */
uint32_t tb_size; /**< Pipe token bucket size (measured in credits) */
percentage of output port rate) determined as credits_per_period divided by period. One credit
represents one byte. */
struct rte_sched_pipe_params {
/* Pipe token bucket */
uint32_t tb_rate; /**< Pipe token bucket rate (measured in bytes per second) */
uint32_t tb_size; /**< Pipe token bucket size (measured in credits) */
/* Pipe traffic classes */
uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Pipe traffic class rates (measured in bytes per second) */
uint32_t tc_period; /**< Enforcement period for pipe traffic class rates (measured in milliseconds) */
#ifdef RTE_SCHED_SUBPORT_TC_OV
/* Pipe traffic classes */
uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Pipe traffic class rates (measured in bytes per second) */
uint32_t tc_period; /**< Enforcement period for pipe traffic class rates (measured in milliseconds) */
#ifdef RTE_SCHED_SUBPORT_TC_OV
/* Packets */
uint32_t n_pkts; /**< Number of packets successfully written to current queue */
uint32_t n_pkts_dropped; /**< Number of packets dropped due to current queue being full or congested */
/* Packets */
uint32_t n_pkts; /**< Number of packets successfully written to current queue */
uint32_t n_pkts_dropped; /**< Number of packets dropped due to current queue being full or congested */
uint32_t frame_overhead; /**< Framing overhead per packet (measured in bytes) */
uint32_t n_subports_per_port; /**< Number of subports for the current port scheduler instance*/
uint32_t n_pipes_per_subport; /**< Number of pipes for each port scheduler subport */
uint32_t frame_overhead; /**< Framing overhead per packet (measured in bytes) */
uint32_t n_subports_per_port; /**< Number of subports for the current port scheduler instance*/
uint32_t n_pipes_per_subport; /**< Number of pipes for each port scheduler subport */
- uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Packet queue size for each traffic class. All queues
- within the same pipe traffic class have the same size. Queues from
+ uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Packet queue size for each traffic class. All queues
+ within the same pipe traffic class have the same size. Queues from
different pipes serving the same traffic class have the same size. */
struct rte_sched_pipe_params *pipe_profiles; /**< Pipe profile table defined for current port scheduler instance.
Every pipe of the current port scheduler is configured using one of the
different pipes serving the same traffic class have the same size. */
struct rte_sched_pipe_params *pipe_profiles; /**< Pipe profile table defined for current port scheduler instance.
Every pipe of the current port scheduler is configured using one of the
-identify the destination queue for the current packet. Stored in the field pkt.hash.sched
-of struct rte_mbuf of each packet, typically written by the classification stage and read by
+identify the destination queue for the current packet. Stored in the field hash.sched
+of struct rte_mbuf of each packet, typically written by the classification stage and read by
* counters should be stored
* @param tc_ov
* Pointer to pre-allocated 4-entry array where the oversubscription status for
* counters should be stored
* @param tc_ov
* Pointer to pre-allocated 4-entry array where the oversubscription status for
* counters should be stored
* @param qlen
* Pointer to pre-allocated variable where the current queue length should be stored.
* counters should be stored
* @param qlen
* Pointer to pre-allocated variable where the current queue length should be stored.
uint32_t subport, uint32_t pipe, uint32_t traffic_class, uint32_t queue, enum rte_meter_color color)
{
uint32_t subport, uint32_t pipe, uint32_t traffic_class, uint32_t queue, enum rte_meter_color color)
{
*/
static inline void
rte_sched_port_pkt_read_tree_path(struct rte_mbuf *pkt, uint32_t *subport, uint32_t *pipe, uint32_t *traffic_class, uint32_t *queue)
{
*/
static inline void
rte_sched_port_pkt_read_tree_path(struct rte_mbuf *pkt, uint32_t *subport, uint32_t *pipe, uint32_t *traffic_class, uint32_t *queue)
{
- * 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
+ * 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
- * 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.
+ * 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.
*
* @param port
* Handle to port scheduler instance
* @param pkts
* The pkts array needs to be pre-allocated by the caller with at least n_pkts entries.
*
* @param port
* Handle to port scheduler instance
* @param pkts