summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8581385)
This enables the use of the OpenFlow 12 flow format.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
return "OpenFlow10+table_id";
case OFPUTIL_P_OF12_OXM:
return "OpenFlow10+table_id";
case OFPUTIL_P_OF12_OXM:
}
/* Check abbreviations. */
}
/* Check abbreviations. */
BUILD_ASSERT_DECL(FLOW_WC_SEQ == 17);
BUILD_ASSERT_DECL(FLOW_WC_SEQ == 17);
- /* NXM and OF1.1+ supports bitwise matching on ethernet addresses. */
+ /* NXM, OXM, and OF1.1 support bitwise matching on ethernet addresses. */
if (!eth_mask_is_exact(wc->masks.dl_src)
&& !eth_addr_is_zero(wc->masks.dl_src)) {
if (!eth_mask_is_exact(wc->masks.dl_src)
&& !eth_addr_is_zero(wc->masks.dl_src)) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
}
if (!eth_mask_is_exact(wc->masks.dl_dst)
&& !eth_addr_is_zero(wc->masks.dl_dst)) {
}
if (!eth_mask_is_exact(wc->masks.dl_dst)
&& !eth_addr_is_zero(wc->masks.dl_dst)) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* NXM and OF1.1+ support matching metadata. */
+ /* NXM, OXM, and OF1.1+ support matching metadata. */
if (wc->masks.metadata != htonll(0)) {
if (wc->masks.metadata != htonll(0)) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports matching ARP hardware addresses. */
+ /* NXM and OXM support matching ARP hardware addresses. */
if (!eth_addr_is_zero(wc->masks.arp_sha) ||
!eth_addr_is_zero(wc->masks.arp_tha)) {
if (!eth_addr_is_zero(wc->masks.arp_sha) ||
!eth_addr_is_zero(wc->masks.arp_tha)) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports matching IPv6 traffic. */
+ /* NXM and OXM support matching IPv6 traffic. */
if (match->flow.dl_type == htons(ETH_TYPE_IPV6)) {
if (match->flow.dl_type == htons(ETH_TYPE_IPV6)) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports matching registers. */
+ /* NXM and OXM support matching registers. */
if (!regs_fully_wildcarded(wc)) {
if (!regs_fully_wildcarded(wc)) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports matching tun_id. */
+ /* NXM and OXM support matching tun_id. */
if (wc->masks.tunnel.tun_id != htonll(0)) {
if (wc->masks.tunnel.tun_id != htonll(0)) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports matching fragments. */
+ /* NXM and OXM support matching fragments. */
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports matching IPv6 flow label. */
+ /* NXM and OXM support matching IPv6 flow label. */
if (wc->masks.ipv6_label) {
if (wc->masks.ipv6_label) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports matching IP ECN bits. */
+ /* NXM and OXM support matching IP ECN bits. */
if (wc->masks.nw_tos & IP_ECN_MASK) {
if (wc->masks.nw_tos & IP_ECN_MASK) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports matching IP TTL/hop limit. */
+ /* NXM and OXM support matching IP TTL/hop limit. */
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports non-CIDR IPv4 address masks. */
+ /* NXM and OXM support non-CIDR IPv4 address masks. */
if (!ip_is_cidr(wc->masks.nw_src) || !ip_is_cidr(wc->masks.nw_dst)) {
if (!ip_is_cidr(wc->masks.nw_src) || !ip_is_cidr(wc->masks.nw_dst)) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
- /* Only NXM supports bitwise matching on transport port. */
+ /* NXM and OXM support bitwise matching on transport port. */
if ((wc->masks.tp_src && wc->masks.tp_src != htons(UINT16_MAX)) ||
(wc->masks.tp_dst && wc->masks.tp_dst != htons(UINT16_MAX))) {
if ((wc->masks.tp_src && wc->masks.tp_src != htons(UINT16_MAX)) ||
(wc->masks.tp_dst && wc->masks.tp_dst != htons(UINT16_MAX))) {
- return OFPUTIL_P_OF10_NXM_ANY;
+ return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
}
/* Other formats can express this rule. */
}
/* Other formats can express this rule. */
usable_protocols &= OFPUTIL_P_TID;
}
usable_protocols &= OFPUTIL_P_TID;
}
- /* Matching of the cookie is only supported through NXM. */
+ /* Matching of the cookie is only supported through NXM or OF1.1+. */
if (fm->cookie_mask != htonll(0)) {
if (fm->cookie_mask != htonll(0)) {
- usable_protocols &= OFPUTIL_P_OF10_NXM_ANY;
+ usable_protocols &= OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
}
}
assert(usable_protocols);
}
}
assert(usable_protocols);
usable_protocols = ofputil_usable_protocols(&fsr->match);
if (fsr->cookie_mask != htonll(0)) {
usable_protocols = ofputil_usable_protocols(&fsr->match);
if (fsr->cookie_mask != htonll(0)) {
- usable_protocols &= OFPUTIL_P_OF10_NXM_ANY;
+ usable_protocols &= OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
}
return usable_protocols;
}
}
return usable_protocols;
}
OFPUTIL_P_OF12_OXM = 1 << 4,
/* All protocols. */
OFPUTIL_P_OF12_OXM = 1 << 4,
/* All protocols. */
-#define OFPUTIL_P_ANY (OFPUTIL_P_OF10_STD_ANY | OFPUTIL_P_OF10_NXM_ANY)
+#define OFPUTIL_P_ANY ((1 << 5) - 1)
/* Protocols in which a specific table may be specified in flow_mods. */
/* Protocols in which a specific table may be specified in flow_mods. */
-#define OFPUTIL_P_TID (OFPUTIL_P_OF10_STD_TID | OFPUTIL_P_OF10_NXM_TID)
+#define OFPUTIL_P_TID (OFPUTIL_P_OF10_STD_TID | \
+ OFPUTIL_P_OF10_NXM_TID | \
+ OFPUTIL_P_OF12_OXM)
};
/* Protocols to use for flow dumps, from most to least preferred. */
};
/* Protocols to use for flow dumps, from most to least preferred. */
table=1 priority=0 actions=flood
]])
AT_CHECK([ovs-ofctl parse-flows flows.txt], [0],
table=1 priority=0 actions=flood
]])
AT_CHECK([ovs-ofctl parse-flows flows.txt], [0],
-[[usable protocols: OpenFlow10+table_id,NXM+table_id
+[[usable protocols: OpenFlow10+table_id,NXM+table_id,OXM
chosen protocol: OpenFlow10+table_id
OFPT_FLOW_MOD (xid=0x1): ADD table:255 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 table:255 actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[])
chosen protocol: OpenFlow10+table_id
OFPT_FLOW_MOD (xid=0x1): ADD table:255 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 table:255 actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[])
AT_CHECK([ovs-ofctl parse-flows flows.txt
], [0], [stdout])
AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
AT_CHECK([ovs-ofctl parse-flows flows.txt
], [0], [stdout])
AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
-[[usable protocols: NXM+table_id
+[[usable protocols: NXM+table_id,OXM
chosen protocol: NXM+table_id
NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD
NXT_FLOW_MOD: ADD table:255 in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
chosen protocol: NXM+table_id
NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD
NXT_FLOW_MOD: ADD table:255 in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
])
AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
])
AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
+usable protocols: NXM,OXM
chosen protocol: NXM-table_id
NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
chosen protocol: NXM-table_id
NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
]])
AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout], [stderr])
AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
]])
AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout], [stderr])
AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
+[[usable protocols: NXM,OXM
chosen protocol: NXM-table_id
NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
chosen protocol: NXM-table_id
NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
dnl such as tunnels and metadata.
AT_SETUP([ovs-ofctl -F option and NXM features])
AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
dnl such as tunnels and metadata.
AT_SETUP([ovs-ofctl -F option and NXM features])
AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
- [1], [], [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
+ [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
])
AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop],
])
AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop],
- [1], [], [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
+ [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
OVS_VSWITCHD_START
AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
OVS_VSWITCHD_START
AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
- [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
+ [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
])
OVS_VSWITCHD_STOP
AT_CLEANUP
])
OVS_VSWITCHD_STOP
AT_CLEANUP