<div dir="ltr"><div dir="ltr">Hi Timo</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 6, 2019 at 2:06 AM txfh2007 &lt;<a href="mailto:txfh2007@aliyun.com">txfh2007@aliyun.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Darrell:<br>
<br>
the flow dump result is as below: Please help to check<br>
BEFORE:<br>
<br>
ct_state(-new+est-rel-rpl-inv+trk),ct_label(0/0x1),recirc_id(0x1b),in_port(6),packet_type(ns=0,id=0),eth(src=fa:16:3e:12:d7:77,dst=fa:16:3e:33:02:d8),eth_type(0x0800),ipv4(dst=<a href="http://192.168.1.8/255.255.255.248,proto=6,frag=no" rel="noreferrer" target="_blank">192.168.1.8/255.255.255.248,proto=6,frag=no</a>),tcp_flags(psh|ack), packets:18934, bytes:26602222, used:0.000s, flags:P., actions:ct(zone=1),recirc(0x1c)<br>
<br>
ct_state(-new+est-rel-rpl-inv+trk),ct_label(0/0x1),recirc_id(0x1c),in_port(6),packet_type(ns=0,id=0),eth(src=fa:16:3e:12:d7:77,dst=fa:16:3e:33:02:d8),eth_type(0x0800),ipv4(src=192.168.1.10,dst=192.168.1.8,proto=6,frag=no), packets:5345996, bytes:7676256441, used:0.000s, flags:P., actions:5<br>
<br>
AFTER:<br>
<br>
ct_state(-new+est-rel-rpl-inv+trk),ct_label(0/0x1),recirc_id(0x19),in_port(6),packet_type(ns=0,id=0),eth(src=fa:16:3e:12:d7:77,dst=fa:16:3e:33:02:d8),eth_type(0x0800),ipv4(dst=<a href="http://192.168.1.8/255.255.255.248,proto=6,frag=no" rel="noreferrer" target="_blank">192.168.1.8/255.255.255.248,proto=6,frag=no</a>),tcp_flags(ack), packets:2473174, bytes:3551472384, used:0.136s, flags:., actions:meter(0),ct(zone=1),recirc(0x1a)<br></blockquote><div><br></div><div>meter is being applied by above rule and then the pipeline continues below to do another pass thru the datapath;</div><div>this would likely explain the numbers</div><div>Can you double check the Openflow rules and do the metering at output rule.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
ct_state(-new+est-rel-rpl-inv+trk),ct_label(0/0x1),recirc_id(0x1a),in_port(6),packet_type(ns=0,id=0),eth(src=fa:16:3e:12:d7:77,dst=fa:16:3e:33:02:d8),eth_type(0x0800),ipv4(src=192.168.1.10,dst=192.168.1.8,proto=6,frag=no), packets:5292889, bytes:7599875381, used:0.046s, flags:P., actions:5<br>
<br>
<br>
<br>
meter rate is 1Gbps, iperf result is around 800Mbps<br>
<br>
[  5]  95.00-96.00  sec   104 MBytes   869 Mbits/sec<br>
[  5]  96.00-97.00  sec  79.4 MBytes   666 Mbits/sec<br>
[  5]  97.00-98.00  sec   107 MBytes   896 Mbits/sec<br>
[  5]  98.00-99.00  sec  75.4 MBytes   632 Mbits/sec<br>
[  5]  99.00-100.00 sec  98.3 MBytes   824 Mbits/sec<br>
[  5] 100.00-100.04 sec  0.00 Bytes  0.00 bits/sec<br>
- - - - - - - - - - - - - - - - - - - - - - - - -<br>
[ ID] Interval           Transfer     Bandwidth<br>
[  5]   0.00-100.04 sec  0.00 Bytes  0.00 bits/sec                  sender<br>
[  5]   0.00-100.04 sec  9.29 GBytes   798 Mbits/sec                  receiver<br>
<br>
<br>
<br>
------------------------------------------------------------------<br>
:Darrell Ball &lt;<a href="mailto:dlu998@gmail.com" target="_blank">dlu998@gmail.com</a>&gt;<br>
:2019年11月6日(星期三) 02:46<br>
:txfh2007 &lt;<a href="mailto:txfh2007@aliyun.com" target="_blank">txfh2007@aliyun.com</a>&gt;<br>
:Ben Pfaff &lt;<a href="mailto:blp@ovn.org" target="_blank">blp@ovn.org</a>&gt;; ovs-discuss &lt;<a href="mailto:ovs-discuss@openvswitch.org" target="_blank">ovs-discuss@openvswitch.org</a>&gt;<br>
:Re: [ovs-discuss] Re:Re: [HELP] Question about icmp pkt marked Invalid by userspace conntrack<br>
<br>
<br>
Hi Timo<br>
<br>
On Mon, Nov 4, 2019 at 11:29 PM txfh2007 &lt;<a href="mailto:txfh2007@aliyun.com" target="_blank">txfh2007@aliyun.com</a>&gt; wrote:<br>
<br>
Hi Darrell:<br>
    The meter rate limit is set as 1Gbps, but the actual rate is around 500Mbps.. I have read the meter patch, but this patch is to prevent delta_t changed to 0. But in my case, the delta_t is around 35500ms.<br>
