patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] test: avoid hang if queues are full and Tx fails
@ 2021-07-20 12:47 Rakesh Kudurumalla
  2021-07-20 16:50 ` [dpdk-stable] [PATCH v2] " Rakesh Kudurumalla
  0 siblings, 1 reply; 7+ messages in thread
From: Rakesh Kudurumalla @ 2021-07-20 12:47 UTC (permalink / raw)
  To: rkudurumalla
  Cc: stable, sa_ip-toolkits-Jenkins, Nithin Kumar Dabilpuram,
	Jerin Jacob Kollanukkaran

Current pmd_perf_autotest() in continuous mode tries
to enqueue MAX_TRAFFIC_BURST completely before starting
the test. Some drivers cannot accept complete
MAX_TRAFFIC_BURST even though rx+tx desc count can fit it.
This patch changes behaviour to stop enqueuing after few
retries.

Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpdk/+/55760
Tested-by: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
Reviewed-by: Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>
Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
---
 app/test/test_pmd_perf.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index 3a248d512c..0a95b408e8 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -456,6 +456,7 @@ main_loop(__rte_unused void *args)
 #define PACKET_SIZE 64
 #define FRAME_GAP 12
 #define MAC_PREAMBLE 8
+#define MAX_RETRY_COUNT 5
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned lcore_id;
 	unsigned i, portid, nb_rx = 0, nb_tx = 0;
@@ -463,6 +464,8 @@ main_loop(__rte_unused void *args)
 	int pkt_per_port;
 	uint64_t diff_tsc;
 	uint64_t packets_per_second, total_packets;
+	int retry_cnt = 0;
+	int free_pkt = 0;
 
 	lcore_id = rte_lcore_id();
 	conf = &lcore_conf[lcore_id];
@@ -480,10 +483,19 @@ main_loop(__rte_unused void *args)
 			nb_tx = RTE_MIN(MAX_PKT_BURST, num);
 			nb_tx = rte_eth_tx_burst(portid, 0,
 						&tx_burst[idx], nb_tx);
+			if (nb_tx == 0)
+				retry_cnt++;
 			num -= nb_tx;
 			idx += nb_tx;
+			if (retry_cnt == MAX_RETRY_COUNT) {
+				retry_cnt = 0;
+				break;
+			}
 		}
 	}
+	for (free_pkt = idx; free_pkt < (MAX_TRAFFIC_BURST*conf->nb_ports)
+			; free_pkt++)
+		rte_pktmbuf_free(tx_burst[free_pkt]);
 	printf("Total packets inject to prime ports = %u\n", idx);
 
 	packets_per_second = (link_mbps * 1000 * 1000) /
-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH v2] test: avoid hang if queues are full and Tx fails
  2021-07-20 12:47 [dpdk-stable] [PATCH] test: avoid hang if queues are full and Tx fails Rakesh Kudurumalla
@ 2021-07-20 16:50 ` Rakesh Kudurumalla
  2021-10-19 10:19   ` Rakesh Kudurumalla
  2021-11-12 11:32   ` Thomas Monjalon
  0 siblings, 2 replies; 7+ messages in thread
From: Rakesh Kudurumalla @ 2021-07-20 16:50 UTC (permalink / raw)
  Cc: dev, Rakesh Kudurumalla, stable

Current pmd_perf_autotest() in continuous mode tries
to enqueue MAX_TRAFFIC_BURST completely before starting
the test. Some drivers cannot accept complete
MAX_TRAFFIC_BURST even though rx+tx desc count can fit it.
This patch changes behaviour to stop enqueuing after few
retries.

Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
v2:
- Fixed commit message errors

 app/test/test_pmd_perf.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index 3a248d512c..0a95b408e8 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -456,6 +456,7 @@ main_loop(__rte_unused void *args)
 #define PACKET_SIZE 64
 #define FRAME_GAP 12
 #define MAC_PREAMBLE 8
+#define MAX_RETRY_COUNT 5
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned lcore_id;
 	unsigned i, portid, nb_rx = 0, nb_tx = 0;
@@ -463,6 +464,8 @@ main_loop(__rte_unused void *args)
 	int pkt_per_port;
 	uint64_t diff_tsc;
 	uint64_t packets_per_second, total_packets;
+	int retry_cnt = 0;
+	int free_pkt = 0;
 
 	lcore_id = rte_lcore_id();
 	conf = &lcore_conf[lcore_id];
@@ -480,10 +483,19 @@ main_loop(__rte_unused void *args)
 			nb_tx = RTE_MIN(MAX_PKT_BURST, num);
 			nb_tx = rte_eth_tx_burst(portid, 0,
 						&tx_burst[idx], nb_tx);
+			if (nb_tx == 0)
+				retry_cnt++;
 			num -= nb_tx;
 			idx += nb_tx;
