On Tue, 28 May 2013 17:05:12 +0000
Shaun Crampton <[email protected]> wrote:

>>> diff --git a/ryu/ofproto/ofproto_v1_3.py b/ryu/ofproto/ofproto_v1_3.py
>>> index 3a40eef..39d7dff 100644
>>> --- a/ryu/ofproto/ofproto_v1_3.py
>>> +++ b/ryu/ofproto/ofproto_v1_3.py
>>> @@ -97,7 +97,8 @@ OFPP_FLOOD = 0xfffffffb         # All physical ports
>>> except input port and
>>>  OFPP_ALL = 0xfffffffc           # All physical ports except input port.
>>>  OFPP_CONTROLLER = 0xfffffffd    # Send to controller.
>>>  OFPP_LOCAL = 0xfffffffe         # Local openflow "port".
>>> -OFPP_ANY = 0xffffffff              # Not associated with a physical port.
>>> +OFPP_ANY = 0xffffffff           # Not associated with a physical port.
>>> +OFPP_NONE = 0xffffffff          # Not associated with a physical port.
>>
>>Hi. OF1.1+ doesn't define OFPP_NONE. Only OF1.0 defines OFFP_NONE
>>If you need it for compatibility, OFPP_ANY should be used, I suppose.
> 
> There are various uses of ofproto.OFPP_NONE in the Ryu codebase, I believe
> removing this constant breaks some code paths.  Maybe it should be
> retained for backwards compatibility.
> 
> For example, in controller.py:
> 
>     def send_packet_out(self, buffer_id=0xffffffff, in_port=None,
>                         actions=None, data=None):
>         if in_port is None:
>             in_port = self.ofproto.OFPP_NONE
>         packet_out = self.ofproto_parser.OFPPacketOut(
>             self, buffer_id, in_port, actions, data)
>         self.send_msg(packet_out)

The above func was added long time ago when OF1.2 and OF1.3 didn't
exist. I think that it's time to fix such functions in Ryu since we
will have many OF1.3 capable switches soon.

There migth be the code using OFPP_NODE outside Ryu and I think that
they should be updated too (easily can be fixed anyway). I prefer not
to have OFPP_NONE in OF1.3 since OF1.3 doesn't have it.

Here's an update your patch.

=
>From 03d84c36e131dc5b68d4031fb56d726d8e50b6bb Mon Sep 17 00:00:00 2001
From: Shaun Crampton <[email protected]>
Date: Sat, 1 Jun 2013 21:35:12 +0900
Subject: [PATCH] of1.3: various fixes

- OFPActionSetField
- OFPBucket parser
- OFPMeterBandStats

Signed-off-by: Shaun Crampton <[email protected]>
Signed-off-by: FUJITA Tomonori <[email protected]>
---
 ryu/ofproto/ofproto_v1_3_parser.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_3_parser.py 
b/ryu/ofproto/ofproto_v1_3_parser.py
index 80a777d..524994d 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -1832,7 +1832,7 @@ class OFPActionPopMpls(OFPAction):
 class OFPActionSetField(OFPAction):
     def __init__(self, field):
         super(OFPActionSetField, self).__init__()
-        set.field = field
+        self.field = field
 
     @classmethod
     def parser(cls, buf, offset):
@@ -1884,13 +1884,12 @@ class OFPBucket(object):
 
     @classmethod
     def parser(cls, buf, offset):
-        (msg.len, msg.weigth, msg.watch_port,
-         msg.watch_group) = struct.unpack_from(
-             ofproto_v1_3.OFP_BUCKET_PACK_STR, buf, offset)
+        (len_, weigth, watch_port, watch_group) = struct.unpack_from(
+            ofproto_v1_3.OFP_BUCKET_PACK_STR, buf, offset)
+        msg = cls(len_, weight, watch_port, watch_group, [])
 
         length = ofproto_v1_3.OFP_BUCKET_SIZE
         offset += ofproto_v1_3.OFP_BUCKET_SIZE
-        msg.actions = []
         while length < msg.len:
             action = OFPAction.parser(buf, offset)
             msg.actions.append(action)
@@ -2402,7 +2401,7 @@ class OFPGroupFeaturesStatsReply(OFPMultipartReply):
 class OFPMeterBandStats(object):
     def __init__(self, packet_band_count, byte_band_count):
         super(OFPMeterBandStats, self).__init__()
-        self.packet_band_count = packet_bound_count
+        self.packet_band_count = packet_band_count
         self.byte_band_count = byte_band_count
 
     @classmethod
-- 
1.7.12.4 (Apple Git-37)


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to