2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

Support matching and modifying IP ECN bits.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
Justin Pettit
2011-11-02 23:34:15 -07:00
parent 9e44d71563
commit 530180fd5a
21 changed files with 146 additions and 72 deletions

View File

@@ -492,6 +492,10 @@ nx_put_match(struct ofpbuf *b, const struct cls_rule *cr)
nxm_put_8(b, NXM_OF_IP_TOS, flow->tos & IP_DSCP_MASK);
}
if (cr->wc.tos_mask & IP_ECN_MASK) {
nxm_put_8(b, NXM_NX_IP_ECN, flow->tos & IP_ECN_MASK);
}
if (!(wc & FWW_NW_PROTO)) {
nxm_put_8(b, NXM_OF_IP_PROTO, flow->nw_proto);
switch (flow->nw_proto) {
@@ -542,6 +546,10 @@ nx_put_match(struct ofpbuf *b, const struct cls_rule *cr)
nxm_put_8(b, NXM_OF_IP_TOS, flow->tos & IP_DSCP_MASK);
}
if (cr->wc.tos_mask & IP_ECN_MASK) {
nxm_put_8(b, NXM_NX_IP_ECN, flow->tos & IP_ECN_MASK);
}
if (!(wc & FWW_NW_PROTO)) {
nxm_put_8(b, NXM_OF_IP_PROTO, flow->nw_proto);
switch (flow->nw_proto) {
@@ -1047,6 +1055,9 @@ nxm_read_field(const struct nxm_field *src, const struct flow *flow)
case NFI_NXM_OF_IP_TOS:
return flow->tos & IP_DSCP_MASK;
case NFI_NXM_NX_IP_ECN:
return flow->tos & IP_ECN_MASK;
case NFI_NXM_NX_IP_FRAG:
return flow->frag;
@@ -1202,6 +1213,11 @@ nxm_write_field(const struct nxm_field *dst, struct flow *flow,
flow->tos |= new_value & IP_DSCP_MASK;
break;
case NFI_NXM_NX_IP_ECN:
flow->tos &= ~IP_ECN_MASK;
flow->tos |= new_value & IP_ECN_MASK;
break;
case NFI_NXM_NX_IP_FRAG:
flow->frag = new_value;
break;