mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
Introduce 128-bit xxregs.
These are needed to handle IPv6 addresses. Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -237,6 +237,10 @@ mf_is_all_wild(const struct mf_field *mf, const struct flow_wildcards *wc)
|
||||
return !wc->masks.regs[mf->id - MFF_REG0];
|
||||
CASE_MFF_XREGS:
|
||||
return !flow_get_xreg(&wc->masks, mf->id - MFF_XREG0);
|
||||
CASE_MFF_XXREGS: {
|
||||
ovs_u128 value = flow_get_xxreg(&wc->masks, mf->id - MFF_XXREG0);
|
||||
return ovs_u128_is_zero(value);
|
||||
}
|
||||
case MFF_ACTSET_OUTPUT:
|
||||
return !wc->masks.actset_output;
|
||||
|
||||
@@ -526,6 +530,7 @@ mf_is_value_valid(const struct mf_field *mf, const union mf_value *value)
|
||||
case MFF_CT_LABEL:
|
||||
CASE_MFF_REGS:
|
||||
CASE_MFF_XREGS:
|
||||
CASE_MFF_XXREGS:
|
||||
case MFF_ETH_SRC:
|
||||
case MFF_ETH_DST:
|
||||
case MFF_ETH_TYPE:
|
||||
@@ -705,6 +710,10 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,
|
||||
value->be64 = htonll(flow_get_xreg(flow, mf->id - MFF_XREG0));
|
||||
break;
|
||||
|
||||
CASE_MFF_XXREGS:
|
||||
value->be128 = hton128(flow_get_xxreg(flow, mf->id - MFF_XXREG0));
|
||||
break;
|
||||
|
||||
case MFF_ETH_SRC:
|
||||
value->mac = flow->dl_src;
|
||||
break;
|
||||
@@ -963,6 +972,10 @@ mf_set_value(const struct mf_field *mf,
|
||||
match_set_xreg(match, mf->id - MFF_XREG0, ntohll(value->be64));
|
||||
break;
|
||||
|
||||
CASE_MFF_XXREGS:
|
||||
match_set_xxreg(match, mf->id - MFF_XXREG0, ntoh128(value->be128));
|
||||
break;
|
||||
|
||||
case MFF_ETH_SRC:
|
||||
match_set_dl_src(match, value->mac);
|
||||
break;
|
||||
@@ -1273,6 +1286,10 @@ mf_set_flow_value(const struct mf_field *mf,
|
||||
flow_set_xreg(flow, mf->id - MFF_XREG0, ntohll(value->be64));
|
||||
break;
|
||||
|
||||
CASE_MFF_XXREGS:
|
||||
flow_set_xxreg(flow, mf->id - MFF_XXREG0, ntoh128(value->be128));
|
||||
break;
|
||||
|
||||
case MFF_ETH_SRC:
|
||||
flow->dl_src = value->mac;
|
||||
break;
|
||||
@@ -1598,6 +1615,12 @@ mf_set_wild(const struct mf_field *mf, struct match *match, char **err_str)
|
||||
match_set_xreg_masked(match, mf->id - MFF_XREG0, 0, 0);
|
||||
break;
|
||||
|
||||
CASE_MFF_XXREGS: {
|
||||
match_set_xxreg_masked(match, mf->id - MFF_XXREG0, OVS_U128_ZERO,
|
||||
OVS_U128_ZERO);
|
||||
break;
|
||||
}
|
||||
|
||||
case MFF_ETH_SRC:
|
||||
match->flow.dl_src = eth_addr_zero;
|
||||
match->wc.masks.dl_src = eth_addr_zero;
|
||||
@@ -1863,6 +1886,12 @@ mf_set(const struct mf_field *mf,
|
||||
ntohll(value->be64), ntohll(mask->be64));
|
||||
break;
|
||||
|
||||
CASE_MFF_XXREGS: {
|
||||
match_set_xxreg_masked(match, mf->id - MFF_XXREG0,
|
||||
ntoh128(value->be128), ntoh128(mask->be128));
|
||||
break;
|
||||
}
|
||||
|
||||
case MFF_PKT_MARK:
|
||||
match_set_pkt_mark_masked(match, ntohl(value->be32),
|
||||
ntohl(mask->be32));
|
||||
|
Reference in New Issue
Block a user