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

Function app_worker_thread

dpdk/examples/qos_sched/app_thread.c:131–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129
130
131void
132app_worker_thread(struct thread_conf **confs)
133{
134 struct rte_mbuf *mbufs[burst_conf.ring_burst];
135 struct thread_conf *conf;
136 int conf_idx = 0;
137
138 while ((conf = confs[conf_idx])) {
139 uint32_t nb_pkt;
140
141 /* Read packet from the ring */
142 nb_pkt = rte_ring_sc_dequeue_burst(conf->rx_ring, (void **)mbufs,
143 burst_conf.ring_burst, NULL);
144 if (likely(nb_pkt)) {
145 int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs,
146 nb_pkt);
147
148 APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent);
149 APP_STATS_ADD(conf->stat.nb_rx, nb_pkt);
150 }
151
152 nb_pkt = rte_sched_port_dequeue(conf->sched_port, mbufs,
153 burst_conf.qos_dequeue);
154 if (likely(nb_pkt > 0))
155 while (rte_ring_sp_enqueue_bulk(conf->tx_ring,
156 (void **)mbufs, nb_pkt, NULL) == 0)
157 ; /* empty body */
158
159 conf_idx++;
160 if (confs[conf_idx] == NULL)
161 conf_idx = 0;
162 }
163}
164
165
166void

Callers 1

app_main_loopFunction · 0.85

Calls 4

rte_sched_port_enqueueFunction · 0.85
rte_sched_port_dequeueFunction · 0.85
rte_ring_sp_enqueue_bulkFunction · 0.85

Tested by

no test coverage detected