[dpdk-dev] [PATCH v6 1/4] test: add ring pmd based packet rx/tx for UT
Burakov, Anatoly
anatoly.burakov at intel.com
Thu Jul 26 11:59:00 CEST 2018
On 25-Jul-18 6:05 PM, Naga Suresh Somarowthu wrote:
> Added ring pmd based packet rx/tx helper functions
> for verifying Latency, Bitrate and pdump lib UTs.
>
> Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu at intel.com>
> Reviewed-by: Reshma Pattan <reshma.pattan at intel.com>
> ---
<snip>
> + ret = test_get_mempool(mp, poolname);
> + if (ret < 0)
> + return -1;
> + if (rte_pktmbuf_alloc_bulk(*mp, pbuf, NUM_PACKETS) != 0) {
> + printf("%s() line %u: rte_pktmbuf_alloc_bulk failed", __func__,
> + __LINE__);
> + return -1;
> + }
> + return 0;
> +}
> +
> +/* sample test to deallocate the allocated buffers */
> +void
> +test_put_mbuf_to_pool(struct rte_mempool *mp, struct rte_mbuf **pbuf)
> +{
> + int itr = 0;
> +
> + for (itr = 0; itr < NUM_PACKETS; itr++)
> + rte_pktmbuf_free(pbuf[itr]);
> + rte_mempool_free(mp);
> +}
The name and description of the above function is a little misleading.
It says it will deallocate buffers, but nowhere does it say that it will
also deallocate the mempool. Is that intentional?
Other than that,
Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
--
Thanks,
Anatoly
More information about the dev
mailing list