Please don't drop ryu-devel.

On Thu, Apr 25, 2013 at 10:26:17PM +0800, ?3?炯 wrote:
>     yes,you catch my mind, and this is a better solution than mine ,but maybe 
> we should  consider if we do not make some changes on method actions_to_str 
> of  ofctl_v1_0, we  will receive the follow flow information:
> 
>     {'n_packets': 806, 'idle_age': 0, 'n_bytes': 198236, 'actions': 
> ['UNKNOWN'], 'priority': 32768, 'cookie': '0x0', 'duration': 
> '17573.631000000', 'table_id': 0, 'nx_match': [{'in_port': '0x2'}, {'value': 
> '0x3'}]}
> 
>     the key actions sets to 'UNKONOWN',may be this is unfriendly .
> 
>     I expect to see some better changes.

Yes, I agree that ofctl_v1_0 still needs to be enhanced.

I just focused on ofproto_v1_0_parser.py. If you are okay, I'll prepare the 
patch
to ofproto_v1_0_parser.py.
After that, let's address ofctl_v1_0.

thanks,

> 
> 
> 
> 
>     Best Regards,
> 
>     Joe
> 
> 
> 
> 2013/4/25 Isaku Yamahata <[email protected]>
> 
>     On Thu, Apr 25, 2013 at 04:19:22PM +0800, ?3?炯 wrote:
>     > Hello,
>     > I find that when I use ryu app ofctl_rest to check flows, there will be
>     an
>     > error in  method actions_to_str of  ofctl_v1_0, the code as follows:
>     >
>     > def actions_to_str(acts):
>     >     actions = []
>     >     for a in acts:
>     >         action_type = a.cls_action_type
>     >
>     >         if action_type == ofproto_v1_0.OFPAT_OUTPUT:
>     >             buf = 'OUTPUT:' + str(a.port)
>     >
>     >     ......
>     >
>     > when I receive a action msg (e.g 
> NXActionResubmitTable,NXActionSetTunnel,
>     other
>     > nx_action_subtype),and these msgs do not have a member like
>     cls_action_type.
>     > so it encounters an error.
> 
>     NXActionHeader should derive from OFPActionVendor, not object?
> 
>     diff --git a/ryu/ofproto/ofproto_v1_0_parser.py b/ryu/ofproto/
>     ofproto_v1_0_parser.py
>     index 7945888..b1fe52d 100644
>     --- a/ryu/ofproto/ofproto_v1_0_parser.py
>     +++ b/ryu/ofproto/ofproto_v1_0_parser.py
>     @@ -394,7 +394,7 @@ class OFPActionVendor(OFPAction):
> 
> 
>      @OFPActionVendor.register_action_vendor(ofproto_v1_0.NX_VENDOR_ID)
>     -class NXActionHeader(object):
>     +class NXActionHeader(OFPActionVendor):
>          _NX_ACTION_SUBTYPES = {}
> 
>          @staticmethod
>     @@ -406,9 +406,8 @@ class NXActionHeader(object):
>              return _register_nx_action_subtype
> 
>          def __init__(self, subtype_, len_):
>     -        self.type = ofproto_v1_0.OFPAT_VENDOR
>     +        super(NXActionHeader, self).__init__(ofproto_v1_0.NX_VENDOR_ID)
>              self.len = len_
>     -        self.vendor = ofproto_v1_0.NX_VENDOR_ID
>              self.subtype = subtype_
> 
>          def serialize(self, buf, offset):
>     
> ---------------------------------------------------------------------------
> 
>     thanks,
> 
> 
>     > I don't know if there are proper ways to fix it ,and my solution is as
>     follows:
>     > ---------------------------------------
>     > diff --git a/ryu/lib/ofctl_v1_0.py b/ryu/lib/ofctl_v1_0.py
>     > index ad47470..ca9d207 100644
>     > --- a/ryu/lib/ofctl_v1_0.py
>     > +++ b/ryu/lib/ofctl_v1_0.py
>     > @@ -71,6 +71,12 @@ def actions_to_str(acts):
>     >              buf = 'SET_DL_SRC:' + haddr_to_str(a.dl_addr)
>     >          elif action_type == ofproto_v1_0.OFPAT_SET_DL_DST:
>     >              buf = 'SET_DL_DST:' + haddr_to_str(a.dl_addr)
>     > +        elif action_type == ofproto_v1_0.OFPAT_VENDOR:
>     > +            action_subtype = a.cls_subtype
>     > +            if action_subtype == ofproto_v1_0.NXAST_RESUBMIT:
>     > +                pass  #TODO
>     > +            else:
>     > +                pass
>     >          else:
>     >              buf = 'UNKNOWN'
>     >          actions.append(buf)
>     > diff --git a/ryu/ofproto/ofproto_v1_0_parser.py b/ryu/ofproto/
>     > ofproto_v1_0_parse
>     > index 7945888..ede1b13 100644
>     > --- a/ryu/ofproto/ofproto_v1_0_parser.py
>     > +++ b/ryu/ofproto/ofproto_v1_0_parser.py
>     > @@ -400,6 +400,7 @@ class NXActionHeader(object):
>     >      @staticmethod
>     >      def register_nx_action_subtype(subtype):
>     >          def _register_nx_action_subtype(cls):
>     > +            cls.cls_action_type = ofproto_v1_0.OFPAT_VENDOR
>     >              cls.cls_subtype = subtype
>     >              NXActionHeader._NX_ACTION_SUBTYPES[cls.cls_subtype] = cls
>     >              return cls
>     >
>     >
>     >
>     > Best regards,
>     > Joe
>     >
>     >
> 
>     >
>     
> ------------------------------------------------------------------------------
>     > Try New Relic Now & We'll Send You this Cool Shirt
>     > New Relic is the only SaaS-based application performance monitoring
>     service
>     > that delivers powerful full stack analytics. Optimize and monitor your
>     > browser, app, & servers with just a few lines of code. Try New Relic
>     > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/
>     newrelic_d2d_apr
>     > _______________________________________________
>     > Ryu-devel mailing list
>     > [email protected]
>     > https://lists.sourceforge.net/lists/listinfo/ryu-devel
>    
> 
>     --
>     yamahata
> 
> 

-- 
yamahata

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to