+ ifname = dev->ifname != NULL ? dev->ifname : "tap%d";
+ data->tapfds[0] = tap_open(ifname, (tap_features & IFF_MULTI_QUEUE) != 0);
+ if (data->tapfds[0] < 0)
+ goto err_tapfds;
+ if (dev->ifname == NULL && tap_get_name(data->tapfds[0], &dev->ifname) < 0) {
+ PMD_DRV_LOG(ERR, "fail to get tap name (%d)", data->tapfds[0]);
+ goto err_tapfds;
+ }
+ if (tap_get_flags(data->tapfds[0], &tap_flags) < 0) {
+ PMD_DRV_LOG(ERR, "fail to get tap flags for tap %s", dev->ifname);
+ goto err_tapfds;
+ }
+ if ((tap_flags & IFF_MULTI_QUEUE) == 0 && dev->max_queue_pairs > 1) {
+ PMD_DRV_LOG(ERR, "tap %s does not support multi queue", dev->ifname);
+ goto err_tapfds;
+ }
+
+ for (i = 1; i < dev->max_queue_pairs; i++) {
+ data->tapfds[i] = tap_open(dev->ifname, true);
+ if (data->tapfds[i] < 0)
+ goto err_tapfds;
+ }
+