net/mlx5: Bridge, extract code to lookup parent bridge of port
authorVlad Buslov <vladbu@nvidia.com>
Mon, 13 Mar 2023 15:22:49 +0000 (16:22 +0100)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 12 Apr 2023 03:57:36 +0000 (20:57 -0700)
commitb99c4ef29e278ab0b91406e52df4fa9b634b117e
tree4c1e2d907e0749c6e675a26ba0964f8e40998f1e
parent6767c97d7adc3c4283c0167a9716de3953f251b1
net/mlx5: Bridge, extract code to lookup parent bridge of port

The pattern when function looks up a port by vport_num+vhca_id tuple in
order to just obtain its parent bridge is repeated multiple times in
bridge.c file. Further commits in this series use the pattern even more.
Extract the pattern to standalone mlx5_esw_bridge_from_port_lookup()
function to improve code readability.

This commits doesn't change functionality.

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