+			if (retry_cnt == MAX_RETRY_COUNT) {
+				retry_cnt = 0;
+				break;
+			}
 		}
 	}
+	for (free_pkt = idx; free_pkt < (MAX_TRAFFIC_BURST*conf->nb_ports)
+			; free_pkt++)
+		rte_pktmbuf_free(tx_burst[free_pkt]);
 	printf("Total packets inject to prime ports = %u\n", idx);
 
 	packets_per_second = (link_mbps * 1000 * 1000) /
-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [PATCH v2] test: avoid hang if queues are full and Tx fails
  2021-07-20 16:50 ` [dpdk-stable] [PATCH v2] " Rakesh Kudurumalla
@ 2021-10-19 10:19   ` Rakesh Kudurumalla
  2021-10-29  7:18     ` Rakesh Kudurumalla
  2021-11-12 11:32   ` Thomas Monjalon
  1 sibling, 1 reply; 7+ messages in thread
From: Rakesh Kudurumalla @ 2021-10-19 10:19 UTC (permalink / raw)
  To: david.marchand; +Cc: dev, stable, Rakesh Kudurumalla

ping

> -----Original Message-----
> From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Sent: Tuesday, July 20, 2021 10:21 PM
> Cc: dev@dpdk.org; Rakesh Kudurumalla <rkudurumalla@marvell.com>;
> stable@dpdk.org
> Subject: [PATCH v2] test: avoid hang if queues are full and Tx fails
> 
> Current pmd_perf_autotest() in continuous mode tries to enqueue
> MAX_TRAFFIC_BURST completely before starting the test. Some drivers
> cannot accept complete MAX_TRAFFIC_BURST even though rx+tx desc count
> can fit it.
> This patch changes behaviour to stop enqueuing after few retries.
> 
> Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---
> v2:
> - Fixed commit message errors
> 
>  app/test/test_pmd_perf.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index
> 3a248d512c..0a95b408e8 100644
> --- a/app/test/test_pmd_perf.c
> +++ b/app/test/test_pmd_perf.c
> @@ -456,6 +456,7 @@ main_loop(__rte_unused void *args)  #define
> PACKET_SIZE 64  #define FRAME_GAP 12  #define MAC_PREAMBLE 8
> +#define MAX_RETRY_COUNT 5
>  	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
>  	unsigned lcore_id;
>  	unsigned i, portid, nb_rx = 0, nb_tx = 0; @@ -463,6 +464,8 @@
> main_loop(__rte_unused void *args)
>  	int pkt_per_port;
>  	uint64_t diff_tsc;
>  	uint64_t packets_per_second, total_packets;
> +	int retry_cnt = 0;
> +	int free_pkt = 0;
> 
>  	lcore_id = rte_lcore_id();
>  	conf = &lcore_conf[lcore_id];
> @@ -480,10 +483,19 @@ main_loop(__rte_unused void *args)
>  			nb_tx = RTE_MIN(MAX_PKT_BURST, num);
>  			nb_tx = rte_eth_tx_burst(portid, 0,
>  						&tx_burst[idx], nb_tx);
> +			if (nb_tx == 0)
> +				retry_cnt++;
>  			num -= nb_tx;
>  			idx += nb_tx;
> +			if (retry_cnt == MAX_RETRY_COUNT) {
> +				retry_cnt = 0;
> +				break;
> +			}
>  		}
>  	}
> +	for (free_pkt = idx; free_pkt < (MAX_TRAFFIC_BURST*conf-
> >nb_ports)
> +			; free_pkt++)
> +		rte_pktmbuf_free(tx_burst[free_pkt]);
>  	printf("Total packets inject to prime ports = %u\n", idx);
> 
>  	packets_per_second = (link_mbps * 1000 * 1000) /
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [PATCH v2] test: avoid hang if queues are full and Tx fails
  2021-10-19 10:19   ` Rakesh Kudurumalla
@ 2021-10-29  7:18     ` Rakesh Kudurumalla
  0 siblings, 0 replies; 7+ messages in thread
From: Rakesh Kudurumalla @ 2021-10-29  7:18 UTC (permalink / raw)
  To: david.marchand, thomas, ferruh.yigit, Jerin Jacob Kollanukkaran,
	Nithin Kumar Dabilpuram
  Cc: dev, stable

ping

