[ovs-dev] netdev-dpdk: fix flow based tunnel

Message ID 20170313110232.11597-1-zealot0630@gmail.com
State Superseded
Headers show

Commit Message

Zang MingJie March 13, 2017, 11:02 a.m.
The push/pop header of flow based tunnel is generated dynamically by flows, so
there won't be any tunnel header associated to netdev.

The patch fixes that tnl_port_cache doesn't contain any flow based tunnel.

Signed-off-by: Zang MingJie <zealot0630@gmail.com>
---
 lib/dpif-netdev.c | 2 +-
 lib/netdev.c      | 7 -------
 2 files changed, 1 insertion(+), 8 deletions(-)

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 7d53a8def..383001e6c 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3599,7 +3599,7 @@  pmd_load_cached_ports(struct dp_netdev_pmd_thread *pmd)
     hmap_shrink(&pmd->tnl_port_cache);
 
     HMAP_FOR_EACH (tx_port, node, &pmd->tx_ports) {
-        if (netdev_has_tunnel_push_pop(tx_port->port->netdev)) {
+        if (netdev_get_tunnel_config(tx_port->port->netdev) != NULL) {
             tx_port_cached = xmemdup(tx_port, sizeof *tx_port_cached);
             hmap_insert(&pmd->tnl_port_cache, &tx_port_cached->node,
                         hash_port_no(tx_port_cached->port->port_no));
diff --git a/lib/netdev.c b/lib/netdev.c
index a8d8edad7..c10c7760c 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -117,13 +117,6 @@  netdev_is_pmd(const struct netdev *netdev)
     return netdev->netdev_class->is_pmd;
 }
 
-bool
-netdev_has_tunnel_push_pop(const struct netdev *netdev)
-{
-    return netdev->netdev_class->push_header
-           && netdev->netdev_class->pop_header;
-}
-
 static void
 netdev_initialize(void)
     OVS_EXCLUDED(netdev_mutex)