Ethan, Some further thought on this:
If a rule is not matching on ‘dp_hash', or is matching on ‘dp_hash’, but not any L2, L3, or L4 fields, its location has little impact on the generated datapath masks. Having ‘dp_hash’ at a later stage makes the bond table lookup a bit less efficient, though, as the lookup typically will need two lookups, whereas only one would be needed if ‘dp_hash’ was with the 1st stage. However, if a rule is matching on ‘dp_hash’ and some L2, L3, and/or L4 fields, it would be better to have it on as early stage as possible to avoid unwildcarding the bits for the further stages in case of a miss. This is not the case currently, and as ‘dp_hash’ is not exposed to the controller, this will likely remain a theoretical consideration. By this logic it would be better to have ‘dp_hash’ with the ‘L1’ like other metadata, no? Jarno On Apr 3, 2014, at 5:46 PM, Ethan Jackson <et...@nicira.com> wrote: > Since the dp_hash will often be a hash of the 5 tuple, it makes sense > to put it with the L4 header so it hits in the last classifier lookup > stage. > > Signed-off-by: Ethan Jackson <et...@nicira.com> > --- > lib/flow.h | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/lib/flow.h b/lib/flow.h > index a6f45c9..7eb79d9 100644 > --- a/lib/flow.h > +++ b/lib/flow.h > @@ -97,17 +97,13 @@ union flow_in_port { > * be looked at. This enables better wildcarding for datapath flows. > */ > struct flow { > - /* Recirculation */ > - uint32_t dp_hash; /* Datapath computed hash value. The exact > - computation is opaque to the user space.*/ > - uint32_t recirc_id; /* Must be exact match. */ > - > /* L1 */ > struct flow_tnl tunnel; /* Encapsulating tunnel parameters. */ > ovs_be64 metadata; /* OpenFlow Metadata. */ > uint32_t regs[FLOW_N_REGS]; /* Registers. */ > uint32_t skb_priority; /* Packet priority for QoS. */ > uint32_t pkt_mark; /* Packet mark. */ > + uint32_t recirc_id; /* Must be exact match. */ > union flow_in_port in_port; /* Input port.*/ > > /* L2 */ > @@ -134,6 +130,8 @@ struct flow { > ovs_be16 pad; /* Padding. */ > > /* L4 */ > + uint32_t dp_hash; /* Datapath computed hash value. The exact > + computation is opaque to the user space.*/ > ovs_be16 tp_src; /* TCP/UDP/SCTP source port. */ > ovs_be16 tp_dst; /* TCP/UDP/SCTP destination port. > * Keep last for the BUILD_ASSERT_DECL below > */ > -- > 1.8.1.2 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev