---
include/openflow/nicira-ext.h | 3 ++-
tests/learn.at | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h
index 8f7506e..e4e2823 100644
--- a/include/openflow/nicira-ext.h
+++ b/include/openflow/nicira-ext.h
@@ -784,7 +784,8 @@ enum nx_mp_algorithm {
* actions=load:A->NXM_NX_REG1[16..31]".
*
* In syntax accepted by ovs-ofctl, this action is: learn(in_port=99,
- * NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31])
+ * NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],
+ * load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31])
*
* 2. Output to input port based on the source MAC and VLAN VID, with lookup
* into NXM_NX_REG1[16:31]:
diff --git a/tests/learn.at b/tests/learn.at
index 20a012d..1a34b9a 100644
--- a/tests/learn.at
+++ b/tests/learn.at
@@ -13,6 +13,23 @@ OFPT_FLOW_MOD (xid=0x3): ADD
actions=learn(table=1,idle_timeout=1,hard_timeout=2
]])
AT_CLEANUP
+AT_SETUP([learning action - examples])
+AT_DATA([flows.txt], [[
+# These are the examples from nicira-ext.h.
+actions=learn(in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],
load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31])
+actions=learn(NXM_OF_VLAN_TCI[0..11],
NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[])
+table=0 actions=learn(table=1,hard_timeout=10,
NXM_OF_VLAN_TCI[0..11],output:NXM_OF_IN_PORT[]), resubmit(,1)
+table=1 priority=0 actions=flood
+]])
+AT_CHECK([ovs-ofctl parse-flows flows.txt], [0],
+[[OFPT_FLOW_MOD (xid=0x1): ADD
actions=learn(table=1,in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31])
+OFPT_FLOW_MOD (xid=0x2): ADD
actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[])
+NXT_FLOW_MOD_TABLE_ID (xid=0x3): enable
+OFPT_FLOW_MOD (xid=0x4): ADD
actions=learn(table=1,hard_timeout=10,NXM_OF_VLAN_TCI[0..11],output:NXM_OF_IN_PORT[]),resubmit(,1)
+OFPT_FLOW_MOD (xid=0x5): ADD table:1 priority=0 actions=FLOOD
+]])
+AT_CLEANUP
+
AT_SETUP([learning action - satisfied prerequisites])
AT_DATA([flows.txt],
[[actions=learn(eth_type=0x800,load:5->NXM_OF_IP_DST[])
--
1.7.4.4
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev