net: flow_offload: add tc police action parameters
The current police offload action entry is missing exceed/notexceed actions and parameters that can be configured by tc police action. Add the missing parameters as a pre-step for offloading police actions to hardware. Signed-off-by: Jianbo Liu <jianbol@nvidia.com> Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
b42a738e40
commit
b8cd5831c6
@@ -159,4 +159,34 @@ static inline u32 tcf_police_tcfp_mtu(const struct tc_action *act)
|
||||
return params->tcfp_mtu;
|
||||
}
|
||||
|
||||
static inline u64 tcf_police_peakrate_bytes_ps(const struct tc_action *act)
|
||||
{
|
||||
struct tcf_police *police = to_police(act);
|
||||
struct tcf_police_params *params;
|
||||
|
||||
params = rcu_dereference_protected(police->params,
|
||||
lockdep_is_held(&police->tcf_lock));
|
||||
return params->peak.rate_bytes_ps;
|
||||
}
|
||||
|
||||
static inline u32 tcf_police_tcfp_ewma_rate(const struct tc_action *act)
|
||||
{
|
||||
struct tcf_police *police = to_police(act);
|
||||
struct tcf_police_params *params;
|
||||
|
||||
params = rcu_dereference_protected(police->params,
|
||||
lockdep_is_held(&police->tcf_lock));
|
||||
return params->tcfp_ewma_rate;
|
||||
}
|
||||
|
||||
static inline u16 tcf_police_rate_overhead(const struct tc_action *act)
|
||||
{
|
||||
struct tcf_police *police = to_police(act);
|
||||
struct tcf_police_params *params;
|
||||
|
||||
params = rcu_dereference_protected(police->params,
|
||||
lockdep_is_held(&police->tcf_lock));
|
||||
return params->rate.overhead;
|
||||
}
|
||||
|
||||
#endif /* __NET_TC_POLICE_H */
|
||||
|
||||
Reference in New Issue
Block a user