2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-28 21:07:47 +00:00

129 Commits

Author SHA1 Message Date
Ben Pfaff
193eb87453 classifier: New function cls_rule_equal(). 2010-11-22 09:40:34 -08:00
Ben Pfaff
f6acdb447e classifier: Remove classifier_for_each(), classifier_for_each_match().
These functions no longer have any users.
2010-11-15 15:10:03 -08:00
Ben Pfaff
5ecc9d8156 classifier: Add functions and macros for iteration, and use them in ofproto.
This is much more convenient in practice than being forced to use a
callback function.
2010-11-15 15:09:00 -08:00
Ben Pfaff
cd10ed7fb4 classifier: Delete dead code specialized for the exact table.
These functions and macros are no longer used.
2010-11-12 14:50:45 -08:00
Ben Pfaff
3c4486a5f7 classifier: Drop CLS_INC_* enumerations and related 'include' parameters.
This type and these parameters were useful when ofproto had the need to
separately traverse exact-match rules looking for subrules, but it no
longer does that because subrules (now called "facets") are not kept in
the classifier any longer.  All the callers are now passing CLS_INC_ALL
anyhow, so we might as well delete this feature and simplify the code.
2010-11-12 14:50:44 -08:00
Ben Pfaff
b63f2ea794 flow: Better abstract flow_wildcards and use it more widely. 2010-11-08 10:43:32 -08:00
Ben Pfaff
81c9dad242 classifier: Add more cls_rule_set_*() functions.
These will be handy later but are not used yet.
2010-11-08 10:43:32 -08:00
Ben Pfaff
64420dfac5 classifier: Move in-band set_<field>() functions publicly available.
These will be useful elsewhere later.
2010-11-08 10:43:31 -08:00
Ben Pfaff
cf3fad8a1b ofproto: Change ofproto_add_flow(), ofproto_delete_flow() to take cls_rule.
This is a small cleanup that will make later changes to wildcards easier.
2010-11-08 10:43:31 -08:00
Ben Pfaff
52ce26ee3b Rename cls_rule_zero_wildcards() to cls_rule_zero_wildcarded_fields().
Justin said that he found the shorter name confusing.
2010-11-08 10:36:26 -08:00
Ben Pfaff
f9bfea1402 ofproto: Generalize tun_id_from_cookie into flow_format.
Upcoming commits will add more flow formats, so this needs to be
an enumerated type instead of a bool.
2010-11-05 11:10:35 -07:00
Ben Pfaff
b5d97350cd classifier: Rewrite.
The old classifier was not adaptive: it required knowing the structure of
the flows that were likely to be in use to get good performance.  It is
likely that it degenerated to linear search in any real-world case.

This new classifier is adaptive and should perform better in the real
world.
2010-11-03 11:12:54 -07:00
Ben Pfaff
faa50f408b classifier: Change classifier_rule_overlaps() to take a cls_rule *.
There's no benefit to spelling out all of the components of a cls_rule
separately.  Just use cls_rule itself.
2010-10-29 09:53:51 -07:00
Ben Pfaff
76ecc72179 classifier: Change classifier_find_rule_exactly() to take a cls_rule *.
There's no benefit to spelling out all of the components of a cls_rule
separately.  Just use cls_rule itself.
2010-10-29 09:53:51 -07:00
Ben Pfaff
48c3de13be classifier: Merge classifier_lookup_wild(), classifier_lookup_exact().
Merge these functions into classifier_lookup() and update its interface.

The new version of the classifier soon to be implemented naturally merges
these functions, so this commit updates the interface early.
2010-10-29 09:53:51 -07:00
Ben Pfaff
e65dc5c57e classifier: Remove unused functions cls_rule_moved(), cls_rule_replace().
In preparation for rewriting the classifier, remove some functions that
nothing uses and have no tests.
2010-10-29 09:53:51 -07:00
Ben Pfaff
ae412e7dd8 flow: Get rid of flow_t typedef.
When userspace and the kernel were using the same structure for flows,
flow_t was a useful way to indicate that a structure was really a userspace
flow instead of a kernel one, but now it's better to just write "struct
flow" for consistency, since OVS doesn't use typedefs for structs
elsewhere.

