MCPcopy Create free account
hub / github.com/F-Stack/f-stack / app_rx_thread

Function app_rx_thread

dpdk/examples/qos_sched/app_thread.c:61–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void
62app_rx_thread(struct thread_conf **confs)
63{
64 uint32_t i, nb_rx;
65 struct rte_mbuf *rx_mbufs[burst_conf.rx_burst] __rte_cache_aligned;
66 struct thread_conf *conf;
67 int conf_idx = 0;
68
69 uint32_t subport;
70 uint32_t pipe;
71 uint32_t traffic_class;
72 uint32_t queue;
73 uint32_t color;
74
75 while ((conf = confs[conf_idx])) {
76 nb_rx = rte_eth_rx_burst(conf->rx_port, conf->rx_queue, rx_mbufs,
77 burst_conf.rx_burst);
78
79 if (likely(nb_rx != 0)) {
80 APP_STATS_ADD(conf->stat.nb_rx, nb_rx);
81
82 for(i = 0; i < nb_rx; i++) {
83 get_pkt_sched(rx_mbufs[i],
84 &subport, &pipe, &traffic_class, &queue, &color);
85 rte_sched_port_pkt_write(conf->sched_port,
86 rx_mbufs[i],
87 subport, pipe,
88 traffic_class, queue,
89 (enum rte_color) color);
90 }
91
92 if (unlikely(rte_ring_sp_enqueue_bulk(conf->rx_ring,
93 (void **)rx_mbufs, nb_rx, NULL) == 0)) {
94 for(i = 0; i < nb_rx; i++) {
95 rte_pktmbuf_free(rx_mbufs[i]);
96
97 APP_STATS_ADD(conf->stat.nb_drop, 1);
98 }
99 }
100 }
101 conf_idx++;
102 if (confs[conf_idx] == NULL)
103 conf_idx = 0;
104 }
105}
106
107void
108app_tx_thread(struct thread_conf **confs)

Callers 1

app_main_loopFunction · 0.85

Calls 5

rte_eth_rx_burstFunction · 0.85
get_pkt_schedFunction · 0.85
rte_sched_port_pkt_writeFunction · 0.85
rte_ring_sp_enqueue_bulkFunction · 0.85
rte_pktmbuf_freeFunction · 0.85

Tested by

no test coverage detected