summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2012-03-08controller: print stack trace when datapath main loop goes wrong and log itIsaku Yamahata
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-08controller/network: fix key errorIsaku Yamahata
This patch fixes key error exception. The switch may connect to the controller before network creation API call. > Traceback (most recent call last): > File "/usr/lib/pymodules/python2.7/gevent/greenlet.py", line 390, in run > result = self._run(*self.args, **self.kwargs) > File "/ryubin/ryu/controller/controller.py", line 237, in datapath_connection_factory > datapath.serve() > File "/ryubin/ryu/controller/controller.py", line 184, in serve > self._recv_loop() > File "/ryubin/ryu/controller/controller.py", line 63, in deactivate > method(self) > File "/ryubin/ryu/controller/controller.py", line 136, in _recv_loop > self.ev_q.queue(ofp_event.ofp_msg_to_ev(msg)) > File "/ryubin/ryu/controller/dispatcher.py", line 106, in queue > self._dispatcher(ev) > File "/ryubin/ryu/controller/dispatcher.py", line 170, in __call__ > self.dispatch(ev) > File "/ryubin/ryu/controller/dispatcher.py", line 187, in dispatch > handled = self._dispatch(ev, self.events.get(ev.__class__, [])) > File "/ryubin/ryu/controller/dispatcher.py", line 178, in _dispatch > ret = h(ev) > File "/ryubin/ryu/app/simple_isolation.py", line 45, in switch_features_handler > self.nw.add_datapath(ev.msg) > File "/ryubin/ryu/controller/network.py", line 137, in add_datapath > self.port_added(datapath, port_no) > File "/ryubin/ryu/controller/network.py", line 144, in port_added > dp = self.dpids[datapath.id] > KeyError: None Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-07Avoid loop in OFPAction.parser()Simon Horman
OFPAction.parser() should call the parser of one of the classes registered in _ACTION_TYPES() rather than calling itself until a buffer underflow occurs. Also, it is not necessary to increment offset as the parser method of the registered classes re-parse the type and length and thus do not expect it to be incremented. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-06Increment offset in OFPFlowStats.parser()Simon Horman
After reading the third portion of the header the offset needs to be incremented as it is used to parse actions later on in the function. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-06Use struct.unpack_from() in OFPFlowStats.parser()Simon Horman
struct.unpack_from() is needed in place of struct.unpack() when an offset argument is passed. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01doc: update README.rst (OpenStack mainline inclusion status)FUJITA Tomonori
Update OpenStack mainline inclusion status Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01Correct typos in OFPFlowStatsRequestBase classSimon Horman
These changes correct what appear to be typos * Parameters should be separated by a comma * The type of the class is OFPFlowStatsRequestBase Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01yield the CPU to other greenletsFUJITA Tomonori
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-01avoid reading too much data from socketFUJITA Tomonori
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-01limit the queue size (send_q)FUJITA Tomonori
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-01kill recv_qFUJITA Tomonori
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-01dispatcher: eliminate weakref.WeakValueDictionaryIsaku Yamahata
For dispatcher to track children, WeakValueDictionary is used. By using explicit destructor, don't use it Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01dispatcher: eliminate use of weakref for EventQueue event queueIsaku Yamahata
event queue for EventQueue event can be normal reference by assuming the queue is never freed. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01controller: eliminate weakref of datapath.ev_q.auxIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01dispatcher: use TrackInstances and kill some WeakValueDictionaryIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01lib: mixin class to track all instances of a given classIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01controller: make Controller::serve more robustIsaku Yamahata
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-01ryu/controller/ofp_event: use utils.load_moduleIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01ryu/utils: make import_module() reliableIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-24controller/dispatcher: eliminate unregistering handlersIsaku Yamahata
This patch eliminates unregistering handlers and inheritable handlers. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-23enable OF1.2 supportFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-23add initial OF1.2 supportFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-22doc: update using_with_openstack.rst to catch up openstackIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-22add HACKING.rst: style guideIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-17doc: update osrg/nova, quantum repositoryIsaku Yamahata
Updated the documentation to refer the repository as I updated the repos, github.com/osrg/nova.git and github.com/osrg/quantum.git Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-17setup.py: typo autor -> authorIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14dpset: pep8Isaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14ryu/controller/handler: pep8Isaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14ofproto_parser: pep8Isaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14ofproto_v1_0_parser: typoIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14ofproto/ofproto_v1_0_parser: unbreak 0bff34ca87af74b7eb13d9c996fd869172a7f0a4Isaku Yamahata
The c/s 774088c3064604482e0d080f1bee2557ea705836 and 0bff34ca87af74b7eb13d9c996fd869172a7f0a4 have conflicted changes. This patch unbreaks it. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14doc: sample configuration filesIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14doc: step-by-step exampleIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-10app/simple_isolation: various improvementIsaku Yamahata
- add drop action when external network id - improve handling port status change Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-10controller/{mac_to_port, network}: add more methods to track port status changeIsaku Yamahata
These methods will be used to handle port status change message. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-10controller/datapath: add a helper function to delete flow entriesIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-09controller/dispatcher: eliminate the use of WeakSetIsaku Yamahata
As weakref.WeakSet is supported by python 2.7+. And RHEL 6.x uses python 2.6.x So avoid weakref.WeakSet by replacing it with WeakValueDictionary which is supported by weakref package from the beginning. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-09fix ofp_event conversion messupMORITA Kazutaka
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-08add cbench applicationFUJITA Tomonori
This simple application does _only_ what cbench expects. As usual, you can use this application in the following way: $ ryu-manager --app_lists ryu.app.cbench.Cbench Currently, this supports only the latency mode. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-05move to the main mode right after sending BARRIERFUJITA Tomonori
We had better to move on to the main state after getting the response of the barrier since it guarantees that the switch is in the known state (all the flows were removed). However, cbench doesn't work because it ignores the barrier. Also, the above "known" state doesn't always work (for example, the secondary controller should not remove all the flows in the case of HA configuration). Let's move on to the main state here for now. I guess that we need API to enable applications to initialize switches in their own ways. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-05fix datapath disconnection cleanupFUJITA Tomonori
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-03rest: add '/network' prefix to its pathIsaku Yamahata
Otherwise, no other REST PATH can't be used because any string is interpreted as network id. Later /switches PATH will be used. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-03remove unused members in Datapath classFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-03client: pass http responce when an error occursIsaku Yamahata
Thus the caller can examine error code instead of abort blindly and can provide more informative message. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-03controller: factor out ofp message event from event.pyIsaku Yamahata
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-03pylint: various fixes for pylintIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-01doc: how to invoke ryu-manager, its options and exampleIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-01app: event dumper applicationIsaku Yamahata
This app dumps events occurred in specified dispatcher. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-01controller/dpset: Introduce datapath enter/leave eventIsaku Yamahata
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-01dispatcher, handler: constantiate dispatcher nameIsaku Yamahata
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>