summaryrefslogtreecommitdiffstats
path: root/include/net/tc_act
diff options
context:
space:
mode:
authorPo Liu <Po.Liu@nxp.com>2020-06-24 17:36:28 +0800
committerDavid S. Miller <davem@davemloft.net>2020-06-24 22:04:26 -0700
commit19e528dc9af29169fa7cdfa61071805fdef504c6 (patch)
treebf1c7dc5c479f69254176b454851dc4bee8e76f7 /include/net/tc_act
parent147373d968f1c1b5d6bb71e4e8b7495eeb9cdcae (diff)
downloadlinux-19e528dc9af29169fa7cdfa61071805fdef504c6.tar.bz2
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: Po Liu <Po.Liu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tc_act')
-rw-r--r--include/net/tc_act/tc_police.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/tc_act/tc_police.h b/include/net/tc_act/tc_police.h
index f098ad4424be..cd973b10ae8c 100644
--- a/include/net/tc_act/tc_police.h
+++ b/include/net/tc_act/tc_police.h
@@ -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 */