OSDN Git Service

net/mlx5: Bridge, obtain core device from eswitch instead of priv
authorVlad Buslov <vladbu@nvidia.com>
Sun, 18 Jul 2021 15:55:45 +0000 (18:55 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 16 Aug 2021 23:17:30 +0000 (16:17 -0700)
commita514d17350597dea242c5486ef70a9ec013c1182
tree7d8c739457b4ca9b541e16f74895c0fca49d28d9
parent4de20e9a1225866a9a2ac2e12cddee51455991fa
net/mlx5: Bridge, obtain core device from eswitch instead of priv

Following patches in series will pass bond device to bridge, which means
the code can't assume the device is mlx5 representor. Moreover, the core
device can be easily obtained from eswitch instance, so there is no reason
for more complex code that obtains struct mlx5_priv from net_device in
order to use its mdev. Refactor the code to use esw->dev instead of
priv->mdev.

Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c