]> git.baikalelectronics.ru Git - kernel.git/commit
mlx4: make sure to always set the port type
authorJakub Kicinski <kuba@kernel.org>
Tue, 8 Sep 2020 22:21:14 +0000 (15:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Sep 2020 19:49:00 +0000 (12:49 -0700)
commit407ab2c275bd4901c002e4e6175cf3473f2de2e2
tree1f2e7506a73cbf66a143b9c057a932790db24d97
parent88ee7a488bec13a0ab15f766e9814e080f86a8f2
mlx4: make sure to always set the port type

Even tho mlx4_core registers the devlink ports, it's mlx4_en
and mlx4_ib which set their type. In situations where one of
the two is not built yet the machine has ports of given type
we see the devlink warning from devlink_port_type_warn() trigger.

Having ports of a type not supported by the kernel may seem
surprising, but it does occur in practice - when the unsupported
port is not plugged in to a switch anyway users are more than happy
not to see it (and potentially allocate any resources to it).

Set the type in mlx4_core if type-specific driver is not built.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/main.c