[v3,08/54] ring: check status of getting ethdev info

Message ID 1567755066-31389-9-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 fail Compilation issues

Commit Message

Andrew Rybchenko Sept. 6, 2019, 7:30 a.m. UTC
  From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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_pmd_ring.c according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_pmd_ring.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
  

Comments

Bruce Richardson Sept. 6, 2019, 9:04 a.m. UTC | #1
On Fri, Sep 06, 2019 at 08:30:20AM +0100, Andrew Rybchenko wrote:
> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
> 
> 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_pmd_ring.c according to its new return type.
> 
> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  

Patch

diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c
index 6414bbd189..65ab6e7e00 100644
--- a/app/test/test_pmd_ring.c
+++ b/app/test/test_pmd_ring.c
@@ -490,10 +490,17 @@  static int
 test_command_line_ring_port(void)
 {
 	int port, cmdl_port0 = -1;
+	int ret;
+
 	/* find a port created with the --vdev=net_ring0 command line option */
 	RTE_ETH_FOREACH_DEV(port) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(port, &dev_info);
+
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		TEST_ASSERT((ret == 0),
+				"Error during getting device (port %d) info: %s\n",
+				port, strerror(-ret));
+
 		if (!strcmp(dev_info.driver_name, "Rings PMD")) {
 			printf("found a command line ring port=%d\n", port);
 			cmdl_port0 = port;