Skip to content

Commit b014d04

Browse files
Colin Ian Kingdavem330
authored andcommitted
net: dsa: felix: fix incorrect clamp calculation for burst
Currently burst is clamping on rate and not burst, the assignment of burst from the clamping discards the previous assignment of burst. This looks like a cut-n-paste error from the previous clamping calculation on ramp. Fix this by replacing ramp with burst. Addresses-Coverity: ("Unused value") Fixes: 0fbabf8 ("net: dsa: felix: add support Credit Based Shaper(CBS) for hardware offload") Signed-off-by: Colin Ian King <[email protected]> Acked-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 140ad6c commit b014d04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/dsa/ocelot/felix_vsc9959.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ static int vsc9959_qos_port_cbs_set(struct dsa_switch *ds, int port,
13601360
/* Burst unit is 4kB */
13611361
burst = DIV_ROUND_UP(cbs_qopt->hicredit, 4096);
13621362
/* Avoid using zero burst size */
1363-
burst = clamp_t(u32, rate, 1, GENMASK(5, 0));
1363+
burst = clamp_t(u32, burst, 1, GENMASK(5, 0));
13641364
ocelot_write_gix(ocelot,
13651365
QSYS_CIR_CFG_CIR_RATE(rate) |
13661366
QSYS_CIR_CFG_CIR_BURST(burst),

0 commit comments

Comments
 (0)