summaryrefslogtreecommitdiff
path: root/tests/test-classifier.c
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2009-11-11 14:59:49 -0800
committerJustin Pettit <jpettit@nicira.com>2010-02-20 02:22:26 -0800
commit959a2ecdc8a5ffe53e74456ff6eb1ec25092db75 (patch)
treed7f7759d577a14c00c0e255e2403a4ecd1f4534d /tests/test-classifier.c
parent2f6d344525463ebe52f6bbd0e9a4cc22e33dacbe (diff)
downloadopenvswitch-959a2ecdc8a5ffe53e74456ff6eb1ec25092db75.tar.gz
ofproto: Match VLAN PCP and rewrite ToS bits (OpenFlow 0.9)
Starting in OpenFlow 0.9, it is possible to match on the VLAN PCP (priority) field and rewrite the IP ToS/DSCP bits. This check-in provides that support and bumps the wire protocol number to 0x98. NOTE: The wire changes come together over the set of OpenFlow 0.9 commits, so OVS will not be OpenFlow-compatible with any official release between this commit and the one that completes the set.
Diffstat (limited to 'tests/test-classifier.c')
-rw-r--r--tests/test-classifier.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test-classifier.c b/tests/test-classifier.c
index 010cdc641..f488ac662 100644
--- a/tests/test-classifier.c
+++ b/tests/test-classifier.c
@@ -240,6 +240,7 @@ static uint32_t nw_dst_values[] = { T_HTONL(0xc0a80002),
T_HTONL(0xc0a04455) };
static uint16_t in_port_values[] = { T_HTONS(1), T_HTONS(OFPP_LOCAL) };
static uint16_t dl_vlan_values[] = { T_HTONS(101), T_HTONS(0) };
+static uint8_t dl_vlan_pcp_values[] = { 7, 0 };
static uint16_t dl_type_values[]
= { T_HTONS(ETH_TYPE_IP), T_HTONS(ETH_TYPE_ARP) };
static uint16_t tp_src_values[] = { T_HTONS(49362), T_HTONS(80) };
@@ -261,6 +262,9 @@ init_values(void)
values[CLS_F_IDX_DL_VLAN][0] = &dl_vlan_values[0];
values[CLS_F_IDX_DL_VLAN][1] = &dl_vlan_values[1];
+ values[CLS_F_IDX_DL_VLAN_PCP][0] = &dl_vlan_pcp_values[0];
+ values[CLS_F_IDX_DL_VLAN_PCP][1] = &dl_vlan_pcp_values[1];
+
values[CLS_F_IDX_DL_SRC][0] = dl_src_values[0];
values[CLS_F_IDX_DL_SRC][1] = dl_src_values[1];
@@ -290,6 +294,7 @@ init_values(void)
#define N_NW_DST_VALUES ARRAY_SIZE(nw_dst_values)
#define N_IN_PORT_VALUES ARRAY_SIZE(in_port_values)
#define N_DL_VLAN_VALUES ARRAY_SIZE(dl_vlan_values)
+#define N_DL_VLAN_PCP_VALUES ARRAY_SIZE(dl_vlan_pcp_values)
#define N_DL_TYPE_VALUES ARRAY_SIZE(dl_type_values)
#define N_TP_SRC_VALUES ARRAY_SIZE(tp_src_values)
#define N_TP_DST_VALUES ARRAY_SIZE(tp_dst_values)
@@ -301,6 +306,7 @@ init_values(void)
N_NW_DST_VALUES * \
N_IN_PORT_VALUES * \
N_DL_VLAN_VALUES * \
+ N_DL_VLAN_PCP_VALUES * \
N_DL_TYPE_VALUES * \
N_TP_SRC_VALUES * \
N_TP_DST_VALUES * \
@@ -350,6 +356,8 @@ compare_classifiers(struct classifier *cls, struct tcls *tcls)
flow.nw_dst = nw_dst_values[get_value(&x, N_NW_DST_VALUES)];
flow.in_port = in_port_values[get_value(&x, N_IN_PORT_VALUES)];
flow.dl_vlan = dl_vlan_values[get_value(&x, N_DL_VLAN_VALUES)];
+ flow.dl_vlan_pcp = dl_vlan_pcp_values[get_value(&x,
+ N_DL_VLAN_PCP_VALUES)];
flow.dl_type = dl_type_values[get_value(&x, N_DL_TYPE_VALUES)];
flow.tp_src = tp_src_values[get_value(&x, N_TP_SRC_VALUES)];
flow.tp_dst = tp_dst_values[get_value(&x, N_TP_DST_VALUES)];
@@ -358,7 +366,6 @@ compare_classifiers(struct classifier *cls, struct tcls *tcls)
memcpy(flow.dl_dst, dl_dst_values[get_value(&x, N_DL_DST_VALUES)],
ETH_ADDR_LEN);
flow.nw_proto = nw_proto_values[get_value(&x, N_NW_PROTO_VALUES)];
- flow.reserved = 0;
for (include = 1; include <= 3; include++) {
cr0 = lookup_with_include_bits(cls, &flow, include);