Commit e696028a authored by Or Gerlitz's avatar Or Gerlitz Committed by David S. Miller

net/sched: Reflect HW offload status

Currently there is no way of querying whether a filter is
offloaded to HW or not when using "both" policy (where none
of skip_sw or skip_hw flags are set by user-space).

Add two new flags, "in hw" and "not in hw" such that user
space can determine if a filter is actually offloaded to
hw or not. The "in hw" UAPI semantics was chosen so it's
similar to the "skip hw" flag logic.

If none of these two flags are set, this signals running
over older kernel.
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: default avatarAmir Vadai <amir@vadai.me>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7a335ada
...@@ -481,6 +481,11 @@ static inline bool tc_flags_valid(u32 flags) ...@@ -481,6 +481,11 @@ static inline bool tc_flags_valid(u32 flags)
return true; return true;
} }
static inline bool tc_in_hw(u32 flags)
{
return (flags & TCA_CLS_FLAGS_IN_HW) ? true : false;
}
enum tc_fl_command { enum tc_fl_command {
TC_CLSFLOWER_REPLACE, TC_CLSFLOWER_REPLACE,
TC_CLSFLOWER_DESTROY, TC_CLSFLOWER_DESTROY,
......
...@@ -103,8 +103,10 @@ enum { ...@@ -103,8 +103,10 @@ enum {
#define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1) #define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
/* tca flags definitions */ /* tca flags definitions */
#define TCA_CLS_FLAGS_SKIP_HW (1 << 0) #define TCA_CLS_FLAGS_SKIP_HW (1 << 0) /* don't offload filter to HW */
#define TCA_CLS_FLAGS_SKIP_SW (1 << 1) #define TCA_CLS_FLAGS_SKIP_SW (1 << 1) /* don't use filter in SW */
#define TCA_CLS_FLAGS_IN_HW (1 << 2) /* filter is offloaded to HW */
#define TCA_CLS_FLAGS_NOT_IN_HW (1 << 3) /* filter isn't offloaded to HW */
/* U32 filters */ /* U32 filters */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment