History

net/sched: Allow flower to match on GTP options

Options are as follows: PDU_TYPE:QFI and they refernce to the fields from the PDU Session Protocol. PDU Session data is conveyed in GTP-U Extension Header. GTP-U Extension Header is described in 3GPP TS 29.281. PDU Session Protocol is described in 3GPP TS 38.415. PDU_TYPE - indicates the type of the PDU Session Information (4 bits) QFI - QoS Flow Identifier (6 bits) # ip link add gtp_dev type gtp role sgsn # tc qdisc add dev gtp_dev ingress # tc filter add dev gtp_dev protocol ip parent ffff: \ flower \ enc_key_id 11 \ gtp_opts 1:8/ff:ff \ action mirred egress redirect dev eth0

Wojciech Drewek committed 4 years ago

Commit e3acda71 parent d33bd754 files · +139 −1Browse files

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

Unified · Split

2 files
  1. include/uapi/linux/if_tunnel.h +3 −1
  2. include/uapi/linux/pkt_cls.h +15 −0
include/uapi/linux/if_tunnel.h+3−1
@@ -176,8 +176,10 @@ enum { · 175 unmodified lines
176#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)176#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
177#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)177#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)
178#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)178#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
179#define TUNNEL_GTP_OPT __cpu_to_be16(0x8000)
179 180
180#define TUNNEL_OPTIONS_PRESENT \181#define TUNNEL_OPTIONS_PRESENT \
181 (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)182 (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT | \
183 TUNNEL_GTP_OPT)
182 184
183#endif /* _UAPI_IF_TUNNEL_H_ */185#endif /* _UAPI_IF_TUNNEL_H_ */
include/uapi/linux/pkt_cls.h+15−0
@@ -616,6 +616,10 @@ enum { · 615 unmodified lines
616 * TCA_FLOWER_KEY_ENC_OPT_ERSPAN_616 * TCA_FLOWER_KEY_ENC_OPT_ERSPAN_
617 * attributes617 * attributes
618 */618 */
619 TCA_FLOWER_KEY_ENC_OPTS_GTP, /* Nested
620 * TCA_FLOWER_KEY_ENC_OPT_GTP_
621 * attributes
622 */
619 __TCA_FLOWER_KEY_ENC_OPTS_MAX,623 __TCA_FLOWER_KEY_ENC_OPTS_MAX,
620};624};
621 625
@@ -654,6 +658,17 @@ enum { · 32 unmodified lines
654#define TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX \658#define TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX \
655 (__TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX - 1)659 (__TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX - 1)
656 660
661enum {
662 TCA_FLOWER_KEY_ENC_OPT_GTP_UNSPEC,
663 TCA_FLOWER_KEY_ENC_OPT_GTP_PDU_TYPE, /* u8 */
664 TCA_FLOWER_KEY_ENC_OPT_GTP_QFI, /* u8 */
665
666 __TCA_FLOWER_KEY_ENC_OPT_GTP_MAX,
667};
668
669#define TCA_FLOWER_KEY_ENC_OPT_GTP_MAX \
670 (__TCA_FLOWER_KEY_ENC_OPT_GTP_MAX - 1)
671
657enum {672enum {
658 TCA_FLOWER_KEY_MPLS_OPTS_UNSPEC,673 TCA_FLOWER_KEY_MPLS_OPTS_UNSPEC,
659 TCA_FLOWER_KEY_MPLS_OPTS_LSE,674 TCA_FLOWER_KEY_MPLS_OPTS_LSE,