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.
Showing the changes to include/uapi (1 of 1 file). Show all
Unified · Split
| @@ -1060,6 +1060,29 @@ struct ib_uverbs_flow_spec_gre { · 1059 unmodified lines | ||
| 1060 | 1060 | struct ib_uverbs_flow_gre_filter mask; |
| 1061 | 1061 | }; |
| 1062 | 1062 | |
| 1063 | +struct ib_uverbs_flow_mpls_filter { | |
| 1064 | + /* The field includes the entire MPLS label: | |
| 1065 | + * bits 0:19 - label field. | |
| 1066 | + * bits 20:22 - traffic class field. | |
| 1067 | + * bits 23 - bottom of stack bit. | |
| 1068 | + * bits 24:31 - ttl field. | |
| 1069 | + */ | |
| 1070 | + __be32 label; | |
| 1071 | +}; | |
| 1072 | + | |
| 1073 | +struct ib_uverbs_flow_spec_mpls { | |
| 1074 | + union { | |
| 1075 | + struct ib_uverbs_flow_spec_hdr hdr; | |
| 1076 | + struct { | |
| 1077 | + __u32 type; | |
| 1078 | + __u16 size; | |
| 1079 | + __u16 reserved; | |
| 1080 | + }; | |
| 1081 | + }; | |
| 1082 | + struct ib_uverbs_flow_mpls_filter val; | |
| 1083 | + struct ib_uverbs_flow_mpls_filter mask; | |
| 1084 | +}; | |
| 1085 | + | |
| 1063 | 1086 | struct ib_uverbs_flow_attr { |
| 1064 | 1087 | __u32 type; |
| 1065 | 1088 | __u16 size; |