net/bnxt: refactor multi-queue Rx configuration
[dpdk.git] / drivers / net / virtio / virtio_user / vhost_kernel_tap.c
index 79b8446..99096bd 100644 (file)
 
 #include "vhost_kernel_tap.h"
 #include "../virtio_logs.h"
-#include "../virtio_pci.h"
+#include "../virtio.h"
+
+
+int
+tap_support_features(unsigned int *tap_features)
+{
+       int tapfd;
+
+       tapfd = open(PATH_NET_TUN, O_RDWR);
+       if (tapfd < 0) {
+               PMD_DRV_LOG(ERR, "fail to open %s: %s",
+                           PATH_NET_TUN, strerror(errno));
+               return -1;
+       }
+
+       if (ioctl(tapfd, TUNGETFEATURES, tap_features) == -1) {
+               PMD_DRV_LOG(ERR, "TUNGETFEATURES failed: %s", strerror(errno));
+               close(tapfd);
+               return -1;
+       }
+
+       close(tapfd);
+       return 0;
+}
 
 int
 vhost_kernel_tap_set_offload(int fd, uint64_t features)