DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Chas Williams <chas3@att.com>
Cc: <dev@dpdk.org>, Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH v2 12/13] test/bonding: check code of promiscuous mode switch
Date: Mon, 9 Sep 2019 12:58:49 +0100	[thread overview]
Message-ID: <1568030331-16526-13-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1568030331-16526-1-git-send-email-arybchenko@solarflare.com>

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so this patch modify usage
of these functions across test/bonding
according to new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_link_bonding.c       | 55 ++++++++++++++++++++++++------
 app/test/test_link_bonding_mode4.c | 16 +++++++--
 2 files changed, 58 insertions(+), 13 deletions(-)

diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 938fafca3a..cbbbc98a16 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -1760,13 +1760,17 @@ static int
 test_roundrobin_verify_promiscuous_enable_disable(void)
 {
 	int i, promiscuous_en;
+	int ret;
 
 	/* Initialize bonded device with 4 slaves in round robin mode */
 	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
 			BONDING_MODE_ROUND_ROBIN, 0, 4, 1),
 			"Failed to initialize bonded device with slaves");
 
-	rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to enable promiscuous mode for port %d: %s",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 	promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);
 	TEST_ASSERT_EQUAL(promiscuous_en, 1,
@@ -1781,7 +1785,10 @@ test_roundrobin_verify_promiscuous_enable_disable(void)
 				test_params->slave_port_ids[i]);
 	}
 
-	rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to disable promiscuous mode for port %d: %s",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 	promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);
 	TEST_ASSERT_EQUAL(promiscuous_en, 0,
@@ -2200,6 +2207,7 @@ static int
 test_activebackup_verify_promiscuous_enable_disable(void)
 {
 	int i, primary_port, promiscuous_en;
+	int ret;
 
 	/* Initialize bonded device with 4 slaves in round robin mode */
 	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
@@ -2211,7 +2219,10 @@ test_activebackup_verify_promiscuous_enable_disable(void)
 			"failed to get primary slave for bonded port (%d)",
 			test_params->bonded_port_id);
 
-	rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to enable promiscuous mode for port %d: %s",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 	TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1,
 			"Port (%d) promiscuous mode not enabled",
@@ -2232,7 +2243,10 @@ test_activebackup_verify_promiscuous_enable_disable(void)
 
 	}
 
-	rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to disable promiscuous mode for port %d: %s",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 	TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0,
 			"Port (%d) promiscuous mode not disabled\n",
@@ -3110,13 +3124,17 @@ static int
 test_balance_verify_promiscuous_enable_disable(void)
 {
 	int i;
+	int ret;
 
 	/* Initialize bonded device with 4 slaves in round robin mode */
 	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
 			BONDING_MODE_BALANCE, 0, 4, 1),
 			"Failed to initialise bonded device");
 
-	rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to enable promiscuous mode for port %d: %s",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 	TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1,
 			"Port (%d) promiscuous mode not enabled",
@@ -3129,7 +3147,10 @@ test_balance_verify_promiscuous_enable_disable(void)
 				test_params->slave_port_ids[i]);
 	}
 
-	rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to disable promiscuous mode for port %d: %s",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 	TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0,
 			"Port (%d) promiscuous mode not disabled",
@@ -3696,13 +3717,17 @@ static int
 test_broadcast_verify_promiscuous_enable_disable(void)
 {
 	int i;
+	int ret;
 
 	/* Initialize bonded device with 4 slaves in round robin mode */
 	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
 			BONDING_MODE_BROADCAST, 0, 4, 1),
 			"Failed to initialise bonded device");
 
-	rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to enable promiscuous mode for port %d: %s",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 
 	TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1,
@@ -3716,7 +3741,10 @@ test_broadcast_verify_promiscuous_enable_disable(void)
 				test_params->slave_port_ids[i]);
 	}
 
-	rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to disable promiscuous mode for port %d: %s",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 	TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0,
 			"Port (%d) promiscuous mode not disabled",
