patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Cc: Venkat Kumar Ande <venkatkumar.ande@amd.com>,
	Dengdui Huang <huangdengdui@huawei.com>,
	Pavan Nikhilesh <pbhagavatula@marvell.com>,
	Chengwen Feng <fengchengwen@huawei.com>,
	dpdk stable <stable@dpdk.org>, Shani Peretz <shperetz@nvidia.com>
Subject: Re: patch 'examples/l3fwd: add Tx burst size configuration option' has been queued to stable release 24.11.4
Date: Wed, 26 Nov 2025 11:08:33 +0000	[thread overview]
Message-ID: <547c464d-2c6e-4ed5-b93a-80d16626634e@redhat.com> (raw)
In-Reply-To: <20251125150558.232595-1-ktraynor@redhat.com>

On 25/11/2025 15:05, Kevin Traynor wrote:
> Hi,
> 
> FYI, your patch has been queued to stable release 24.11.4
> 
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 11/28/25. So please
> shout if anyone has objections.
> 

Re-reading this patch. It doesn't have stable tags and I don't think we
should take it to LTS branches, as it is changing defaults and seems to
be a small performance improvement.

> Also note that after the patch there's a diff of the upstream commit vs the
> patch applied to the branch. This will indicate if there was any rebasing
> needed to apply to the stable branch. If there were code changes for rebasing
> (ie: not only metadata diffs), please double check that the rebase was
> correctly done.
> 
> Queued patches are on a temporary branch at:
> https://github.com/kevintraynor/dpdk-stable
> 
> This queued commit can be viewed at:
> https://github.com/kevintraynor/dpdk-stable/commit/d150d3359e9f7cbd22b2d34c0fdec7b101400e98
> 
> Thanks.
> 
> Kevin
> 
> ---
>>From d150d3359e9f7cbd22b2d34c0fdec7b101400e98 Mon Sep 17 00:00:00 2001
> From: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> Date: Thu, 6 Nov 2025 14:16:31 +0000
> Subject: [PATCH] examples/l3fwd: add Tx burst size configuration option
> 
> [ upstream commit 79375d1015b308234e8b6955671a296394249f9b ]
> 
> Previously, the Tx burst size in l3fwd was fixed at 256, which could
> lead to suboptimal performance in certain scenarios.
> 
> This patch introduces separate --rx-burst and --tx-burst options to
> explicitly configure Rx and Tx burst sizes. By default, the Tx burst
> size now matches the Rx burst size for better efficiency and pipeline
> balance.
> 
> Fixes: d5c4897ecfb2 ("examples/l3fwd: add option to set Rx burst size")
> 
> Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> Tested-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
> Tested-by: Dengdui Huang <huangdengdui@huawei.com>
> Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
>  doc/guides/sample_app_ug/l3_forward.rst |  6 ++
>  examples/l3fwd/l3fwd.h                  | 10 +---
>  examples/l3fwd/l3fwd_acl.c              |  2 +-
>  examples/l3fwd/l3fwd_common.h           |  5 +-
>  examples/l3fwd/l3fwd_em.c               |  2 +-
>  examples/l3fwd/l3fwd_fib.c              |  2 +-
>  examples/l3fwd/l3fwd_lpm.c              |  2 +-
>  examples/l3fwd/main.c                   | 80 +++++++++++++++----------
>  8 files changed, 67 insertions(+), 42 deletions(-)
> 
> diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst
> index de347eeeb1..aba671d2b7 100644
> --- a/doc/guides/sample_app_ug/l3_forward.rst
> +++ b/doc/guides/sample_app_ug/l3_forward.rst
> @@ -78,4 +78,6 @@ The application has a number of command line options::
>                               [--lookup LOOKUP_METHOD]
>                               --config(port,queue,lcore)[,(port,queue,lcore)]
> +                             [--rx-burst NPKTS]
> +                             [--tx-burst NPKTS]
>                               [--eth-dest=X,MM:MM:MM:MM:MM:MM]
>                               [--max-pkt-len PKTLEN]
> @@ -114,4 +116,8 @@ Where,
>  * ``--config (port,queue,lcore)[,(port,queue,lcore)]:`` Determines which queues from which ports are mapped to which cores.
>  
> +* ``--rx-burst NPKTS:`` Optional, Rx burst size in decimal (default 32).
> +
> +* ``--tx-burst NPKTS:`` Optional, Tx burst size in decimal (default 32).
> +
>  * ``--eth-dest=X,MM:MM:MM:MM:MM:MM:`` Optional, ethernet destination for port X.
>  
> diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
> index 0cce3406ee..471e3b488f 100644
> --- a/examples/l3fwd/l3fwd.h
> +++ b/examples/l3fwd/l3fwd.h
> @@ -33,8 +33,4 @@
>  #define VECTOR_SIZE_DEFAULT   MAX_PKT_BURST
>  #define VECTOR_TMO_NS_DEFAULT 1E6 /* 1ms */
> -/*
> - * Try to avoid TX buffering if we have at least MAX_TX_BURST packets to send.
> - */
> -#define	MAX_TX_BURST	  (MAX_PKT_BURST / 2)
>  
>  #define NB_SOCKETS        8
> @@ -117,5 +113,5 @@ extern struct acl_algorithms acl_alg[];
>  extern uint32_t max_pkt_len;
>  
> -extern uint32_t nb_pkt_per_burst;
> +extern uint32_t rx_burst_size;
>  extern uint32_t mb_mempool_cache_size;
>  
> @@ -153,6 +149,6 @@ send_single_packet(struct lcore_conf *qconf,
>  
>  	/* enough pkts to be sent */
> -	if (unlikely(len == MAX_PKT_BURST)) {
> -		send_burst(qconf, MAX_PKT_BURST, port);
> +	if (unlikely(len == rx_burst_size)) {
> +		send_burst(qconf, rx_burst_size, port);
>  		len = 0;
>  	}
> diff --git a/examples/l3fwd/l3fwd_acl.c b/examples/l3fwd/l3fwd_acl.c
> index 4fc4b986cc..a1275e18bc 100644
> --- a/examples/l3fwd/l3fwd_acl.c
> +++ b/examples/l3fwd/l3fwd_acl.c
> @@ -1137,5 +1137,5 @@ acl_main_loop(__rte_unused void *dummy)
>  			queueid = qconf->rx_queue_list[i].queue_id;
>  			nb_rx = rte_eth_rx_burst(portid, queueid,
> -				pkts_burst, nb_pkt_per_burst);
> +				pkts_burst, rx_burst_size);
>  
>  			if (nb_rx > 0) {
> diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h
> index d94e5f1357..ccaf0cd402 100644
> --- a/examples/l3fwd/l3fwd_common.h
> +++ b/examples/l3fwd/l3fwd_common.h
> @@ -26,4 +26,7 @@
>  #define SENDM_PORT_OVERHEAD(x) (x)
>  
> +extern uint32_t rx_burst_size;
> +extern uint32_t tx_burst_size;
> +
>  /*
>   * From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2:
> @@ -72,5 +75,5 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[],
>  	 * then send them straightway.
>  	 */
> -	if (num >= MAX_TX_BURST && len == 0) {
> +	if (num >= tx_burst_size && len == 0) {
>  		n = rte_eth_tx_burst(port, qconf->tx_queue_id[port], m, num);
>  		if (unlikely(n < num)) {
> diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
> index da9c45e3a4..58c54ed77e 100644
> --- a/examples/l3fwd/l3fwd_em.c
> +++ b/examples/l3fwd/l3fwd_em.c
> @@ -645,5 +645,5 @@ em_main_loop(__rte_unused void *dummy)
>  			queueid = qconf->rx_queue_list[i].queue_id;
>  			nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst,
> -				nb_pkt_per_burst);
> +				rx_burst_size);
>  			if (nb_rx == 0)
>  				continue;
> diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c
> index 82f1739df7..4fc6bf90d5 100644
> --- a/examples/l3fwd/l3fwd_fib.c
> +++ b/examples/l3fwd/l3fwd_fib.c
> @@ -240,5 +240,5 @@ fib_main_loop(__rte_unused void *dummy)
>  			queueid = qconf->rx_queue_list[i].queue_id;
>  			nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst,
> -					nb_pkt_per_burst);
> +					rx_burst_size);
>  			if (nb_rx == 0)
>  				continue;
> diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
> index fec0aeb79c..a71eee69ec 100644
> --- a/examples/l3fwd/l3fwd_lpm.c
> +++ b/examples/l3fwd/l3fwd_lpm.c
> @@ -206,5 +206,5 @@ lpm_main_loop(__rte_unused void *dummy)
>  			queueid = qconf->rx_queue_list[i].queue_id;
>  			nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst,
> -				nb_pkt_per_burst);
> +				rx_burst_size);
>  			if (nb_rx == 0)
>  				continue;
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index ae3b4f6439..11aed26f94 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -58,6 +58,7 @@ static_assert(MEMPOOL_CACHE_SIZE >= MAX_PKT_BURST, "MAX_PKT_BURST should be at m
>  uint16_t nb_rxd = RX_DESC_DEFAULT;
>  uint16_t nb_txd = TX_DESC_DEFAULT;
> -uint32_t nb_pkt_per_burst = DEFAULT_PKT_BURST;
> +uint32_t rx_burst_size = DEFAULT_PKT_BURST;
>  uint32_t mb_mempool_cache_size = MEMPOOL_CACHE_SIZE;
> +uint32_t tx_burst_size = DEFAULT_PKT_BURST;
>  
>  /**< Ports set in promiscuous mode off by default. */
> @@ -401,5 +402,6 @@ print_usage(const char *prgname)
>  		" [--rx-queue-size NPKTS]"
>  		" [--tx-queue-size NPKTS]"
> -		" [--burst NPKTS]"
> +		" [--rx-burst NPKTS]"
> +		" [--tx-burst NPKTS]"
>  		" [--mbcache CACHESZ]"
>  		" [--eth-dest=X,MM:MM:MM:MM:MM:MM]"
> @@ -428,5 +430,7 @@ print_usage(const char *prgname)
>  		"  --tx-queue-size NPKTS: Tx queue size in decimal\n"
>  		"            Default: %d\n"
> -		"  --burst NPKTS: Burst size in decimal\n"
> +		"  --rx-burst NPKTS: RX Burst size in decimal\n"
> +		"            Default: %d\n"
> +		"  --tx-burst NPKTS: TX Burst size in decimal\n"
>  		"            Default: %d\n"
>  		"  --mbcache CACHESZ: Mbuf cache size in decimal\n"
> @@ -461,6 +465,6 @@ print_usage(const char *prgname)
>  		"  --rule_ipv6=FILE: Specify the ipv6 rules entries file.\n"
>  		"  --alg: ACL classify method to use, one of: %s.\n\n",
> -		prgname, RX_DESC_DEFAULT, TX_DESC_DEFAULT, DEFAULT_PKT_BURST, MEMPOOL_CACHE_SIZE,
> -		ACL_LEAD_CHAR, ROUTE_LEAD_CHAR, alg);
> +		prgname, RX_DESC_DEFAULT, TX_DESC_DEFAULT, DEFAULT_PKT_BURST, DEFAULT_PKT_BURST,
> +		MEMPOOL_CACHE_SIZE, ACL_LEAD_CHAR, ROUTE_LEAD_CHAR, alg);
>  }
>  
> @@ -696,5 +700,5 @@ parse_mbcache_size(const char *optarg)
>  
>  static void
> -parse_pkt_burst(const char *optarg)
> +parse_pkt_burst(const char *optarg, bool is_rx_burst, uint32_t *burst_sz)
>  {
>  	struct rte_eth_dev_info dev_info;
> @@ -711,29 +715,36 @@ parse_pkt_burst(const char *optarg)
>  	if (pkt_burst > MAX_PKT_BURST) {
>  		RTE_LOG(INFO, L3FWD, "User provided burst must be <= %d. Using default value %d\n",
> -			MAX_PKT_BURST, nb_pkt_per_burst);
> +			MAX_PKT_BURST, *burst_sz);
>  		return;
>  	} else if (pkt_burst > 0) {
> -		nb_pkt_per_burst = (uint32_t)pkt_burst;
> +		*burst_sz = (uint32_t)pkt_burst;
>  		return;
>  	}
>  
> -	/* If user gives a value of zero, query the PMD for its recommended Rx burst size. */
> -	ret = rte_eth_dev_info_get(0, &dev_info);
> -	if (ret != 0)
> -		return;
> -	burst_size = dev_info.default_rxportconf.burst_size;
> -	if (burst_size == 0) {
> -		RTE_LOG(INFO, L3FWD, "PMD does not recommend a burst size. Using default value %d. "
> -			"User provided value must be in [1, %d]\n",
> -			nb_pkt_per_burst, MAX_PKT_BURST);
> -		return;
> -	} else if (burst_size > MAX_PKT_BURST) {
> -		RTE_LOG(INFO, L3FWD, "PMD recommended burst size %d exceeds maximum value %d. "
> -			"Using default value %d\n",
> -			burst_size, MAX_PKT_BURST, nb_pkt_per_burst);
> -		return;
> +	if (is_rx_burst) {
> +		/* If user gives a value of zero, query the PMD for its recommended
> +		 * Rx burst size.
> +		 */
> +		ret = rte_eth_dev_info_get(0, &dev_info);
> +		if (ret != 0)
> +			return;
> +		burst_size = dev_info.default_rxportconf.burst_size;
> +		if (burst_size == 0) {
> +			RTE_LOG(INFO, L3FWD, "PMD does not recommend a burst size. Using default value %d. "
> +				"User provided value must be in [1, %d]\n",
> +				rx_burst_size, MAX_PKT_BURST);
> +			return;
> +		} else if (burst_size > MAX_PKT_BURST) {
> +			RTE_LOG(INFO, L3FWD, "PMD recommended burst size %d exceeds maximum value %d. "
> +				"Using default value %d\n",
> +				burst_size, MAX_PKT_BURST, rx_burst_size);
> +			return;
> +		}
> +		*burst_sz = burst_size;
> +		RTE_LOG(INFO, L3FWD, "Using PMD-provided RX burst value %d\n", burst_size);
> +	} else {
> +		RTE_LOG(INFO, L3FWD, "User provided TX burst is 0. Using default value %d\n",
> +			*burst_sz);
>  	}
> -	nb_pkt_per_burst = burst_size;
> -	RTE_LOG(INFO, L3FWD, "Using PMD-provided burst value %d\n", burst_size);
>  }
>  
> @@ -769,5 +780,6 @@ static const char short_options[] =
>  #define CMD_LINE_OPT_RULE_IPV6 "rule_ipv6"
>  #define CMD_LINE_OPT_ALG "alg"
> -#define CMD_LINE_OPT_PKT_BURST "burst"
> +#define CMD_LINE_OPT_PKT_RX_BURST "rx-burst"
> +#define CMD_LINE_OPT_PKT_TX_BURST "tx-burst"
>  #define CMD_LINE_OPT_MB_CACHE_SIZE "mbcache"
>  
> @@ -800,5 +812,6 @@ enum {
>  	CMD_LINE_OPT_VECTOR_SIZE_NUM,
>  	CMD_LINE_OPT_VECTOR_TMO_NS_NUM,
> -	CMD_LINE_OPT_PKT_BURST_NUM,
> +	CMD_LINE_OPT_PKT_RX_BURST_NUM,
> +	CMD_LINE_OPT_PKT_TX_BURST_NUM,
>  	CMD_LINE_OPT_MB_CACHE_SIZE_NUM,
>  };
> @@ -828,5 +841,6 @@ static const struct option lgopts[] = {
>  	{CMD_LINE_OPT_RULE_IPV6,   1, 0, CMD_LINE_OPT_RULE_IPV6_NUM},
>  	{CMD_LINE_OPT_ALG,   1, 0, CMD_LINE_OPT_ALG_NUM},
> -	{CMD_LINE_OPT_PKT_BURST,   1, 0, CMD_LINE_OPT_PKT_BURST_NUM},
> +	{CMD_LINE_OPT_PKT_RX_BURST,   1, 0, CMD_LINE_OPT_PKT_RX_BURST_NUM},
> +	{CMD_LINE_OPT_PKT_TX_BURST,   1, 0, CMD_LINE_OPT_PKT_TX_BURST_NUM},
>  	{CMD_LINE_OPT_MB_CACHE_SIZE,   1, 0, CMD_LINE_OPT_MB_CACHE_SIZE_NUM},
>  	{NULL, 0, 0, 0}
> @@ -918,6 +932,10 @@ parse_args(int argc, char **argv)
>  			break;
>  
> -		case CMD_LINE_OPT_PKT_BURST_NUM:
> -			parse_pkt_burst(optarg);
> +		case CMD_LINE_OPT_PKT_RX_BURST_NUM:
> +			parse_pkt_burst(optarg, true, &rx_burst_size);
> +			break;
> +
> +		case CMD_LINE_OPT_PKT_TX_BURST_NUM:
> +			parse_pkt_burst(optarg, false, &tx_burst_size);
>  			break;
>  
> @@ -1655,4 +1673,6 @@ main(int argc, char **argv)
>  		rte_exit(EXIT_FAILURE, "Invalid L3FWD parameters\n");
>  
> +	RTE_LOG(INFO, L3FWD, "Using Rx burst %u Tx burst %u\n", rx_burst_size, tx_burst_size);
> +
>  	/* Setup function pointers for lookup method. */
>  	setup_l3fwd_lookup_tables();


  parent reply	other threads:[~2025-11-26 11:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 15:05 Kevin Traynor
2025-11-25 15:05 ` patch 'examples/server_node_efd: fix format overflow' " Kevin Traynor
2025-11-25 15:05 ` patch 'examples/vdpa: " Kevin Traynor
2025-11-25 15:05 ` patch 'net/mlx5: fix flex flow item header length' " Kevin Traynor
2025-11-25 15:05 ` patch 'doc: add Pollara 400 device in ionic guide' " Kevin Traynor
2025-11-25 15:13   ` Kevin Traynor
2025-11-25 15:26     ` Boyer, Andrew
2025-11-25 15:05 ` patch 'doc: fix note in FreeBSD " Kevin Traynor
2025-11-26 11:08 ` Kevin Traynor [this message]
2025-11-26 11:19   ` patch 'examples/l3fwd: add Tx burst size configuration option' " Ande, Venkat Kumar
2025-11-26 11:51     ` Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=547c464d-2c6e-4ed5-b93a-80d16626634e@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=fengchengwen@huawei.com \
    --cc=huangdengdui@huawei.com \
    --cc=pbhagavatula@marvell.com \
    --cc=shperetz@nvidia.com \
    --cc=sivaprasad.tummala@amd.com \
    --cc=stable@dpdk.org \
    --cc=venkatkumar.ande@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).