sliver-openvswitch.git
15 years agoSend of0 packets from workqueue, to avoid recursive locking of ofN device.
Ben Pfaff [Tue, 9 Sep 2008 19:53:47 +0000 (12:53 -0700)]
Send of0 packets from workqueue, to avoid recursive locking of ofN device.

lockdep reported the following warning, showing that dev_queue_xmit()
for of0 and for another ethernet device (eth0?) were taking locks of
the same class.  It was not a problem in this particular case, because
of0 != eth0, but if a flow were to send a packet back to of0 then we
would have a deadlock.

Solution: use a workqueue to send packets to avoid recursive locking.
We will still waste a lot of CPU time if we get a packet that loops back
to of0.  Solution for that still needed.

=============================================
[ INFO: possible recursive locking detected ]
2.6.26.5 #1
---------------------------------------------
memcheck/1258 is trying to acquire lock:
 (_xmit_ETHER){-+..}, at: [<c025b126>] __qdisc_run+0xa0/0x18a

but task is already holding lock:
 (_xmit_ETHER){-+..}, at: [<c024f3cd>] dev_queue_xmit+0x23c/0x334

other info that might help us debug this:
9 locks held by memcheck/1258:
 #0:  (genl_mutex){--..}, at: [<c0262037>] genl_rcv+0x12/0x2b
 #1:  (dp_mutex){--..}, at: [<c88e9a13>] dp_genl_openflow+0x58/0x91 [openflow_mo
d]
 #2:  (rcu_read_lock){..--}, at: [<c024e749>] netif_receive_skb+0x9e/0x328
 #3:  (rcu_read_lock){..--}, at: [<c0267f77>] ip_local_deliver_finish+0x2a/0x1d7
 #4:  (slock-AF_INET/1){-+..}, at: [<c027f1b8>] tcp_v4_rcv+0x29f/0x5ef
 #5:  (rcu_read_lock){..--}, at: [<c024f308>] dev_queue_xmit+0x177/0x334
 #6:  (_xmit_ETHER){-+..}, at: [<c024f3cd>] dev_queue_xmit+0x23c/0x334
 #7:  (rcu_read_lock){..--}, at: [<c88ea214>] dp_dev_xmit+0x0/0x6c [openflow_mod
]
 #8:  (rcu_read_lock){..--}, at: [<c024f308>] dev_queue_xmit+0x177/0x334

