Commit 19e528dc authored by Po Liu's avatar Po Liu Committed by David S. Miller

net: qos: add tc police offloading action with max frame size limit

Current police offloading support the 'burst'' and 'rate_bytes_ps'. Some
hardware own the capability to limit the frame size. If the frame size
larger than the setting, the frame would be dropped. For the police
action itself already accept the 'mtu' parameter in tc command. But not
extend to tc flower offloading. So extend 'mtu' to tc flower offloading.
Signed-off-by: default avatarPo Liu <Po.Liu@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 147373d9
......@@ -234,6 +234,7 @@ struct flow_action_entry {
struct { /* FLOW_ACTION_POLICE */
s64 burst;
u64 rate_bytes_ps;
u32 mtu;
} police;
struct { /* FLOW_ACTION_CT */
int action;
......
......@@ -69,4 +69,14 @@ static inline s64 tcf_police_tcfp_burst(const struct tc_action *act)
return params->tcfp_burst;
}
static inline u32 tcf_police_tcfp_mtu(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_mtu;
}
#endif /* __NET_TC_POLICE_H */
......@@ -3658,6 +3658,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
entry->police.burst = tcf_police_tcfp_burst(act);
entry->police.rate_bytes_ps =
tcf_police_rate_bytes_ps(act);
entry->police.mtu = tcf_police_tcfp_mtu(act);
} else if (is_tcf_ct(act)) {
entry->id = FLOW_ACTION_CT;
entry->ct.action = tcf_ct_action(act);
......
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