Commit Graph
81 Commits
Author SHA1 Message Date
Justin Pettit b7f66c424f Pull configuration information from DMI.
Pull configuration information from DMI when available.  In its current form,
it will only use DMI information set by Nicira.  Otherwise, it will use default
values.  This change also makes DPIDs the same as the MAC address of the
local OpenFlow device.
2008-10-30 16:23:27 -07:00
Ben Pfaff 6b617bac12 Move exported headers to include/openflow, private headers to lib/.
This makes it easier to install the headers, or to use them directly from
another software package with -I$(openflow)/include, without invading
the top-level include file namespace.
2008-10-29 15:15:45 -07:00
Justin Pettit 2f58a5d003 Fix crash when SNAT support is built and traffic is in-band.
In order to make netfilter happy, we have to create a fake routing table
entry.  Unfortunately, the kernel really doesn't like this when it actually
needs to make use of it.  This code now removes the link between the packet
and the fake routing entry when the packet is being sent to a local port.
2008-10-21 17:16:46 -07:00
Ben Pfaff 4a4424a739 Support up to 0xff00 ports in OpenFlow, without changing the implemented max. 2008-10-14 10:53:27 -07:00
Justin Pettit 94f287969d Add support for Source-NAT to Linux 2.6 datapaths.
To enable SNAT, run configure with the "--enable-snat" flag.  This has
only been tested with the 2.6.23 kernel...more diverse testing will follow.
Documentation and a cleaner build setup will also be in a future check-in.
2008-10-11 00:30:02 -07:00
Justin Pettit 9073578e38 Free sk_buffs with kfree_skb() instead of just kfree(). 2008-10-10 15:06:43 -07:00
Justin Pettit 4d0a329652 Unconditionally set skb->dev in dp_set_origin.
If an invalid port index was used in dp_set_origin, the value of skb->dev
was left unchanged.  This change causes skb->dev to be set to NULL in those
circumstances.  This makes Packet Out and Add Flow messages that use a
buffer id behave like Packet Out without a buffer id.
2008-10-06 15:51:06 -07:00
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 9da88ee2ad Modify OpenFlow commands related to ports to be more expressive.
This new OpenFlow message format provides a cleaner interface and greater
detail and control over ports.  It is now possible to see what features
the switch's port is currently configured as having, what it's advertising,
and what it's capable of handling.  It is also possible to return the
features advertised by the port's peer.
2008-09-22 15:18:22 -07:00
Justin Pettit 1400bbb7eb Use device notifier in Linux kernel switch for detecting port status changes.
To report on link status and whether a port is administratively enabled or
disabled, the reference switches poll.  This change uses the Linux kernel's
device notification system, so that polling isn't necessary.
2008-09-19 16:10:28 -07:00
Justin Pettit 034f125955 Added lookup count to ofp_table_stats. 2008-09-18 19:47:27 -07:00
Ben Pfaff 4da0bed334 Make "controller nl:0" work again, by fixing a layering violation.
The kernel datapath was claiming that it implements STP, which is untrue.
In fact, the secchan implements STP, so if the secchan was not running
the STP support did not work.  Thus, "controller nl:0" would do the
wrong thing.

This makes the secchan edit the responses from the datapath to claim
STP support.
2008-09-16 16:56:37 -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
Ben Pfaff 9c1b16772c Implement OFPT_HELLO simple version negotiation. 2008-09-15 14:29:53 -07:00
Justin Pettit 6026cfb7ab Fix broken stat requests over netlink.
A recent change (696db2) modified the way stats were being sent over the
netlink socket.  Unfortunately, the responder set the transaction id to the
type, which caused the requestor to ignore the repsone.
2008-09-14 23:05:37 -07:00
Ben Pfaff 39136b0fb9 Make switches send error messages when they receive a bad request. 2008-09-10 13:22:25 -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 b5e9402df5 Implement 802.1D Spanning Tree Protocol. 2008-09-09 14:15:57 -07:00
Justin Pettit 7d7d973d8b Add serial number to description status message. 2008-09-03 17:51:42 -07:00
Ben Pfaff 637bae3222 Make OpenFlow kernel module print protocol version. 2008-08-28 09:54:50 -07:00
Justin Pettit a9485e1c39 Fix a couple of typos. 2008-08-22 13:21:58 -07:00
Justin Pettit f1c6daebf3 Send PORT_STATUS messages on port and link changes. Add ability to remotely enable and disable a port through the PORT_MOD message. 2008-08-22 12:47:54 -07:00
Ben Pfaff 9630e41005 Implement subnet mask matching in OpenFlow. 2008-08-18 14:26:50 -07:00
Justin Pettit fc13a47f4d Use a consistent naming convention for counts. 2008-08-17 23:15:21 -07:00
Justin Pettit d6a1e67a8d Add stats message that allows querying description of components in OpenFlow. 2008-08-16 09:43:05 -07:00
Justin Pettit b41a6a0a6d Added new interface statistics. 2008-08-14 23:12:37 -07:00
Justin Pettit 0226bbc742 Switch to new packet-out format and add OFPP_IN_PORT.
The original packet-out format allowed multiple actions to be specified for
buffered packets, but only a destination port for messages including data.
This change makes packet-out more consistent by allowing multiple actions
regardless of how the packet is stored.

