[dpdk-dev] [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs

Thomas Monjalon thomas at monjalon.net
Sun Apr 26 23:12:20 CEST 2020


11/03/2020 13:04, Louise Kilheeney:
> MBUF pool of size 8192 was causing packet loss when using four ports. To
> fix this issue this patch specifies the number of MBUF's per port
> instead of having one set MBUF pool size, this way it will adapt to any
> number of ports.
> 
> Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
> 
> Cc: stable at dpdk.org

No blank line between Fixes and Cc lines please.

> 
> Signed-off-by: Louise Kilheeney <louise.kilheeney at intel.com>
> ---
>  examples/l2fwd-keepalive/main.c | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
> index b36834974..0f0010d51 100644
> --- a/examples/l2fwd-keepalive/main.c
> +++ b/examples/l2fwd-keepalive/main.c
>  	nb_ports = rte_eth_dev_count_avail();
>  	if (nb_ports == 0)
>  		rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
>  
> +	/* create the mbuf pool */
> +	unsigned int total_nb_mbufs = NB_MBUF_PER_PORT * nb_ports;

Please avoid declaring a variable in the middle of a function.
This code style is too much modern for DPDK ;-)
It could break on a random compiler.





More information about the dev mailing list