[PATCH] examples/l3fwd: add option to set RX burst size
Morten Brørup
mb at smartsharesystems.com
Sat Oct 12 14:22:50 CEST 2024
> From: Jie Hai [mailto:haijie1 at huawei.com]
> Sent: Saturday, 12 October 2024 10.41
>
> Now the Rx burst size is fixed to MAX_PKT_BURST (32). This
> parameter needs to be modified in some performance optimization
> scenarios. So an option '--burst' is added to set the burst size
> explicitly. The default value is DEFAULT_PKT_BURST (32) and maximum
> value is MAX_PKT_BURST (512).
Good idea.
>
> Signed-off-by: Jie Hai <haijie1 at huawei.com>
> ---
>
> -#define MAX_PKT_BURST 32
> +#define DEFAULT_PKT_BURST 32
> +#define MAX_PKT_BURST 512
> #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
>
> #define MEMPOOL_CACHE_SIZE 256
It seems strange to use a burst size larger than the mempool cache size.
You might want to make the cache size configurable too, or simply define MEMPOOL_CACHE_SIZE as RTE_MEMPOOL_CACHE_MAX_SIZE (currently 512) instead of 256.
And, as a safety measure, consider adding:
#include <assert.h>
static_assert(MEMPOOL_CACHE_SIZE >= MAX_PKT_BURST);
More information about the dev
mailing list