• Amir Vadai's avatar
    net/sched: cls_flower: Classify packet in ip tunnels · bc3103f1
    Amir Vadai authored
    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.
    Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
    Signed-off-by: default avatarHadar Hen Zion <hadarh@mellanox.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    bc3103f1
cls_flower.c 26.5 KB