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 <jmilan.dev@gmail.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
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) {