DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test: fix test_tlb_tx_burst
@ 2015-08-05  9:10 Michal Jastrzebski
  2015-08-05  9:28 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Jastrzebski @ 2015-08-05  9:10 UTC (permalink / raw)
  To: dev

This patch fixes error in tlb_tx_burst function:
Distribution is not even.
A condition in TEST_ASSERT macro was changed,
as the previous one was random.
Also the time of generating packets can now be decreased.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
---
 app/test/test_link_bonding.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 305d45d..b02ae94 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -4058,7 +4058,6 @@ test_tlb_tx_burst(void)
 	struct rte_eth_stats port_stats[32];
 	uint64_t sum_ports_opackets = 0, all_bond_opackets = 0, all_bond_obytes = 0;
 	uint16_t pktlen;
-	uint64_t floor_obytes = 0, ceiling_obytes = 0;
 
 	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves
 			(BONDING_MODE_TLB, 1, 3, 1),
@@ -4071,7 +4070,7 @@ test_tlb_tx_burst(void)
 
 
 	/* Generate 400000 test bursts in 2s of packets to transmit  */
-	for (i = 0; i < 400000; i++) {
+	for (i = 0; i < 10000; i++) {
 		/*test two types of mac src own(bonding) and others */
 		if (i % 2 == 0) {
 			initialize_eth_header(test_params->pkt_eth_hdr,
@@ -4099,7 +4098,6 @@ test_tlb_tx_burst(void)
 		TEST_ASSERT_EQUAL(nb_tx, burst_size,
 				"number of packet not equal burst size");
 
-		rte_delay_us(5);
 	}
 
 
@@ -4126,11 +4124,9 @@ test_tlb_tx_burst(void)
 	/* distribution of packets on each slave within +/- 10% of the expected value. */
 	for (i = 0; i < test_params->bonded_slave_count; i++) {
 
-		floor_obytes = (all_bond_obytes*90)/(test_params->bonded_slave_count*100);
-		ceiling_obytes = (all_bond_obytes*110)/(test_params->bonded_slave_count*100);
-		TEST_ASSERT(port_stats[i].obytes >= floor_obytes &&
-				port_stats[i].obytes <= ceiling_obytes,
-						"Distribution is not even");
+	TEST_ASSERT(port_stats[i].obytes > 0 &&
+			port_stats[i].obytes <= all_bond_obytes,
+					"Distribution is not even");
 	}
 	/* Put all slaves down and try and transmit */
 	for (i = 0; i < test_params->bonded_slave_count; i++) {
-- 
1.7.9.5

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

* Re: [dpdk-dev] [PATCH] test: fix test_tlb_tx_burst
  2015-08-05  9:10 [dpdk-dev] [PATCH] test: fix test_tlb_tx_burst Michal Jastrzebski
@ 2015-08-05  9:28 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-08-05  9:28 UTC (permalink / raw)
  To: Michal Jastrzebski; +Cc: dev

2015-08-05 11:10, Michal Jastrzebski:
> This patch fixes error in tlb_tx_burst function:
> Distribution is not even.

What was the error exactly?

> A condition in TEST_ASSERT macro was changed,
> as the previous one was random.

I think "random" can be better described.

> Also the time of generating packets can now be decreased.

>  	/* Generate 400000 test bursts in 2s of packets to transmit  */
> -	for (i = 0; i < 400000; i++) {
> +	for (i = 0; i < 10000; i++) {

It is a good example of an useless comment which becomes easily out-of-date.

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

end of thread, other threads:[~2015-08-05  9:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-05  9:10 [dpdk-dev] [PATCH] test: fix test_tlb_tx_burst Michal Jastrzebski
2015-08-05  9:28 ` Thomas Monjalon

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).