> -----Original Message-----
> From: Rakesh Kudurumalla
> Sent: Tuesday, October 19, 2021 3:50 PM
> To: david.marchand@redhat.com
> Cc: dev@dpdk.org; stable@dpdk.org; Rakesh Kudurumalla
> <rkudurumalla@marvell.com>
> Subject: RE: [PATCH v2] test: avoid hang if queues are full and Tx fails
> 
> ping
> 
> > -----Original Message-----
> > From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > Sent: Tuesday, July 20, 2021 10:21 PM
> > Cc: dev@dpdk.org; Rakesh Kudurumalla <rkudurumalla@marvell.com>;
> > stable@dpdk.org
> > Subject: [PATCH v2] test: avoid hang if queues are full and Tx fails
> >
> > Current pmd_perf_autotest() in continuous mode tries to enqueue
> > MAX_TRAFFIC_BURST completely before starting the test. Some drivers
> > cannot accept complete MAX_TRAFFIC_BURST even though rx+tx desc
> count
> > can fit it.
> > This patch changes behaviour to stop enqueuing after few retries.
> >
> > Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > ---
> > v2:
> > - Fixed commit message errors
> >
> >  app/test/test_pmd_perf.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> >
> > diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index
> > 3a248d512c..0a95b408e8 100644
> > --- a/app/test/test_pmd_perf.c
> > +++ b/app/test/test_pmd_perf.c
> > @@ -456,6 +456,7 @@ main_loop(__rte_unused void *args)  #define
> > PACKET_SIZE 64  #define FRAME_GAP 12  #define MAC_PREAMBLE 8
> > +#define MAX_RETRY_COUNT 5
> >  	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
> >  	unsigned lcore_id;
> >  	unsigned i, portid, nb_rx = 0, nb_tx = 0; @@ -463,6 +464,8 @@
> > main_loop(__rte_unused void *args)
> >  	int pkt_per_port;
> >  	uint64_t diff_tsc;
> >  	uint64_t packets_per_second, total_packets;
> > +	int retry_cnt = 0;
> > +	int free_pkt = 0;
> >
> >  	lcore_id = rte_lcore_id();
> >  	conf = &lcore_conf[lcore_id];
> > @@ -480,10 +483,19 @@ main_loop(__rte_unused void *args)
> >  			nb_tx = RTE_MIN(MAX_PKT_BURST, num);
> >  			nb_tx = rte_eth_tx_burst(portid, 0,
> >  						&tx_burst[idx], nb_tx);
> > +			if (nb_tx == 0)
> > +				retry_cnt++;
> >  			num -= nb_tx;
> >  			idx += nb_tx;
> > +			if (retry_cnt == MAX_RETRY_COUNT) {
> > +				retry_cnt = 0;
> > +				break;
> > +			}
> >  		}
> >  	}
> > +	for (free_pkt = idx; free_pkt < (MAX_TRAFFIC_BURST*conf-
> > >nb_ports)
> > +			; free_pkt++)
> > +		rte_pktmbuf_free(tx_burst[free_pkt]);
> >  	printf("Total packets inject to prime ports = %u\n", idx);
> >
> >  	packets_per_second = (link_mbps * 1000 * 1000) /
> > --
> > 2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [PATCH v2] test: avoid hang if queues are full and Tx fails
  2021-07-20 16:50 ` [dpdk-stable] [PATCH v2] " Rakesh Kudurumalla
  2021-10-19 10:19   ` Rakesh Kudurumalla
@ 2021-11-12 11:32   ` Thomas Monjalon
  2021-11-22  7:59     ` [EXT] " Rakesh Kudurumalla
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2021-11-12 11:32 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: stable, dev, david.marchand, ferruh.yigit, andrew.rybchenko,
	ajit.khaparde, jerinj

20/07/2021 18:50, Rakesh Kudurumalla:
> Current pmd_perf_autotest() in continuous mode tries
> to enqueue MAX_TRAFFIC_BURST completely before starting
> the test. Some drivers cannot accept complete
> MAX_TRAFFIC_BURST even though rx+tx desc count can fit it.

Which driver is failing to do so?
Why it cannot enqueue 32 packets?

> This patch changes behaviour to stop enqueuing after few
> retries.

If there is a real limitation, there will be issues in more places
than this test program.
I feel it should be addressed either in the driver or at ethdev level.

[...]
> @@ -480,10 +483,19 @@ main_loop(__rte_unused void *args)
>  			nb_tx = RTE_MIN(MAX_PKT_BURST, num);
>  			nb_tx = rte_eth_tx_burst(portid, 0,
>  						&tx_burst[idx], nb_tx);
> +			if (nb_tx == 0)
> +				retry_cnt++;
>  			num -= nb_tx;
>  			idx += nb_tx;
> +			if (retry_cnt == MAX_RETRY_COUNT) {
> +				retry_cnt = 0;
> +				break;
> +			}




^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXT] Re: [dpdk-stable] [PATCH v2] test: avoid hang if queues are full and Tx fails
  2021-11-12 11:32   ` Thomas Monjalon
@ 2021-11-22  7:59     ` Rakesh Kudurumalla
  2021-11-22  8:58       ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Rakesh Kudurumalla @ 2021-11-22  7:59 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: stable, dev, david.marchand, ferruh.yigit, andrew.rybchenko,
	ajit.khaparde, Jerin Jacob Kollanukkaran


