• Ondřej Hlavatý's avatar
    ixgbe: fix parsing of TC actions for HW offload · 16e6653c
    Ondřej Hlavatý authored
    The previous code was optimistic, accepting the offload of whole action
    chain when there was a single known action (drop/redirect). This results
    in offloading a rule which should not be offloaded, because its behavior
    cannot be reproduced in the hardware.
    
    For example:
    
    $ tc filter add dev eno1 parent ffff: protocol ip \
        u32 ht 800: order 1 match tcp src 42 FFFF \
        action mirred egress mirror dev enp1s16 pipe \
        drop
    
    The controller is unable to mirror the packet to a VF, but still
    offloads the rule by dropping the packet.
    
    Change the approach of the function to a pessimistic one, rejecting the
    chain when an unknown action is found. This is better suited for future
    extensions.
    
    Note that both recognized actions always return TC_ACT_SHOT, therefore
    it is safe to ignore actions behind them.
    Signed-off-by: default avatarOndřej Hlavatý <ohlavaty@redhat.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    16e6653c
ixgbe_main.c 301 KB