Commit Graph

119 Commits

Author SHA1 Message Date
Rob Sherwood 9b78488f60 unbroke kernel datapath build
* split durration into secs and nsecs for updated flow_remove
2009-12-11 18:17:45 -08:00
Mikio Hara f72223e66a Specify port number when requsting port stats
Enable the port stats for a particular port to be requested by
specifying a port number. Can request all port stats by specifying
OFPP_NONE for the port number.
2009-12-11 15:43:37 -08:00
Mikio Hara 1c9b2f7b2d IPv4 DSCP match: Add IPv4 DSCP field match feature
Note: Now regression test sets *and* tests the IPv4 DSCP bits.  Test
script was renamed from test_set_nw_tos to test_set_n_match_nw_tos.
2009-12-11 15:43:36 -08:00
Rob Sherwood 20634da473 added dp_desc field to ofp_stats_desc
added a human readable string to ofp_stats_desc to describe
the datapath, e.g., "switch4 in closet 3b of Gates"

* updated openflow.h
* updated udatapath: defaults to "$HOSTNAME pid=$$"
* updated kernel datapath: defaults to "$HOSTNAME idx=$i"
* updated wireshark plugin
* added regression test for ofp_desc_stats
* addressed KK's review comments from:
    https://mailman.stanford.edu/pipermail/openflow-dev/2009-December/000545.html
2009-12-11 15:43:35 -08:00
Mikio Hara 31a507fedc Adapt kernel datapath to new netdevice ops scheme
Note: 2.6.29 to 2.6.30 kernel provides CONFIG_COMPAT_NET_DEV_OPS,
so we recommend that use this option except 2.6.31 and higher kernel.
2009-10-21 11:35:30 -07:00
Glen Gibb 17af341ffe Don't perform 64-bit division in kernel
Replace 64-bit division (using '/') to call to do_div. This function is
designed for use in the kernel.
2009-10-15 14:14:47 -07:00
Glen Gibb ea288488c8 Replace ns_flow_end with ofp_flow_removed
datapath/udatapath now sends ofp_flow_removed messages instead of
nx_flow_end. This allows for the removal of secchan/flow-end.* as
flow-end message now no longer need to be translated.
2009-10-14 15:56:37 -07:00
Glen Gibb d1957f2054 s/nx_flow_end_reason/ofp_flow_removed_reason/g
Replaced references to custom Nicira flow end reason and replaced with
OpenFlow flow removed reason.
2009-10-14 15:56:36 -07:00
Glen Gibb ec0c97d6a1 Removed send_flow_end field from datapath struct
send_flow_end was a hold-over from 0.8.x releases. Version 0.9 removed the
datapath-wide send flow mod expire flag and replaced it by a per-flow flag.
This field was used by the NetFlow code to force notification of expires.
2009-10-14 15:56:36 -07:00
Mikio Hara 59c9a188d6 Cosmetic change: Made use of definition instead of raw value 2009-07-16 12:53:19 -07:00
Mikio Hara 3f3dc5f1fc Remove experimental XEN adaptation 2009-07-16 09:26:26 -07:00
Mikio Hara 623e899a93 Bug fix: Restore 64-bit struct alignment
Commit 238c5065 (Vlan pcp match: Reorder VLAN priority field...)
changed ofp_match from 36B to 40B, breaking the 8B alignment of a
number of structs.  This commit modifies those structs to at least
pass the assertion tests and regression tests.
2009-07-16 09:23:19 -07:00
Mikio Hara ad94e12a04 Change meaning miss_send_len of set config and max_len field of output
action

If "max_send_len" (or the "max_len" field for the controller output
action) is zero, then send a packet-in with zero bytes of the packet
data.
2009-07-15 09:47:15 -07:00
Mikio Hara 36a60a74fc Emergency flow cache: Suppress flow removed notification for flows in
emergency flow table, add logic to emergency flow to reject entries
with timer
2009-07-11 21:02:04 -07:00
Mikio Hara 9b3b165270 Change manufacturer information 2009-07-02 05:46:48 -07:00
Mikio Hara 292ffb1f39 Barrier command: Add new protocol messages: barrier request and reply
When a switch receives a barrier message it must first complete all
commands sent before the barrier message before executing any commands
after it. When all commands before the Barrier message have completed,
it must send a barrier reply message back to the controller.
2009-06-29 11:21:40 -07:00
Mikio Hara 1ae2cd3781 Start port enumeration: Change OpenFlow start port enumeration at 1 2009-06-29 10:02:02 -07:00
Yiannis Yiakoumis a47208dc76 Flow mod behavior: Add a new flag to flow mods and flow conflict
detection handler for table maintanance

Add a CHECK_OVERLAP flag to flow mods which requires the switch to do
the (potentially more costly) check that there doesn't already exist a
conflicting flow with the same priority. If there is one, the mod
fails and an error code is returned.

Flow expiry: Record OFPFF_SEND_FLOW_EXP flag in user data path
2009-06-29 10:00:55 -07:00
tyabe dde4979698 Vlan pcp match: Implemented on datapath and udatapath 2009-06-29 07:27:42 -07:00
Glen Gibb 500fb599be Flow expiry: Send flow exp if the flow's send_exp flag is set 2009-06-29 07:04:48 -07:00
Glen Gibb 44d43c2988 Flow expiry: Add send_flow_exp to nx_flow_end msg
Need to pass message that indicates whether to send flow expiry message
to the controller.
2009-06-29 07:04:02 -07:00
Glen Gibb ad42ba0b93 Flow expiry: Added idle_timout to nx_flow_end struct
Extra field added to struct
Padding field split
Populate idle_timeout in dp_send_flow_end funcs
2009-06-29 06:59:05 -07:00
Mikio Hara 58ee7f213f Emergency flow cache: Add emergency flow cache framework
Emergency flow cache use completely separate flow table from working
and its table ID for stats is 0xfe.
2009-06-29 06:57:37 -07:00
Mikio Hara 9cf6bcdd04 Add vendor extension stats hook patches from HPL (jt@hpl.hp.com)
vendor_stat: This is a patch that add vendor stats primitive and
reorganise the flow creation process. It does not add any
functionality, it just make it easier for us to add our own hooks.
2009-06-29 06:43:02 -07:00
Mikio Hara 43f19193fb Remove experimental SNAT (source NAT) support 2009-06-29 05:33:18 -07:00
Mikio Hara 5ff6ec248d Change code base to Nicira's master branch 2009-06-29 05:03:42 -07:00
Mikio Hara 695db2964e Change code base to Nicira's for-nox/0.4 branch
Remove monolithic OpenFlow switch.
Add userspace datapath.
Fix BUG#13: Revise check wildcards for in_port != out_port output
validation.
Fix BUG#30: Made use of get_jiffies_64 instead of jiffies.
Fix BUG#31: Fix NetFPGA crash in case of test_delete test harness run.
Fix BUG#32: Add stack depth limitation to avoid inifinite loop in
log_backtrace.
Fix BUG#33: Improve NetFPGA kernel extension and NetFPGA image to
support MAC address rewrite features (two actions) on NetFPGA enabled
OpenFlow switch.
Fix BUG#34: Add NetFPGA kernel extension source codes to create
distribution package with NetFPGA correctly.
Fix BUG#38: Improve regression test for FLOW_MOD ACTION SET_DL_SRC and
SET_DL_DST.
Fix BUG#39: Correct misunderstanding of byte order ops for OFPAT_XXX.
2009-06-29 05:02:16 -07:00
Mikio Hara 761bde8d08 Fix BUG#14.
Check DMI strings for NULL.
Avoid pointer arithmetic on possibly-NULL pointer.
2009-01-26 13:21:19 -08:00
Justin Pettit 75f7b917bc Add support for listing and deleting entries based on an output port.
To support this, an "out_port" field has been added to the "ofp_flow_mod",
"ofp_flow_stats_request", and "ofp_aggregate_stats_request" messages.  If an
"out_port" contains a value other than "OFPP_NONE", it introduces a constraint
when matching.  This constraint is that the rule must contain an output action
directed at that port.  Other constraints such as ofp_match structs and
priorities are still used; this is purely an *additional* constraint.  Note
that to get previous behavior, though, "out_port" must be set to "OFPP_NONE",
since "0" is a valid port id.  This only applies to the delete and
delete_strict flow mod commands; the field is ignored by add, modify, and
modify_strict.
2008-12-02 00:48:28 -08:00
Ben Pfaff e21567dc0d Allow the datapath ID to be configured by changing the ofX MAC address.
Previously, you could change the MAC address but that had no effect on
the datapath ID, so that there was no way to change the datapath ID at all.
2008-11-26 22:26:42 -08:00
Ben Pfaff ad27c8ac82 Fix double-free: NF_HOOK sometimes frees the sk_buff passed in.
NF_HOOK is supposed to *always* consume the sk_buff passed in, either
internally or through the okfn argument.  We assumed that it never
consumed its sk_buff, which was OK in the case where it called okfn,
since our okfn (snat_pre_route_finish) never freed its sk_buff, but
not when one of the netfilter hooks dropped or stole the packet, because
then we'd assume that it still existed and free it a second time.

The other users of NF_HOOK in this file, in snat_skb() and
snat_skb_finish(), do not need to be fixed because they always pass a
copy of their sk_buff argument to NF_HOOK and expect it to be freed.
2008-11-13 12:45:38 -08:00
Ben Pfaff 2d82ee4e58 No need to test argument of kfree_skb() for non-null. 2008-11-13 12:45:38 -08:00
Ben Pfaff fba83e4033 Never free an skb that has been passed to genlmsg_reply().
genlmsg_reply() always consumes its argument, not just in the success case.
2008-11-13 12:45:38 -08:00
Ben Pfaff 8c1c06ba95 Use skb_copy_bits() to copy data that might not be pulled into headers. 2008-11-13 12:44:04 -08:00
Ben Pfaff 42841a1a87 Don't oops in dp_output_control() for skbs with null ->dev.
This shouldn't ordinarily happen, since normal packets are received from
a real device, but some packets can be spontaneously generated within
the switch and thus have null ->dev.  (Possibly that is itself a bug
that we should track down; not sure.)
2008-11-13 12:44:04 -08:00
Ben Pfaff cdbc9a4a81 When a packet arrives via bridging, clone it if it is shared.
Otherwise we will mangle the packet for anyone who came before us
(e.g. tcpdump via AF_PACKET).
2008-11-13 12:44:04 -08:00
Ben Pfaff dac4f19861 Make sure that do_port_input() always puts a MAC header on packets.
Prompted by persistent oopses on packets received by e1000e, in which
skb_mac_header() for the packet always returned null.
2008-11-13 12:44:04 -08:00
Ben Pfaff af26d107aa Add build number to datapath version and --version output from programs. 2008-11-04 14:10:00 -08:00
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