diff mbox series

examples/l3fwd: fib skip tx queue drain on first iteration

Message ID 20210421124842.1550979-1-conor.walsh@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series examples/l3fwd: fib skip tx queue drain on first iteration | expand

Checks

Context Check Description
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues
ci/intel-Testing success Testing PASS
ci/Intel-compilation fail Compilation issues
ci/github-robot success github build: passed
ci/checkpatch success coding style OK

Commit Message

Walsh, Conor April 21, 2021, 12:48 p.m. UTC
The commit a8f8b672d575 ("examples/l3fwd: skip Tx queue drain on first
iteration") implemented a change to the em and lpm lookup methods to
prevent the TX queue drain running in the first iteration of their
packet processing loops. This patch introduces this change into the
fib lookup method, this was done to keep the fib code aligned with
the em and lpm code.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
---
 examples/l3fwd/l3fwd_fib.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Ananyev, Konstantin April 21, 2021, 1:01 p.m. UTC | #1
> The commit a8f8b672d575 ("examples/l3fwd: skip Tx queue drain on first
> iteration") implemented a change to the em and lpm lookup methods to
> prevent the TX queue drain running in the first iteration of their
> packet processing loops. This patch introduces this change into the
> fib lookup method, this was done to keep the fib code aligned with
> the em and lpm code.
> 
> Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> ---
>  examples/l3fwd/l3fwd_fib.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c
> index c7d7689a94..1787229942 100644
> --- a/examples/l3fwd/l3fwd_fib.c
> +++ b/examples/l3fwd/l3fwd_fib.c
> @@ -179,8 +179,6 @@ fib_main_loop(__rte_unused void *dummy)
>  	const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /
>  			US_PER_S * BURST_TX_DRAIN_US;
> 
> -	prev_tsc = 0;
> -
>  	lcore_id = rte_lcore_id();
>  	qconf = &lcore_conf[lcore_id];
> 
> @@ -200,9 +198,10 @@ fib_main_loop(__rte_unused void *dummy)
>  				lcore_id, portid, queueid);
>  	}
> 
> -	while (!force_quit) {
> +	cur_tsc = rte_rdtsc();
> +	prev_tsc = cur_tsc;
> 
> -		cur_tsc = rte_rdtsc();
> +	while (!force_quit) {
> 
>  		/* TX burst queue drain. */
>  		diff_tsc = cur_tsc - prev_tsc;
> @@ -233,6 +232,8 @@ fib_main_loop(__rte_unused void *dummy)
>  			/* Use fib to lookup port IDs and transmit them. */
>  			fib_send_packets(nb_rx, pkts_burst,	portid, qconf);
>  		}
> +
> +		cur_tsc = rte_rdtsc();
>  	}
> 
>  	return 0;
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.25.1
Medvedkin, Vladimir April 21, 2021, 3:11 p.m. UTC | #2
On 21/04/2021 15:48, Conor Walsh wrote:
> The commit a8f8b672d575 ("examples/l3fwd: skip Tx queue drain on first
> iteration") implemented a change to the em and lpm lookup methods to
> prevent the TX queue drain running in the first iteration of their
> packet processing loops. This patch introduces this change into the
> fib lookup method, this was done to keep the fib code aligned with
> the em and lpm code.
> 
> Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> ---
>   examples/l3fwd/l3fwd_fib.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c
> index c7d7689a94..1787229942 100644
> --- a/examples/l3fwd/l3fwd_fib.c
> +++ b/examples/l3fwd/l3fwd_fib.c
> @@ -179,8 +179,6 @@ fib_main_loop(__rte_unused void *dummy)
>   	const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /
>   			US_PER_S * BURST_TX_DRAIN_US;
>   
> -	prev_tsc = 0;
> -
>   	lcore_id = rte_lcore_id();
>   	qconf = &lcore_conf[lcore_id];
>   
> @@ -200,9 +198,10 @@ fib_main_loop(__rte_unused void *dummy)
>   				lcore_id, portid, queueid);
>   	}
>   
> -	while (!force_quit) {
> +	cur_tsc = rte_rdtsc();
> +	prev_tsc = cur_tsc;
>   
> -		cur_tsc = rte_rdtsc();
> +	while (!force_quit) {
>   
>   		/* TX burst queue drain. */
>   		diff_tsc = cur_tsc - prev_tsc;
> @@ -233,6 +232,8 @@ fib_main_loop(__rte_unused void *dummy)
>   			/* Use fib to lookup port IDs and transmit them. */
>   			fib_send_packets(nb_rx, pkts_burst,	portid, qconf);
>   		}
> +
> +		cur_tsc = rte_rdtsc();
>   	}
>   
>   	return 0;
> 

Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Thomas Monjalon April 21, 2021, 6:45 p.m. UTC | #3
> > The commit a8f8b672d575 ("examples/l3fwd: skip Tx queue drain on first
> > iteration") implemented a change to the em and lpm lookup methods to
> > prevent the TX queue drain running in the first iteration of their
> > packet processing loops. This patch introduces this change into the
> > fib lookup method, this was done to keep the fib code aligned with
> > the em and lpm code.
> > 
> > Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> 
> Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

Applied, thanks
diff mbox series

Patch

diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c
index c7d7689a94..1787229942 100644
--- a/examples/l3fwd/l3fwd_fib.c
+++ b/examples/l3fwd/l3fwd_fib.c
@@ -179,8 +179,6 @@  fib_main_loop(__rte_unused void *dummy)
 	const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /
 			US_PER_S * BURST_TX_DRAIN_US;
 
-	prev_tsc = 0;
-
 	lcore_id = rte_lcore_id();
 	qconf = &lcore_conf[lcore_id];
 
@@ -200,9 +198,10 @@  fib_main_loop(__rte_unused void *dummy)
 				lcore_id, portid, queueid);
 	}
 
-	while (!force_quit) {
+	cur_tsc = rte_rdtsc();
+	prev_tsc = cur_tsc;
 
-		cur_tsc = rte_rdtsc();
+	while (!force_quit) {
 
 		/* TX burst queue drain. */
 		diff_tsc = cur_tsc - prev_tsc;
@@ -233,6 +232,8 @@  fib_main_loop(__rte_unused void *dummy)
 			/* Use fib to lookup port IDs and transmit them. */
 			fib_send_packets(nb_rx, pkts_burst,	portid, qconf);
 		}
+
+		cur_tsc = rte_rdtsc();
 	}
 
 	return 0;