Commit Graph
27 Commits
Author SHA1 Message Date
Justin Pettit 1489ca2657 Add support for vendor-defined and variable-length actions.
Allow vendors to define their own actions.  Actions were originally fixed-
length, which was a bit constraining.  Actions now contain a length field,
which gives them more flexibility.
2008-10-03 16:44:13 -07:00
Justin Pettit 034f125955 Added lookup count to ofp_table_stats. 2008-09-18 19:47:27 -07:00
Justin Pettit e4cf5c4b82 Added OFPFC_MODIFY_STRICT flow mod command.
This cleans up the handling of modifying existing flows.  There now exists
OFPFC_MODIFY and OFPFC_MODIFY_STRICT commands, which have the same matching
characteristics to their OFPFC_DELETE* counterparts.  When adding a flow that
already exists, the counters and timers are now reset (ie, its treated as a
new flow).  This commit also adds the "--strict" option to dpctl to allow
strict matching for "mod-flows" and "del-flows".
2008-09-16 16:07:41 -07:00
Justin Pettit 57d5205765 Add support for OFPFC_MODIFY Flow Mod command.
The OFPFC_MODIFY command allows the controller to modify the actions of
existing flows.  When it does this, it does not reset counters or timers.
2008-09-15 15:27:04 -07:00
Justin Pettit 5f9d831715 Keep old stats when a Flow Add replaces an existing entry. 2008-09-12 18:57:21 -07:00
Justin Pettit 176265ed07 Use new method to describe table entries in OpenFlow wire protocol.
Older versions of OpenFlow pre-defined a few different types of tables and the
Features Reply message would indicate how many of those entries existed.  This
was very inflexible, so now the Features Reply just indicates how many tables
there are.  The controller now sends a Table Stats request to find out how
many entries are supported and the fields that can be wildcarded.

This change also removes the "buffer_mb" field from the Features Reply, since
it was not being used and seemed to be of limited value.
2008-09-10 13:03:25 -07:00
Ben Pfaff 9630e41005 Implement subnet mask matching in OpenFlow. 2008-08-18 14:26:50 -07:00
Ben Pfaff 7bee00fad9 Implement OpenFlow hard timeouts.
This updates the OpenFlow protocol version and changes the names of
structure members, so any software that uses OpenFlow will need to be
updated to match.
2008-08-07 15:19:31 -07:00
Justin Pettit 5caaf64f20 Properly track table match counts. 2008-08-06 01:58:15 -07:00
Ben Pfaff be25fa83e8 Merge branch 'locking' 2008-07-24 16:07:32 -07:00
Ben Pfaff f2232335ab Don't need 'deleted' member of struct flow.
Flow deletion is already fully serialized on dp_mutex.
2008-07-21 13:59:55 -07:00
Ben Pfaff 7d73c8bac5 Don't use atomic_t for tracking table flow counts.
Changes to n_flows is already fully serialized by dp_mutex.
2008-07-21 13:59:54 -07:00
Ben Pfaff 53e16ab6f3 Get rid of unnecessary synchronization in tables.
The table insert and delete functions are already fully serialized
on dp_mutex (and genl_mutex), so there's no need for them to use
additional spinlocks.
2008-07-21 13:59:54 -07:00
Ben Pfaff 47b8652dbe Simplify use of dp_mutex.
There was little point in taking the dp_mutex farther down in the
code than dp_genl_openflow, since that function is already completely
serialized by genl_rcv across the genl_mutex.  We could get rid of
dp_mutex completely, except that we still need it to serialize timeout.
2008-07-21 13:59:10 -07:00
Ben Pfaff b926a8f5e6 Fix build on Linux 2.6.26.
Linux 2.6.26 requires us to additionally include <linux/rculist.h>
to use RCU lists.
2008-07-19 16:14:18 -07:00
Ben Pfaff 4f8e1eb539 Fix buggy table-linear iterator function.
Apparently the linear table iteration had never really been tested,
since most flows go into table-hash.  It didn't work.  This fixes it.
2008-05-28 09:58:22 -07:00
Ben Pfaff bbf5f5607f When deleting flows, only insist on matching priority with strict matching.
(The code before this change would only ever delete flows if strict
matching was turned on.)
2008-05-07 15:23:45 -07:00
Ben Pfaff 726bd68327 Compile fix for Linux 2.6.26-rc1: don't use the removed list_for_each_safe_rcu macro.
There is no need for a "safe" version of the RCU list iteration macros,
because the ordinary version of the macros is "safe".  Linux 2.6.26-rc1
removed these "safe" versions, so this change modifies OpenFlow's uses
of these macros to use the ordinary versions.  This also simplifies the
code because we don't need to use the list_entry macros any longer.
2008-05-05 12:17:04 -07:00
Ben Pfaff 3ef905e11a Remove MAX_ACTIONS (which was 16) as a limit on the number of actions in a flow table entry.
Now the number of actions is limited, as a practical matter, to the size
of the buffer that the kernel provides for Netlink dumps, which is usually
4096 bytes.  A flow statistics entry must fit in a single one of these
buffers.  Actions are 8 bytes each, so this is about 500 actions
considering overhead.
2008-05-02 11:37:04 -07:00
Justin Pettit d1d2f3f321 - On flow entries with wildcards, match priority field when doing a "strict" delete.
- Remove group_id from flow entries.
- Show priority when print flow mod messages.
2008-04-29 15:00:28 -07:00
Ben Pfaff d8e826e291 Get rid of union in struct sw_flow, because only one member is ever used any longer. 2008-04-29 10:12:46 -07:00
Ben Pfaff db74f01873 Make dumping large numbers of flows possible.
This changes the kernel switch implementation to use the kernel Netlink
"dump" interface to allow flow stats that don't fit in the socket buffer
to be dumped gradually as the caller drains the socket buffer.

