From: Július Milan Date: Fri, 12 Jul 2019 07:55:46 +0000 (+0200) Subject: net/af_xdp: fix handling of not supported feature X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=06bb59f6b4a34a181b81147cc424e7c4685d7624;p=dpdk.git net/af_xdp: fix handling of not supported feature Procedure xdp_get_channels_info was returning error code -1 in case of ioctl command SIOCETHTOOL was not supported. This patch sets return value back to 0 as it is valid case. Fixes: 339b88c6a91f ("net/af_xdp: support multi-queue") Signed-off-by: Július Milan Reviewed-by: Xiaolong Ye --- diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index ff8e90589e..33352e10a7 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -852,9 +852,13 @@ xdp_get_channels_info(const char *if_name, int *max_queues, ifr.ifr_data = (void *)&channels; strncpy(ifr.ifr_name, if_name, IFNAMSIZ); ret = ioctl(fd, SIOCETHTOOL, &ifr); - if (ret && errno != EOPNOTSUPP) { - ret = -errno; - goto out; + if (ret) { + if (errno == EOPNOTSUPP) { + ret = 0; + } else { + ret = -errno; + goto out; + } } if (channels.max_combined == 0 || errno == EOPNOTSUPP) {