From 25aff5d9533c37474ae5a8ed16feb8f5246c81fa Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 9 Oct 2013 14:17:36 +0900 Subject: [PATCH 1/2] l2_switch_v1_3: avoid sending a packet back to in_port otherwise it would confuse neighbour switches' mac learning. this should fix the problem reported by Ramachandra Kasyap on ryu-devel ML. http://sourceforge.net/mailarchive/forum.php?thread_name=CAMv-r%2BNXa2XqKxkQ2Hexa7egnS6_dxzZ%3Doba%2BdMXFZ2WdoXV3w%40mail.gmail.com&forum_name=ryu-devel --- scripts/ryu/l2_switch_v1_3.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ryu/l2_switch_v1_3.py b/scripts/ryu/l2_switch_v1_3.py index aab1d56..a7ac6ed 100644 --- a/scripts/ryu/l2_switch_v1_3.py +++ b/scripts/ryu/l2_switch_v1_3.py @@ -81,7 +81,7 @@ def _packet_in_handler(self, ev): self.install_dst_entry(datapath, in_port, eth_src) # Flood - self.flood(datapath, msg.data) + self.flood(datapath, in_port, msg.data) def install_src_entry(self, datapath, in_port, eth_src): """Install flow entry matching on eth_src in table 0.""" @@ -105,13 +105,13 @@ def install_dst_entry(self, datapath, in_port, eth_src): flow_mod = self.create_flow_mod(datapath, 123, 1, match, [write]) datapath.send_msg(flow_mod) - def flood(self, datapath, data): + def flood(self, datapath, in_port, data): """Send a packet_out with output to all ports.""" parser = datapath.ofproto_parser ofproto = datapath.ofproto output_all = parser.OFPActionOutput(ofproto.OFPP_ALL, ofproto.OFPCML_NO_BUFFER) packet_out = parser.OFPPacketOut(datapath, 0xffffffff, - ofproto.OFPP_CONTROLLER, + in_port, [output_all], data) datapath.send_msg(packet_out) From 829fa7ec3de35ed3993ff57ed932fa6e0699487b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 9 Oct 2013 14:22:08 +0900 Subject: [PATCH 2/2] l2_switch_v1_3: use the correct no_buffer macro these variants actually have different values. ie. 16 bit vs 32 bit. i found this while looking at log provided by Ramachandra Kasyap. http://sourceforge.net/mailarchive/message.php?msg_id=31499382 --- scripts/ryu/l2_switch_v1_3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ryu/l2_switch_v1_3.py b/scripts/ryu/l2_switch_v1_3.py index a7ac6ed..e2771af 100644 --- a/scripts/ryu/l2_switch_v1_3.py +++ b/scripts/ryu/l2_switch_v1_3.py @@ -36,7 +36,7 @@ def create_flow_mod(self, datapath, priority, flow_mod = datapath.ofproto_parser.OFPFlowMod(datapath, 0, 0, table_id, ofproto.OFPFC_ADD, 0, 0, priority, - ofproto.OFPCML_NO_BUFFER, + ofproto.OFP_NO_BUFFER, ofproto.OFPP_ANY, OFPG_ANY, 0, match, instructions) @@ -111,7 +111,7 @@ def flood(self, datapath, in_port, data): ofproto = datapath.ofproto output_all = parser.OFPActionOutput(ofproto.OFPP_ALL, ofproto.OFPCML_NO_BUFFER) - packet_out = parser.OFPPacketOut(datapath, 0xffffffff, + packet_out = parser.OFPPacketOut(datapath, ofproto.OFP_NO_BUFFER, in_port, [output_all], data) datapath.send_msg(packet_out)