History

net/sched: cls_flower: Classify packet in ip tunnels

Introduce classifying by metadata extracted by the tunnel device. Outer header fields - source/dest ip and tunnel id, are extracted from the metadata when classifying. For example, the following will add a filter on the ingress Qdisc of shared vxlan device named 'vxlan0'. To forward packets with outer src ip 11.11.0.2, dst ip 11.11.0.1 and tunnel id 11. The packets will be forwarded to tap device 'vnet0' (after metadata is released): $ tc filter add dev vxlan0 protocol ip parent ffff: \ flower \ enc_src_ip 11.11.0.2 \ enc_dst_ip 11.11.0.1 \ enc_key_id 11 \ dst_ip 11.11.11.1 \ action tunnel_key release \ action mirred egress redirect dev vnet0 The action tunnel_key, will be introduced in the next patch in this series.

Amir Vadai committed 10 years ago

Commit bc3103f1 parent 2ff378b2 files · +110 −1Browse files

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

Unified · Split

include/uapi/linux/pkt_cls.h+11−0
@@ -431,6 +431,17 @@ enum { · 430 unmodified lines
431 TCA_FLOWER_KEY_VLAN_ID,431 TCA_FLOWER_KEY_VLAN_ID,
432 TCA_FLOWER_KEY_VLAN_PRIO,432 TCA_FLOWER_KEY_VLAN_PRIO,
433 TCA_FLOWER_KEY_VLAN_ETH_TYPE,433 TCA_FLOWER_KEY_VLAN_ETH_TYPE,
434
435 TCA_FLOWER_KEY_ENC_KEY_ID, /* be32 */
436 TCA_FLOWER_KEY_ENC_IPV4_SRC, /* be32 */
437 TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK,/* be32 */
438 TCA_FLOWER_KEY_ENC_IPV4_DST, /* be32 */
439 TCA_FLOWER_KEY_ENC_IPV4_DST_MASK,/* be32 */
440 TCA_FLOWER_KEY_ENC_IPV6_SRC, /* struct in6_addr */
441 TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK,/* struct in6_addr */
442 TCA_FLOWER_KEY_ENC_IPV6_DST, /* struct in6_addr */
443 TCA_FLOWER_KEY_ENC_IPV6_DST_MASK,/* struct in6_addr */
444
434 __TCA_FLOWER_MAX,445 __TCA_FLOWER_MAX,
435};446};
436 447

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t