[ovs-discuss] [HELP] OVS-DPDK crash when executing ovs-tcpdump

Tonghao Zhang xiangxia.m.yue at gmail.com
Thu May 21 07:34:35 UTC 2020


On Tue, May 19, 2020 at 2:59 PM txfh2007 via discuss
<ovs-discuss at openvswitch.org> wrote:
>
> Hi all:
>     I am using OVS-2.13 together with DPDK-19.11 and hw-offload turnd on.  I have found when I tried to capture pkts by using ovs-tcpdump, the main process crash, I have found in log there is an assertion fail: "
> |util(dp_netdev_flow_43)|EMER|lib/cmap.c:922: assertion cmap_replace__(impl, old_node, new_node, hash, h1) || cmap_replace__(impl, old_node, new_node, hash, h2) failed in cmap_replace() "
>     After tracing by gdb, I have found it may caused by reload_affected_pmds mechanism: when we add or remove ports in datapath(e.g. capture pkts by ovs-tcpdump script), the reload_affected_pmds should call flow_mark_flush and then mark_to_flow_disassociate several times, for the second time that we call mark_to_flow_disassociate, as the flow->mark has already been set by 0xffffffff, so the cmap_remove would emit an error.
>     I don't know how to avoid this error?
>
> Thanks for your help !
> Timo
I don't try to reproduce the crash, you can offer more information,
such as your commands which you run.
Other crash I found, but patch is not ready for now, because I am busy
for something else. You can try it. I hope it is useful for you.

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index d8df8b50ec71..ad3ad22249c1 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -2366,6 +2366,12 @@ mark_to_flow_disassociate(struct
dp_netdev_pmd_thread *pmd,
     struct cmap_node *mark_node = CONST_CAST(struct cmap_node *,
                                              &flow->mark_node);

+    if (OVS_UNLIKELY(mark == INVALID_FLOW_MARK)) {
+        dp_netdev_flow_unref(flow);
+        return ret;
+    }
+
     cmap_remove(&flow_mark.mark_to_flow, mark_node, hash_int(mark, 0));
     flow->mark = INVALID_FLOW_MARK;

> _______________________________________________
> discuss mailing list
> discuss at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss



-- 
Best regards, Tonghao


More information about the discuss mailing list