[ovs-git] Open vSwitch: Classifier: Track address prefixes. (master)

dev at openvswitch.org dev at openvswitch.org
Wed Dec 11 19:07:31 UTC 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  13751fd88c4b7464f9453c03659201c10b3b87a0 (commit)
       via  8c301900fc6f7faface4a2cbd016411f966d0601 (commit)
      from  54d68e0edfc40592e2f3c0b088c075d8793b5359 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 13751fd88c4b7464f9453c03659201c10b3b87a0
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=13751fd88c4b7464f9453c03659201c10b3b87a0
Author: Jarno Rajahalme <jrajahalme at nicira.com>
		
Classifier: Track address prefixes.
		
Add a prefix tree (trie) structure for tracking the used address
space, enabling skipping classifier tables containing longer masks
than necessary for an address field value in a packet header being
classified.  This enables less unwildcarding for datapath flows in
parts of the address space without host routes.

Trie lookup is interwoven to the staged lookup, so that a trie is
searched only when the configured trie field becomes relevant
for the lookup.  The trie lookup results are retained so that each
trie is checked at most once for each classifier lookup.

This implementation tracks the number of rules at each address prefix
for the whole classifier.  More aggressive table skipping would be
possible by maintaining lists of tables that have prefixes at the
lengths encountered on tree traversal, or by maintaining separate
tries for subsets of rules separated by metadata fields.

Prefix tracking is configured via OVSDB.  A new column "prefixes" is
added to the database table "Flow_Table".  "prefixes" is a set of
string values listing the field names for which prefix lookup should
be used.

As of now, the fields for which prefix lookup can be enabled are:
- tun_id, tun_src, tun_dst
- nw_src, nw_dst (or aliases ip_src and ip_dst)
- ipv6_src, ipv6_dst

There is a maximum number of fields that can be enabled for any one
flow table.  Currently this limit is 3.

Examples:

ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- \
 --id=@N1 create Flow_Table name=table0
ovs-vsctl set Bridge br0 flow_tables:1=@N1 -- \
 --id=@N1 create Flow_Table name=table1

ovs-vsctl set Flow_Table table0 prefixes=ip_dst,ip_src
ovs-vsctl set Flow_Table table1 prefixes=[]

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit 8c301900fc6f7faface4a2cbd016411f966d0601
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=8c301900fc6f7faface4a2cbd016411f966d0601
Author: Jarno Rajahalme <jrajahalme at nicira.com>
		
dpif-netdev: Properly create exact match masks.
		
Normally OVS userspace supplies a mask along with a flow key for each
new data path flow that should be created.  OVS also provides an
option to disable the kernel wildcarding, in which case the flows are
created without a mask.  When kernel wildcarding is disabled, the
datapath should use exact match, i.e. not wildcard any bits in the
flow key.  Currently, what happens with the userspace datapath instead
is that a datapath flow with mostly empty mask is created (i.e., most
fields are wildcarded), as the current code does not examine the given
mask key length to find out that the mask key is actually empty.  This
results in the same datapath flow matching on packets of multiple
different flows, wrong actions being processed, and stats being
incorrect.

This patch refactors userspace datapath code to explicitly initialize
a suitable exact match mask when a flow put without a mask is
executed.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 NEWS                       |   24 ++
 lib/classifier.c           |  662 ++++++++++++++++++++++++++++++++++++++++++--
 lib/classifier.h           |  152 ++++++++--
 lib/dpif-netdev.c          |   92 ++++--
 lib/flow.c                 |   12 +-
 lib/meta-flow.c            |   56 ++++
 lib/meta-flow.h            |    3 +
 lib/ofp-util.h             |    2 +-
 ofproto/ofproto.c          |    6 +-
 ofproto/ofproto.h          |    8 +
 tests/classifier.at        |   47 ++++
 tests/ofproto-dpif.at      |   45 ++-
 tests/test-classifier.c    |   17 +-
 vswitchd/bridge.c          |   40 ++-
 vswitchd/vswitch.ovsschema |    8 +-
 vswitchd/vswitch.xml       |   62 +++++
 16 files changed, 1159 insertions(+), 77 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list