|SUCCESS| Updated skeleton example code to better emit error
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Wed May 13 21:26:34 CEST 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/163973
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-05-13
This review covers the patch for examples/skeleton/basicfwd.c focusing
on correctness, coding style, and DPDK guidelines.
commit 20260512192834.130651-1-arinkharkar at gmail.com
Author: Arin Kharkar <arinkharkar at gmail.com>
Updated skeleton example code to better emit error
The patch improves error messaging by showing the actual number of ports
found and consolidates comments about mempool creation.
> examples/skeleton/basicfwd.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
> index 133293cf15..381e4d4273 100644
> --- a/examples/skeleton/basicfwd.c
> +++ b/examples/skeleton/basicfwd.c
> @@ -188,11 +188,9 @@ main(int argc, char *argv[])
> /* Check that there is an even number of ports to send/receive on. */
> nb_ports = rte_eth_dev_count_avail();
> if (nb_ports < 2 || (nb_ports & 1))
> - rte_exit(EXIT_FAILURE, "Error: number of ports must be even\n");
> + rte_exit(EXIT_FAILURE, "Error: number of ports must be even, found %u ports\n", nb_ports);
The error message improvement is good, but does this line exceed 79
characters? The coding style guide mandates wrapping at 79 characters.
Can this message be shortened or split across lines?
>
> - /* Creates a new mempool in memory to hold the mbufs. */
> -
> - /* Allocates mempool to hold the mbufs. 8< */
> + /* Creates and allocates a mempool to hold the mbufs. 8< */
> mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL", NUM_MBUFS * nb_ports,
> MBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
> /* >8 End of allocating mempool to hold mbuf. */
The comment consolidation looks reasonable.
More information about the test-report
mailing list