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

70 Commits

Author SHA1 Message Date
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
fbb2ea0b5b classifier: Remove classifier_insert_exact().
This function doesn't provide any extra useful functionality.  It is
amenable to a slightly optimized implementation in the current classifier,
but not in the one that will soon replace it, so get rid of it.
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
Ben Pfaff
14608a1539 flow: Separate "flow_t" from "struct odp_flow_key".
The "struct odp_flow_key" used in the kernel datapath is conceptually
separate from the "flow_t" used in userspace, but until now we have
used the latter as a typedef for the former for convenience.  This commit
separates them.  This makes it possible in upcoming commits to change
them independently.

This is cross-ported from the "wdp" branch, which has had it for months.
2010-10-11 13:31:35 -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
Ben Pfaff
4e8e4213a8 Switch many macros from using CONTAINER_OF to using OBJECT_CONTAINING.
These macros require one fewer argument by switching, which makes code
that uses them shorter and more readable.
2010-10-01 10:25:29 -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
Jesse Gross
4b2db3840c classifier: Check all rules of equal priority when inserting.
When adding a new classifier rule we check if there is a rule
of the same priority first and overwrite it before inserting a
new rule.  Previously we would stop looking if we found one rule
in the correct bucket with the same priority, even if it didn't
match.  This keeps going until we either find a matching rule or
we run out of equal priority rules.

Reported-by: Tetsuo NAKAGAWA <nakagawa@mxc.nes.nec.co.jp>
2010-03-19 12:18:57 -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
63e60b866f hmap: Rename hmap_moved() to hmap_node_moved().
This prepares for adding a new function that deals with a "struct hmap"
moving, as opposed to a "struct hmap_node".

Since there was only a single call to this in the whole tree, and its
caller didn't have any callers of its own at all, also move this function
from hmap.h to hmap.c.
2010-01-28 16:06:31 -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