From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2F0F3567E for ; Fri, 7 Aug 2015 14:16:10 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 07 Aug 2015 05:16:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,629,1432623600"; d="scan'208";a="779656198" Received: from unknown (HELO Sent) ([10.217.248.120]) by orsmga002.jf.intel.com with SMTP; 07 Aug 2015 05:15:33 -0700 Received: by Sent (sSMTP sendmail emulation); Fri, 07 Aug 2015 14:15:32 +0116 From: Michal Jastrzebski To: dev@dpdk.org Date: Fri, 7 Aug 2015 14:15:31 +0200 Message-Id: <1438949731-17748-1-git-send-email-michalx.k.jastrzebski@intel.com> X-Mailer: git-send-email 2.1.1 Subject: [dpdk-dev] [PATCH v2] test: fix test_tlb_tx_burst X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2015 12:16:10 -0000 Test failed on verification if number of bytes transmitted on each slave is not less than 90% and greater than 110% of mean value of bytes transmitted thru one slave. This was verified on a real system but is difficult to achieve using virtualpmd. That's why for unit tests only, it is sufficient to verify that with high load (2 seconds transsmission) all slaves are trasnitting so the traffic is balanced. v2 changes: - improved description - reverted number of packets generated (in v1 it was decreased, but to achieve balancing it has to be high load). Signed-off-by: Michal Jastrzebski --- app/test/test_link_bonding.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c index 305d45d..388cf11 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), @@ -4070,7 +4069,7 @@ test_tlb_tx_burst(void) "Burst size specified is greater than supported.\n"); - /* Generate 400000 test bursts in 2s of packets to transmit */ + /* Generate bursts of packets */ for (i = 0; i < 400000; i++) { /*test two types of mac src own(bonding) and others */ if (i % 2 == 0) { @@ -4123,15 +4122,14 @@ test_tlb_tx_burst(void) TEST_ASSERT_EQUAL(sum_ports_opackets, (uint64_t)all_bond_opackets, "Total packets sent by slaves is not equal to packets sent by bond interface"); - /* 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"); + /* checking if distribution of packets is balanced over slaves */ + for (i = 0; i < test_params->bonded_slave_count; i++) { + TEST_ASSERT(port_stats[i].obytes > 0 && + port_stats[i].obytes < all_bond_obytes, + "Packets are not balanced over slaves"); } + /* Put all slaves down and try and transmit */ for (i = 0; i < test_params->bonded_slave_count; i++) { virtual_ethdev_simulate_link_status_interrupt( -- 1.7.9.5