[02/11] test/event: check eth dev stop status

Message ID 1602682146-4722-3-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: change device stop to return status |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Oct. 14, 2020, 1:28 p.m. UTC
  From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

rte_eth_dev_stop() return value was changed from void to int,
so this patch modify usage of this function across test/event
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_event_eth_rx_adapter.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
  

Patch

diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index dd3bce71b8..60435b2faa 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -156,7 +156,9 @@  init_port_rx_intr(int num_ports)
 			default_params.rx_intr_port = portid;
 			return 0;
 		}
-		rte_eth_dev_stop(portid);
+		retval = rte_eth_dev_stop(portid);
+		TEST_ASSERT(retval == 0, "Failed to stop port %u: %d\n",
+					portid, retval);
 	}
 	return 0;
 }
@@ -479,8 +481,11 @@  adapter_multi_eth_add_del(void)
 
 	/* stop eth devices for existing */
 	port_index = 0;
-	for (; port_index < rte_eth_dev_count_total(); port_index += 1)
-		rte_eth_dev_stop(port_index);
+	for (; port_index < rte_eth_dev_count_total(); port_index += 1) {
+		err = rte_eth_dev_stop(port_index);
+		TEST_ASSERT(err == 0, "Failed to stop port %u: %d\n",
+					port_index, err);
+	}
 
 	/* add the max port for rx_adapter */
 	port_index = rte_eth_dev_count_total();