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

Function app_main_loop_tx

dpdk/app/test-pipeline/runtime.c:111–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void
112app_main_loop_tx(void) {
113 uint32_t i;
114
115 RTE_LOG(INFO, USER1, "Core %u is doing TX\n", rte_lcore_id());
116
117 while (!force_quit) {
118 for (i = 0; i < app.n_ports; i++) {
119 uint16_t n_mbufs, n_pkts;
120 int ret;
121
122 n_mbufs = app.mbuf_tx[i].n_mbufs;
123
124 ret = rte_ring_sc_dequeue_bulk(
125 app.rings_tx[i],
126 (void **) &app.mbuf_tx[i].array[n_mbufs],
127 app.burst_size_tx_read,
128 NULL);
129
130 if (ret == 0)
131 continue;
132
133 n_mbufs += app.burst_size_tx_read;
134
135 if (n_mbufs < app.burst_size_tx_write) {
136 app.mbuf_tx[i].n_mbufs = n_mbufs;
137 continue;
138 }
139
140 n_pkts = rte_eth_tx_burst(
141 app.ports[i],
142 0,
143 app.mbuf_tx[i].array,
144 n_mbufs);
145
146 if (n_pkts < n_mbufs) {
147 uint16_t k;
148
149 for (k = n_pkts; k < n_mbufs; k++) {
150 struct rte_mbuf *pkt_to_free;
151
152 pkt_to_free = app.mbuf_tx[i].array[k];
153 rte_pktmbuf_free(pkt_to_free);
154 }
155 }
156
157 app.mbuf_tx[i].n_mbufs = 0;
158 }
159 }
160}

Callers 1

app_lcore_main_loopFunction · 0.85

Calls 4

rte_lcore_idFunction · 0.85
rte_ring_sc_dequeue_bulkFunction · 0.85
rte_eth_tx_burstFunction · 0.85
rte_pktmbuf_freeFunction · 0.85

Tested by

no test coverage detected