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

Function mempool_add_elem

dpdk/lib/mempool/rte_mempool.c:159–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157
158
159static void
160mempool_add_elem(struct rte_mempool *mp, __rte_unused void *opaque,
161 void *obj, rte_iova_t iova)
162{
163 struct rte_mempool_objhdr *hdr;
164 struct rte_mempool_objtlr *tlr __rte_unused;
165
166 /* set mempool ptr in header */
167 hdr = RTE_PTR_SUB(obj, sizeof(*hdr));
168 hdr->mp = mp;
169 hdr->iova = iova;
170 STAILQ_INSERT_TAIL(&mp->elt_list, hdr, next);
171 mp->populated_size++;
172
173#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
174 hdr->cookie = RTE_MEMPOOL_HEADER_COOKIE2;
175 tlr = rte_mempool_get_trailer(obj);
176 tlr->cookie = RTE_MEMPOOL_TRAILER_COOKIE;
177#endif
178}
179
180/* call obj_cb() for each mempool element */
181uint32_t

Callers

nothing calls this directly

Calls 1

rte_mempool_get_trailerFunction · 0.85

Tested by

no test coverage detected