28 Commits

Author SHA1 Message Date
Isaku Yamahata
3579a3e37c controller: print backtrace when exception in addition to stacktrace
This is useful when debugging. it's difficult to debug without
backtrace.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-20 11:25:06 +09:00
FUJITA Tomonori
4c2de66d32 stop import ofproto_v1_0 as ofproto
'from . import ofproto_v1_0 as ofproto' in ryu/ofproto/__init__.py is
a wrong assumption. We need to remove it.

This introduces ryu/ofproto/ofproto_common.py including only constatns
that OF version independent code must use. Note that I don't move data
structures there that multiple OF versions can share (like OVS does).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-07-17 19:32:13 +09:00
Isaku Yamahata
10fcdec3b3 controller/controller: make send_flow_mod() allow default value for priority
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:48:33 +09:00
Isaku Yamahata
57bd1abe5c controller, ofproto_v1_0: avoid format for argument
format is defined in builtin, so it should be avoid for argument.
use flow_format instead.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Reviewed-by: Simon Horman <simon@horms.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:44:02 +09:00
FUJITA Tomonori
711301abb3 Switch to Apache 2.0 license
To make the further integration into IaaS OSS (OpenStack and
CloudStack) easier, we switch to Apache 2.0 license.

ryu/app/wsapi.py is still under GPL3 or later. We replace it later.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-04-06 08:38:45 +09:00
FUJITA Tomonori
8d2a263694 ignore GreenletExit exception
We get a pretty anonying message every time a datapath has gone since
we kill send_thr gleenlet in the normal termination. Let's ignore the
exception.

In the long term, we should improve error message delivering. Just
printing an error is pretty useless.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-16 02:39:44 +09:00
Simon Horman
c5a2dd55ed Allow send_flow_mod() to send NXTFlowMod messages
Allow send_flow_mod() to send NXTFlowMod messages in place of OFPFlowMod
messages if the match includes fields chat can't be encoded by OFPMatch

The flow format will be upgraded as necessary

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:42 -07:00
Simon Horman
85fe60abe0 Add support for NXT_SET_FLOW_FORMAT
This message may be used to request that the NXM
flow format may be used. NXM is used as the match
in NX vendor extension messages such as NXT_FLOW_MOD.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:25 -07:00
Isaku Yamahata
ba5ce1a72e controller: print stack trace when datapath main loop goes wrong and log it
log errors when serving datapath. And a comment to clarify the intention.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-08 05:54:19 +09:00
FUJITA Tomonori
d7ee5d2282 yield the CPU to other greenlets
We need to yield the CPU to other greenlets. Otherwise, ryu can't
accept new switches or handle the existing switches. The limit is
arbitrary. I guess that we need to think about the better approach in
the future (e.g. non greenlet framework).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:11:29 +09:00
FUJITA Tomonori
f6741e9c93 avoid reading too much data from socket
Currently, we try to read OFP_MSG_SIZE_MAX (65535) from sockets. This
hurts the performance badly. This patch changes ryu to read a single
request from socket.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:11:26 +09:00
FUJITA Tomonori
d0e3264a84 limit the queue size (send_q)
cbench in throughtput mode doesn't work with ryu. We need to limit
queue size to prevent the queue from eating memory up.

The size is arbitrary. It can be the startup parameter. But I think
that we should solve this in the better way. So let's not make it
global for now

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:11:01 +09:00
FUJITA Tomonori
e44c9d6089 kill recv_q
Using Queue hurts the performance badly. So let's kill recv_q. It's
not useufl.

Killing send_q is difficult because letting multiple greenlets to send
data to a switch is tricky.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:09:55 +09:00
Isaku Yamahata
68b1424ef3 controller: eliminate weakref of datapath.ev_q.aux
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:06:48 +09:00
Isaku Yamahata
0275604621 controller: make Controller::serve more robust
Even when exception occurred, kill other thread.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:06:21 +09:00
FUJITA Tomonori
92b58c2a41 enable OF1.2 support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-23 12:57:51 +09:00
Isaku Yamahata
2c018c6b99 controller/datapath: add a helper function to delete flow entries
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-10 16:45:14 +09:00
FUJITA Tomonori
567cb2c364 fix datapath disconnection cleanup
After the datapath connection is close, we call gevent.joinall for
ev_thr and send_thr greenlets to wait for the completion of them.
However, gevent.joinall will block forever since the greenlets sleep.
We can put some junk to the queues to wake them but looks like just
killing the greenlets is simpler.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-05 15:41:30 +09:00
FUJITA Tomonori
78e3eba75d remove unused members in Datapath class
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-03 12:21:14 +09:00
Isaku Yamahata
c22ef47a9c controller: factor out ofp message event from event.py
Move out ofp msg event from event.py into ofp_event.py

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-03 02:36:26 +09:00
Isaku Yamahata
b3002281e9 pylint: various fixes for pylint
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-03 02:35:38 +09:00
Isaku Yamahata
e66a04e80e controller/dpset: Introduce datapath enter/leave event
Introduce DPSet class to track datapath enter/leave and generate events.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-01 08:55:44 +09:00
Isaku Yamahata
39bc833bf3 controller: pass datapath to EventQueue for EventQueueCreate event
Later dpset is decoupled with EventQueueCreate.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-01 08:55:42 +09:00
Isaku Yamahata
4dd1118b7d dispatcher: pass name to EventQueue and track all instances
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-01 08:55:35 +09:00
FUJITA Tomonori
0be016c271 use 0 dl_{src, dst} for OFPMatch
Simplify the code a bit.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-01-31 04:02:21 +09:00
Isaku Yamahata
104436157a xid: improve xid handling
Generate xid for ofp message instead of always 0.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-01-30 18:32:47 +09:00
FUJITA Tomonori
cd0fbaffd9 Fix to send OFPT_HELLO with the highest OpenFlow protocol version
Preparation for 1.2 support.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-01-17 23:04:31 +09:00
FUJITA Tomonori
aa5051a162 initial commit
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2011-12-09 15:56:05 +09:00