#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;
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;
}
}