]> git.droids-corp.org - dpdk.git/blobdiff - examples/vhost/main.c
examples: take promiscuous mode switch result into account
[dpdk.git] / examples / vhost / main.c
index 794d12ba7e470ba3bdd82425d9680f2f94be107a..b5632d771d46dea256dd2b359a7dff8584ee93fc 100644 (file)
@@ -336,8 +336,15 @@ port_init(uint16_t port)
                return retval;
        }
 
-       if (promiscuous)
-               rte_eth_promiscuous_enable(port);
+       if (promiscuous) {
+               retval = rte_eth_promiscuous_enable(port);
+               if (retval != 0) {
+                       RTE_LOG(ERR, VHOST_PORT,
+                               "Failed to enable promiscuous mode on port %u: %s\n",
+                               port, rte_strerror(-retval));
+                       return retval;
+               }
+       }
 
        rte_eth_macaddr_get(port, &vmdq_ports_eth_addr[port]);
        RTE_LOG(INFO, VHOST_PORT, "Max virtio devices supported: %u\n", num_devices);