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

Function app_mixed_thread

dpdk/examples/qos_sched/app_thread.c:166–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164
165
166void
167app_mixed_thread(struct thread_conf **confs)
168{
169 struct rte_mbuf *mbufs[burst_conf.ring_burst];
170 struct thread_conf *conf;
171 int conf_idx = 0;
172
173 while ((conf = confs[conf_idx])) {
174 uint32_t nb_pkt;
175
176 /* Read packet from the ring */
177 nb_pkt = rte_ring_sc_dequeue_burst(conf->rx_ring, (void **)mbufs,
178 burst_conf.ring_burst, NULL);
179 if (likely(nb_pkt)) {
180 int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs,
181 nb_pkt);
182
183 APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent);
184 APP_STATS_ADD(conf->stat.nb_rx, nb_pkt);
185 }
186
187
188 nb_pkt = rte_sched_port_dequeue(conf->sched_port, mbufs,
189 burst_conf.qos_dequeue);
190 if (likely(nb_pkt > 0)) {
191 uint16_t nb_tx = rte_eth_tx_burst(conf->tx_port, 0, mbufs, nb_pkt);
192 if (nb_tx != nb_pkt)
193 rte_pktmbuf_free_bulk(&mbufs[nb_tx], nb_pkt - nb_tx);
194 }
195
196 conf_idx++;
197 if (confs[conf_idx] == NULL)
198 conf_idx = 0;
199 }
200}

Callers 1

app_main_loopFunction · 0.85

Calls 5

rte_sched_port_enqueueFunction · 0.85
rte_sched_port_dequeueFunction · 0.85
rte_eth_tx_burstFunction · 0.85
rte_pktmbuf_free_bulkFunction · 0.85

Tested by

no test coverage detected