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

Function eth_pcap_rx_jumbo

dpdk/drivers/net/pcap/pcap_ethdev.c:198–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198static int
199eth_pcap_rx_jumbo(struct rte_mempool *mb_pool, struct rte_mbuf *mbuf,
200 const u_char *data, uint16_t data_len)
201{
202 /* Copy the first segment. */
203 uint16_t len = rte_pktmbuf_tailroom(mbuf);
204 struct rte_mbuf *m = mbuf;
205
206 rte_memcpy(rte_pktmbuf_append(mbuf, len), data, len);
207 data_len -= len;
208 data += len;
209
210 while (data_len > 0) {
211 /* Allocate next mbuf and point to that. */
212 m->next = rte_pktmbuf_alloc(mb_pool);
213
214 if (unlikely(!m->next))
215 return -1;
216
217 m = m->next;
218
219 /* Headroom is not needed in chained mbufs. */
220 rte_pktmbuf_prepend(m, rte_pktmbuf_headroom(m));
221 m->pkt_len = 0;
222 m->data_len = 0;
223
224 /* Copy next segment. */
225 len = RTE_MIN(rte_pktmbuf_tailroom(m), data_len);
226 rte_memcpy(rte_pktmbuf_append(m, len), data, len);
227
228 mbuf->nb_segs++;
229 data_len -= len;
230 data += len;
231 }
232
233 return mbuf->nb_segs;
234}
235
236static uint16_t
237eth_pcap_rx_infinite(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)

Callers 1

eth_pcap_rxFunction · 0.85

Calls 6

rte_pktmbuf_tailroomFunction · 0.85
rte_pktmbuf_appendFunction · 0.85
rte_pktmbuf_allocFunction · 0.85
rte_pktmbuf_prependFunction · 0.85
rte_pktmbuf_headroomFunction · 0.85
rte_memcpyFunction · 0.50

Tested by

no test coverage detected