<br>
<br>
It might be good to just include all known related fixes anyways, including this other one<br>
<br>
<br>
<a href="https://github.com/openvswitch/ovs/commit/acc5df0e3cb036524d49891fdb9ba89b609dd26a" rel="noreferrer" target="_blank">https://github.com/openvswitch/ovs/commit/acc5df0e3cb036524d49891fdb9ba89b609dd26a</a><br>
<br>
<br>
<br>
<br>
For my case, the meter action is on openflow table 46, and the ct action is on table 44, the output action is on table 65, so I guess the order is right?<br>
<br>
<br>
Could you dump the &#39;relevant&#39; datapath flows before adding the meter rule and after adding the meter rule ?<br>
ovs-appctl dpif/dump-flows &lt;bridge&gt;<br>
<br>
<br>
<br>
Thanks <br>
<br>
Timo <br>
<br>
<br>
<br>
------------------------------------------------------------------<br>
:Darrell Ball &lt;<a href="mailto:dlu998@gmail.com" target="_blank">dlu998@gmail.com</a>&gt;<br>
:2019年11月5日(星期二) 06:56<br>
:txfh2007 &lt;<a href="mailto:txfh2007@aliyun.com" target="_blank">txfh2007@aliyun.com</a>&gt;<br>
:Ben Pfaff &lt;<a href="mailto:blp@ovn.org" target="_blank">blp@ovn.org</a>&gt;; ovs-discuss &lt;<a href="mailto:ovs-discuss@openvswitch.org" target="_blank">ovs-discuss@openvswitch.org</a>&gt;<br>
:Re: [ovs-discuss] Re:Re: [HELP] Question about icmp pkt marked Invalid by userspace conntrack<br>
<br>
<br>
Hi Timo<br>
<br>
On Sun, Nov 3, 2019 at 5:12 PM txfh2007 &lt;<a href="mailto:txfh2007@aliyun.com" target="_blank">txfh2007@aliyun.com</a>&gt; wrote:<br>
<br>
Hi Darrell:<br>
    Sorry for my late reply. Yes, the two VMs under test are on same compute node , and pkts rx/tx via vhost user type port.<br>
<br>
Got it<br>
<br>
<br>
Firstly if I don&#39;t configure meter table, then Iperf TCP bandwidth result From VM1 to VM2 is around 5Gbps, then I set the meter entry and constraint the rate, and the deviation is larger than I throught.<br>
<br>
<br>
IIUC, pre-meter, you get 5 Gbps, then post-meter 0.5 Gpbs, which is less than you expected ?<br>
What did you expect the metered rate to be ?<br>
Note Ben pointed you to a meter related bug fix on the alias b4.<br>
<br>
    I guess the recalculation of l4 checksum during conntrack would impact the actual rate?<br>
