Commit Graph
667 Commits
Author SHA1 Message Date
Justin Pettit 6df83df15e Add support for deleting flow entries with "del-flows" command in "dpctl". 2008-04-26 14:08:41 -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 1cd415531c Fix problem where the add_flow command is reading an unitialized array. 2008-04-26 14:08:41 -07:00
Ben Pfaff 9b45107fb7 Improve list traversal macros.
Make LIST_FOR_EACH[_SAFE] variable take logically correct value upon loop termination.

Also, add regression tests for linked list routines, to ensure that this
change does not break code.

Also, add new macro LIST_FOR_EACH_REVERSE.
2008-04-26 14:03:16 -07:00
Ben Pfaff a3505dd08f Add missing header to Makefile.am. 2008-04-26 09:13:31 -07:00
Ben Pfaff c3e9dac408 Drop stray debug messages. 2008-04-24 19:08:52 -07:00
Ben Pfaff c5f976a78f Get rid of build dependency on netlink-related headers from Linux 2.6.
This fixes userspace program build problems on top of systems with
Linux 2.4 headers.
2008-04-24 16:29:53 -07:00
root 9d3ea3b581 Fix problem in sending netlink messages on non-32-bit platforms.
** Fix provided by Ben. **
2008-04-24 11:37:54 -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
root cdd0a5ba36 Tolerate ENOBUFS from kernel netlink code in second call to recvmsg.
The Linux kernel returns ENOBUFS to userspace code to indicate that
a netlink message that the kernel wanted to send could not be due to
a lack of buffer space.  We checked for this and dealt with it in
one recvmsg call but not in another.  This change tolerates it in
both places.

Should fix a problem encountered on the OF6k under "hping3 --flood".

** This fix was done by Ben. **
2008-04-23 15:20:58 -07:00
Ben Pfaff 15bf0e0b5d Support NETLINK_ADD_MEMBERSHIP even when compiled with old kernel headers.
Commit 0a9024a2d7, "Changes based on feedback from GigaFin," added support
for compiling on a system that lacked up-to-date Linux kernel headers, by
dropping support for a feature only in newer kernels on such a system.
But the code already supported such a system properly; only the lack of
a macro definition kept it from compiling.  So define the macro ourselves
instead of disabling the feature.

To elaborate, there are two issues here.

The first is kernel support for NETLINK_ADD_MEMBERSHIP.  Older
kernels don't support this.  But NETLINK_ADD_MEMBERSHIP was added
at the same time as support for more than 32 netlink multicast
groups.  Netlink multicast groups numbered less than 32 can be
subscribed using a different mechanism, and in fact we do that
for such groups.  Thus, attempting to use NETLINK_ADD_MEMBERSHIP
on an older kernel basically can't happen, and if it did it would
be a bug in the OpenFlow kernel module for telling userspace to
subscribe to a multicast group that cannot exist on that kernel.

The second is the kernel headers that the userspace programs are
compiled with.  Without the change quoted below, the userspace
programs will silently fail if they are compiled with 2.4.x
headers and then run on a 2.6.x kernel and given a multicast
group numbered above 32, because they will not even try to
subscribe to that group.  With the change, the userspace programs
will work properly when run on 2.4.x or 2.6.x kernels regardless
of the multicast group number and regardless of whether the
headers they were compiled against were from 2.4.x or 2.6.x.
2008-04-23 14:25:27 -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
Ben Pfaff b5b2cd3880 Mark functions not meant to be exported as static. 2008-04-22 17:48:22 -07:00
Justin Pettit fc2925fecf Add priority field to flow_mod...code to support this forthcoming. 2008-04-21 18:13:42 -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 95a73db4c2 Mark structures as packed that cause alignment problems on architectures like ARM. 2008-04-21 13:46:36 -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 928a5ae0c1 Fix call from vfprintf to fprintf, which could cause seg faults. 2008-04-16 16:49:42 -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 17c21631d5 Use new OpenFlow protocol versioning scheme. 2008-04-16 10:39:21 -07:00
Justin Pettit d485c3f0ce Finish removing references to the MAC table. 2008-04-15 13:42:35 -07:00
Ben Pfaff 6f8d45bf7d Merge remote branch 'repo/master' into stats
Conflicts:

	datapath/table-mac.c