stack backtrace:
Pid: 1258, comm: memcheck Not tainted 2.6.26.5 #1
 [<c02c11cc>] ? printk+0xf/0x13
 [<c01368c5>] __lock_acquire+0x8c2/0xbe4
 [<c0134d35>] ? add_lock_to_list+0x64/0x8a
 [<c0107a78>] ? native_sched_clock+0x82/0x94
 [<c0136c3e>] lock_acquire+0x57/0x73
 [<c025b126>] ? __qdisc_run+0xa0/0x18a
 [<c02c3919>] _spin_lock+0x1c/0x49
 [<c025b126>] ? __qdisc_run+0xa0/0x18a
 [<c025b126>] __qdisc_run+0xa0/0x18a
 [<c024f382>] dev_queue_xmit+0x1f1/0x334
 [<c88e9cde>] xmit_skb+0x5b/0x65 [openflow_mod]
 [<c88e9e60>] dp_output_port+0x178/0x1ae [openflow_mod]
 [<c88eaf91>] do_output+0x2a/0x4c [openflow_mod]
 [<c88eb11f>] execute_actions+0x16c/0x198 [openflow_mod]
 [<c88eb622>] run_flow_through_tables+0xe9/0xf6 [openflow_mod]
 [<c88eb63e>] fwd_port_input+0xf/0x3d [openflow_mod]
 [<c88ea260>] dp_dev_xmit+0x4c/0x6c [openflow_mod]
 [<c88ea214>] ? dp_dev_xmit+0x0/0x6c [openflow_mod]
 [<c024f042>] dev_hard_start_xmit+0x20f/0x276
 [<c024f3e2>] dev_queue_xmit+0x251/0x334
 [<c026bfcb>] ip_finish_output+0x1ea/0x222
 [<c026c081>] ip_output+0x7e/0x83
 [<c026b37a>] ip_local_out+0x18/0x1b
 [<c026baa2>] ip_queue_xmit+0x288/0x2c9
 [<c0136a0c>] ? __lock_acquire+0xa09/0xbe4
 [<c0111264>] ? kernel_map_pages+0xfc/0x113
 [<c027ddad>] ? tcp_v4_send_check+0x80/0xba
 [<c027a281>] tcp_transmit_skb+0x695/0x6cd
 [<c016060a>] ? __kmalloc_track_caller+0xee/0x12a
 [<c024aacc>] ? __alloc_skb+0x51/0xff
 [<c027a43c>] tcp_send_ack+0xdf/0xe7
 [<c02781e4>] tcp_rcv_state_process+0x389/0xc33
 [<c027eebd>] tcp_v4_do_rcv+0x3bd/0x419
 [<c027f2c7>] tcp_v4_rcv+0x3ae/0x5ef
 [<c026805f>] ip_local_deliver_finish+0x112/0x1d7
 [<c0268185>] ip_local_deliver+0x61/0x6a
 [<c0267d14>] ip_rcv_finish+0x2a4/0x2c3
 [<c0267f23>] ip_rcv+0x1f0/0x21a
 [<c024e990>] netif_receive_skb+0x2e5/0x328
 [<c024ea52>] process_backlog+0x7f/0xca
 [<c024d867>] net_rx_action+0x72/0x127
 [<c0120ea1>] __do_softirq+0x7b/0xf2
 [<c0105a5d>] do_softirq+0x66/0xb3
 [<c024ec69>] netif_rx_ni+0x29/0x2e
 [<c88ea2cd>] dp_dev_recv+0x4d/0x6c [openflow_mod]
 [<c88e9e06>] dp_output_port+0x11e/0x1ae [openflow_mod]
 [<c88eaf91>] do_output+0x2a/0x4c [openflow_mod]
 [<c88eb11f>] execute_actions+0x16c/0x198 [openflow_mod]
 [<c88eb312>] recv_flow+0x1c7/0x2a5 [openflow_mod]
 [<c88eb14b>] ? recv_flow+0x0/0x2a5 [openflow_mod]
 [<c88eab37>] fwd_control_input+0x53/0x60 [openflow_mod]
 [<c88e9a27>] dp_genl_openflow+0x6c/0x91 [openflow_mod]
 [<c02621ce>] genl_rcv_msg+0x17e/0x198
 [<c0262050>] ? genl_rcv_msg+0x0/0x198
 [<c02614c6>] netlink_rcv_skb+0x30/0x76
 [<c0262043>] genl_rcv+0x1e/0x2b
 [<c0261053>] netlink_unicast+0x1a9/0x20f
 [<c02612dc>] netlink_sendmsg+0x223/0x230
 [<c0245384>] sock_sendmsg+0xca/0xe1
 [<c012c501>] ? autoremove_wake_function+0x0/0x33
 [<c015f6ce>] ? cache_free_debugcheck+0x2a3/0x2be
 [<c0107a78>] ? native_sched_clock+0x82/0x94
 [<c0134382>] ? lock_release_holdtime+0x1a/0x115
 [<c01f52b7>] ? copy_from_user+0x34/0x11b
 [<c024b6a5>] ? verify_iovec+0x40/0x6f
 [<c02454da>] sys_sendmsg+0x13f/0x192
 [<c0168d51>] ? pipe_write+0x434/0x43f
 [<c0107a78>] ? native_sched_clock+0x82/0x94
 [<c0107a78>] ? native_sched_clock+0x82/0x94
 [<c0134382>] ? lock_release_holdtime+0x1a/0x115
 [<c0107a78>] ? native_sched_clock+0x82/0x94
 [<c0134382>] ? lock_release_holdtime+0x1a/0x115
 [<c0246189>] sys_socketcall+0x14e/0x169
 [<c0102d43>] ? restore_nocheck+0x12/0x15
 [<c0102ce2>] syscall_call+0x7/0xb
 =======================

15 years agoAdd ability to monitor both ends of secchan connections from dpctl.
Ben Pfaff [Mon, 8 Sep 2008 17:05:12 +0000 (10:05 -0700)]
Add ability to monitor both ends of secchan connections from dpctl.

15 years agovconn: New function vconn_get_name().
Ben Pfaff [Fri, 5 Sep 2008 21:33:08 +0000 (14:33 -0700)]
vconn: New function vconn_get_name().

15 years agoRe-add extensions submodule that was accidentally dropped.
Ben Pfaff [Mon, 8 Sep 2008 16:25:25 +0000 (09:25 -0700)]
Re-add extensions submodule that was accidentally dropped.

15 years agoCompatibility fixes for 2.6.18 kernel
Ben Pfaff [Sat, 6 Sep 2008 04:23:34 +0000 (21:23 -0700)]
Compatibility fixes for 2.6.18 kernel

Functions added in the 2.6.22 kernel in tcp.h and skbuff.h
have been added to the compatibility headers. Additionally
the data argument was dropped in 2.6.22 for the work queue
macros, requiring them to be redfined for previous kernels.

Based on changes from David Erickson.

15 years agoDo not send in-band control traffic to the controller.
Ben Pfaff [Sat, 6 Sep 2008 00:09:53 +0000 (17:09 -0700)]
Do not send in-band control traffic to the controller.

This commit prevents the secure channel from sending any traffic to
or from the controller up to the controller over its OpenFlow connection.
Instead, such traffic is always handled completely locally.  This is
what the changes to in-band control up until now have been converging on:
each time, we have reduced the category of traffic that can be sent up
to the controller because we have found that doing so can cause a control
loop.  This change goes all the way.

15 years agoUse make_openflow() function to simplify send_features_request().
Ben Pfaff [Mon, 18 Aug 2008 20:57:14 +0000 (13:57 -0700)]
Use make_openflow() function to simplify send_features_request().

15 years agoFix typo in comment.
Ben Pfaff [Thu, 14 Aug 2008 18:43:05 +0000 (11:43 -0700)]
Fix typo in comment.

15 years agoRevert "Do not send in-band control traffic to the controller."
Ben Pfaff [Thu, 4 Sep 2008 20:51:54 +0000 (13:51 -0700)]
Revert "Do not send in-band control traffic to the controller."

This reverts commit 123301f8b57df7e539478c607d52d21b55e023c0,
because it broke second-hop OpenFlow switches' attempts to connect
to the controller.

Probably re-spin it later, with more testing this time.

15 years agoSimplify code by using rconn_send_with_limit() helper function.
Ben Pfaff [Thu, 4 Sep 2008 16:48:27 +0000 (09:48 -0700)]
Simplify code by using rconn_send_with_limit() helper function.

15 years agoInitialize otherwise uninitialized variable.
Ben Pfaff [Thu, 4 Sep 2008 16:47:33 +0000 (09:47 -0700)]
Initialize otherwise uninitialized variable.

Found by valgrind.

15 years agoRespin "Make vconns keep track of their names and include them in log messages."
Ben Pfaff [Thu, 4 Sep 2008 16:47:05 +0000 (09:47 -0700)]
Respin "Make vconns keep track of their names and include them in log messages."

This time, leave out the segfaults.

15 years agoAdd serial number to description status message.
Justin Pettit [Thu, 4 Sep 2008 00:51:42 +0000 (17:51 -0700)]
Add serial number to description status message.

15 years agoRevert "Make vconns keep track of their names and include them in log messages."
Justin Pettit [Thu, 4 Sep 2008 00:43:30 +0000 (17:43 -0700)]
Revert "Make vconns keep track of their names and include them in log messages."

This reverts commit a39a2431c12d25aab4d6ed560da3607611a74937.

15 years agoAlso disable atexit hooks in fatal_signal_fork().
Ben Pfaff [Wed, 3 Sep 2008 17:10:39 +0000 (10:10 -0700)]
Also disable atexit hooks in fatal_signal_fork().

This fixes a problem in ofp-discover, where it would daemonize itself
after setting an IP address on one of its interfaces.  The daemonize
function would call fatal_signal_fork() then exit(0), which would in turn
cause the netdev code to disable the interface and thereby remove the IP
address.

The bug that this fixes was introduced in commit 3cc1ae6a3, "Add ability
to run fatal signal hooks upon normal termination too."

15 years agoDo not send in-band control traffic to the controller.
Ben Pfaff [Tue, 2 Sep 2008 22:44:58 +0000 (15:44 -0700)]
Do not send in-band control traffic to the controller.

This commit prevents the secure channel from sending any traffic to
or from the controller up to the controller over its OpenFlow connection.
Instead, such traffic is always handled completely locally.  This is
what the changes to in-band control up until now have been converging on:
each time, we have reduced the category of traffic that can be sent up
to the controller because we have found that doing so can cause a control
loop.  This change goes all the way.

15 years agoMinimal fix for in-band control loop with hub.
Ben Pfaff [Tue, 2 Sep 2008 22:42:34 +0000 (15:42 -0700)]
Minimal fix for in-band control loop with hub.

When a hub has two switches and the controller on three of its ports,
control traffic from the controller to switch 1 is seen by switch 2 as
data traffic, and switch 2 sends it up over its OpenFlow connection.  That
control traffic is in turn seen by the switch 1 as data traffic, and so
switch 1 sends it up over its OpenFlow connection.  And so on: this is a
loop.

This commit fixes the situation by not sending up over the OpenFlow
connection traffic to the controller that arrived on the controller's
port, as well as traffic from the controller.

15 years agoMake vconns keep track of their names and include them in log messages.
Ben Pfaff [Tue, 2 Sep 2008 21:28:22 +0000 (14:28 -0700)]
Make vconns keep track of their names and include them in log messages.

15 years agoUpdate ext.
Ben Pfaff [Tue, 2 Sep 2008 20:44:49 +0000 (13:44 -0700)]
Update ext.

15 years agoMake "make dist", "make clean" work without extensions submodule present.
Ben Pfaff [Fri, 29 Aug 2008 17:05:14 +0000 (10:05 -0700)]
Make "make dist", "make clean" work without extensions submodule present.

15 years agoFix detection of OpenFlow extensions submodule.
Ben Pfaff [Fri, 29 Aug 2008 16:55:34 +0000 (09:55 -0700)]
Fix detection of OpenFlow extensions submodule.

15 years agoFix "make distcheck" error due to failure to clean files added by Automake.
Ben Pfaff [Fri, 29 Aug 2008 00:47:01 +0000 (17:47 -0700)]
Fix "make distcheck" error due to failure to clean files added by Automake.

15 years agoAdd support for extensions submodule.
Ben Pfaff [Fri, 29 Aug 2008 00:36:33 +0000 (17:36 -0700)]
Add support for extensions submodule.

15 years agoRemove duplicate prefixes on switch-status items.
Ben Pfaff [Wed, 27 Aug 2008 18:29:57 +0000 (11:29 -0700)]
Remove duplicate prefixes on switch-status items.

15 years agoMake the secchan report a few more switch-status items.
Ben Pfaff [Wed, 27 Aug 2008 18:29:53 +0000 (11:29 -0700)]
Make the secchan report a few more switch-status items.

15 years agoAdd ability to run fatal signal hooks upon normal termination too.
Ben Pfaff [Wed, 27 Aug 2008 18:29:45 +0000 (11:29 -0700)]
Add ability to run fatal signal hooks upon normal termination too.

This is convenient since in many cases we want these hooks to run in
both cases.

15 years agoAdd license notice to acinclude.m4, configure.ac.
Ben Pfaff [Wed, 27 Aug 2008 18:28:53 +0000 (11:28 -0700)]
Add license notice to acinclude.m4, configure.ac.

15 years agoMake -P or --pidfile keep programs from running if already running.
Ben Pfaff [Thu, 28 Aug 2008 20:17:16 +0000 (13:17 -0700)]
Make -P or --pidfile keep programs from running if already running.

15 years agoFix test for fcntl return value.
Ben Pfaff [Thu, 28 Aug 2008 20:15:32 +0000 (13:15 -0700)]
Fix test for fcntl return value.

POSIX only says that -1 is an error; other return values have unspecified
meanings.

15 years agoMake OpenFlow kernel module print protocol version.
Ben Pfaff [Thu, 24 Jul 2008 00:38:42 +0000 (17:38 -0700)]
Make OpenFlow kernel module print protocol version.

15 years agoAllow multiple -l or --listen options on secchan command line.
Ben Pfaff [Wed, 27 Aug 2008 18:50:11 +0000 (11:50 -0700)]
Allow multiple -l or --listen options on secchan command line.

Bug #149.

15 years agovlog: Apply rate-limiting everywhere it seems warranted.
Ben Pfaff [Tue, 19 Aug 2008 22:18:51 +0000 (15:18 -0700)]
vlog: Apply rate-limiting everywhere it seems warranted.

15 years agovlog: Implement rate-limiting.
Ben Pfaff [Tue, 19 Aug 2008 22:16:57 +0000 (15:16 -0700)]
vlog: Implement rate-limiting.

15 years agovlog: Simplify vlog() by using dynamic-string functions.
Ben Pfaff [Tue, 19 Aug 2008 20:58:59 +0000 (13:58 -0700)]
vlog: Simplify vlog() by using dynamic-string functions.

15 years agoNew functions ds_put_strftime(), ds_chomp().
Ben Pfaff [Tue, 19 Aug 2008 20:57:55 +0000 (13:57 -0700)]
New functions ds_put_strftime(), ds_chomp().

15 years agoNew header for saturating arithmetic.
Ben Pfaff [Tue, 19 Aug 2008 20:57:17 +0000 (13:57 -0700)]
New header for saturating arithmetic.

15 years agoEliminate dpctl dependency on /sbin/ifconfig.
Ben Pfaff [Tue, 19 Aug 2008 20:56:28 +0000 (13:56 -0700)]
Eliminate dpctl dependency on /sbin/ifconfig.

15 years agoAllow multiple ports on dpctl addif and delif commands, for convenience.
Ben Pfaff [Tue, 19 Aug 2008 20:47:17 +0000 (13:47 -0700)]
Allow multiple ports on dpctl addif and delif commands, for convenience.

15 years agoImplement new OpenFlow "switch statistics" feature.
Ben Pfaff [Tue, 26 Aug 2008 18:53:51 +0000 (11:53 -0700)]
Implement new OpenFlow "switch statistics" feature.

This should be useful for reporting the status of a switch on its
front-panel display (for those switches that have one) or in the
controller UI.

15 years agorconn: Add functions for reporting connection statistics.
Ben Pfaff [Tue, 19 Aug 2008 18:17:58 +0000 (11:17 -0700)]
rconn: Add functions for reporting connection statistics.

15 years agoAdd functions for reporting dhcp client statistics.
Ben Pfaff [Tue, 19 Aug 2008 18:17:26 +0000 (11:17 -0700)]
Add functions for reporting dhcp client statistics.

15 years agoChange netdev_get_in4() to re-check the IP address on each call.
Ben Pfaff [Tue, 19 Aug 2008 18:14:52 +0000 (11:14 -0700)]
Change netdev_get_in4() to re-check the IP address on each call.

As part of implementing switch stats, secchan wants to report the
IP address currently configured on an interface.  Caching it for
all time defeats that purpose.

15 years agoNew functions ds_truncate(), ds_last().
Ben Pfaff [Tue, 19 Aug 2008 18:12:59 +0000 (11:12 -0700)]
New functions ds_truncate(), ds_last().

15 years agoNew function ds_put_printable().
Ben Pfaff [Tue, 19 Aug 2008 18:12:45 +0000 (11:12 -0700)]
New function ds_put_printable().

Use the function in dhcp_option_to_string().

15 years agoFix a couple of typos.
Justin Pettit [Fri, 22 Aug 2008 20:21:58 +0000 (13:21 -0700)]
Fix a couple of typos.

15 years agoSend PORT_STATUS messages on port and link changes. Add ability to remotely enable...
Justin Pettit [Fri, 22 Aug 2008 19:47:54 +0000 (12:47 -0700)]
Send PORT_STATUS messages on port and link changes.  Add ability to remotely enable and disable a port through the PORT_MOD message.

15 years agorconn: Fix bug #100, "Inactivity time-out slow under heavy load."
Ben Pfaff [Fri, 22 Aug 2008 17:34:15 +0000 (10:34 -0700)]
rconn: Fix bug #100, "Inactivity time-out slow under heavy load."

The timeout() function returns a duration relative to the time at which the
current state was entered, but rconn_run_wait() was treating it as the
waiting time remaining.

15 years agoUn-learn the port on which a MAC is located after some time.
Ben Pfaff [Mon, 18 Aug 2008 22:01:35 +0000 (15:01 -0700)]
Un-learn the port on which a MAC is located after some time.

Otherwise, we can send frames the wrong port indefinitely, if the device
in question does not itself initiate sending data.

15 years agoRemove unnecessary AC_PROG_LD since OpenFlow no longer uses libtool.
Justin Pettit [Thu, 21 Aug 2008 23:16:33 +0000 (16:16 -0700)]
Remove unnecessary AC_PROG_LD since OpenFlow no longer uses libtool.

15 years agoInitialize the table structures to zero.
Justin Pettit [Wed, 20 Aug 2008 00:06:10 +0000 (17:06 -0700)]
Initialize the table structures to zero.

15 years agoCleanup git-status by not showing some unnecessary files.
Justin Pettit [Tue, 19 Aug 2008 06:48:58 +0000 (23:48 -0700)]
Cleanup git-status by not showing some unnecessary files.

15 years agoFix problem where packets never matched in hash table and flows always added regardle...
Justin Pettit [Tue, 19 Aug 2008 05:23:03 +0000 (22:23 -0700)]
Fix problem where packets never matched in hash table and flows always added regardless of whether they currently exist.

15 years agoLink to the normal OpenFlow lib directory, not this hidden one.
Justin Pettit [Tue, 19 Aug 2008 05:13:36 +0000 (22:13 -0700)]
Link to the normal OpenFlow lib directory, not this hidden one.

15 years agoDon't compare wildcards, nw_src_mask, nw_dst_mask fields in hash table.
Ben Pfaff [Fri, 8 Aug 2008 23:09:15 +0000 (16:09 -0700)]
Don't compare wildcards, nw_src_mask, nw_dst_mask fields in hash table.

They should always compare equal, so there's no point in wasting the
time.

15 years agoAllow and use shorthands such as "ip" or "tcp" for specifying flows.
Ben Pfaff [Fri, 8 Aug 2008 21:03:37 +0000 (14:03 -0700)]
Allow and use shorthands such as "ip" or "tcp" for specifying flows.

15 years agoMake ofp_packet_in() print the flow corresponding to the buffer also.
Ben Pfaff [Fri, 8 Aug 2008 21:05:09 +0000 (14:05 -0700)]
Make ofp_packet_in() print the flow corresponding to the buffer also.

15 years agoImplement subnet mask matching in OpenFlow.
Ben Pfaff [Thu, 7 Aug 2008 05:00:29 +0000 (22:00 -0700)]
Implement subnet mask matching in OpenFlow.

15 years agoUse ETH_ALEN in place of hard-coded 6 in datapath/flow.h.
Ben Pfaff [Mon, 18 Aug 2008 21:20:21 +0000 (14:20 -0700)]
Use ETH_ALEN in place of hard-coded 6 in datapath/flow.h.

15 years agoFix typo in comment.
Ben Pfaff [Wed, 6 Aug 2008 21:12:22 +0000 (14:12 -0700)]
Fix typo in comment.

15 years agoFix dump-flows to be usable by add-flows.
Justin Pettit [Mon, 18 Aug 2008 06:17:07 +0000 (23:17 -0700)]
Fix dump-flows to be usable by add-flows.

Some of the fields when printing a flow are hex, but they don't have a
preceeding "0x".  When one tries to import them, they're treated as decimal
and weird results occur.  Bug 27.

15 years agoUse a consistent naming convention for counts.
Justin Pettit [Mon, 18 Aug 2008 06:15:21 +0000 (23:15 -0700)]
Use a consistent naming convention for counts.

15 years agoAdd stats message that allows querying description of components in OpenFlow.
Justin Pettit [Sat, 16 Aug 2008 16:43:05 +0000 (09:43 -0700)]
Add stats message that allows querying description of components in OpenFlow.

15 years agoAdded new interface statistics.
Justin Pettit [Fri, 15 Aug 2008 06:12:37 +0000 (23:12 -0700)]
Added new interface statistics.

15 years agoMake hwtable_dummy compile again.
Ben Pfaff [Thu, 14 Aug 2008 23:22:00 +0000 (16:22 -0700)]
Make hwtable_dummy compile again.

Bug #109.

15 years agoFix vlogconf EINTR error returns.
Ben Pfaff [Thu, 14 Aug 2008 23:18:46 +0000 (16:18 -0700)]
Fix vlogconf EINTR error returns.

Bug #111.

15 years agoUse OpenFlow OUI for Ethernet address of local ports.
Ben Pfaff [Thu, 14 Aug 2008 23:10:59 +0000 (16:10 -0700)]
Use OpenFlow OUI for Ethernet address of local ports.

15 years agoUse proper byte order for dl_type of 802.2, non-SNAP frames.
Ben Pfaff [Thu, 14 Aug 2008 18:05:50 +0000 (11:05 -0700)]
Use proper byte order for dl_type of 802.2, non-SNAP frames.

15 years agoSwitch to new packet-out format and add OFPP_IN_PORT.
Justin Pettit [Thu, 14 Aug 2008 07:02:14 +0000 (00:02 -0700)]
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.

15 years agoPrint OpenFlow ref. impl. and protocol versions at secchan startup time.
Ben Pfaff [Wed, 13 Aug 2008 21:37:36 +0000 (14:37 -0700)]
Print OpenFlow ref. impl. and protocol versions at secchan startup time.

Bug #83.

15 years agoDescribe how to build and use Debian packages in INSTALL.
Ben Pfaff [Wed, 13 Aug 2008 21:29:33 +0000 (14:29 -0700)]
Describe how to build and use Debian packages in INSTALL.

15 years agoAdd missing prerequisite to debian/control.
Ben Pfaff [Wed, 13 Aug 2008 21:29:18 +0000 (14:29 -0700)]
Add missing prerequisite to debian/control.

15 years agorconn: Wake up immediately if we drain the send queue.
Ben Pfaff [Wed, 13 Aug 2008 18:30:31 +0000 (11:30 -0700)]
rconn: Wake up immediately if we drain the send queue.

It is possible that some task is waiting for space to open up in the
send queue, so we need to give it a chance to run.

15 years agorconn: Use rconn_send() to send echo requests.
Ben Pfaff [Wed, 13 Aug 2008 18:26:26 +0000 (11:26 -0700)]
rconn: Use rconn_send() to send echo requests.

There's no point in sending echo requests by hand.

15 years agorconn: Queue packets for tx only if connected.
Ben Pfaff [Wed, 13 Aug 2008 18:21:49 +0000 (11:21 -0700)]
rconn: Queue packets for tx only if connected.

Until now, the rconn code would queue up packets not just while connected
but also while connecting.  This is not just unnecessary, however, it
actually causes a problem in secchan: if the secchan receives packets
from nl:0 and tries to transmit them, then they will quickly fill up
the rconn's transmit buffer (it uses a 1-packet buffer), which causes
secchan to stop reading packets from nl:0 until the buffer frees up.
That cannot happen until the connection completes.  With in-band control,
however, the connection cannot complete until we receive and process
packet_in messages in our in-band hook.  Thus, we have a deadlock.

Fixes bug #90, "Sometimes secchan has to go into fail-open mode to connect."

15 years agoPrevent the secchan from dying due to SIGPIPE.
Ben Pfaff [Tue, 12 Aug 2008 23:21:45 +0000 (16:21 -0700)]
Prevent the secchan from dying due to SIGPIPE.

Fix for bug #88.

15 years agoReduce default burst limit to rate limit / 4.
Ben Pfaff [Tue, 12 Aug 2008 23:15:42 +0000 (16:15 -0700)]
Reduce default burst limit to rate limit / 4.

With the previous default burst limit of rate limit * 2, we would queue
up 2 seconds worth of packet_in messages.  This is not only much more
than actually needed, it causes an actual problem: the datapath only
retains buffered packets for up to 1 second, by default, so that flow
setups sent in response have no packet to work with.

15 years agoMake discovery happen faster.
Ben Pfaff [Tue, 12 Aug 2008 23:09:31 +0000 (16:09 -0700)]
Make discovery happen faster.

This reduces the initial delay before sending DHCPDISCOVER from
1...10 seconds to 1...3 seconds.

15 years agoImplement rate limiting in secchan.
Ben Pfaff [Tue, 12 Aug 2008 22:34:47 +0000 (15:34 -0700)]
Implement rate limiting in secchan.

15 years agoDrop rconn's responsibility for limiting the tx queue.
Ben Pfaff [Mon, 11 Aug 2008 23:24:24 +0000 (16:24 -0700)]
Drop rconn's responsibility for limiting the tx queue.

Now it helps clients track the number of in-flight messages, but lets the
clients do the limiting themselves.  This will come in handy for packet-in
rate limiting (in an upcoming commit), in which we want to track in-flight
packet-in messages separately from other in-flight messages.

15 years agoUse signal-based timekeeping functions throughout the source base.
Ben Pfaff [Mon, 11 Aug 2008 20:44:29 +0000 (13:44 -0700)]
Use signal-based timekeeping functions throughout the source base.

15 years agoInitialize the timetracking module in each userspace program.
Ben Pfaff [Tue, 12 Aug 2008 20:13:16 +0000 (13:13 -0700)]
Initialize the timetracking module in each userspace program.

Also, use time_alarm() instead of the POSIX alarm() function, because
alarm() interferes with time_alarm().

15 years agoImplement signal-driven time tracking.
Ben Pfaff [Tue, 12 Aug 2008 21:41:48 +0000 (14:41 -0700)]
Implement signal-driven time tracking.

Checking the current time only when a periodic timer expires allows us
to reduce the number of system calls to obtain the current time to 10 per
second (from an arbitrary number) plus one per poll loop.

This fixes poll_block() to properly handle being interrupted.
Otherwise, a timeout longer than the interval between signals will never
complete (because it will restart from the beginning after every
signal).

15 years agoMake fatal-signal more willing to share signals with other handlers.
Ben Pfaff [Tue, 12 Aug 2008 21:24:10 +0000 (14:24 -0700)]
Make fatal-signal more willing to share signals with other handlers.

15 years agoSet up flow to drop packets that come in on their output port.
Ben Pfaff [Fri, 8 Aug 2008 22:39:20 +0000 (15:39 -0700)]
Set up flow to drop packets that come in on their output port.

Commit 0a3d4ba3a, "Don't allow the learning switch to send packets back
out the incoming port," drops packets that come in on their incoming port,
but it does not set up a flow to drop those packets.  If we are connected
to a hub, then this can be very expensive, since we can continue to get
many packets in that flow and have to drop them in secchan one by one.  So
now we set up a flow to drop them for us.

15 years agoFix handling of IP but non-TCP, non-UDP packets in kernel flow_extract().
Ben Pfaff [Fri, 8 Aug 2008 18:43:41 +0000 (11:43 -0700)]
Fix handling of IP but non-TCP, non-UDP packets in kernel flow_extract().

In particular, ICMP was broken.

15 years agoMake vconn_open() consistently set *vconnp to NULL on failure.
Ben Pfaff [Thu, 7 Aug 2008 22:37:44 +0000 (15:37 -0700)]
Make vconn_open() consistently set *vconnp to NULL on failure.

Fixes issue #80.

15 years agoImplement OpenFlow hard timeouts.
Ben Pfaff [Thu, 7 Aug 2008 22:19:31 +0000 (15:19 -0700)]
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.

15 years agoFix formatting of flow matches in ofp-print:
Ben Pfaff [Wed, 6 Aug 2008 18:39:51 +0000 (11:39 -0700)]
Fix formatting of flow matches in ofp-print:

Print a comma after wildcard matches as well as exact matches.

15 years agoFix uninitialized struct member in userspace table-linear.
Ben Pfaff [Wed, 6 Aug 2008 18:40:14 +0000 (11:40 -0700)]
Fix uninitialized struct member in userspace table-linear.

15 years agoFix bug in clearing unsupported switch flags.
Ben Pfaff [Thu, 7 Aug 2008 20:19:09 +0000 (13:19 -0700)]
Fix bug in clearing unsupported switch flags.

We need to keep the flags we support, not drop them.

15 years agoDon't call kfree_skb() with interrupts disabled.
Ben Pfaff [Thu, 7 Aug 2008 18:46:22 +0000 (11:46 -0700)]
Don't call kfree_skb() with interrupts disabled.

Freeing an skb that has a destructor may require interrupts to be enabled.
This can happen when netfilter is performing NAT, for example.

Discovered by Murphy McCauley.

15 years agoDon't allow unsupported flags to be set in the switch.
Ben Pfaff [Tue, 5 Aug 2008 20:51:29 +0000 (13:51 -0700)]
Don't allow unsupported flags to be set in the switch.

15 years agoImplement OFPC_FRAG_DROP fragment handling policy.
Ben Pfaff [Mon, 4 Aug 2008 22:34:26 +0000 (15:34 -0700)]
Implement OFPC_FRAG_DROP fragment handling policy.

15 years agoReduce redundancy in datapath code.
Ben Pfaff [Tue, 5 Aug 2008 20:58:12 +0000 (13:58 -0700)]
Reduce redundancy in datapath code.

15 years agoMaintain userspace switch configuration in host byte order.
Ben Pfaff [Tue, 5 Aug 2008 21:13:54 +0000 (14:13 -0700)]
Maintain userspace switch configuration in host byte order.

This makes it easier to work with and makes the code more like the
kernel switch.

15 years agoFix memory leak when OFPP_TABLE is used for a packet that matches no flow.
Ben Pfaff [Tue, 5 Aug 2008 21:35:26 +0000 (14:35 -0700)]
Fix memory leak when OFPP_TABLE is used for a packet that matches no flow.

15 years agoDrop controller-bound traffic that arrives on the controller's port.
Ben Pfaff [Tue, 5 Aug 2008 20:05:56 +0000 (13:05 -0700)]
Drop controller-bound traffic that arrives on the controller's port.

Before, if a hub connected a number of OpenFlow switches and the controller,
then in-band control traffic from one of the OpenFlow switches would be
seen by each of the other switches and forwarded up to the controller as
an ofp_packet_in message.  That message would then be seen by all of the
other OpenFlow switches and also forwarded, and so on in an infinite loop.

This change prevents this situation by keeping secchan from forwarding
ofp_packet_in messages for a packet destined to the controller that
arrives on the port where the controller is located.

This code has at least two weaknesses.  First, if the controller's port
changes, then the flows set up to drop packets will not be deleted.  This
should not be a major problem: if this inadvertently kills a switch's
connection to the controller, then the switch will realize it after it
stops receiving data and re-connect.  Its new connection will have new
flow data and therefore its packets will not be dropped.

Second, the notion of the "controller's port" does not take into account
the possibility of loops in the network topology.  We need spanning tree
protocol for that.

15 years agoProperly track table match counts.
Justin Pettit [Wed, 6 Aug 2008 08:58:15 +0000 (01:58 -0700)]
Properly track table match counts.

15 years agoFix typo in comment.
Ben Pfaff [Mon, 4 Aug 2008 22:30:19 +0000 (15:30 -0700)]
Fix typo in comment.

15 years agoMark functions not used in other source files static.
Ben Pfaff [Mon, 4 Aug 2008 21:47:27 +0000 (14:47 -0700)]
Mark functions not used in other source files static.