Octeontx2 driver is failing to enqueue because hardware buffers are full before test.
pmd_perf_autotest() in continuous mode tries to enqueue MAX_TRAFFIC_BURST (2048)
before starting the test.

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Friday, November 12, 2021 5:02 PM
> To: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Cc: stable@dpdk.org; dev@dpdk.org; david.marchand@redhat.com;
> ferruh.yigit@intel.com; andrew.rybchenko@oktetlabs.ru;
> ajit.khaparde@broadcom.com; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>
> Subject: [EXT] Re: [dpdk-stable] [PATCH v2] test: avoid hang if queues are full
> and Tx fails
> 
> External Email
> 
> ----------------------------------------------------------------------
> 20/07/2021 18:50, Rakesh Kudurumalla:
> > Current pmd_perf_autotest() in continuous mode tries to enqueue
> > MAX_TRAFFIC_BURST completely before starting the test. Some drivers
> > cannot accept complete MAX_TRAFFIC_BURST even though rx+tx desc
> count
> > can fit it.
> 
> Which driver is failing to do so?
> Why it cannot enqueue 32 packets?
> 
> > This patch changes behaviour to stop enqueuing after few retries.
> 
> If there is a real limitation, there will be issues in more places than this test
> program.
> I feel it should be addressed either in the driver or at ethdev level.
> 
> [...]
> > @@ -480,10 +483,19 @@ main_loop(__rte_unused void *args)
> >  			nb_tx = RTE_MIN(MAX_PKT_BURST, num);
> >  			nb_tx = rte_eth_tx_burst(portid, 0,
> >  						&tx_burst[idx], nb_tx);
> > +			if (nb_tx == 0)
> > +				retry_cnt++;
> >  			num -= nb_tx;
> >  			idx += nb_tx;
> > +			if (retry_cnt == MAX_RETRY_COUNT) {
> > +				retry_cnt = 0;
> > +				break;
> > +			}
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXT] Re: [dpdk-stable] [PATCH v2] test: avoid hang if queues are full and Tx fails
  2021-11-22  7:59     ` [EXT] " Rakesh Kudurumalla
@ 2021-11-22  8:58       ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2021-11-22  8:58 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: stable, dev, david.marchand, ferruh.yigit, andrew.rybchenko,
	ajit.khaparde, Jerin Jacob Kollanukkaran

22/11/2021 08:59, Rakesh Kudurumalla:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 20/07/2021 18:50, Rakesh Kudurumalla:
> > > Current pmd_perf_autotest() in continuous mode tries to enqueue
> > > MAX_TRAFFIC_BURST completely before starting the test. Some drivers
> > > cannot accept complete MAX_TRAFFIC_BURST even though rx+tx desc
> > count
> > > can fit it.
> > 
> > Which driver is failing to do so?
> > Why it cannot enqueue 32 packets?
> 
> Octeontx2 driver is failing to enqueue because hardware buffers are full before test.

Why hardware buffers are full?

> pmd_perf_autotest() in continuous mode tries to enqueue MAX_TRAFFIC_BURST (2048)
> before starting the test.
> 
> > > This patch changes behaviour to stop enqueuing after few retries.
> > 
> > If there is a real limitation, there will be issues in more places than this test
> > program.
> > I feel it should be addressed either in the driver or at ethdev level.
> > 
> > [...]
> > > @@ -480,10 +483,19 @@ main_loop(__rte_unused void *args)
> > >  			nb_tx = RTE_MIN(MAX_PKT_BURST, num);
> > >  			nb_tx = rte_eth_tx_burst(portid, 0,
> > >  						&tx_burst[idx], nb_tx);
> > > +			if (nb_tx == 0)
> > > +				retry_cnt++;
> > >  			num -= nb_tx;
> > >  			idx += nb_tx;
> > > +			if (retry_cnt == MAX_RETRY_COUNT) {
> > > +				retry_cnt = 0;
> > > +				break;
> > > +			}




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-22  8:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20 12:47 [dpdk-stable] [PATCH] test: avoid hang if queues are full and Tx fails Rakesh Kudurumalla
2021-07-20 16:50 ` [dpdk-stable] [PATCH v2] " Rakesh Kudurumalla
2021-10-19 10:19   ` Rakesh Kudurumalla
2021-10-29  7:18     ` Rakesh Kudurumalla
2021-11-12 11:32   ` Thomas Monjalon
2021-11-22  7:59     ` [EXT] " Rakesh Kudurumalla
2021-11-22  8:58       ` Thomas Monjalon

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git