Signed-off-by: Simon Horman <ho...@verge.net.au> ---
Tests pass with the "[PATCH 0/6 v3] OXM VLAN VID and VLAN PCP" series applied on top of the current master branch (df77824). --- tests/ovs-ofctl.at | 12 ++++++++++-- utilities/ovs-ofctl.c | 14 +++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 0ea076d..8e3c5f7 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -1694,24 +1694,25 @@ dnl [1] AT_CHECK([ovs-ofctl check-vlan 0000 0000], [0], [dnl -> 0000/0000 NXM: <any> -> 0000/0000 +OXM: <any> -> 0000/0000,-- OF1.0: 0000/1,00/1 -> 0000/0000 OF1.1: 0000/1,00/1 -> 0000/0000 -OF1.2: 0000/1,00/1 -> 0000/0000 ]) dnl [2] AT_CHECK([ovs-ofctl check-vlan 0000 ffff], [0], [dnl vlan_tci=0x0000 -> 0000/ffff NXM: NXM_OF_VLAN_TCI(0000) -> 0000/ffff +OXM: OXM_OF_VLAN_VID(0000) -> 0000/1fff,-- OF1.0: ffff/0,00/1 -> 0000/ffff OF1.1: ffff/0,00/1 -> 0000/ffff -OF1.2: ffff/0,00/1 -> 0000/ffff ]) dnl [3] AT_CHECK([ovs-ofctl check-vlan 1abc 1fff], [0], [dnl dl_vlan=2748 -> 1abc/1fff NXM: NXM_OF_VLAN_TCI_W(1abc/1fff) -> 1abc/1fff +OXM: OXM_OF_VLAN_VID(1abc) -> 1abc/1fff,-- OF1.0: 0abc/0,00/1 -> 1abc/1fff OF1.1: 0abc/0,00/1 -> 1abc/1fff ]) @@ -1720,6 +1721,7 @@ dnl [4] AT_CHECK([ovs-ofctl check-vlan b000 f000], [0], [dnl dl_vlan_pcp=5 -> b000/f000 NXM: NXM_OF_VLAN_TCI_W(b000/f000) -> b000/f000 +OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(05) -> 1000/1000,05 OF1.0: 0000/1,05/0 -> b000/f000 OF1.1: fffe/0,05/0 -> b000/f000 ]) @@ -1728,6 +1730,7 @@ dnl [5] AT_CHECK([ovs-ofctl check-vlan babc ffff], [0], [dnl dl_vlan=2748,dl_vlan_pcp=5 -> babc/ffff NXM: NXM_OF_VLAN_TCI(babc) -> babc/ffff +OXM: OXM_OF_VLAN_VID(1abc), OXM_OF_VLAN_PCP(05) -> 1abc/1fff,05 OF1.0: 0abc/0,05/0 -> babc/ffff OF1.1: 0abc/0,05/0 -> babc/ffff ]) @@ -1736,6 +1739,7 @@ dnl [6] AT_CHECK([ovs-ofctl check-vlan 0000 0fff], [0], [dnl vlan_tci=0x0000/0x0fff -> 0000/0fff NXM: NXM_OF_VLAN_TCI_W(0000/0fff) -> 0000/0fff +OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,-- OF1.0: 0000/0,00/1 -> 1000/1fff OF1.1: 0000/0,00/1 -> 1000/1fff ]) @@ -1744,6 +1748,7 @@ dnl [7] AT_CHECK([ovs-ofctl check-vlan 0000 f000], [0], [dnl vlan_tci=0x0000/0xf000 -> 0000/f000 NXM: NXM_OF_VLAN_TCI_W(0000/f000) -> 0000/f000 +OXM: OXM_OF_VLAN_VID_W(0000/1000) -> 0000/1000,-- OF1.0: ffff/0,00/1 -> 0000/ffff OF1.1: ffff/0,00/1 -> 0000/ffff ]) @@ -1752,6 +1757,7 @@ dnl [8] AT_CHECK([ovs-ofctl check-vlan 0000 efff], [0], [dnl vlan_tci=0x0000/0xefff -> 0000/efff NXM: NXM_OF_VLAN_TCI_W(0000/efff) -> 0000/efff +OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,-- OF1.0: 0000/0,00/0 -> 1000/ffff OF1.1: 0000/0,00/0 -> 1000/ffff ]) @@ -1760,6 +1766,7 @@ dnl [9] AT_CHECK([ovs-ofctl check-vlan 1001 1001], [0], [dnl vlan_tci=0x1001/0x1001 -> 1001/1001 NXM: NXM_OF_VLAN_TCI_W(1001/1001) -> 1001/1001 +OXM: OXM_OF_VLAN_VID_W(1001/1001) -> 1001/1001,-- OF1.0: 0001/0,00/1 -> 1001/1fff OF1.1: 0001/0,00/1 -> 1001/1fff ]) @@ -1768,6 +1775,7 @@ dnl [10] AT_CHECK([ovs-ofctl check-vlan 3000 3000], [0], [dnl vlan_tci=0x3000/0x3000 -> 3000/3000 NXM: NXM_OF_VLAN_TCI_W(3000/3000) -> 3000/3000 +OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) -> 1000/1000,01 OF1.0: 0000/1,01/0 -> 3000/f000 OF1.1: fffe/0,01/0 -> 3000/f000 ]) diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index a647506..4a5a601 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -2589,9 +2589,17 @@ ofctl_check_vlan(int argc OVS_UNUSED, char *argv[]) if (error) { printf("%s\n", ofperr_to_string(error)); } else { - printf("%04"PRIx16"/%04"PRIx16"\n", - ntohs(nxm_rule.flow.vlan_tci), - ntohs(nxm_rule.wc.vlan_tci_mask)); + uint16_t vid = ntohs(nxm_rule.flow.vlan_tci) & + (VLAN_VID_MASK | VLAN_CFI); + uint16_t mask = ntohs(nxm_rule.wc.vlan_tci_mask) & + (VLAN_VID_MASK | VLAN_CFI); + + printf("%04"PRIx16"/%04"PRIx16",", vid, mask); + if (vid && vlan_tci_to_pcp(nxm_rule.wc.vlan_tci_mask)) { + printf("%02"PRIx8"\n", vlan_tci_to_pcp(nxm_rule.flow.vlan_tci)); + } else { + printf("--\n"); + } } free(nxm_s); ofpbuf_uninit(&nxm); -- 1.7.10.2.484.gcd07cc5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev