Commit Graph
667 Commits
Author SHA1 Message Date
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
Justin Pettit f8704c4470 Mark the "vlan_eth_header" struct as packed, because it's getting padded on some architectures.
-- Reported by GigaFin --
2008-05-06 22:20:58 -07:00
root a6c34acd7a Clean-up some compiler warnings related to printing numbers. 2008-05-05 18:49:10 -07:00
Ben Pfaff bcdd14c2d0 Fix a secure channel memory leak that appears only under high load. 2008-05-05 16:06:56 -07:00
Ben Pfaff 648ff09fff Fix memory leak in secure channel.
Thanks to Reid for noticing and helping to track down this leak.
2008-05-05 16:06:56 -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 e41a35b6ed Officially designate the v0.8.0 release. 2008-05-05 11:27:39 -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
Justin Pettit 2f009daf82 Clean-up OpenFlow main header a bit. 2008-05-04 21:05:51 -07:00
Justin Pettit 7d780b0571 Fix typo in comment. 2008-05-02 21:53:15 -07:00
Justin Pettit 349a316121 Finishing touches on v0.8.0 release candidate. 2008-05-02 21:51:02 -07:00
Justin Pettit e7b0a579de - Update man pages to reflect recent spat of changes.
- Clean-up man pages.
2008-05-02 21:46:39 -07:00
Justin Pettit 2e313fbdea Send the features request before the set config to be OpenFlow-compliant. 2008-05-02 17:43:39 -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 2f20865ed2 Convert tabs to spaces to fix indentation issues. 2008-05-01 17:04:44 -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 9e6949d69f Drop prototype for function that does not exist. 2008-05-01 17:02:31 -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
Ben Pfaff b9ef4eca41 Initialize n_flows member in table-hash.
Found by valgrind.
2008-05-01 17:02:31 -07:00
Ben Pfaff 1daf19850e Initialize rconn "connected" member.
Found by valgrind.
2008-05-01 17:02:31 -07:00
Ben Pfaff 4c411bcb40 New utility function xmemdup(). 2008-05-01 17:02:31 -07:00
Justin Pettit 3f5c2e0dad Add support for OFPP_TABLE virtual port to user-space switch. 2008-05-01 16:30:09 -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 2f6f9fc086 Fix problem displaying duration when printing flow stats. 2008-04-29 15:55:45 -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 3ee68a5b11 Fix openflow.h compilation with GCC 2.95.
Necessary because older Linux 2.4 releases will only compile with GCC 2.95.
2008-04-29 10:19:36 -07:00
Ben Pfaff 5ef980e9e2 Rename variables with duplicate names, so as to be less confusing.
Suggestion from Justin.
2008-04-29 10:18:45 -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 f60a0b20d6 BUG #6
Fix problem with "dpctl monitor" not working.

** Fix by Ben. **
2008-04-28 14:33:02 -07:00
Ben Pfaff b73abcfdc3 Add missing NLM_F flags constants (oops). 2008-04-28 14:16:57 -07:00
Ben Pfaff 25c6b13561 Enable the netlink library to dump more verbose debug output. 2008-04-28 13:52:48 -07:00
Ben Pfaff cacf0c4926 Make nl_sock_sendv properly implement 'wait' option. 2008-04-28 13:52:27 -07:00
Ben Pfaff 9b97611f42 Fix typo in comment. 2008-04-28 13:52:27 -07:00
Justin Pettit 44e9d4f5fc Clean-up related to supporting priorities...mostly suggestions from Ben. 2008-04-26 14:27:32 -07:00
Justin Pettit d7b253eaca BUG #5
Fixes crash when a non-existent command is given to dpctl.
2008-04-26 14:08:41 -07:00
Justin Pettit f1bfddabdb Print the configuration of the switch in addition to the features when "dpctl show" is run. 2008-04-26 14:08:41 -07:00