* [dpdk-stable] [PATCH] net/mvpp2: fix port max speed overflow
@ 2021-07-11 13:11 danat
2021-07-12 8:01 ` [dpdk-stable] [dpdk-dev] " Jerin Jacob
0 siblings, 1 reply; 2+ messages in thread
From: danat @ 2021-07-11 13:11 UTC (permalink / raw)
To: jerinj; +Cc: dev, danat, lironh, tdu, stable
From: Dana Vardi <danat@marvell.com>
ethtool_cmd_speed return uint32 and after the arithmetic
operation in mrvl_get_max_rate func the result is out of range.
Fixes: 429c394417 ("net/mvpp2: support traffic manager")
Cc: tdu@semihalf.com
Cc: stable@dpdk.org
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
drivers/net/mvpp2/mrvl_tm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mvpp2/mrvl_tm.c b/drivers/net/mvpp2/mrvl_tm.c
index a3150328d9..4d75f8e915 100644
--- a/drivers/net/mvpp2/mrvl_tm.c
+++ b/drivers/net/mvpp2/mrvl_tm.c
@@ -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;
}
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mvpp2: fix port max speed overflow
2021-07-11 13:11 [dpdk-stable] [PATCH] net/mvpp2: fix port max speed overflow danat
@ 2021-07-12 8:01 ` Jerin Jacob
0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2021-07-12 8:01 UTC (permalink / raw)
To: Dana Vardi
Cc: Jerin Jacob, dpdk-dev, Liron Himi, Tomasz Duszynski, dpdk stable
On Sun, Jul 11, 2021 at 6:41 PM <danat@marvell.com> wrote:
>
> From: Dana Vardi <danat@marvell.com>
>
> ethtool_cmd_speed return uint32 and after the arithmetic
> operation in mrvl_get_max_rate func the result is out of range.
>
> Fixes: 429c394417 ("net/mvpp2: support traffic manager")
> Cc: tdu@semihalf.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Dana Vardi <danat@marvell.com>
> Reviewed-by: Liron Himi <lironh@marvell.com>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks
> ---
> drivers/net/mvpp2/mrvl_tm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/mvpp2/mrvl_tm.c b/drivers/net/mvpp2/mrvl_tm.c
> index a3150328d9..4d75f8e915 100644
> --- a/drivers/net/mvpp2/mrvl_tm.c
> +++ b/drivers/net/mvpp2/mrvl_tm.c
> @@ -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;
> }
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-12 8:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-11 13:11 [dpdk-stable] [PATCH] net/mvpp2: fix port max speed overflow danat
2021-07-12 8:01 ` [dpdk-stable] [dpdk-dev] " Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).