2008-04-15 09:57:38 -07:00
Ben Pfaff 5bb08bc0ef Expand tabs to spaces in dp_send_flow_stats.
Suggested by Justin.
2008-04-15 09:56:49 -07:00
Ben Pfaff d2552c15f3 Make table_id in OpenFlow messages 8 bits, since 255 should be enough.
Suggested by Justin.
2008-04-15 09:56:46 -07:00
Ben Pfaff 0a1a667973 Make duration in ofp_flow_stats a 32-bit quantity (instead of 16).
Otherwise duration is capped at under 24 hours.

Suggested by Justin.
2008-04-15 09:56:41 -07:00
Ben Pfaff b9cdc64135 Add missing calls to htons/ntohs in accesses to miss_send_len.
Thanks to Justin for pointing out the problem.
2008-04-15 09:56:36 -07:00
Justin Pettit bbbc6bc992 MIPS fixes based on suggestions from Jiang. 2008-04-14 00:10:48 -07:00
Justin Pettit e28564c5fa Add support for OFPP_TABLE virtual port. 2008-04-11 17:40:05 -07:00
Justin Pettit 00529de1f0 Fix compilation error in 2.4.20 kernels. 2008-04-11 14:40:29 -07:00
Justin Pettit 6d188895dc Remove MAC table support. 2008-04-10 18:31:44 -07:00
Justin Pettit 2989e654ac Fixes to configure script based on suggestions from GigaFin. 2008-04-10 16:51:46 -07:00
Justin Pettit 0a9024a2d7 Changes based on feedback from GigaFin. 2008-04-10 15:50:25 -07:00
Justin Pettit 2e00e6fb49 Fixed minor tab/spaces issue. 2008-04-08 00:10:08 -07:00
Ben Pfaff 149893aeeb Don't read info->attrs[DP_GENL_A_OPENFLOW] twice, unnecessarily. 2008-04-07 13:55:47 -07:00
Ben Pfaff f6cae73ec3 Implement OpenFlow statistics in switches and in dpctl.
This has two notable omissions.  First, only at most 4k of flow statistics
are reported.  Second, aggregate statistics are not yet supported.  Both
of these are fairly easily fixable, just not fixed yet.
2008-04-04 16:22:40 -07:00
Ben Pfaff 4fc7e7d11f Send replies to OpenFlow requests only to the sender. 2008-04-04 16:22:23 -07:00
Ben Pfaff f30d8168a7 Factor out parsing vconn-ssl options. 2008-04-04 16:22:23 -07:00
Ben Pfaff a14c841f32 Factor out printing the list of available vconns. 2008-04-04 16:22:23 -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
Ben Pfaff ae3f2361b6 Allow secchan to listen for management connections also.
This is needed in the userspace switch code also.  That
change is implemented in later change "Send replies to
OpenFlow requests only to the sender".  Really that part
of the change should be moved into this one, but intervening
changes are intertwined enough with the same code to
make that difficult.
2008-04-04 16:20:55 -07:00
Ben Pfaff 14da11884d Rename controller_connection to rconn and use it in secchan also.
Also, clean up code and add comments.
2008-04-04 16:20:55 -07:00
Ben Pfaff 3140992bb7 Make vconn-tcp log an error when the connection drops mid-packet. 2008-04-04 16:20:55 -07:00
Ben Pfaff 8240e9cdc7 Make vconn log all incoming and outgoing OpenFlow packets at debug level. 2008-04-04 16:20:55 -07:00
Ben Pfaff c2fa32706e Add new functions for pretty-printing an OpenFlow message to a string.
This makes it possible to send pretty-printed versions of OpenFlow
messages to vlog.
2008-04-04 16:20:55 -07:00
Ben Pfaff 0a0a1dbe4c Add vlog functions and macros for testing whether a module and level are enabled. 2008-04-04 16:20:54 -07:00
Ben Pfaff f57b5979f4 Fix bug in vconn-tcp, vconn-ssl that prevented minimum-length OpenFlow packets from being received correctly. 2008-04-04 16:20:54 -07:00
Ben Pfaff c985123c3c Fix logic bug in userspace switch that could cause reading invalid memory.
Also, fix comment.
2008-04-04 16:20:54 -07:00