[v3,10/13] app/test: check code of promiscuous mode switch

Message ID 1568461055-16472-11-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: change promiscuous mode functions to return status |

Checks

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

Commit Message

Andrew Rybchenko Sept. 14, 2019, 11:37 a.m. UTC
  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 app/test/test_event_eth_rx_adapter.c
and app/test/test_event_eth_tx_adapter.c 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 | 4 +++-
 app/test/test_event_eth_tx_adapter.c | 4 +++-
 app/test/test_pmd_perf.c             | 6 +++++-
 3 files changed, 11 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 950bc67c2..6254fcd33 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -90,7 +90,9 @@  port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
 			addr.addr_bytes[4], addr.addr_bytes[5]);
 
 	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
 
 	return 0;
 }
diff --git a/app/test/test_event_eth_tx_adapter.c b/app/test/test_event_eth_tx_adapter.c
index 208d20c53..73f6afea2 100644
--- a/app/test/test_event_eth_tx_adapter.c
+++ b/app/test/test_event_eth_tx_adapter.c
@@ -94,7 +94,9 @@  port_init_common(uint8_t port, const struct rte_eth_conf *port_conf,
 			addr.addr_bytes[4], addr.addr_bytes[5]);
 
 	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
 
 	return 0;
 }
diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index 4f9fc0d87..85ef11899 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -745,7 +745,11 @@  test_pmd_perf(void)
 				ret, portid);
 
 		/* always eanble promiscuous */
-		rte_eth_promiscuous_enable(portid);
+		ret = rte_eth_promiscuous_enable(portid);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				 "rte_eth_promiscuous_enable: err=%s, port=%d\n",
+				 rte_strerror(-ret), portid);
 
 		lcore_conf[slave_id].portlist[num++] = portid;
 		lcore_conf[slave_id].nb_ports++;