Acked-by: Jesse Gross <jesse@nicira.com>
2010-10-11 13:31:43 -07:00
Justin Pettit
5db39d100c classifier: Add missing argument in CLASSIFIER_FOR_EACH_EXACT_RULE_SAFE
The CLASSIFIER_FOR_EACH_EXACT_RULE_SAFE macro was missing its "MEMBER"
argument.  It doesn't currently cause any problems because no one uses
the macro.
2010-10-08 11:19:02 -07:00
Ben Pfaff
35950f0cfa classifier: Introduce macros for iterating exact-match flows.
This special case of iterating through flows is easier and presumably
faster to implement using a macro.
2010-10-07 10:36:02 -07:00
Joe Perches
d295e8e97a treewide: Remove trailing whitespace
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-30 13:23:08 -07:00
Jesse Gross
659586efcf tunneling: Add support for tunnel ID.
Add a tun_id field which contains the ID of the encapsulating tunnel
on which a packet was received (0 if not received on a tunnel).  Also
add an action which allows the tunnel ID to be set for outgoing
packets.  At this point there aren't any tunnel implementations so
these fields don't have any effect.

The matching is exposed to OpenFlow by overloading the high 32 bits
of the cookie as the tunnel ID.  ovs-ofctl is capable of turning
on this special behavior using a new "tun-cookie" command but this
command is intentially undocumented to avoid it being used without
a full understanding of the consequences.
2010-04-19 09:11:51 -04:00
Ben Pfaff
02dd3123a0 Merge "master" into "next". 2010-02-24 13:47:09 -08:00
Justin Pettit
834377ea55 ofproto: Match on IP ToS/DSCP bits (OpenFlow 1.0)
OpenFlow 1.0 adds support for matching on IP ToS/DSCP bits.

NOTE: OVS at this point is not wire-compatible with OpenFlow 1.0 until
the final commit in this OpenFlow 1.0 set.
2010-02-20 02:22:28 -08:00
Justin Pettit
49bdc010df ofproto: Check overlap, emerg flow cache, and error code sync (OpenFlow 0.9)
This commit adds (some) support for a couple new OpenFlow 0.9 features:

    - The OFPFF_CHECK_OVERLAP flag in Flow Mod messages allows the
      controller to prevent flows that would conflict at the same
      priority.

    - An emergency flow cache that contains a small flow table that is
      used if the switch loses connectivity with the controller.  I
      believe the design has fundamental flaws and looks likely to be
      retired.  If a controller attempts to add a flow to the emergency
      flow cache, OVS always responds that the tables are full.

The OpenFlow 0.9 error codes are also sync'd in the commit.

NOTE: OVS at this point is not wire-compatible with OpenFlow 0.9 until the
final commit in this OpenFlow 0.9 set.
2010-02-20 02:22:27 -08:00
Justin Pettit
959a2ecdc8 ofproto: Match VLAN PCP and rewrite ToS bits (OpenFlow 0.9)
Starting in OpenFlow 0.9, it is possible to match on the VLAN PCP
(priority) field and rewrite the IP ToS/DSCP bits.  This check-in
provides that support and bumps the wire protocol number to 0x98.

NOTE: The wire changes come together over the set of OpenFlow 0.9 commits,
so OVS will not be OpenFlow-compatible with any official release between
this commit and the one that completes the set.
2010-02-20 02:22:26 -08:00
Ben Pfaff
68d1c8c3c3 classifier: New function cls_rule_to_string().
This may be useful for debugging.

From Jean Tourrilhes <jt@hpl.hp.com>.
2010-02-12 13:55:47 -08:00
Ben Pfaff
318e2e6d60 classifier: Improve comments. 2009-11-24 09:59:54 -08:00
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00