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

Function test_mbuf_validate_tx_offload

dpdk/app/test/test_mbuf.c:1694–1726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1692}
1693
1694static int
1695test_mbuf_validate_tx_offload(const char *test_name,
1696 struct rte_mempool *pktmbuf_pool,
1697 uint64_t ol_flags,
1698 uint16_t segsize,
1699 int expected_retval)
1700{
1701 struct rte_mbuf *m = NULL;
1702 int ret = 0;
1703
1704 /* alloc a mbuf and do sanity check */
1705 m = rte_pktmbuf_alloc(pktmbuf_pool);
1706 if (m == NULL)
1707 GOTO_FAIL("%s: mbuf allocation failed!\n", __func__);
1708 if (rte_pktmbuf_pkt_len(m) != 0)
1709 GOTO_FAIL("%s: Bad packet length\n", __func__);
1710 rte_mbuf_sanity_check(m, 0);
1711 m->ol_flags = ol_flags;
1712 m->tso_segsz = segsize;
1713 ret = rte_validate_tx_offload(m);
1714 if (ret != expected_retval)
1715 GOTO_FAIL("%s(%s): expected ret val: %d; received: %d\n",
1716 __func__, test_name, expected_retval, ret);
1717 rte_pktmbuf_free(m);
1718 m = NULL;
1719 return 0;
1720fail:
1721 if (m) {
1722 rte_pktmbuf_free(m);
1723 m = NULL;
1724 }
1725 return -1;
1726}
1727
1728static int
1729test_mbuf_validate_tx_offload_one(struct rte_mempool *pktmbuf_pool)

Callers 1

Calls 4

rte_pktmbuf_allocFunction · 0.85
rte_mbuf_sanity_checkFunction · 0.85
rte_validate_tx_offloadFunction · 0.85
rte_pktmbuf_freeFunction · 0.85

Tested by

no test coverage detected