<br>
<br>
are you applying the meter rule at end of the complete pipeline ?<br>
<br>
<br>
Thank you <br>
Timo <br>
<br>
<br>
<br>
<br>
txfh2007 &lt;<a href="mailto:txfh2007@aliyun.com" target="_blank">txfh2007@aliyun.com</a>&gt;<br>
Ben Pfaff &lt;<a href="mailto:blp@ovn.org" target="_blank">blp@ovn.org</a>&gt;; ovs-discuss &lt;<a href="mailto:ovs-discuss@openvswitch.org" target="_blank">ovs-discuss@openvswitch.org</a>&gt;<br>
Re: [ovs-discuss] Re:Re: [HELP] Question about icmp pkt marked Invalid by userspace conntrack<br>
<br>
<br>
Hi Timo<br>
<br>
<br>
I read thru this thread to get more context on what you are doing; you have a base OVS-DPDK<br>
use case and are measuring VM to VM performance across 2 compute nodes. You are probably using<br>
vhost-user-client ports ? Pls correct me if I am wrong.<br>
In this case, &quot;per direction&quot; you have one rx virtual interface to handle in OVS; there will be a tradeoff b/w<br>
checksum validation security and performance.<br>
JTBC, in terms of your measurements, how did you arrive at the 5Gbps - instrumented code or otherwise ?.<br>
(I can verify that later when I have a setup).<br>
<br>
<br>
Darrell<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Thu, Oct 31, 2019 at 9:23 AM Darrell Ball &lt;<a href="mailto:dlu998@gmail.com" target="_blank">dlu998@gmail.com</a>&gt; wrote:<br>
<br>
<br>
<br>
<br>
On Thu, Oct 31, 2019 at 3:04 AM txfh2007 via discuss &lt;<a href="mailto:ovs-discuss@openvswitch.org" target="_blank">ovs-discuss@openvswitch.org</a>&gt; wrote:<br>
<br>
Hi Ben &amp;&amp; Darrell:<br>
     This patch works, but after merging this patch I have found the iperf throughout decrease from 5Gbps+ to 500Mbps.<br>
<br>
what is the 5Gbps number ? Is that the number with marking all packets as invalid in initial sanity checks ?<br>
<br>
<br>
Typically one wants to offload checksum checks. The code checks whether that has been done and skips<br>
doing it in software; can you verify that you have the capability and are using it ?<br>
<br>
<br>
Skipping checksum checks reduces security, of course, but it can be added if there is a common case of<br>
not being able to offload checksumming. <br>
<br>
<br>
<br>
 I guess maybe we should add a switch to turn off layer4 checksum validation when doing userspace conntrack ? I have found for kernel conntrack, there is a related button named &quot;nf_conntrack_checksum&quot;  .<br>
<br>
Any advice?<br>
<br>
Thank you !<br>
<br>
------------------------------------------------------------------<br>
<br>
:Ben Pfaff &lt;<a href="mailto:blp@ovn.org" target="_blank">blp@ovn.org</a>&gt;<br>
:ovs-discuss &lt;<a href="mailto:ovs-discuss@openvswitch.org" target="_blank">ovs-discuss@openvswitch.org</a>&gt;<br>
:Re:Re:[ovs-discuss] [HELP] Question about icmp pkt marked Invalid by userspace conntrack<br>
<br>
<br>
Hi Ben &amp;&amp; Darrell:<br>
     Thanks, this patch works! Now the issue seems fixed <br>
