OSDN Git Service
Merge branch 'use-tc_cls_can_offload_and_chain0-throughout-the-drivers'
Jakub Kicinski says:
====================
use tc_cls_can_offload_and_chain0() throughout the drivers
This set makes all drivers use a new tc_cls_can_offload_and_chain0()
helper which will set extack in case TC hw offload flag is disabled.
I chose to keep the new helper which also looks at the chain but
renamed it more appropriately. The rationale being that most drivers
don't accept chains other than 0 and since we have to pass extack
to the helper we can as well pass the entire struct tc_cls_common_offload
and perform the most common checks.
This code makes the assumption that type_data in the callback can
be interpreted as struct tc_cls_common_offload, i.e. the real offload
structure has common part as the first member. This allows us to
make the check once for all classifier types if driver supports
more than one.
v1:
- drop the type validation in nfp and netdevsim.
v2:
- reorder checks in patch 1;
- split other changes from patch 1;
- add the i40e patch in;
- add one more test case - for chain 0 extack.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>