Skip to content

Commit

Permalink
net/mvpp2: fix port speed overflow
Browse files Browse the repository at this point in the history
[ upstream commit 8fa07a6 ]

ethtool_cmd_speed return uint32 and after the arithmetic
operation in mrvl_get_max_rate func the result is out of range.

Fixes: 429c394 ("net/mvpp2: support traffic manager")

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
  • Loading branch information
Dana Vardi authored and cpaelzer committed Aug 9, 2021
1 parent c9440cf commit de826be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/mvpp2/mrvl_tm.c
Expand Up @@ -57,7 +57,7 @@ mrvl_get_max_rate(struct rte_eth_dev *dev, uint64_t *rate)

close(fd);

*rate = ethtool_cmd_speed(&edata) * 1000 * 1000 / 8;
*rate = (uint64_t)ethtool_cmd_speed(&edata) * 1000 * 1000 / 8;

return 0;
}
Expand Down

0 comments on commit de826be

Please sign in to comment.