diff options
author | Ben Pfaff <blp@nicira.com> | 2013-04-18 09:40:48 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-04-18 09:40:48 -0700 |
commit | 1638b90642cf9046a463d69bf1ea641cc81f66b2 (patch) | |
tree | 9768d8cbc91df3daaa8329c3e273319e5c9cf2ec /lib/meta-flow.h | |
parent | 781d44723705929ba8aea3c39611fe807c453682 (diff) |
Correctly implement the OpenFlow 1.2+ OXM_OF_IP_DSCP field.
NXM puts the DSCP value in bits 2-7 of NXM_OF_IP_TOS.
OXM puts the DSCP value in bits 0-6 of OXM_OF_IP_DSCP.
Before this commit, Open vSwitch incorrectly implemented OXM_OF_IP_DSCP
with the same format as NXM_OF_IP_TOS. This commit fixes the problem and
adds a test (previously missing but I don't know why).
Reported-by: Hiroshi Miyata <miyahiro.dazu@gmail.com>
Tested-by: Hiroshi Miyata <miyahiro.dazu@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/meta-flow.h')
-rw-r--r-- | lib/meta-flow.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/meta-flow.h b/lib/meta-flow.h index 57f6df57..9577a100 100644 --- a/lib/meta-flow.h +++ b/lib/meta-flow.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,8 +91,18 @@ enum mf_field_id { MFF_IPV6_DST, /* ipv6 */ MFF_IPV6_LABEL, /* be32 */ + /* The IPv4/IPv6 DSCP field has two different views: + * + * - MFF_IP_DSCP has the DSCP in bits 2-7, their bit positions in the + * IPv4 and IPv6 "traffic class" field, as used in OpenFlow 1.0 and 1.1 + * flow format and in NXM's NXM_OF_IP_TOS + * + * - MFF_IP_DSCP has the DSCP in bits 0-5, shifted right two bits from + * their positions in the IPv4 and IPv6 "traffic class" field, as used + * in OpenFlow 1.2+ OXM's OXM_OF_IP_DSCP. */ MFF_IP_PROTO, /* u8 (used for IPv4 or IPv6) */ MFF_IP_DSCP, /* u8 (used for IPv4 or IPv6) */ + MFF_IP_DSCP_SHIFTED, /* u8 (used for IPv4 or IPv6) (OF1.2 compat) */ MFF_IP_ECN, /* u8 (used for IPv4 or IPv6) */ MFF_IP_TTL, /* u8 (used for IPv4 or IPv6) */ MFF_IP_FRAG, /* u8 (used for IPv4 or IPv6) */ |