diff options
author | David S. Miller <davem@davemloft.net> | 2016-12-08 11:32:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-08 11:32:50 -0500 |
commit | 8b7b707a3c2746566d21871e1715ce325fb2e656 (patch) | |
tree | c185d8ea9b9e4420af0012d920aebca699b1c4c3 /drivers | |
parent | d26aac2d8783ab7ec94e07d412d785b3ac183606 (diff) | |
parent | 3f7d0eb42d593a3326617dac0a247d981b3356d9 (diff) |
Merge branch 'cls_flower-flags'
Or Gerlitz says:
====================
net/sched: cls_flower: Add support for matching on dissection flags
This series add the UAPI to provide set of flags for matching, where the
flags provided from user-space are mapped to flow-dissector flags.
The 1st flag allows to match on whether the packet is an
IP fragment and corresponds to the FLOW_DIS_IS_FRAGMENT flag.
v2->v3:
- replace BIT() with << (kbuild test robot)
v1->v2:
- dropped the flow dissector patch (#1) as no changes are needed there (Jiri)
- applied code review comments from Jiri to the flower patch
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index f07ef8c7da55..f8829b517156 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -31,6 +31,7 @@ */ #include <net/flow_dissector.h> +#include <net/sch_generic.h> #include <net/pkt_cls.h> #include <net/tc_act/tc_gact.h> #include <net/tc_act/tc_skbedit.h> @@ -363,7 +364,18 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, skb_flow_dissector_target(f->dissector, FLOW_DISSECTOR_KEY_CONTROL, f->key); + + struct flow_dissector_key_control *mask = + skb_flow_dissector_target(f->dissector, + FLOW_DISSECTOR_KEY_CONTROL, + f->mask); addr_type = key->addr_type; + + if (mask->flags & FLOW_DIS_IS_FRAGMENT) { + MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1); + MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, + key->flags & FLOW_DIS_IS_FRAGMENT); + } } if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_BASIC)) { |