#include <stdint.h>
#include "main.h"
#define SUBPORT_OFFSET 7
#define PIPE_OFFSET 9
#define QUEUE_OFFSET 20
#define COLOR_OFFSET 19
static inline int
get_pkt_sched(
struct rte_mbuf *m, uint32_t *subport, uint32_t *pipe,
uint32_t *traffic_class, uint32_t *queue, uint32_t *color)
{
uint16_t pipe_queue;
(port_params.n_subports_per_port - 1);
(subport_params[*subport].n_pipes_per_subport_enabled - 1);
pipe_queue = active_queues[(pdata[QUEUE_OFFSET] >> 8) % n_active_queues];
*queue = pipe_queue - *traffic_class;
*color = pdata[COLOR_OFFSET] & 0x03;
return 0;
}
void
app_rx_thread(struct thread_conf **confs)
{
uint32_t i, nb_rx;
alignas(RTE_CACHE_LINE_SIZE)
struct rte_mbuf *rx_mbufs[burst_conf.rx_burst];
struct thread_conf *conf;
int conf_idx = 0;
uint32_t subport;
uint32_t pipe;
uint32_t traffic_class;
uint32_t queue;
uint32_t color;
while ((conf = confs[conf_idx])) {
burst_conf.rx_burst);
APP_STATS_ADD(conf->stat.nb_rx, nb_rx);
for(i = 0; i < nb_rx; i++) {
get_pkt_sched(rx_mbufs[i],
&subport, &pipe, &traffic_class, &queue, &color);
rx_mbufs[i],
subport, pipe,
traffic_class, queue,
}
(void **)rx_mbufs, nb_rx, NULL) == 0)) {
for(i = 0; i < nb_rx; i++) {
APP_STATS_ADD(conf->stat.nb_drop, 1);
}
}
}
conf_idx++;
if (confs[conf_idx] == NULL)
conf_idx = 0;
}
}
void
app_tx_thread(struct thread_conf **confs)
{
struct rte_mbuf *mbufs[burst_conf.qos_dequeue];
struct thread_conf *conf;
int conf_idx = 0;
int nb_pkts;
while ((conf = confs[conf_idx])) {
burst_conf.qos_dequeue, NULL);
if (nb_pkts != nb_tx)
}
conf_idx++;
if (confs[conf_idx] == NULL)
conf_idx = 0;
}
}
void
app_worker_thread(struct thread_conf **confs)
{
struct rte_mbuf *mbufs[burst_conf.ring_burst];
struct thread_conf *conf;
int conf_idx = 0;
while ((conf = confs[conf_idx])) {
uint32_t nb_pkt;
burst_conf.ring_burst, NULL);
nb_pkt);
APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent);
APP_STATS_ADD(conf->stat.nb_rx, nb_pkt);
}
burst_conf.qos_dequeue);
(void **)mbufs, nb_pkt, NULL) == 0)
;
conf_idx++;
if (confs[conf_idx] == NULL)
conf_idx = 0;
}
}
void
app_mixed_thread(struct thread_conf **confs)
{
struct rte_mbuf *mbufs[burst_conf.ring_burst];
struct thread_conf *conf;
int conf_idx = 0;
while ((conf = confs[conf_idx])) {
uint32_t nb_pkt;
burst_conf.ring_burst, NULL);
nb_pkt);
APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent);
APP_STATS_ADD(conf->stat.nb_rx, nb_pkt);
}
burst_conf.qos_dequeue);
if (nb_tx != nb_pkt)
}
conf_idx++;
if (confs[conf_idx] == NULL)
conf_idx = 0;
}
}
static uint16_t rte_be_to_cpu_16(rte_be16_t x)
static uint16_t rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
static uint16_t rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
static void rte_pktmbuf_free(struct rte_mbuf *m)
void rte_pktmbuf_free_bulk(struct rte_mbuf **mbufs, unsigned int count)
#define rte_pktmbuf_mtod(m, t)
static __rte_always_inline unsigned int rte_ring_sc_dequeue_burst(struct rte_ring *r, void **obj_table, unsigned int n, unsigned int *available)
static __rte_always_inline unsigned int rte_ring_sp_enqueue_bulk(struct rte_ring *r, void *const *obj_table, unsigned int n, unsigned int *free_space)
int rte_sched_port_enqueue(struct rte_sched_port *port, struct rte_mbuf **pkts, uint32_t n_pkts)
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)
#define RTE_SCHED_TRAFFIC_CLASS_BE
int rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf **pkts, uint32_t n_pkts)