rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so modify usage of these
functions across lib/librte_kni according to new return type.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
printf("fail to start port %d\n", port_id);
return -1;
}
printf("fail to start port %d\n", port_id);
return -1;
}
- rte_eth_promiscuous_enable(port_id);
+ ret = rte_eth_promiscuous_enable(port_id);
+ if (ret != 0) {
+ printf("fail to enable promiscuous mode for port %d: %s\n",
+ port_id, rte_strerror(-ret));
+ return -1;
+ }
/* basic test of kni processing */
fd = fopen(KNI_MODULE_PARAM_LO, "r");
/* basic test of kni processing */
fd = fopen(KNI_MODULE_PARAM_LO, "r");
rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
(unsigned)port, ret);
rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
(unsigned)port, ret);
- if (promiscuous_on)
- rte_eth_promiscuous_enable(port);
+ if (promiscuous_on) {
+ ret = rte_eth_promiscuous_enable(port);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "Could not enable promiscuous mode for port%u: %s\n",
+ port, rte_strerror(-ret));
+ }
}
/* Check the link status of all ports in up to 9s, and print them finally */
}
/* Check the link status of all ports in up to 9s, and print them finally */
static int
kni_config_promiscusity(uint16_t port_id, uint8_t to_on)
{
static int
kni_config_promiscusity(uint16_t port_id, uint8_t to_on)
{
if (!rte_eth_dev_is_valid_port(port_id)) {
RTE_LOG(ERR, KNI, "Invalid port id %d\n", port_id);
return -EINVAL;
if (!rte_eth_dev_is_valid_port(port_id)) {
RTE_LOG(ERR, KNI, "Invalid port id %d\n", port_id);
return -EINVAL;
port_id, to_on);
if (to_on)
port_id, to_on);
if (to_on)
- rte_eth_promiscuous_enable(port_id);
+ ret = rte_eth_promiscuous_enable(port_id);
- rte_eth_promiscuous_disable(port_id);
+ ret = rte_eth_promiscuous_disable(port_id);
+ if (ret != 0)
+ RTE_LOG(ERR, KNI,
+ "Failed to %s promiscuous mode for port %u: %s\n",
+ to_on ? "enable" : "disable", port_id,
+ rte_strerror(-ret));
+
+ return ret;