[v3,10/13] app/test: check code of promiscuous mode switch
Checks
Commit Message
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(-)
@@ -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;
}
@@ -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;
}
@@ -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++;