On Sat, 23 Jun 2012 21:25:27 +0900
FUJITA Tomonori <[email protected]> wrote:

> btw, the current code is totally broken. We need to handle
> ofproto_v1_0.nxm_nx_reg_w().

Applied the following patch.

> diff --git a/ryu/ofproto/nx_match.py b/ryu/ofproto/nx_match.py
> index 12453c7..c9f2834 100644
> --- a/ryu/ofproto/nx_match.py
> +++ b/ryu/ofproto/nx_match.py
> @@ -704,7 +704,8 @@ class MFICMPV6Label(MFField):
>  
>  
>  @_register_make
> -@_set_nxm_headers([ofproto_v1_0.nxm_nx_reg(i) for i in range(FLOW_N_REGS)])
> +@_set_nxm_headers([ofproto_v1_0.nxm_nx_reg(i) for i in range(FLOW_N_REGS)]
> +                  + [ofproto_v1_0.nxm_nx_reg_w(i) for i in 
> range(FLOW_N_REGS)])
>  class MFRegister(MFField):
>      @classmethod
>      def make(cls, header):
> @@ -712,7 +713,8 @@ class MFRegister(MFField):
>  
>      def put(self, buf, offset, rule):
>          for i in range(FLOW_N_REGS):
> -            if ofproto_v1_0.nxm_nx_reg(i) == self.nxm_header:
> +            if (ofproto_v1_0.nxm_nx_reg(i) == self.nxm_header or
> +                ofproto_v1_0.nxm_nx_reg_w(i) == self.nxm_header):
>                  if rule.wc.regs_mask[i]:
>                      return self.putm(buf, offset, rule.flow.regs[i],
>                                       rule.wc.regs_mask[i])
> @@ -889,7 +891,10 @@ def serialize_nxm_match(rule, buf, offset):
>  
>      for i in range(FLOW_N_REGS):
>          if rule.wc.regs_bits & (1 << i):
> -            header = ofproto_v1_0.nxm_nx_reg(i)
> +            if rule.wc.regs_mask[i]:
> +                header = ofproto_v1_0.nxm_nx_reg_w(i)
> +            else:
> +                header = ofproto_v1_0.nxm_nx_reg(i)
>              offset += nxm_put(buf, offset, header, rule)
>  
>      # Pad
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to