[ovs-dev] [PATCH 2/3] datapath: Optimize flow key match for non tunnel flows.

Ben Pfaff blp at nicira.com
Wed Oct 17 23:15:07 UTC 2012

On Wed, Oct 17, 2012 at 04:09:52PM -0700, Pravin Shelar wrote:
> On Wed, Oct 17, 2012 at 3:52 PM, Ben Pfaff <blp at nicira.com> wrote:
> > On Sun, Oct 14, 2012 at 06:41:25PM -0700, Pravin B Shelar wrote:
> >> Following patch adds start offset for sw_flow-key, so that we can
> >> skip tunneling information in key for non-tunnel flows.
> >>
> >> Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
> >> CC: Kyle Mestery <kmestery at cisco.com>
> >> Cc: Simon Horman <horms at verge.net.au>
> >> Cc: Jesse Gross <jesse at nicira.com>
> >
> > Does this actually speed up the fast path?  (Did you measure it?)
> >
> perf does show flow hashing as one of top symbol in netperf test.


> > In struct sw_flow_key, why put tun inside phy?  Why not just move it
> > to the beginning without nesting it?  Why change tun from struct to
> > (one-member) union?
> >
> tun_id was always in phy, that why I kept it in phy. once we have
> support for ipv6 tunnels it will be union, so I am changed it to
> union. if you want I can revert it.

No need, that makes sense then.

> > In ovs_flow_tbl_lookup(), I think there's a (faint) possibility that
> > the key and the hash are equal, but the bucket's key_offset differs
> > from the searched-for key_offset, so I would check for a match in that
> > also.
> >
> I am not sure I understand that possibility, non-tunnel and tunnel
> keys can not be same as key still have in_port as differentiator.

Hmm, you're right, thanks.

Acked-by: Ben Pfaff <blp at nicira.com>

More information about the dev mailing list