• Ido Schimmel's avatar
    net/sched: flower: Take verbose flag into account when logging error messages · 11c95317
    Ido Schimmel authored
    The verbose flag was added in commit 81c7288b ("sched: cls: enable
    verbose logging") to avoid suppressing logging of error messages that
    occur "when the rule is not to be exclusively executed by the hardware".
    
    However, such error messages are currently suppressed when setup of flow
    action fails. Take the verbose flag into account to avoid suppressing
    error messages. This is done by using the extack pointer initialized by
    tc_cls_common_offload_init(), which performs the necessary checks.
    
    Before:
    
     # tc filter add dev dummy0 ingress pref 1 proto ip flower dst_ip 198.51.100.1 action police rate 100Mbit burst 10000
     # tc filter add dev dummy0 ingress pref 2 proto ip flower verbose dst_ip 198.51.100.1 action police rate 100Mbit burst 10000
    
    After:
    
     # tc filter add dev dummy0 ingress pref 1 proto ip flower dst_ip 198.51.100.1 action police rate 100Mbit burst 10000
     # tc filter add dev dummy0 ingress pref 2 proto ip flower verbose dst_ip 198.51.100.1 action police rate 100Mbit burst 10000
     Warning: cls_flower: Failed to setup flow action.
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    11c95317
cls_flower.c 95.4 KB