[09/51] app/test: check status of getting ethdev info in bonding

Message ID 1566915962-5472-10-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: change rte_eth_dev_info_get() return value to int |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Andrew Rybchenko Aug. 27, 2019, 2:25 p.m. UTC
  From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

rte_eth_dev_info_get() return value was changed from void to int,
so this patch modify rte_eth_dev_info_get() usage across
app/test/test_link_bonding_rssconf.c according to its 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_rssconf.c | 33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)
  

Patch

diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
index 65de3b9..1a9571e 100644
--- a/app/test/test_link_bonding_rssconf.c
+++ b/app/test/test_link_bonding_rssconf.c
@@ -329,7 +329,11 @@  struct link_bonding_rssconf_unittest_params {
 	uint64_t rss_hf = 0;
 	uint64_t default_rss_hf = 0;
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	retval = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+	TEST_ASSERT((retval == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-retval));
 
 	/*
 	 *  Test hash function propagation
@@ -443,10 +447,16 @@  struct link_bonding_rssconf_unittest_params {
 	/**
 	 * Configure bonding port in RSS mq mode
 	 */
+	int ret;
+
 	TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 			&rss_pmd_conf, 0), "Failed to configure bonding device\n");
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	ret = rte_eth_dev_info_get(test_params.bond_port_id,
+					&test_params.bond_dev_info);
+	TEST_ASSERT((ret == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-ret));
 
 	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
 
@@ -468,10 +478,16 @@  struct link_bonding_rssconf_unittest_params {
 static int
 test_rss_lazy(void)
 {
+	int ret;
+
 	TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 			&default_pmd_conf, 0), "Failed to configure bonding device\n");
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	ret = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+	TEST_ASSERT((ret == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-ret));
 
 	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
 
@@ -532,6 +548,10 @@  struct link_bonding_rssconf_unittest_params {
 		rte_eth_dev_default_mac_addr_set(port->port_id, &mac_addr);
 
 		rte_eth_dev_info_get(port->port_id, &port->dev_info);
+		retval = rte_eth_dev_info_get(port->port_id, &port->dev_info);
+		TEST_ASSERT((retval == 0),
+				"Error during getting device (port %u) info: %s\n",
+				test_params.bond_port_id, strerror(-retval));
 	}
 
 	if (test_params.bond_port_id == INVALID_PORT_ID) {
@@ -545,8 +565,11 @@  struct link_bonding_rssconf_unittest_params {
 		TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 				&default_pmd_conf, 0), "Failed to configure bonding device\n");
 
-		rte_eth_dev_info_get(test_params.bond_port_id,
-				&test_params.bond_dev_info);
+		retval = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+		TEST_ASSERT((retval == 0),
+				"Error during getting device (port %u) info: %s\n",
+				test_params.bond_port_id, strerror(-retval));
 	}
 
 	return TEST_SUCCESS;