Commit Graph
178 Commits
Author SHA1 Message Date
Ben Pfaff 59ba307325 Make the OFPP_LOCAL port work in the kernel OpenFlow implementation. 2008-05-28 10:46:54 -07:00
Ben Pfaff 94ce314ecb Get rid of obsolete, commented-out debugging code in datapath.c. 2008-05-28 09:58:22 -07:00
Ben Pfaff 253d1704aa Always do exact-match on undefined flow fields, so that such flows can be in table-hash. 2008-05-28 09:58:22 -07:00
Ben Pfaff e5ccf3cc8b Don't allow CONFIG_PREEMPT with Linux 2.6.x before 2.6.21, because it's busted. 2008-05-28 09:58:22 -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 dfdde7a55f Don't ever send frames on OpenFlow devices to the host stack.
On Linux 2.6 only, we would send frames received on OpenFlow devices to
the host TCP/IP stack if the dest Ethernet address matched the device's
Ethernet address (or under some other conditions).  This caused confusion
when the host stack was configured for forwarding, because received IP
packets would be forwarded to other interfaces with IP addresses even if
the device on which they were received was configured with no IP address.
(This was discovered by Murphy.  Thanks Murphy!)

This change drops this "feature".  A more or less equivalent feature that
may be less prone to confusion and which works on any kernel version will
be added in a future commit via the of%d device.

This also allowed factoring out common code from the bridge hooks.
2008-05-27 17:42:40 -07:00
root 10d1259a9b - When deleting an entry, remove the entry from "iter_node" as well as "node".
- Clean code up a bit to make it more consistent.
2008-05-22 21:38:16 -07:00
Justin Pettit e8a84e56c9 - Add Stanford License.
- Remove unnecessary printk.
2008-05-20 12:44:56 -07:00
Justin Pettit b968c34567 Make sure destroy function was defined before trying to call it. 2008-05-20 12:43:19 -07:00
Ben Pfaff a0fd7dde11 Add-on hardware tables initial implementation.
Incorporates suggestions from Justin.
2008-05-14 22:18:36 -07:00
Justin Pettit df50f327ff Remove definition of unused function "hash_in6". 2008-05-14 17:06:12 -07:00
Justin Pettit 7a1d4f038d Fix problem with identifying SNAP frames when extracting flows.
The ssap field was being checked twice to see if it was SNAP, when one of the checks should have been dsap.
2008-05-14 15:50:30 -07:00
Justin Pettit 03addaad57 Don't try to use the IP addresses from ARP packets when matching. 2008-05-10 00:45:06 -07:00
Justin Pettit d22fc1ef68 IPv6 is not supported in OpenFlow, so don't try to parse it. 2008-05-10 00:27:13 -07:00
Justin Pettit 3cf996b4cd Zero-out invalid fields when extracting a "match" and transforming it into a "flow".
When the controller wishes to add a flow entry to the switch, it sends a request with a description of matching flows in a "match".  The switch was adding these exactly as described into the flow tables.  However, when packets arrived, all invalid fields (e.g., the TCP/UDP ports in a non-TCP/UDP packet) are set to zero.  If the rule being added by the controller had not set these invalid fields to zero, the packets would never match.  We now zero out these fields when extracing a "match".

-- Reported by Brandon H. --
2008-05-09 11:24:04 -07:00
Justin Pettit 5f4a12ce38 Implement the OFPP_ALL virtual port.
-- Reported by Brandon H. --
2008-05-09 11:24:04 -07:00
Ben Pfaff c8e4cbbd3a Treat flows without any wildcards as maximum priority.
Otherwise, we give the table implementations the opportunity to screw up
by distinguishing between two flows without wildcards but with apparently
different priorities that are required to be treated as the same priority.
2008-05-07 15:23:45 -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
root a6c34acd7a Clean-up some compiler warnings related to printing numbers. 2008-05-05 18:49:10 -07:00
Ben Pfaff ff9464d2ad Fix compilation on Linux 2.6.20: declare NLMSG_DEFAULT_SIZE with this kernel.
NLMSG_DEFAULT_SIZE was introduced in 2.6.20-rc1 in commit 339bf98ff,
"[NETLINK]: Do precise netlink message allocations where possible", but
we only defined it for kernels 2.6.18 and earlier.  This change fixes
up the discrepancy.
2008-05-05 14:56:28 -07:00
Ben Pfaff 510763c801 Support pre-Linux 2.6.20 genetlink, which didn't have "done" functions for dumps. 2008-05-05 14:56:28 -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
Justin Pettit f4c3fbc94d Check whether kernel has been configured by "version.h" instead of "utsrelease.h", since that convention wasn't introduced until 2.6.18. 2008-05-05 11:36:15 -07:00
Justin Pettit 0b22dde033 Get rid of compiler warning under gcc 4.2. 2008-05-04 22:29:48 -07:00
Justin Pettit d54088ba92 Fix problem introduced by kernel threads when building for 2.4.20. 2008-05-04 21:07:24 -07:00
Ben Pfaff 98657c45e9 Add build directory to include path.
Otherwise generated headers (forward_t.h) will not be found at build
time.
2008-05-02 17:33:34 -07:00
Ben Pfaff 04da964606 Suppress Automake warnings about GNU make extensions in Modules.mk files. 2008-05-02 17:10:12 -07:00
Ben Pfaff f7bf3916ff Implement aggregate flow statistics in kernel and userspace switches. 2008-05-02 16:58:33 -07:00
Ben Pfaff 53cceda7ad Reduce spurious recompilations for Linux 2.4 datapath.
We need object files to depend on the build directories, so that the
build directories get created before we try to output files into them.
But making them depend directly on the build directories means that
whenever a build directory changes (including any change to the set of
files inside it) all the source files get recompiled.  So, instead, make
them depend on dummy files inside the directories, which will only get
modified if someone does it intentionally.
2008-05-02 15:51:08 -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
Ben Pfaff 4f5b4efc54 Send actions as part of flow statistics messages. 2008-05-02 10:58:53 -07:00
Ben Pfaff 2e12784892 Add max_idle field to flow stats messages. 2008-05-02 10:58:52 -07:00
Justin Pettit 917160e384 - Add priority to flow expiration messages.
- Clear contents of "pad" field port status messages.
2008-05-01 17:11:29 -07:00
Ben Pfaff 3b9c97ee01 Implement new statistics format in kernel and userspace switches.
This change really cuts the muster!
2008-05-01 17:04:44 -07:00
Ben Pfaff f8416ecdee Clear padding bytes in fill_flow_stats(), to avoid state leakage.
Found by valgrind.
2008-05-01 17:02:31 -07:00
Justin Pettit 66b5c90376 - Add support for OpenFlow error message type.
- Ensure OpenFlow messages fit in 16-bit length field.
2008-04-30 17:38:03 -07:00
Ben Pfaff 93c6fe87d7 Revamp OpenFlow kernel module build system.
The new build system supports using a build tree separate from the
source tree, which makes it easier to build for multiple targets
using a single source tree.  It also factors out the means for specifying
the modules to be built and the source files that comprise those
modules into simple files named Modules.mk.  This is intended to
make it easier to add support for separate hardware table modules in
an upcoming commit.
2008-04-29 18:34:47 -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
root ba858d3ec5 CHECKSUM_COMPLETE and CHECKSUM_PARTIAL were added Linux 2.6.19, so update the compatiblity layer to reflect this. 2008-04-23 15:48:56 -07:00
Ben Pfaff 800a8d91cb Handle memory allocation failure in dp_output_control().
Possible fix for bug observed on OF6k.
2008-04-23 12:24:32 -07:00
Justin Pettit 72188350c9 Fix tab/space issue. 2008-04-21 17:59:44 -07:00
Justin Pettit 25a6a99f6d BUG #4.
Don't use kmalloc with GFP_KERNEL within an rcu_read_lock().
2008-04-21 17:56:12 -07:00
Justin Pettit 30217c8a48 Fix a problem with not allocating enough room for netlink messages. 2008-04-16 18:26:47 -07:00
Justin Pettit 0d3a0643c4 Switch from "stat" to "stats" everywhere. 2008-04-16 15:38:25 -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
Natasha Gude 8623e6c16e Updated version references to OFP_VERSION 2008-04-16 11:30:55 -07:00
Justin Pettit d485c3f0ce Finish removing references to the MAC table. 2008-04-15 13:42:35 -07:00