/* ## -------- ## */
{
+ MFF_DP_HASH, "dp_hash", NULL,
+ MF_FIELD_SIZES(be32),
+ MFM_FULLY,
+ MFS_HEXADECIMAL,
+ MFP_NONE,
+ false,
+ NXM_NX_DP_HASH, "NXM_NX_DP_HASH",
+ NXM_NX_DP_HASH, "NXM_NX_DP_HASH",
+ OFPUTIL_P_NXM_OXM_ANY,
+ OFPUTIL_P_NXM_OXM_ANY,
+ -1,
+ }, {
+ MFF_RECIRC_ID, "recirc_id", NULL,
+ MF_FIELD_SIZES(be32),
+ MFM_NONE,
+ MFS_DECIMAL,
+ MFP_NONE,
+ false,
+ NXM_NX_RECIRC_ID, "NXM_NX_RECIRC_ID",
+ NXM_NX_RECIRC_ID, "NXM_NX_RECIRC_ID",
+ OFPUTIL_P_NXM_OXM_ANY,
+ OFPUTIL_P_NXM_OXM_ANY,
+ -1,
+ }, {
MFF_TUN_ID, "tun_id", "tunnel_id",
MF_FIELD_SIZES(be64),
MFM_FULLY,
mf_is_all_wild(const struct mf_field *mf, const struct flow_wildcards *wc)
{
switch (mf->id) {
+ case MFF_DP_HASH:
+ return !wc->masks.dp_hash;
+ case MFF_RECIRC_ID:
+ return !wc->masks.recirc_id;
case MFF_TUN_SRC:
return !wc->masks.tunnel.ip_src;
case MFF_TUN_DST:
OVS_NOT_REACHED();
}
-static bool
-is_icmpv4(const struct flow *flow)
-{
- return (flow->dl_type == htons(ETH_TYPE_IP)
- && flow->nw_proto == IPPROTO_ICMP);
-}
-
-static bool
-is_icmpv6(const struct flow *flow)
-{
- return (flow->dl_type == htons(ETH_TYPE_IPV6)
- && flow->nw_proto == IPPROTO_ICMPV6);
-}
-
/* Returns true if 'flow' meets the prerequisites for 'mf', false otherwise. */
bool
mf_are_prereqs_ok(const struct mf_field *mf, const struct flow *flow)
mf_is_value_valid(const struct mf_field *mf, const union mf_value *value)
{
switch (mf->id) {
+ case MFF_DP_HASH:
+ case MFF_RECIRC_ID:
case MFF_TUN_ID:
case MFF_TUN_SRC:
case MFF_TUN_DST:
union mf_value *value)
{
switch (mf->id) {
+ case MFF_DP_HASH:
+ value->be32 = htonl(flow->dp_hash);
+ break;
+ case MFF_RECIRC_ID:
+ value->be32 = htonl(flow->recirc_id);
+ break;
case MFF_TUN_ID:
value->be64 = flow->tunnel.tun_id;
break;
case MFF_MPLS_BOS:
value->u8 = mpls_lse_to_bos(flow->mpls_lse[0]);
break;
- break;
case MFF_IPV4_SRC:
value->be32 = flow->nw_src;
const union mf_value *value, struct match *match)
{
switch (mf->id) {
+ case MFF_DP_HASH:
+ match_set_dp_hash(match, ntohl(value->be32));
+ break;
+ case MFF_RECIRC_ID:
+ match_set_recirc_id(match, ntohl(value->be32));
+ break;
case MFF_TUN_ID:
match_set_tun_id(match, value->be64);
break;
case MFF_MPLS_BOS:
match_set_mpls_bos(match, 0, value->u8);
break;
- break;
case MFF_IPV4_SRC:
match_set_nw_src(match, value->be32);
const union mf_value *value, struct flow *flow)
{
switch (mf->id) {
+ case MFF_DP_HASH:
+ flow->dp_hash = ntohl(value->be32);
+ break;
+ case MFF_RECIRC_ID:
+ flow->recirc_id = ntohl(value->be32);
+ break;
case MFF_TUN_ID:
flow->tunnel.tun_id = value->be64;
break;
case MFF_MPLS_BOS:
flow_set_mpls_bos(flow, 0, value->u8);
break;
- break;
case MFF_IPV4_SRC:
flow->nw_src = value->be32;
break;
case MFF_IP_FRAG:
- flow->nw_frag &= value->u8;
+ flow->nw_frag = value->u8 & FLOW_NW_FRAG_MASK;
break;
case MFF_ARP_OP:
mf_set_wild(const struct mf_field *mf, struct match *match)
{
switch (mf->id) {
+ case MFF_DP_HASH:
+ match->flow.dp_hash = 0;
+ match->wc.masks.dp_hash = 0;
+ break;
+ case MFF_RECIRC_ID:
+ match->flow.recirc_id = 0;
+ match->wc.masks.recirc_id = 0;
+ break;
case MFF_TUN_ID:
match_set_tun_id_masked(match, htonll(0), htonll(0));
break;
case MFF_MPLS_BOS:
match_set_any_mpls_bos(match, 0);
break;
- break;
case MFF_IPV4_SRC:
case MFF_ARP_SPA:
}
switch (mf->id) {
+ case MFF_RECIRC_ID:
case MFF_IN_PORT:
case MFF_IN_PORT_OXM:
case MFF_SKB_PRIORITY:
case MFF_ICMPV6_CODE:
return OFPUTIL_P_NONE;
+ case MFF_DP_HASH:
+ match_set_dp_hash_masked(match, ntohl(value->be32), ntohl(mask->be32));
+ break;
case MFF_TUN_ID:
match_set_tun_id_masked(match, value->be64, mask->be64);
break;