summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mscc/ocelot_flower.c
diff options
context:
space:
mode:
authorPo Liu <po.liu@nxp.com>2020-06-29 14:54:16 +0800
committerDavid S. Miller <davem@davemloft.net>2020-06-29 17:33:42 -0700
commit5f035af76e51cd622abc6564d5512ffeb9e06917 (patch)
treed8535555e53b97e2a5bac14887677f9715898151 /drivers/net/ethernet/mscc/ocelot_flower.c
parent13f1555c1b4c49b8ab9dd80b7353deec0526ccac (diff)
downloadlinux-5f035af76e51cd622abc6564d5512ffeb9e06917.tar.gz
linux-5f035af76e51cd622abc6564d5512ffeb9e06917.tar.bz2
linux-5f035af76e51cd622abc6564d5512ffeb9e06917.zip
net:qos: police action offloading parameter 'burst' change to the original value
Since 'tcfp_burst' with TICK factor, driver side always need to recover it to the original value, this patch moves the generic calculation and recover to the 'burst' original value before offloading to device driver. Signed-off-by: Po Liu <po.liu@nxp.com> Acked-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc/ocelot_flower.c')
-rw-r--r--drivers/net/ethernet/mscc/ocelot_flower.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot_flower.c b/drivers/net/ethernet/mscc/ocelot_flower.c
index f2a85b06a6e7..ec1b6e2572ba 100644
--- a/drivers/net/ethernet/mscc/ocelot_flower.c
+++ b/drivers/net/ethernet/mscc/ocelot_flower.c
@@ -12,7 +12,6 @@ static int ocelot_flower_parse_action(struct flow_cls_offload *f,
struct ocelot_vcap_filter *filter)
{
const struct flow_action_entry *a;
- s64 burst;
u64 rate;
int i;
@@ -35,8 +34,7 @@ static int ocelot_flower_parse_action(struct flow_cls_offload *f,
filter->action = OCELOT_VCAP_ACTION_POLICE;
rate = a->police.rate_bytes_ps;
filter->pol.rate = div_u64(rate, 1000) * 8;
- burst = rate * PSCHED_NS2TICKS(a->police.burst);
- filter->pol.burst = div_u64(burst, PSCHED_TICKS_PER_SEC);
+ filter->pol.burst = a->police.burst;
break;
default:
return -EOPNOTSUPP;