diff mbox

[ovs-dev,v2] netdev-dpdk: update vhost user client port status.

Message ID 1503647589-32847-1-git-send-email-wangzhike@jd.com
State Accepted
Delegated to: Darrell Ball
Headers show

Commit Message

Zhike Wang Aug. 25, 2017, 7:53 a.m. UTC
After ovs-vswitchd reboots, vhost user client port status is displayed as
LINK DOWN though the traffic is OK.

The problem is that the port may be udpated while the vhost_reconfigured
is false. Then the vhost_reconfigured is updated to true. As a result,
the vhost port status is kept as LINK-DOWN.

Signed-off-by: wangzhike <wangzhike@jd.com>
---
 lib/netdev-dpdk.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Darrell Ball Aug. 30, 2017, 6:52 a.m. UTC | #1
I applied the patch to dpdk_merge here

https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_darball_ovs_commits_dpdk-5Fmerge&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=A2_FCacqbp2moAo3HGFlTuxsjONUGhlN42OBcAuQQ6w&s=b6btPKhgvOFr2GOUYvktND6kaC6jc3fXI-mXfvNgXOU&e=

This can be backported as far back as 2.6.


On 8/25/17, 12:53 AM, "ovs-dev-bounces@openvswitch.org on behalf of wangzhike" <ovs-dev-bounces@openvswitch.org on behalf of wangzhike@jd.com> wrote:

    After ovs-vswitchd reboots, vhost user client port status is displayed as
    LINK DOWN though the traffic is OK.
    
    The problem is that the port may be udpated while the vhost_reconfigured
    is false. Then the vhost_reconfigured is updated to true. As a result,
    the vhost port status is kept as LINK-DOWN.
    
    Signed-off-by: wangzhike <wangzhike@jd.com>
    ---
     lib/netdev-dpdk.c | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
    index 1aaf6f7..80415ef 100644
    --- a/lib/netdev-dpdk.c
    +++ b/lib/netdev-dpdk.c
    @@ -3227,7 +3227,11 @@ dpdk_vhost_reconfigure_helper(struct netdev_dpdk *dev)
         }
     
         if (netdev_dpdk_get_vid(dev) >= 0) {
    -        dev->vhost_reconfigured = true;
    +        if (dev->vhost_reconfigured == false) {
    +            dev->vhost_reconfigured = true;
    +            /* Carrier status may need updating. */
    +            netdev_change_seq_changed(&dev->up);
    +        }
         }
     
         return 0;
    -- 
    1.8.3.1
    
    _______________________________________________
    dev mailing list
    dev@openvswitch.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=bGcXuczLYRy8N41DitmYiqCgX63ICdaK_g-UGzgNPqM&s=CaAAi5CWKkwsk7f7iWm01rmy6fRjmbygHFqEU2rhp6k&e=
diff mbox

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 1aaf6f7..80415ef 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -3227,7 +3227,11 @@  dpdk_vhost_reconfigure_helper(struct netdev_dpdk *dev)
     }
 
     if (netdev_dpdk_get_vid(dev) >= 0) {
-        dev->vhost_reconfigured = true;
+        if (dev->vhost_reconfigured == false) {
+            dev->vhost_reconfigured = true;
+            /* Carrier status may need updating. */
+            netdev_change_seq_changed(&dev->up);
+        }
     }
 
     return 0;