[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180226201015.29094-1-acollins@cradlepoint.com>
Date: Mon, 26 Feb 2018 13:10:15 -0700
From: Andrew Collins <acollins@...dlepoint.com>
To: jhs@...atatu.com, xiyou.wangcong@...il.com, davem@...emloft.net,
netdev@...r.kernel.org
Cc: Andrew Collins <acollins@...dlepoint.com>
Subject: [PATCH] net: make tc-police action MTU behavior match documentation
The man page for tc-police states that the MTU defaults to
unlimited if peakrate is not specified, but it actually defaults
to 2047.
This causes issues with GRO enabled interfaces, as >2047 coalesced
packets get dropped and the resulting rate is wildly inaccurate.
Fix by only setting the default MTU when peakrate is specified.
Longer term act_police should likely segment GRO packets like
sch_tbf does, but I see no clear way to accomplish this within
a tc action.
Signed-off-by: Andrew Collins <acollins@...dlepoint.com>
---
net/sched/act_police.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 95d3c9097b25..36b8c92f644c 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -149,7 +149,7 @@ static int tcf_act_police_init(struct net *net, struct nlattr *nla,
police->tcfp_mtu = parm->mtu;
if (police->tcfp_mtu == 0) {
police->tcfp_mtu = ~0;
- if (R_tab)
+ if (R_tab && P_tab)
police->tcfp_mtu = 255 << R_tab->rate.cell_log;
}
if (R_tab) {
--
2.14.3
Powered by blists - more mailing lists