summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriel Levkovich <lariel@mellanox.com>2018-05-13 14:33:31 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-05-16 21:32:54 -0600
commit0d86bbec71b283803f844b35d50dba977be2db4a (patch)
treea46961467c476fa342c385d72db51c2ebf423dd0
parentd90e5e5038ef8e62c82710e3970317ef4eb367cf (diff)
downloadlinux-stable-0d86bbec71b283803f844b35d50dba977be2db4a.tar.gz
linux-stable-0d86bbec71b283803f844b35d50dba977be2db4a.tar.bz2
linux-stable-0d86bbec71b283803f844b35d50dba977be2db4a.zip
IB/uverbs: Expose MPLS flow spec to the user-kernel ABI header
Add ib_uverbs_flow_spec_mpls to define a rule to match the MPLS protocol. The spec includes the generic specs header, type, size and reserved fields while the filter itself is defined as ib_uverbs_flow_mpls_filter and includes a single 32bit field named 'label' which consists of: Bits 0:19 - The MPLS label. Bits 20:22 - Traffic class field. Bit 23 - Bottom of stack bit. Bits 24:31 - Time to live (TTL) field. Reviewed-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Ariel Levkovich <lariel@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--include/uapi/rdma/ib_user_verbs.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index 77c1a9a76e71..409507f83b91 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -1060,6 +1060,29 @@ struct ib_uverbs_flow_spec_gre {
struct ib_uverbs_flow_gre_filter mask;
};
+struct ib_uverbs_flow_mpls_filter {
+ /* The field includes the entire MPLS label:
+ * bits 0:19 - label field.
+ * bits 20:22 - traffic class field.
+ * bits 23 - bottom of stack bit.
+ * bits 24:31 - ttl field.
+ */
+ __be32 label;
+};
+
+struct ib_uverbs_flow_spec_mpls {
+ union {
+ struct ib_uverbs_flow_spec_hdr hdr;
+ struct {
+ __u32 type;
+ __u16 size;
+ __u16 reserved;
+ };
+ };
+ struct ib_uverbs_flow_mpls_filter val;
+ struct ib_uverbs_flow_mpls_filter mask;
+};
+
struct ib_uverbs_flow_attr {
__u32 type;
__u16 size;