From: Paul Blakey <pa...@mellanox.com>

Ports already added to a switch are not being initialized for offloading
so when enabling offload we need to go over those ports.

Signed-off-by: Paul Blakey <pa...@mellanox.com>
Reviewed-by: Roi Dayan <r...@mellanox.com>
Reviewed-by: Simon Horman <simon.hor...@netronome.com>
---
 lib/netdev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/netdev.c b/lib/netdev.c
index 0aae83a..001b7b3 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -2346,6 +2346,18 @@ netdev_ports_flow_get(const void *obj, struct match 
*match,
 }
 
 #ifdef __linux__
+static void
+netdev_ports_flow_init(void)
+{
+    struct port_to_netdev_data *data;
+
+    ovs_mutex_lock(&netdev_hmap_mutex);
+    HMAP_FOR_EACH(data, node, &port_to_netdev) {
+       netdev_init_flow_api(data->netdev);
+    }
+    ovs_mutex_unlock(&netdev_hmap_mutex);
+}
+
 void
 netdev_set_flow_api_enabled(const struct smap *ovs_other_config)
 {
@@ -2360,6 +2372,8 @@ netdev_set_flow_api_enabled(const struct smap 
*ovs_other_config)
             tc_set_policy(smap_get_def(ovs_other_config, "tc-policy",
                                        TC_POLICY_DEFAULT));
 
+            netdev_ports_flow_init();
+
             ovsthread_once_done(&once);
         }
     }
-- 
2.7.4

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to