Skip to content

Commit 3f7d0eb

Browse files
ogerlitzdavem330
authored andcommitted
net/mlx5e: Offload TC matching on packets being IP fragments
Enable offloading of matching on packets being fragments. Signed-off-by: Or Gerlitz <[email protected]> Reviewed-by: Paul Blakey <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent faa3ffc commit 3f7d0eb

File tree

1 file changed

+12
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+12
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*/
3232

3333
#include <net/flow_dissector.h>
34+
#include <net/sch_generic.h>
3435
#include <net/pkt_cls.h>
3536
#include <net/tc_act/tc_gact.h>
3637
#include <net/tc_act/tc_skbedit.h>
@@ -363,7 +364,18 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
363364
skb_flow_dissector_target(f->dissector,
364365
FLOW_DISSECTOR_KEY_CONTROL,
365366
f->key);
367+
368+
struct flow_dissector_key_control *mask =
369+
skb_flow_dissector_target(f->dissector,
370+
FLOW_DISSECTOR_KEY_CONTROL,
371+
f->mask);
366372
addr_type = key->addr_type;
373+
374+
if (mask->flags & FLOW_DIS_IS_FRAGMENT) {
375+
MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1);
376+
MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag,
377+
key->flags & FLOW_DIS_IS_FRAGMENT);
378+
}
367379
}
368380

369381
if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_BASIC)) {

0 commit comments

Comments
 (0)