<br>
Timo<br>
<br>
<br>
Re: Re:[ovs-discuss] [HELP] Question about icmp pkt marked Invalid by userspace conntrack<br>
<br>
<br>
I see.<br>
<br>
It sounds like Darrell pointed out the solution, but please let me know<br>
if it did not help.<br>
<br>
On Fri, Oct 11, 2019 at 08:57:58AM +0800, txfh2007 wrote:<br>
&gt; Hi Ben:<br>
&gt; <br>
&gt;      I just found the GCC_UNALIGNED_ACCESSORS error during gdb trace and not sure this is a misaligned error or others. What I can confirm is  during &quot;extract_l4&quot; of this icmp reply packet, when we do &quot;check_l4_icmp&quot;, the unaligned error emits and the &quot;extract_l4&quot; returned false. So this packet be marked as ct_state=invalid.<br>
&gt; <br>
&gt; Thank you for your help.<br>
&gt; <br>
&gt; Timo<br>
&gt; <br>
&gt; Topic:Re: [ovs-discuss] [HELP] Question about icmp pkt marked Invalid by userspace conntrack<br>
&gt; <br>
&gt; <br>
&gt; It&#39;s very surprising.<br>
&gt; <br>
&gt; Are you using a RISC architecture that insists on aligned accesses?  On<br>
&gt; the other hand, if you are using x86-64 or some other architecture that<br>
&gt; ordinarily does not care, are you sure that this is about a misaligned<br>
&gt; access (it is more likely to simply be a bad pointer)?<br>
&gt; <br>
&gt; On Thu, Oct 10, 2019 at 10:50:33PM +0800, txfh2007 via discuss wrote:<br>
&gt; &gt; <br>
&gt; &gt; Hi all:<br>
&gt; &gt;     I was using OVS-DPDK(version 2.10-1), and I have found pinging between two VMs on different compute nodes failed. I have checked my env and found there is one node&#39;s NIC cannot strip CRC of a frame, the other node&#39;s NIC is normal(I mean it can strip CRC ). And the reason of ping fail is the icmp reply pkt (from node whose NIC cannot strip CRC) is marked as invalid . So the icmp request From Node A is 64 bytes, but the icmp reply From Node B is 68 bytes(with 4 bytes CRC). And when doing &quot;check_l4_icmp&quot;, when we call csum task(in lib/csum.c). Gcc emits unaligned accessor error. The backtrace is as below: <br>
&gt; &gt; <br>
&gt; &gt;     I just want to confirm if this phenomenon is reasonable?<br>
&gt; &gt; <br>
&gt; &gt; Many thanks<br>
&gt; &gt; <br>
&gt; &gt; Timo<br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; get_unaligned_be16 (p=0x7f2ad0b1ed5c) at lib/unaligned.h:89<br>
&gt; &gt; 89 GCC_UNALIGNED_ACCESSORS(ovs_be16, be16);<br>
&gt; &gt; (gdb) bt<br>
&gt; &gt; #0  get_unaligned_be16 (p=0x7f2ad0b1ed5c) at lib/unaligned.h:89<br>
&gt; &gt; #1  0x000000000075a584 in csum_continue (partial=0, data_=0x7f2ad0b1ed5c, n=68) at lib/csum.c:46<br>
&gt; &gt; #2  0x000000000075a552 in csum (data=0x7f2ad0b1ed5c, n=68) at lib/csum.c:33<br>
&gt; &gt; #3  0x00000000008ddf18 in check_l4_icmp (data=0x7f2ad0b1ed5c, size=68, validate_checksum=true) at lib/conntrack.c:1638<br>
&gt; &gt; #4  0x00000000008de650 in extract_l4 (key=0x7f32a20df120, data=0x7f2ad0b1ed5c, size=68, related=0x7f32a20df15d, l3=0x7f2ad0b1ed48, <br>
&gt; &gt;     validate_checksum=true) at lib/conntrack.c:1888<br>
&gt; &gt; #5  0x00000000008de90d in conn_key_extract (ct=0x7f32b42a2d98, pkt=0x7f2ad0b1e9c0, dl_type=8, ctx=0x7f32a20df120, zone=4)<br>
&gt; &gt;     at lib/conntrack.c:1973<br>
&gt; &gt; #6  0x00000000008dd49c in conntrack_execute (ct=0x7f32b42a2d98, pkt_batch=0x7f32a20e08b0, dl_type=8, force=false, commit=false, <br>
&gt; &gt;     zone=4, setmark=0x0, setlabel=0x0, tp_src=0, tp_dst=0, helper=0x0, nat_action_info=0x0, now=5395897849) at lib/conntrack.c:1318<br>
&gt; &gt; #7  0x000000000076d651 in dp_execute_cb (aux_=0x7f32a20dfb00, packets_=0x7f32a20e08b0, a=0x7f32a20e0ac8, should_steal=false)<br>
&gt; &gt;     at lib/dpif-netdev.c:6711<br>
&gt; &gt; #8  0x00000000007b2d49 in odp_execute_actions (dp=0x7f32a20dfb00, batch=0x7f32a20e08b0, steal=true, actions=0x7f32a20e0ac8, <br>
&gt; &gt;     actions_len=20, dp_execute_action=0x76ca60 &lt;dp_execute_cb&gt;) at lib/odp-execute.c:726<br>
&gt; &gt; #9  0x000000000076d71b in dp_netdev_execute_actions (pmd=0x7f2a6e1ce010, packets=0x7f32a20e08b0, should_steal=true, <br>
&gt; &gt;     flow=0x7f32a20dfb60, actions=0x7f32a20e0ac8, actions_len=20) at lib/dpif-netdev.c:6754<br>
&gt; &gt; #10 0x000000000076b900 in handle_packet_upcall (pmd=0x7f2a6e1ce010, packet=0x7f2ad0b1e9c0, key=0x7f32a20e1100, <br>
&gt; &gt;     actions=0x7f32a20e0a40, put_actions=0x7f32a20e0a80) at lib/dpif-netdev.c:6056<br>
&gt; &gt; #11 0x000000000076bdf0 in fast_path_processing (pmd=0x7f2a6e1ce010, packets_=0x7f32a20e2b60, keys=0x7f32a20e10c0, <br>
&gt; &gt;     batches=0x7f32a20e0f90, n_batches=0x7f32a20e13c0, in_port=15) at lib/dpif-netdev.c:6153<br>
&gt; &gt; #12 0x000000000076c3df in dp_netdev_input__ (pmd=0x7f2a6e1ce010, packets=0x7f32a20e2b60, md_is_valid=true, port_no=0)<br>
&gt; &gt;     at lib/dpif-netdev.c:6230<br>
&gt; &gt; #13 0x000000000076c4d4 in dp_netdev_recirculate (pmd=0x7f2a6e1ce010, packets=0x7f32a20e2b60) at lib/dpif-netdev.c:6265<br>
&gt; &gt; #14 0x000000000076ceae in dp_execute_cb (aux_=0x7f32a20e1db0, packets_=0x7f32a20e2b60, a=0x7f32a20e2d78, should_steal=true) <br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; discuss mailing list<br>
&gt; &gt; <a href="mailto:discuss@openvswitch.org" target="_blank">discuss@openvswitch.org</a><br>
&gt; &gt; <a href="https://mail.openvswitch.org/mailman/listinfo/ovs-discuss" rel="noreferrer" target="_blank">https://mail.openvswitch.org/mailman/listinfo/ovs-discuss</a><br>
&gt; <br>
<br>
<br>
<br>
_______________________________________________<br>
discuss mailing list<br>
<a href="mailto:discuss@openvswitch.org" target="_blank">discuss@openvswitch.org</a><br>
<a href="https://mail.openvswitch.org/mailman/listinfo/ovs-discuss" rel="noreferrer" target="_blank">https://mail.openvswitch.org/mailman/listinfo/ovs-discuss</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div></div>