[ovs-discuss] Megaflow effectiveness problem

Han Zhou zhouhan at gmail.com
Tue Oct 2 04:51:26 UTC 2018


On Mon, Oct 1, 2018 at 12:49 PM Ben Pfaff <blp at ovn.org> wrote:
>
> On Fri, Sep 28, 2018 at 05:57:28PM -0700, Han Zhou wrote:
> > Justin, please find the ofproto/trace result with the new wildcards
here:
> > https://gist.github.com/hzhou8/ff719b6565b9264304251054ce447b5d
> > I also tried using different ports, but result is same - no wildcard
> > happening for the dst-port field.
>
> I don't actually see tp_dst mentioned on any of the "new wildcards"
> lines there.  That is weird.

(resend since the mailing-lists were not working for last 2-3 days)

Checking the xlate code, the problem is that bit-wise un-wildcarding
happens only for general rule classification. For BFD, which is handled in
process_special() -> bfd_should_process_flow(), it is set to full mask for
the whole tp_dst field directly in the code.
I submitted a patch to fix this by un-wildcarding only the necessary bits:
https://mail.openvswitch.org/pipermail/ovs-dev/2018-October/352587.html

With this patch the problem is solved - udp dst ports are now getting
wildcarded. E.g.
- send packet with dst udp port = 3785, it is still fully unwildcarded,
because all bits are used in the comparison to determine that it is not
equal to the bfd port 3784.
- send packet with dst udp port = 3786, it is wildcarded as
dst=3786/0xfffe, because the last bit is not needed for the comparison.
- send packet with dst udp port = 4000, it is wildcarded as
dst=3840/0xff00, because the first bit that differentiate from bfd port
3784 is the 8th bit.

And so OVS is now generating much less datapath flows, and much less flow
misses in datapath.

Please let me know if it is a reasonable fix.

Thanks,
Han
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20181001/ac4bec2b/attachment.html>


More information about the discuss mailing list