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

Function move_bad_mbufs

dpdk/lib/ipsec/misc.h:18–39  ·  view source on GitHub ↗

* Move bad (unprocessed) mbufs beyond the good (processed) ones. * bad_idx[] contains the indexes of bad mbufs inside the mb[]. */

Source from the content-addressed store, hash-verified

16 * bad_idx[] contains the indexes of bad mbufs inside the mb[].
17 */
18static inline void
19move_bad_mbufs(struct rte_mbuf *mb[], const uint32_t bad_idx[], uint32_t nb_mb,
20 uint32_t nb_bad)
21{
22 uint32_t i, j, k;
23 struct rte_mbuf *drb[nb_bad];
24
25 j = 0;
26 k = 0;
27
28 /* copy bad ones into a temp place */
29 for (i = 0; i != nb_mb; i++) {
30 if (j != nb_bad && i == bad_idx[j])
31 drb[j++] = mb[i];
32 else
33 mb[k++] = mb[i];
34 }
35
36 /* copy bad ones after the good ones */
37 for (i = 0; i != nb_bad; i++)
38 mb[k + i] = drb[i];
39}
40
41/*
42 * Find packet's segment for the specified offset.

Callers 10

esp_inb_pkt_prepareFunction · 0.85
esp_inb_pkt_processFunction · 0.85
cpu_inb_pkt_prepareFunction · 0.85
pkt_flag_processFunction · 0.85
esp_outb_tun_prepareFunction · 0.85
esp_outb_trs_prepareFunction · 0.85
cpu_outb_pkt_prepareFunction · 0.85
esp_outb_sqh_processFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected