DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 5/6] bond: modify TLB unit tests
Date: Fri, 13 Feb 2015 16:16:09 +0100	[thread overview]
Message-ID: <1423840570-6452-6-git-send-email-michalx.k.jastrzebski@intel.com> (raw)
In-Reply-To: <1423840570-6452-1-git-send-email-michalx.k.jastrzebski@intel.com>

This patch modify mode older name from 
BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING to BONDING_MODE_TLB
that was used in unittests.
It also changes 

Signed-off-by: Daniel Mrzyglod  <danielx.t.mrzyglod@intel.com>
---
 app/test/test_link_bonding.c            |   27 ++++++++++++++-------------
 lib/librte_pmd_bond/rte_eth_bond.h      |    2 +-
 lib/librte_pmd_bond/rte_eth_bond_api.c  |    8 ++++----
 lib/librte_pmd_bond/rte_eth_bond_args.c |    2 +-
 lib/librte_pmd_bond/rte_eth_bond_pmd.c  |   12 ++++++------
 5 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 579ebbf..dd6e357 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -4053,7 +4053,7 @@ test_tlb_tx_burst(void)
 	uint64_t floor_obytes = 0, ceiling_obytes = 0;
 
 	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves
-			(BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING, 1, 3, 1),
+			(BONDING_MODE_TLB, 1, 3, 1),
 			"Failed to initialise bonded device");
 
 	burst_size = 20 * test_params->bonded_slave_count;
@@ -4153,7 +4153,7 @@ test_tlb_rx_burst(void)
 
 	/* Initialize bonded device with 4 slaves in transmit load balancing mode */
 	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
-			BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING,
+			BONDING_MODE_TLB,
 			TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT, 1, 1),
 			"Failed to initialize bonded device");
 
@@ -4231,7 +4231,7 @@ test_tlb_verify_promiscuous_enable_disable(void)
 
 	/* Initialize bonded device with 4 slaves in transmit load balancing mode */
 	TEST_ASSERT_SUCCESS( initialize_bonded_device_with_slaves(
-			BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING, 0, 4, 1),
+			BONDING_MODE_TLB, 0, 4, 1),
 			"Failed to initialize bonded device");
 
 	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
@@ -4289,7 +4289,7 @@ test_tlb_verify_mac_assignment(void)
 
 	/* Initialize bonded device with 2 slaves in active backup mode */
 	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
-			BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING, 0, 2, 1),
+			BONDING_MODE_TLB, 0, 2, 1),
 			"Failed to initialize bonded device");
 
 	/* Verify that bonded MACs is that of first slave and that the other slave
@@ -4409,7 +4409,7 @@ test_tlb_verify_slave_link_status_change_failover(void)
 
 	/* Initialize bonded device with 4 slaves in round robin mode */
 	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
-			BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING, 0,
+			BONDING_MODE_TLB, 0,
 			TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT, 1),
 			"Failed to initialize bonded device with slaves");
 
@@ -4472,20 +4472,21 @@ test_tlb_verify_slave_link_status_change_failover(void)
 		rte_delay_us(11000);
 	}
 
-	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
-	TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0,
-			"(%d) port_stats.opackets not as expected\n",
-			test_params->slave_port_ids[2]);
-
 	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
 	TEST_ASSERT_EQUAL(port_stats.opackets, (int8_t)0,
-			"(%d) port_stats.opackets not as expected\n",
-			test_params->slave_port_ids[0]);
+				"(%d) port_stats.opackets not as expected\n",
+				test_params->slave_port_ids[0]);
 
 	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
 	TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0,
+					"(%d) port_stats.opackets not as expected\n",
+					test_params->slave_port_ids[1]);
+
+
+	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
+	TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0,
 			"(%d) port_stats.opackets not as expected\n",
-			test_params->slave_port_ids[1]);
+			test_params->slave_port_ids[2]);
 
 	rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);
 	TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0,
diff --git a/lib/librte_pmd_bond/rte_eth_bond.h b/lib/librte_pmd_bond/rte_eth_bond.h
index 13581cb..4117a70 100644
--- a/lib/librte_pmd_bond/rte_eth_bond.h
+++ b/lib/librte_pmd_bond/rte_eth_bond.h
@@ -96,7 +96,7 @@ extern "C" {
  * to rx_burst should be at least 2 times the slave count size.
  *
  */
-#define BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING	(5)
+#define BONDING_MODE_TLB	(5)
 /**< Adaptive TLB (Mode 5)
  * This mode provides an adaptive transmit load balancing. It dynamically
  * changes the transmitting slave, according to the computed load. Statistics
diff --git a/lib/librte_pmd_bond/rte_eth_bond_api.c b/lib/librte_pmd_bond/rte_eth_bond_api.c
index cbfd185..a5f2c26 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_api.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_api.c
@@ -116,7 +116,7 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id)
 	if (internals->mode == BONDING_MODE_8023AD)
 		bond_mode_8023ad_activate_slave(eth_dev, port_id);
 
-	if (internals->mode == BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING
+	if (internals->mode == BONDING_MODE_TLB
 			|| internals->mode == BONDING_MODE_ALB) {
 
 		internals->tlb_slaves_order[active_count] = port_id;
@@ -128,7 +128,7 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id)
 	internals->active_slaves[internals->active_slave_count] = port_id;
 	internals->active_slave_count++;
 
-	if (internals->mode == BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING)
+	if (internals->mode == BONDING_MODE_TLB)
 		bond_tlb_activate_slave(internals);
 	if (internals->mode == BONDING_MODE_ALB)
 		bond_mode_alb_client_list_upd(eth_dev);
@@ -144,7 +144,7 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id)
 	if (internals->mode == BONDING_MODE_8023AD) {
 		bond_mode_8023ad_stop(eth_dev);
 		bond_mode_8023ad_deactivate_slave(eth_dev, port_id);
-	} else if (internals->mode == BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING
+	} else if (internals->mode == BONDING_MODE_TLB
 			|| internals->mode == BONDING_MODE_ALB)
 		bond_tlb_disable(internals);
 
@@ -167,7 +167,7 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id)
 	if (eth_dev->data->dev_started) {
 	   if (internals->mode == BONDING_MODE_8023AD) {
 			   bond_mode_8023ad_start(eth_dev);
-	   } else if (internals->mode == BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING) {
+	   } else if (internals->mode == BONDING_MODE_TLB) {
 			   bond_tlb_enable(internals);
 	   } else if (internals->mode == BONDING_MODE_ALB) {
 			   bond_tlb_enable(internals);
diff --git a/lib/librte_pmd_bond/rte_eth_bond_args.c b/lib/librte_pmd_bond/rte_eth_bond_args.c
index a3f7f55..0801cb5 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_args.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_args.c
@@ -174,7 +174,7 @@ bond_ethdev_parse_slave_mode_kvarg(const char *key __rte_unused,
 	case BONDING_MODE_BROADCAST:
 #endif
 	case BONDING_MODE_8023AD:
-	case BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING:
+	case BONDING_MODE_TLB:
 	case BONDING_MODE_ALB:
 		return 0;
 	default:
diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
index f469b5c..a473e5d 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
@@ -1225,7 +1225,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
 		bond_mode_8023ad_mac_address_update(bonded_eth_dev);
 		break;
 	case BONDING_MODE_ACTIVE_BACKUP:
-	case BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING:
+	case BONDING_MODE_TLB:
 	case BONDING_MODE_ALB:
 	default:
 		for (i = 0; i < internals->slave_count; i++) {
@@ -1288,7 +1288,7 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode)
 				"Using mode 4, it is necessary to do TX burst and RX burst "
 				"at least every 100ms.");
 		break;
-	case BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING:
+	case BONDING_MODE_TLB:
 		eth_dev->tx_pkt_burst = bond_ethdev_tx_burst_tlb;
 		eth_dev->rx_pkt_burst = bond_ethdev_rx_burst_active_backup;
 		break;
@@ -1514,7 +1514,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
 	if (internals->mode == BONDING_MODE_8023AD)
 		bond_mode_8023ad_start(eth_dev);
 
-	if (internals->mode == BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING ||
+	if (internals->mode == BONDING_MODE_TLB ||
 			internals->mode == BONDING_MODE_ALB)
 		bond_tlb_enable(internals);
 
@@ -1547,7 +1547,7 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
 		}
 	}
 
-	if (internals->mode == BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING ||
+	if (internals->mode == BONDING_MODE_TLB ||
 			internals->mode == BONDING_MODE_ALB) {
 		bond_tlb_disable(internals);
 		for (i = 0; i < internals->active_slave_count; i++)
@@ -1807,7 +1807,7 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)
 		break;
 	/* Promiscuous mode is propagated only to primary slave */
 	case BONDING_MODE_ACTIVE_BACKUP:
-	case BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING:
+	case BONDING_MODE_TLB:
 	case BONDING_MODE_ALB:
 	default:
 		rte_eth_promiscuous_enable(internals->current_primary_port);
@@ -1837,7 +1837,7 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
 		break;
 	/* Promiscuous mode is propagated only to primary slave */
 	case BONDING_MODE_ACTIVE_BACKUP:
-	case BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING:
+	case BONDING_MODE_TLB:
 	case BONDING_MODE_ALB:
 	default:
 		rte_eth_promiscuous_disable(internals->current_primary_port);
-- 
1.7.9.5

  parent reply	other threads:[~2015-02-13 15:18 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 15:16 [dpdk-dev] [PATCH v2 0/6] Link Bonding mode 6 support (ALB) Michal Jastrzebski
2015-02-13 15:16 ` [dpdk-dev] [PATCH v2 1/6] net: changed arp_hdr struct declaration Michal Jastrzebski
2015-02-13 15:16 ` [dpdk-dev] [PATCH v2 2/6] bond: add link bonding mode 6 implementation Michal Jastrzebski
2015-02-13 15:16 ` [dpdk-dev] [PATCH v2 3/6] bond: add debug info for mode 6 link bonding Michal Jastrzebski
2015-02-13 15:16 ` [dpdk-dev] [PATCH v2 4/6] bond: add example application for link bonding mode 6 Michal Jastrzebski
2015-02-13 15:16 ` Michal Jastrzebski [this message]
2015-02-13 15:16 ` [dpdk-dev] [PATCH v2 6/6] bond: add unit tests " Michal Jastrzebski
2015-02-13 16:12 ` [dpdk-dev] [PATCH v2 0/6] Link Bonding mode 6 support (ALB) Declan Doherty
2015-02-18 19:10   ` Thomas Monjalon
2015-02-19  9:18     ` Jastrzebski, MichalX K
2015-02-19  9:39       ` Thomas Monjalon
2015-02-19 10:14         ` Jastrzebski, MichalX K
2015-02-19 10:27           ` Thomas Monjalon
2015-02-19 17:26 ` [dpdk-dev] [PATCH v3 " Michal Jastrzebski
2015-02-19 17:26   ` [dpdk-dev] [PATCH v3 1/6] net: changed arp_hdr struct declaration Michal Jastrzebski
2015-02-20 14:30     ` Thomas Monjalon
2015-02-20 14:54       ` Gajdzica, MaciejX T
2015-02-20 15:22         ` Thomas Monjalon
2015-02-19 17:26   ` [dpdk-dev] [PATCH v3 2/6] bond: add link bonding mode 6 implementation Michal Jastrzebski
2015-02-19 17:26   ` [dpdk-dev] [PATCH v3 3/6] bond: add debug info for mode 6 link bonding Michal Jastrzebski
2015-02-19 17:26   ` [dpdk-dev] [PATCH v3 4/6] bond: add example application for link bonding mode 6 Michal Jastrzebski
2015-02-20 14:42     ` Thomas Monjalon
2015-02-20 16:12       ` Jastrzebski, MichalX K
2015-02-19 17:26   ` [dpdk-dev] [PATCH v3 5/6] bond: modify TLB unit tests Michal Jastrzebski
2015-02-19 17:26   ` [dpdk-dev] [PATCH v3 6/6] bond: add unit tests for link bonding mode 6 Michal Jastrzebski
2015-02-20 16:09 ` [dpdk-dev] [PATCH v4 0/6] Link Bonding mode 6 support (ALB) Michal Jastrzebski
2015-02-20 16:09   ` [dpdk-dev] [PATCH v4 1/6] net: changed arp_hdr struct declaration Michal Jastrzebski
2015-02-20 16:09   ` [dpdk-dev] [PATCH v4 2/6] bond: add link bonding mode 6 implementation Michal Jastrzebski
2015-02-20 16:09   ` [dpdk-dev] [PATCH v4 3/6] bond: add debug info for mode 6 link bonding Michal Jastrzebski
2015-02-20 16:09   ` [dpdk-dev] [PATCH v4 4/6] bond: add example application for link bonding mode 6 Michal Jastrzebski
2015-02-20 16:09   ` [dpdk-dev] [PATCH v4 5/6] bond: modify TLB unit tests Michal Jastrzebski
2015-02-20 16:09   ` [dpdk-dev] [PATCH v4 6/6] bond: add unit tests for link bonding mode 6 Michal Jastrzebski
2015-02-20 17:44   ` [dpdk-dev] [PATCH v4 0/6] Link Bonding mode 6 support (ALB) Declan Doherty
2015-02-20 21:58     ` Thomas Monjalon
2015-03-04  3:53     ` Jiajia, SunX

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=1423840570-6452-6-git-send-email-michalx.k.jastrzebski@intel.com \
    --to=michalx.k.jastrzebski@intel.com \
    --cc=dev@dpdk.org \
    /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).