History

net: sched: allow flower to match vxlan options

This patch is to allow matching gbp option in vxlan. The options can be described in the form GBP/GBP_MASK, where GBP is represented as a 32bit hexadecimal value. Different from geneve, only one option can be set. And also, geneve options and vxlan options can't be set at the same time. # ip link add name vxlan0 type vxlan dstport 0 external # tc qdisc add dev vxlan0 ingress # tc filter add dev vxlan0 protocol ip parent ffff: \ flower \ enc_src_ip 10.0.99.192 \ enc_dst_ip 10.0.99.193 \ enc_key_id 11 \ vxlan_opts 01020304/ffffffff \ ip_proto udp \ action mirred egress redirect dev eth0 v1->v2: - add .strict_start_type for enc_opts_policy as Jakub noticed. - use Duplicate instead of Wrong in err msg for extack as Jakub suggested.

Xin Long committed 6 years ago

Commit d8f9dfa1 parent e20d4ff2 files · +122 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/pkt_cls.h+13−0
@@ -571,6 +571,10 @@ enum { · 570 unmodified lines
571 * TCA_FLOWER_KEY_ENC_OPT_GENEVE_571 * TCA_FLOWER_KEY_ENC_OPT_GENEVE_
572 * attributes572 * attributes
573 */573 */
574 TCA_FLOWER_KEY_ENC_OPTS_VXLAN, /* Nested
575 * TCA_FLOWER_KEY_ENC_OPT_VXLAN_
576 * attributes
577 */
574 __TCA_FLOWER_KEY_ENC_OPTS_MAX,578 __TCA_FLOWER_KEY_ENC_OPTS_MAX,
575};579};
576 580
@@ -588,6 +592,15 @@ enum { · 11 unmodified lines
588#define TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX \592#define TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX \
589 (__TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX - 1)593 (__TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX - 1)
590 594
595enum {
596 TCA_FLOWER_KEY_ENC_OPT_VXLAN_UNSPEC,
597 TCA_FLOWER_KEY_ENC_OPT_VXLAN_GBP, /* u32 */
598 __TCA_FLOWER_KEY_ENC_OPT_VXLAN_MAX,
599};
600
601#define TCA_FLOWER_KEY_ENC_OPT_VXLAN_MAX \
602 (__TCA_FLOWER_KEY_ENC_OPT_VXLAN_MAX - 1)
603
591enum {604enum {
592 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),605 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),
593 TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),606 TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),