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

Function mbuf_create

dpdk/app/test/test_cryptodev_crosscheck.c:645–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643}
644
645static struct rte_mbuf*
646mbuf_create(const uint8_t *input_buf, uint16_t input_len)
647{
648 struct rte_mbuf *pkt;
649 uint8_t *pkt_data;
650
651 pkt = rte_pktmbuf_alloc(testsuite_params.mbuf_pool);
652 if (pkt == NULL) {
653 RTE_LOG(ERR, USER1, "Failed to allocate input buffer in mempool");
654 return NULL;
655 }
656
657 /* zeroing tailroom */
658 memset(rte_pktmbuf_mtod(pkt, uint8_t *), 0, rte_pktmbuf_tailroom(pkt));
659
660 pkt_data = (uint8_t *)rte_pktmbuf_append(pkt, input_len);
661 if (pkt_data == NULL) {
662 RTE_LOG(ERR, USER1, "no room to append data, len: %d", input_len);
663 goto error;
664 }
665 rte_memcpy(pkt_data, input_buf, input_len);
666
667 return pkt;
668error:
669 rte_pktmbuf_free(pkt);
670 return NULL;
671}
672
673static struct rte_crypto_op*
674operation_create(const struct crosscheck_test_profile *profile,

Callers 1

single_dev_processFunction · 0.85

Calls 4

rte_pktmbuf_allocFunction · 0.85
rte_pktmbuf_appendFunction · 0.85
rte_pktmbuf_freeFunction · 0.85
rte_memcpyFunction · 0.50

Tested by

no test coverage detected