diff options
author | Simon Horman <horms@verge.net.au> | 2013-01-25 16:22:07 +0900 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-02-05 09:17:45 -0800 |
commit | b02475c53b3ca857c45eb5e17d12fdf233a9dac8 (patch) | |
tree | 2f655ed5868adfceff879e372951e04a89599750 /lib/meta-flow.h | |
parent | d224e3501437af4a8480d734a99ca371a1eafa11 (diff) |
User-Space MPLS actions and matches
This patch implements use-space datapath and non-datapath code
to match and use the datapath API set out in Leo Alterman's patch
"user-space datapath: Add basic MPLS support to kernel".
The resulting MPLS implementation supports:
* Pushing a single MPLS label
* Poping a single MPLS label
* Modifying an MPLS lable using set-field or load actions
that act on the label value, tc and bos bit.
* There is no support for manipulating the TTL
this is considered future work.
The single-level push pop limitation is implemented by processing
push, pop and set-field/load actions in order and discarding information
that would require multiple levels of push/pop to be supported.
e.g.
push,push -> the first push is discarded
pop,pop -> the first pop is discarded
This patch is based heavily on work by Ravi K.
Cc: Ravi K <rkerur@gmail.com>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/meta-flow.h')
-rw-r--r-- | lib/meta-flow.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/meta-flow.h b/lib/meta-flow.h index 36758836..57f6df57 100644 --- a/lib/meta-flow.h +++ b/lib/meta-flow.h @@ -78,6 +78,11 @@ enum mf_field_id { MFF_DL_VLAN_PCP, /* u8 (OpenFlow 1.0 compatibility) */ MFF_VLAN_PCP, /* be16 (OpenFlow 1.2 compatibility) */ + /* L2.5 */ + MFF_MPLS_LABEL, /* be32 */ + MFF_MPLS_TC, /* u8 */ + MFF_MPLS_BOS, /* u8 */ + /* L3. */ MFF_IPV4_SRC, /* be32 */ MFF_IPV4_DST, /* be32 */ @@ -168,6 +173,9 @@ enum mf_prereqs { MFP_IPV6, MFP_IP_ANY, + /* L2.5 requirements. */ + MFP_MPLS, + /* L2+L3 requirements. */ MFP_TCP, /* On IPv4 or IPv6. */ MFP_UDP, /* On IPv4 or IPv6. */ @@ -220,6 +228,9 @@ struct mf_field { * - "dl_vlan_pcp" is 1 byte but only 3 bits. * - "is_frag" is 1 byte but only 2 bits. * - "ipv6_label" is 4 bytes but only 20 bits. + * - "mpls_label" is 4 bytes but only 20 bits. + * - "mpls_tc" is 1 byte but only 3 bits. + * - "mpls_bos" is 1 byte but only 1 bit. */ unsigned int n_bytes; /* Width of the field in bytes. */ unsigned int n_bits; /* Number of significant bits in field. */ |