[PATCH v3] examples/distributor: update dynamic configuration
Thomas Monjalon
thomas at monjalon.net
Mon Oct 31 16:03:25 CET 2022
Hello,
Not a complete review, but few general comments to improve the patch below:
01/09/2022 16:09, Abdullah Ömer Yamaç:
> In this patch,
> * It is possible to switch the running mode of the distributor
> using the command line argument.
> * With "-c" parameter, you can run RX and Distributor
> on the same core.
> * Without "-c" parameter, you can run RX and Distributor
> on the different core.
> * Consecutive termination of the lcores fixed.
> The termination order was wrong, and you couldn't terminate the
> application while traffic was capturing. The current order is
> RX -> Distributor -> TX -> Workers
> * When "-c" parameter is active, the wasted distributor core is
> also deactivated in the main function.
Please could you make clear what was the issue,
and what was changed in the commit message?
> -#if 0
It's good to remove such thing.
Dead code should not exist.
> + /*
> + * Swap the following two lines if you want the rx traffic
> + * to go directly to tx, no distribution.
> + */
In DPDK, it is preferred to use uppercase Rx and Tx.
> + struct rte_ring *out_ring = p->rx_dist_ring;
> + /* struct rte_ring *out_ring = p->dist_tx_ring; */
This line is dead code, please remove.
> + if (!pd)
It is preferred to not use boolean operator with pointer.
Explicit comparison is encouraged: pd == NULL
> - rte_free(pd);
> + if (pd)
> + rte_free(pd);
This check is useless because redundant with rte_free behaviour.
More information about the dev
mailing list