diff mbox

[ovs-dev,1/3] netdev-dpdk: Can't set specified vhost port's admin state

Message ID 20161111134451.2280-1-xu.binbin1@zte.com.cn
State Accepted
Delegated to: Daniele Di Proietto
Headers show

Commit Message

Xu Binbin Nov. 11, 2016, 1:44 p.m. UTC
When we set a vhost port's admin state via ovs-appctl, the
application doesn't work and returns the information
"Not a DPDK Interface".

Signed-off-by: Binbin Xu <xu.binbin1@zte.com.cn>
---
 lib/netdev-dpdk.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Daniele Di Proietto Nov. 16, 2016, 12:47 a.m. UTC | #1
2016-11-11 5:44 GMT-08:00 Binbin Xu <xu.binbin1@zte.com.cn>:

> When we set a vhost port's admin state via ovs-appctl, the
> application doesn't work and returns the information
> "Not a DPDK Interface".
>
> Signed-off-by: Binbin Xu <xu.binbin1@zte.com.cn>
>

Thanks for the patch

I'm thinking about removing the 'ovs-appctl netdev-dpdk/set-admin-state'
command, because we can use

ovs-ofctl mod-port br0 dpdk0 up
ovs-ofctl mod-port br0 dpdk0 down

but as long as we keep it should work for vhost, so I applied this to master
diff mbox

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 7c1523e..c536992 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -391,7 +391,8 @@  struct netdev_rxq_dpdk {
     int port_id;
 };
 
-static int netdev_dpdk_construct(struct netdev *);
+static int netdev_dpdk_class_init(void);
+static int netdev_dpdk_vhost_class_init(void);
 
 int netdev_dpdk_get_vid(const struct netdev_dpdk *dev);
 
@@ -401,7 +402,8 @@  netdev_dpdk_get_ingress_policer(const struct netdev_dpdk *dev);
 static bool
 is_dpdk_class(const struct netdev_class *class)
 {
-    return class->construct == netdev_dpdk_construct;
+    return class->init == netdev_dpdk_class_init
+        || class->init == netdev_dpdk_vhost_class_init;
 }
 
 /* DPDK NIC drivers allocate RX buffers at a particular granularity, typically