This change also disallows sending packets through the incoming port without
explicitly using the OFPP_IN_PORT virtual port.
2008-08-14 00:07:18 -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
Ben Pfaff 2a6dc4f319 Reduce redundancy in datapath code. 2008-08-07 10:34:37 -07:00
Ben Pfaff 6ca5840e48 Fix memory leak when OFPP_TABLE is used for a packet that matches no flow. 2008-08-07 10:23:06 -07:00
Justin Pettit 5caaf64f20 Properly track table match counts. 2008-08-06 01:58:15 -07:00
Justin Pettit 15c94784de Export the "dp_mutex" symbol, since it's needed by the hardware tables. 2008-07-28 16:08:37 -07:00
Ben Pfaff be25fa83e8 Merge branch 'locking' 2008-07-24 16:07:32 -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 988b8ef729 Get rid of useless use of rcu_read_lock.
These code paths are fully protected by the Generic Netlink genl_mutex,
which is taken by genl_rcv() that calls dp_genl_openflow(), so there is
no need for them to take the rcu_read_lock.
2008-07-21 13:26:37 -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 88df6edbfa Drop "benchmark" netlink message and "benchmark-nl" dpctl command.
The new OFPT_ECHO_REQUEST and OFPT_ECHO_REPLY OpenFlow messages
have the same functionality and are more general (in that they
are not Netlink-specific).
2008-07-01 10:59:04 -07:00
Ben Pfaff 258f32a084 Respond to echo requests in OpenFlow implementations.
Nothing yet sends such requests.  This is preparation for their
use in following commits.
2008-07-01 10:51:50 -07:00
Justin Pettit 58dc4ead3b Fix VLAN modification action in kernel switch.
A number of errors were uncovered when we actually tried playing with VLAN tags on real traffic.  This fixes endian, sk_buff, and other issues.  Unrelated to VLAN tagging, this also protects some printk calls with net_ratelimit.
2008-06-25 23:22:39 -07:00
Ben Pfaff bc96a226a9 Drop "send_openflow_skb: send failed: -3" warning.
This message appeared in the normal course of OpenFlow usage when
a packet arrived on an OpenFlow interface and no secure channel
was running, or if packets arrived too fast for the secure channel
to process them.  It confused more people than it assisted, so drop
it.
2008-06-23 14:08:37 -07:00
Ben Pfaff 6787fab28f Fix "waiting for of0 to become free" message on deldp.
Thanks to Murphy for help debugging this.
2008-06-05 13:38:09 -07:00
Ben Pfaff fc51dcfff9 Don't oops on deldp, by avoiding use-after-free on net_bridge_port. 2008-06-02 20:18:38 -07:00
Ben Pfaff 0b75446a26 Don't try to destroy dp_dev while the local port holds a reference to it.
Fixes a message output at deldp time:
unregister_netdevice: waiting for of0 to become free. Usage count = 1

Thanks to Murphy and Justin for reporting this bug.
2008-06-02 20:18:38 -07:00
Ben Pfaff 26e5b3af27 Avoid wild pointer write in del_switch_port(). 2008-06-02 20:18:38 -07:00
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 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
Ben Pfaff a0fd7dde11 Add-on hardware tables initial implementation.
Incorporates suggestions from Justin.
2008-05-14 22:18:36 -07:00
Justin Pettit 5f4a12ce38 Implement the OFPP_ALL virtual port.
-- Reported by Brandon H. --
2008-05-09 11:24:04 -07:00
root a6c34acd7a Clean-up some compiler warnings related to printing numbers. 2008-05-05 18:49:10 -07:00