• Kiran Patil's avatar
    ice: Add tc-flower filter support for channel · 9fea7498
    Kiran Patil authored
    Add support to add/delete channel specific filter using tc-flower.
    For now, only supported action is "skip_sw hw_tc <tc_num>"
    
    Filter criteria is specific to channel and it can be
    combination of L3, L3+L4, L2+L4.
    
    Example:
    MATCH criteria       Action
    ---------------------------
    src and/or dest IPv4[6]/mask -> Forward to "hw_tc <tc_num>"
    dest IPv4[6]/mask + dest L4 port -> Forward to "hw_tc <tc_num>"
    dest MAC + dest L4 port -> Forward to "hw_tc <tc_num>"
    src IPv4[6]/mask + src L4 port -> Forward to "hw_tc <tc_num>"
    src MAC + src L4 port -> Forward to "hw_tc <tc_num>"
    
    Adding tc-flower filter for channel using "hw_tc"
    -------------------------------------------------
    tc qdisc add dev <ethX> clsact
    
    Above two steps are only needed the first time when adding
    tc-flower filter.
    
    tc filter add dev <ethX> protocol ip ingress prio 1 flower \
         dst_ip 192.168.0.1/32 ip_proto tcp dst_port 5001 \
         skip_sw hw_tc 1
    
    tc filter show dev <ethX> ingress
    filter protocol ip pref 1 flower chain 0
    filter protocol ip pref 1 flower chain 0 handle 0x1 hw_tc 1
      eth_type ipv4
      ip_proto tcp
      dst_ip 192.168.0.1
      dst_port 5001
      skip_sw
      in_hw in_hw_count 1
    
    Delete specific filter:
    -------------------------
    tc filter del  dev <ethx> ingress pref 1 handle 0x1 flower
    
    Delete All filters:
    ------------------
    tc filter del dev <ethX> ingress
    Co-developed-by: default avatarAmritha Nambiar <amritha.nambiar@intel.com>
    Signed-off-by: default avatarAmritha Nambiar <amritha.nambiar@intel.com>
    Signed-off-by: default avatarKiran Patil <kiran.patil@intel.com>
    Signed-off-by: default avatarSudheer Mogilappagari <sudheer.mogilappagari@intel.com>
    Tested-by: default avatarBharathi Sreenivas <bharathi.sreenivas@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    9fea7498
ice_switch.h 10.7 KB