]> git.baikalelectronics.ru Git - kernel.git/commit
net: flow_offload: skip hw stats check for FLOW_ACTION_HW_STATS_DONT_CARE
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 6 May 2020 18:34:50 +0000 (20:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 May 2020 03:13:10 +0000 (20:13 -0700)
commit9d6bee3d24d7fc7b2d90a97fbbfdb7a7e38037c7
tree23ecfc61c1efb40e0f8fb93993cd3e1a6d870b19
parentca9e695ce4d8a7686d4e60d9261791505dc3946f
net: flow_offload: skip hw stats check for FLOW_ACTION_HW_STATS_DONT_CARE

This patch adds FLOW_ACTION_HW_STATS_DONT_CARE which tells the driver
that the frontend does not need counters, this hw stats type request
never fails. The FLOW_ACTION_HW_STATS_DISABLED type explicitly requests
the driver to disable the stats, however, if the driver cannot disable
counters, it bails out.

TCA_ACT_HW_STATS_* maintains the 1:1 mapping with FLOW_ACTION_HW_STATS_*
except by disabled which is mapped to FLOW_ACTION_HW_STATS_DISABLED
(this is 0 in tc). Add tc_act_hw_stats() to perform the mapping between
TCA_ACT_HW_STATS_* and FLOW_ACTION_HW_STATS_*.

Fixes: 2550d8305759 ("flow_offload: check for basic action hw stats type")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
include/net/flow_offload.h
net/sched/cls_api.c