@@ -4174,6 +4202,7 @@ static int
 test_tlb_verify_promiscuous_enable_disable(void)
 {
 	int i, primary_port, promiscuous_en;
+	int ret;
 
 	/* Initialize bonded device with 4 slaves in transmit load balancing mode */
 	TEST_ASSERT_SUCCESS( initialize_bonded_device_with_slaves(
@@ -4185,7 +4214,10 @@ test_tlb_verify_promiscuous_enable_disable(void)
 			"failed to get primary slave for bonded port (%d)",
 			test_params->bonded_port_id);
 
-	rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_enable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to enable promiscuous mode for port %d: %s",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 	promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);
 	TEST_ASSERT_EQUAL(promiscuous_en, (int)1,
@@ -4206,7 +4238,10 @@ test_tlb_verify_promiscuous_enable_disable(void)
 
 	}
 
-	rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	ret = rte_eth_promiscuous_disable(test_params->bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed to disable promiscuous mode for port %d: %s\n",
+		test_params->bonded_port_id, rte_strerror(-ret));
 
 	promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);
 	TEST_ASSERT_EQUAL(promiscuous_en, (int)0,
diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index bbb4e9cce1..70b95d0405 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -312,6 +312,7 @@ static int
 initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm)
 {
 	uint8_t i;
+	int ret;
 
 	RTE_VERIFY(test_params.bonded_port_id != INVALID_PORT_ID);
 
@@ -323,7 +324,10 @@ initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm)
 
 	/* Reset mode 4 configuration */
 	rte_eth_bond_8023ad_setup(test_params.bonded_port_id, NULL);
-	rte_eth_promiscuous_disable(test_params.bonded_port_id);
+	ret = rte_eth_promiscuous_disable(test_params.bonded_port_id);
+	TEST_ASSERT_SUCCESS(ret,
+		"Failed disable promiscuous mode for port %d: %s",
+		test_params.bonded_port_id, rte_strerror(-ret));
 
 	if (external_sm) {
 		struct rte_eth_bond_8023ad_conf conf;
@@ -824,7 +828,10 @@ test_mode4_rx(void)
 	/* First try with promiscuous mode enabled.
 	 * Add 2 packets to each slave. First with bonding MAC address, second with
 	 * different. Check if we received all of them. */
-	rte_eth_promiscuous_enable(test_params.bonded_port_id);
+	retval = rte_eth_promiscuous_enable(test_params.bonded_port_id);
+	TEST_ASSERT_SUCCESS(retval,
+			"Failed to enable promiscuous mode for port %d: %s",
+			test_params.bonded_port_id, rte_strerror(-retval));
 
 	expected_pkts_cnt = 0;
 	FOR_EACH_SLAVE(i, slave) {
@@ -869,7 +876,10 @@ test_mode4_rx(void)
 
 	/* Now, disable promiscuous mode. When promiscuous mode is disabled we
 	 * expect to receive only packets that are directed to bonding port. */
-	rte_eth_promiscuous_disable(test_params.bonded_port_id);
+	retval = rte_eth_promiscuous_disable(test_params.bonded_port_id);
+	TEST_ASSERT_SUCCESS(retval,
+		"Failed to disable promiscuous mode for port %d: %s",
+		test_params.bonded_port_id, rte_strerror(-retval));
 
 	expected_pkts_cnt = 0;
 	FOR_EACH_SLAVE(i, slave) {
-- 
2.17.1


  parent reply	other threads:[~2019-09-09 12:01 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 16:10 [dpdk-dev] [PATCH 00/13] ethdev: change promiscuous mode functions to return status Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 01/13] ethdev: change promiscuous mode controllers to return errors Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 02/13] net/failsafe: check code of promiscuous mode switch Andrew Rybchenko
2019-09-05 16:25   ` Gaëtan Rivet
2019-09-05 16:32     ` Andrew Rybchenko
2019-09-05 16:36   ` Stephen Hemminger
2019-09-05 16:38     ` Andrew Rybchenko
2019-09-06  9:24       ` Gaëtan Rivet
2019-09-06 10:08         ` Andrew Rybchenko
2019-09-05 16:40   ` Stephen Hemminger
2019-09-05 16:49     ` Andrew Rybchenko
2019-09-05 17:13       ` Stephen Hemminger
2019-09-05 16:10 ` [dpdk-dev] [PATCH 03/13] net/bonding: " Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 04/13] ethdev: change promiscuous callbacks to return status Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 05/13] ethdev: do nothing if promiscuous mode is applied again Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 06/13] app/pipeline: check code of promiscuous mode switch Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 07/13] app/testpmd: " Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 08/13] app/eventdev: " Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 09/13] app/pdump: " Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 10/13] app/test: " Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 11/13] kni: " Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 12/13] test/bonding: " Andrew Rybchenko
2019-09-05 16:10 ` [dpdk-dev] [PATCH 13/13] examples: take promiscuous mode switch result into account Andrew Rybchenko
2019-09-09 11:58 ` [dpdk-dev] [PATCH v2 00/13] ethdev: change promiscuous mode functions to return status Andrew Rybchenko
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 01/13] ethdev: change promiscuous mode controllers to return errors Andrew Rybchenko
2019-09-13 15:35     ` Ferruh Yigit
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 02/13] net/failsafe: check code of promiscuous mode switch Andrew Rybchenko
2019-09-09 12:48     ` Gaëtan Rivet
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 03/13] net/bonding: " Andrew Rybchenko
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 04/13] ethdev: change promiscuous callbacks to return status Andrew Rybchenko
2019-09-10  7:53     ` Matan Azrad
2019-09-13 21:05       ` Andrew Rybchenko
2019-09-11  8:46     ` Hyong Youb Kim (hyonkim)
2019-09-13 21:06       ` Andrew Rybchenko
2019-09-16  6:48         ` Hyong Youb Kim (hyonkim)
2019-09-13 15:34     ` Ferruh Yigit
2019-09-13 15:54       ` Andrew Rybchenko
2019-09-13 16:33         ` Ferruh Yigit
2019-09-13 15:39     ` Ferruh Yigit
2019-09-13 16:05       ` Andrew Rybchenko
2019-09-13 16:34         ` Ferruh Yigit
2019-09-13 19:57           ` Andrew Rybchenko
2019-09-16 13:22             ` Ferruh Yigit
2019-09-16 15:45               ` Andrew Rybchenko
2019-09-16 15:58                 ` Ferruh Yigit
2019-09-13 16:43     ` Ferruh Yigit
2019-09-13 20:33       ` Andrew Rybchenko
2019-09-13 16:56     ` Ferruh Yigit
2019-09-13 20:38       ` Andrew Rybchenko
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 05/13] ethdev: do nothing if promiscuous mode is applied again Andrew Rybchenko
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 06/13] app/pipeline: check code of promiscuous mode switch Andrew Rybchenko
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 07/13] app/testpmd: " Andrew Rybchenko
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 08/13] app/eventdev: " Andrew Rybchenko
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 09/13] app/pdump: " Andrew Rybchenko
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 10/13] app/test: " Andrew Rybchenko
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 11/13] kni: " Andrew Rybchenko
2019-09-09 11:58   ` Andrew Rybchenko [this message]
2019-09-09 11:58   ` [dpdk-dev] [PATCH v2 13/13] examples: take promiscuous mode switch result into account Andrew Rybchenko
2019-09-13 16:40     ` Ferruh Yigit
2019-09-13 18:30       ` Andrew Rybchenko
2019-09-13 16:37   ` [dpdk-dev] [PATCH v2 00/13] ethdev: change promiscuous mode functions to return status Ferruh Yigit
2019-09-14 11:37 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 01/13] ethdev: change promiscuous mode controllers to return errors Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 02/13] net/failsafe: check code of promiscuous mode switch Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 03/13] net/bonding: " Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 04/13] ethdev: change promiscuous callbacks to return status Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 05/13] ethdev: do nothing if promiscuous mode is applied again Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 06/13] app/pipeline: check code of promiscuous mode switch Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 07/13] app/testpmd: " Andrew Rybchenko
2019-09-16 13:18     ` Iremonger, Bernard
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 08/13] app/eventdev: " Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 09/13] app/pdump: " Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 10/13] app/test: " Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 11/13] kni: " Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 12/13] test/bonding: " Andrew Rybchenko
2019-09-14 11:37   ` [dpdk-dev] [PATCH v3 13/13] examples: take promiscuous mode switch result into account Andrew Rybchenko
2019-09-24  7:31   ` [dpdk-dev] [PATCH v3 00/13] ethdev: change promiscuous mode functions to return status Ferruh Yigit

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=1568030331-16526-13-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=Ivan.Ilchenko@oktetlabs.ru \
    --cc=chas3@att.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).