One of the changes here is a bug fix for nla_unreserve.  Because Netlink
attributes' lengths are rounded up to a multiple of 4 bytes, reducing
the length of the payload by N bytes doesn't necessarily reduce the
length of the skb by N bytes.  Instead, we need to know the original
length and final length of the attribute.  This means that using 'len'
as a difference in bytes doesn't really make sense, so this changes
'len' to be the new length of the attribute payload and renames the
function to nla_shrink to (IMO) better reflect what it is now doing.

Since we have to release the RCU read lock between calls to the dump
function, we need table iterators that persist across RCU epochs.  One
way to do this would be to add new "iterator_save" and "iterator_restore"
functions, but this seemed like overkill since there would then be a
total of 5 iterator functions that have only one user (flow stats dumping).
Instead, this patch refactors table iteration into a single "iterate"
function that takes a callback.  This simplifies the table iteration code
significantly.

This change also modifies dpctl to understand the new format of flow
stats.
2008-04-29 10:12:46 -07:00
Justin Pettit bfe3b4df89 - Add support for flow entry priorities.
- Fix "flow-add" action for dpctl.
2008-04-26 14:08:41 -07:00
Justin Pettit 541d0fee0d - Keep datapath config in host-byte order (and fix a couple of bugs related to this).
- Fix type for "get config" replies.
2008-04-16 14:09:27 -07:00
Ben Pfaff 60a87c9b00 Break data_hello and control_hello messages into multiple messages.
We want to allow multiple OpenFlow connections to a switch, so that
dpctl and other management tools can also connect to a switch that
is connecte to the controller.  These tools will want to fetch the
information in the data_hello message, but currently this can only
be done by sending a control_hello message, which changes the
switch configuration state.  So breaking the hello messages up into
multiple different messages, only some of which affect configuration
state, cures the problem.

Also, clean up the kernel datapath a bit, by adding helper functions
for allocating and resizing Generic Netlink messages that encapsulate
OpenFlow messages.
2008-04-04 16:22:21 -07:00
Justin Pettit de6e0a76a3 Update 2007 copyrights to include 2008. 2008-03-27 23:51:58 -07:00
Martin Casado 468e00132f Initial import 2008-03-04 13:12:53 -08:00