Commit 6e9d51b1 authored by Roy Novich's avatar Roy Novich Committed by Saeed Mahameed

net/mlx5e: Initialize link speed to zero

mlx5e_port_max_linkspeed does not guarantee value assignment for speed.
Avoid cases where link_speed might be used uninitialized. In case
mlx5e_port_max_linkspeed fails, a default link speed of 50000 will be
used for the calculations.

Fixes: 3f6d08d1 ("net/mlx5e: Add RSS support for hairpin")
Signed-off-by: default avatarRoy Novich <royno@nvidia.com>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Reviewed-by: default avatarAya Levin <ayal@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 922f56e9
...@@ -1103,8 +1103,8 @@ static void ...@@ -1103,8 +1103,8 @@ static void
mlx5e_hairpin_params_init(struct mlx5e_hairpin_params *hairpin_params, mlx5e_hairpin_params_init(struct mlx5e_hairpin_params *hairpin_params,
struct mlx5_core_dev *mdev) struct mlx5_core_dev *mdev)
{ {
u32 link_speed = 0;
u64 link_speed64; u64 link_speed64;
u32 link_speed;
hairpin_params->mdev = mdev; hairpin_params->mdev = mdev;
/* set hairpin pair per each 50Gbs share of the link */ /* set hairpin pair per each 50Gbs share of the link */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment