Commit Graph

489 Commits

Author SHA1 Message Date
Ben Pfaff 74cacf6067 Get rid of OFP_MAXLEN.
Statistics or vendor extensions can fill up the whole 64 kB.
2008-09-10 20:05:49 -07:00
Ben Pfaff d0fb7347b9 Delete OFPST_SWITCH and make it available as a Nicira vendor extension. 2008-09-10 15:00:47 -07:00
Ben Pfaff 39136b0fb9 Make switches send error messages when they receive a bad request. 2008-09-10 13:22:25 -07:00
Ben Pfaff 696db2c3b6 Add vendor-specific messages and statistics to OpenFlow protocol. 2008-09-10 13:21:34 -07:00
Ben Pfaff a70ca44e6d Fix uninitialized data read in secchan.
Found by valgrind.
2008-09-10 13:21:34 -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
Ben Pfaff 9bf3d9301e Zero out otherwise uninitialized padding in make_unbuffered_packet_out().
Found with valgrind.
2008-09-09 14:12:57 -07:00
Ben Pfaff 8f56e1fd10 Fix instructions for running ofp-pki: "new-pki" is now "init".
Thanks to Dan for pointing out the problem.
2008-09-09 14:12:57 -07:00
Ben Pfaff 71f13ed0b6 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
 =======================
2008-09-09 12:53:47 -07:00
Ben Pfaff b5bcab1b47 Add ability to monitor both ends of secchan connections from dpctl. 2008-09-08 10:05:13 -07:00
Ben Pfaff 9e7df18a42 vconn: New function vconn_get_name(). 2008-09-08 10:05:13 -07:00
Ben Pfaff 7949a13230 Re-add extensions submodule that was accidentally dropped. 2008-09-08 09:25:25 -07:00
Ben Pfaff 7fe9460749 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.
2008-09-05 21:46:20 -07:00
Ben Pfaff e71fcda320 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.
2008-09-05 17:09:53 -07:00
Ben Pfaff c907aae9f1 Use make_openflow() function to simplify send_features_request(). 2008-09-04 14:24:45 -07:00
Ben Pfaff c572b9a572 Fix typo in comment. 2008-09-04 14:24:45 -07:00
Ben Pfaff 9b13a5792f Revert "Do not send in-band control traffic to the controller."
This reverts commit 123301f8b5,
because it broke second-hop OpenFlow switches' attempts to connect
to the controller.

Probably re-spin it later, with more testing this time.
2008-09-04 13:53:26 -07:00
Ben Pfaff 4870c3cc79 Simplify code by using rconn_send_with_limit() helper function. 2008-09-04 09:48:27 -07:00
Ben Pfaff 2137c4a80e Initialize otherwise uninitialized variable.
Found by valgrind.
2008-09-04 09:47:33 -07:00
Ben Pfaff b5e16b0723 Respin "Make vconns keep track of their names and include them in log messages."
This time, leave out the segfaults.
2008-09-04 09:47:05 -07:00
Justin Pettit 7d7d973d8b Add serial number to description status message. 2008-09-03 17:51:42 -07:00
Justin Pettit af04b055a7 Revert "Make vconns keep track of their names and include them in log messages."
This reverts commit a39a2431c1.
2008-09-03 17:43:30 -07:00
Ben Pfaff bb93ad418c 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."
2008-09-03 10:10:39 -07:00
Ben Pfaff 123301f8b5 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.
2008-09-02 15:44:58 -07:00
Ben Pfaff cfc54b8793 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.
2008-09-02 15:42:34 -07:00
Ben Pfaff a39a2431c1 Make vconns keep track of their names and include them in log messages. 2008-09-02 14:28:22 -07:00
Ben Pfaff b67a54201f Update ext. 2008-09-02 13:44:49 -07:00
Ben Pfaff 13e9c27b20 Make "make dist", "make clean" work without extensions submodule present. 2008-08-29 10:05:14 -07:00
Ben Pfaff 27dadb6bc6 Fix detection of OpenFlow extensions submodule. 2008-08-29 09:56:01 -07:00
Ben Pfaff 7b8b6bac10 Fix "make distcheck" error due to failure to clean files added by Automake. 2008-08-28 17:47:01 -07:00
Ben Pfaff 263aa64c49 Add support for extensions submodule. 2008-08-28 17:36:33 -07:00
Ben Pfaff 80e0e1e029 Remove duplicate prefixes on switch-status items. 2008-08-28 14:25:05 -07:00
Ben Pfaff 686e34c8b7 Make the secchan report a few more switch-status items. 2008-08-28 14:25:05 -07:00
Ben Pfaff 3cc1ae6a32 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.
2008-08-28 14:24:39 -07:00
Ben Pfaff 7129a314b2 Add license notice to acinclude.m4, configure.ac. 2008-08-28 14:24:39 -07:00
Ben Pfaff e9ab3dbf6d Make -P or --pidfile keep programs from running if already running. 2008-08-28 13:17:16 -07:00
Ben Pfaff 3059085830 Fix test for fcntl return value.
POSIX only says that -1 is an error; other return values have unspecified
meanings.
2008-08-28 13:15:32 -07:00
Ben Pfaff 637bae3222 Make OpenFlow kernel module print protocol version. 2008-08-28 09:54:50 -07:00
Ben Pfaff 7518061f7d Allow multiple -l or --listen options on secchan command line.
Bug #149.
2008-08-27 11:50:11 -07:00
Ben Pfaff ab43666b20 vlog: Apply rate-limiting everywhere it seems warranted. 2008-08-26 13:25:21 -07:00
Ben Pfaff 1a41889356 vlog: Implement rate-limiting. 2008-08-26 13:25:19 -07:00
Ben Pfaff c1d17df989 vlog: Simplify vlog() by using dynamic-string functions. 2008-08-26 13:25:17 -07:00
Ben Pfaff 2667dfda01 New functions ds_put_strftime(), ds_chomp(). 2008-08-26 13:25:17 -07:00
Ben Pfaff 394270a0e5 New header for saturating arithmetic. 2008-08-26 12:04:41 -07:00
Ben Pfaff 5d3042a11f Eliminate dpctl dependency on /sbin/ifconfig. 2008-08-26 12:03:14 -07:00
Ben Pfaff 23e60ce176 Allow multiple ports on dpctl addif and delif commands, for convenience. 2008-08-26 12:02:59 -07:00
Ben Pfaff e3d722e73b 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.
2008-08-26 11:53:51 -07:00
Ben Pfaff b057b10a74 rconn: Add functions for reporting connection statistics. 2008-08-26 11:51:17 -07:00
Ben Pfaff 3e464f2c68 Add functions for reporting dhcp client statistics. 2008-08-26 11:51:17 -07:00