diff mbox series

[ovs-dev,31/62] dpif-netdev: add megaflow_to_mark disassociate when flow del

Message ID 20201228092520.11807-32-taoyunxiang@cmss.chinamobile.com
State Not Applicable
Headers show
Series DPDK Offload API to test | expand

Commit Message

Tao YunXiang Dec. 28, 2020, 9:24 a.m. UTC
From: Rongyin <rongyin@cmss.chinamobile.com>

Code Source From: Self Code

Description:

      add megaflow_to_mark disassociate when flow del

Jira:  #[Optional]
市场项目编号(名称):[Optional]
---
 lib/dpif-netdev.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 73367ab..623e1c8 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -2618,7 +2618,7 @@  dp_netdev_pmd_remove_flow(struct dp_netdev_pmd_thread *pmd,
     struct cmap_node *node = CONST_CAST(struct cmap_node *, &flow->node);
     struct dpcls *cls;
     odp_port_t in_port = flow->flow.in_port.odp_port;
-    uint32_t mark ;
+    uint32_t mark = INVALID_FLOW_MARK;
 
     cls = dp_netdev_pmd_lookup_dpcls(pmd, in_port);
     ovs_assert(cls != NULL);
@@ -2632,7 +2632,15 @@  dp_netdev_pmd_remove_flow(struct dp_netdev_pmd_thread *pmd,
         if (mark != INVALID_FLOW_MARK) {
             flow_mark_free(mark);
         }
+        /* As we would to del flow, so disassociate mapping between
+         * mageflow and mark(this mark value is fail offloaded value)
+         * for succeed offload mark, this procesure is done in queue_
+         * netdev_flow_del
+         */
+        megaflow_to_mark_disassociate(&flow->ufid);
     }
+    VLOG_DBG("TIMO DBG: flow del ufid:"UUID_FMT" mark:%u \n",
+          UUID_ARGS((struct uuid *)&flow->ufid),mark);
     if (flow->mark != INVALID_FLOW_MARK) {
         queue_netdev_flow_del(pmd, flow);
     }