[ovs-dev] [PATCH] netdev: Initialize netdev's features before getting them

Binbin Xu xu.binbin1 at zte.com.cn
Wed Oct 12 21:08:39 UTC 2016


When OVS&DPDK is used, DPDK doesn't support features 'advertised',
'supported' and 'peer'. If a physical port added to bridge, features
descirbed above can't be assigned, and the values are random.

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

diff --git a/lib/netdev.c b/lib/netdev.c
index 6c4c657..f40adfd 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -957,14 +957,14 @@ netdev_get_features(const struct netdev *netdev,
         peer = &dummy[3];
     }
 
+    *current = *advertised = *supported = *peer = 0;
+
     get_features = netdev->netdev_class->get_features;
     error = get_features
                     ? get_features(netdev, current, advertised, supported,
                                    peer)
                     : EOPNOTSUPP;
-    if (error) {
-        *current = *advertised = *supported = *peer = 0;
-    }
+
     return error;
 }
 
-- 
2.9.3




More information about the dev mailing list