Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/sched: cls_flower: Add support to handle first frag as match field

Allow setting firstfrag as matching option in tc flower classifier.

# tc filter add dev eth0 protocol ip parent ffff: \
flower indev eth0 \
ip_flags firstfrag
action mirred egress redirect dev eth1

Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Pieter Jansen van Vuuren and committed by
David S. Miller
459d153d 08a24239

+7
+1
include/uapi/linux/pkt_cls.h
··· 475 475 476 476 enum { 477 477 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0), 478 + TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1), 478 479 }; 479 480 480 481 /* Match-all classifier */
+6
net/sched/cls_flower.c
··· 511 511 512 512 fl_set_key_flag(key, mask, flags_key, flags_mask, 513 513 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT, FLOW_DIS_IS_FRAGMENT); 514 + fl_set_key_flag(key, mask, flags_key, flags_mask, 515 + TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST, 516 + FLOW_DIS_FIRST_FRAG); 514 517 515 518 return 0; 516 519 } ··· 1133 1130 1134 1131 fl_get_key_flag(flags_key, flags_mask, &key, &mask, 1135 1132 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT, FLOW_DIS_IS_FRAGMENT); 1133 + fl_get_key_flag(flags_key, flags_mask, &key, &mask, 1134 + TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST, 1135 + FLOW_DIS_FIRST_FRAG); 1136 1136 1137 1137 _key = cpu_to_be32(key); 1138 1138 _mask = cpu_to_be32(mask);