summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-06-26 09:41:45 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-06-26 09:41:45 +0900
commitfd7bac0f2df49f34ee3e19b7aee60b1eb1d53b12 (patch)
tree399e3bfbb93cd5e055c1028fda3286618dade5f3
parent8748812e5efc877f765f963c4f086d45e94099c7 (diff)
nxm: fix NXM_NX_REG
Needs to handle NXM_NX_REG_W. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/nx_match.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/ryu/ofproto/nx_match.py b/ryu/ofproto/nx_match.py
index 12453c78..c9f2834e 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