Testing ofdpa2.0.1 GA release
diff --git a/accton/accton_util.py b/accton/accton_util.py
index a22aa8c..2f0cd35 100755
--- a/accton/accton_util.py
+++ b/accton/accton_util.py
@@ -779,14 +779,17 @@
return request
-def add_mpls_flow(ctrl, action_group_id, label=100 ,ethertype=0x0800, bos=1, send_barrier=False):
+def add_mpls_flow(ctrl, action_group_id, label=100 ,ethertype=0x0800, bos=1, vrf=1, send_barrier=False):
match = ofp.match()
match.oxm_list.append(ofp.oxm.eth_type(0x8847))
match.oxm_list.append(ofp.oxm.mpls_label(label))
match.oxm_list.append(ofp.oxm.mpls_bos(bos))
actions = [ofp.action.dec_mpls_ttl(),
ofp.action.copy_ttl_in(),
+ ofp.action.set_field(ofp.oxm.exp2ByteValue(exp_type=1, value=vrf)),
+ ofp.action.set_field(ofp.oxm.exp2ByteValue(exp_type=23, value=8)),
ofp.action.pop_mpls(ethertype)]
+
request = ofp.message.flow_add(
table_id=24,
cookie=43,
@@ -795,9 +798,9 @@
ofp.instruction.apply_actions(
actions=actions
),
- ofp.instruction.write_actions(
- actions=[ofp.action.group(action_group_id)]),
- ofp.instruction.goto_table(60)
+ #ofp.instruction.write_actions(
+ # actions=[ofp.action.group(action_group_id)]),
+ ofp.instruction.goto_table(27)
],
buffer_id=ofp.OFP_NO_BUFFER,
priority=1)
diff --git a/ofdpa/flows.py b/ofdpa/flows.py
index 0033468..b425be3 100755
--- a/ofdpa/flows.py
+++ b/ofdpa/flows.py
@@ -460,7 +460,7 @@
# ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
do_barrier(self.controller)
# add vlan flow table
- add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=0,
+ add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=2,
flag=VLAN_TABLE_FLAG_ONLY_TAG)
# add termination flow
add_termination_flow(self.controller, port, 0x0800, intf_src_mac,
@@ -468,7 +468,7 @@
# add routing flow
dst_ip = dip + (vlan_id << 8)
add_unicast_routing_flow(self.controller, 0x0800, dst_ip,
- 0xffffffff, mpls_label_gid)
+ 0xffffffff, mpls_label_gid,vrf=2)
Groups._put(l2_gid)
Groups._put(mpls_gid)
Groups._put(mpls_label_gid)
@@ -1152,13 +1152,12 @@
Insert IP packet
Receive MPLS packet
"""
-
def runTest(self):
Groups = Queue.LifoQueue()
if len(config["port_map"]) < 2:
logging.info("Port count less than 2, can't run this case")
return
-
+ dip = 0xc0a80001
intf_src_mac = [0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
dst_mac = [0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
# Assigns unique hardcoded test_id to make sure tests don't overlap when writing rules
@@ -1183,6 +1182,9 @@
add_termination_flow(self.controller, port, 0x8847, intf_src_mac,
vlan_id, goto_table=24)
add_mpls_flow(self.controller, ecmp_msg.group_id, port)
+ dst_ip = dip + (vlan_id << 8)
+ add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0xffffff00,
+ ecmp_msg.group_id, 1)
Groups._put(l2_gid)
Groups._put(l3_msg.group_id)
Groups._put(ecmp_msg.group_id)
@@ -1214,10 +1216,8 @@
pkt = str(exp_pkt)
verify_packet(self, pkt, out_port)
verify_no_other_packets(self)
- delete_all_flows(self.controller)
- delete_groups(self.controller, Groups)
-
-
+ #delete_all_flows(self.controller)
+ #delete_groups(self.controller, Groups)
class _24UcastTagged(base_tests.SimpleDataPlane):
diff --git a/src/python/loxi/of13/oxm.py b/src/python/loxi/of13/oxm.py
index 282e42f..7904ee2 100755
--- a/src/python/loxi/of13/oxm.py
+++ b/src/python/loxi/of13/oxm.py
@@ -6198,7 +6198,7 @@
oxm.subtypes[0xffff0007] = exp1ByteValue
class exp2ByteValue(oxm):
- type_len = 0xffff0008
+ type_len = 0xffff0006
def __init__(self, exp_type=0, value=None):
if value != None:
@@ -6210,9 +6210,9 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.type_len))
+ packed.append(struct.pack("!L", self.type_len | (self.exp_type <<9)))
packed.append(struct.pack("!L", OFDPA_EXPERIMETER))
- packed.append(struct.pack("!H", self.exp_type))
+ #packed.append(struct.pack("!H", self.exp_type))
packed.append(struct.pack("!H", self.value))
return ''.join(packed)
@@ -6292,4 +6292,4 @@
q.breakable()
q.text('}')
-oxm.subtypes[0xffff000a] = exp4ByteValue
\ No newline at end of file
+oxm.subtypes[0xffff000a] = exp4ByteValue