summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>2019-09-24 13:56:12 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-07 15:00:55 +0200
commit8835806ddced62767e4876ce0018c78ba693997d (patch)
tree18208ec480e2d2d8ceacb126fd31d6782a6a2569 /app
parentde5ccf0775ae95d7f41bd3d6adea0b3b82a51a57 (diff)
downloaddpdk-8835806ddced62767e4876ce0018c78ba693997d.zip
dpdk-8835806ddced62767e4876ce0018c78ba693997d.tar.gz
dpdk-8835806ddced62767e4876ce0018c78ba693997d.tar.xz
app/testpmd: check code of allmulticast mode switch
rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable() return value was changed from void to int, so this patch modify usage of these functions across app/test-pmd according to new return type. Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Diffstat (limited to 'app')
-rw-r--r--app/test-pmd/cmdline.c10
-rw-r--r--app/test-pmd/testpmd.h1
-rw-r--r--app/test-pmd/util.c16
3 files changed, 19 insertions, 8 deletions
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 6b9444f..dd4e6e6 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6603,17 +6603,11 @@ static void cmd_set_allmulti_mode_parsed(void *parsed_result,
/* all ports */
if (allports) {
RTE_ETH_FOREACH_DEV(i) {
- if (enable)
- rte_eth_allmulticast_enable(i);
- else
- rte_eth_allmulticast_disable(i);
+ eth_set_allmulticast_mode(i, enable);
}
}
else {
- if (enable)
- rte_eth_allmulticast_enable(res->port_num);
- else
- rte_eth_allmulticast_disable(res->port_num);
+ eth_set_allmulticast_mode(res->port_num, enable);
}
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index bec19ab..f8ebe71 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -825,6 +825,7 @@ void setup_gso(const char *mode, portid_t port_id);
int eth_dev_info_get_print_err(uint16_t port_id,
struct rte_eth_dev_info *dev_info);
void eth_set_promisc_mode(uint16_t port_id, int enable);
+void eth_set_allmulticast_mode(uint16_t port, int enable);
int eth_link_get_nowait_print_err(uint16_t port_id, struct rte_eth_link *link);
int eth_macaddr_get_print_err(uint16_t port_id,
struct rte_ether_addr *mac_addr);
diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index faf247c..1570270 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -262,6 +262,22 @@ eth_set_promisc_mode(uint16_t port, int enable)
port, rte_strerror(-ret));
}
+void
+eth_set_allmulticast_mode(uint16_t port, int enable)
+{
+ int ret;
+
+ if (enable)
+ ret = rte_eth_allmulticast_enable(port);
+ else
+ ret = rte_eth_allmulticast_disable(port);
+
+ if (ret != 0)
+ printf("Error during %s all-multicast mode for port %u: %s\n",
+ enable ? "enabling" : "disabling",
+ port, rte_strerror(-ret));
+}
+
int
eth_link_get_nowait_print_err(uint16_t port_id, struct rte_eth_link *link)
{