summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_repr.c
diff options
context:
space:
mode:
authorWojciech Drewek <wojciech.drewek@intel.com>2023-07-12 13:03:31 +0200
committerTony Nguyen <anthony.l.nguyen@intel.com>2023-07-24 08:53:05 -0700
commitf6e8fb55e5af9a506d2e50d1079a231ce95ca215 (patch)
tree9d76c36cac4faf36a59935a62c1f573d7881b0b1 /drivers/net/ethernet/intel/ice/ice_repr.c
parent6c0f4441d83b1efd311acbab266246aee6e46bea (diff)
downloadlinux-stable-f6e8fb55e5af9a506d2e50d1079a231ce95ca215.tar.gz
linux-stable-f6e8fb55e5af9a506d2e50d1079a231ce95ca215.tar.bz2
linux-stable-f6e8fb55e5af9a506d2e50d1079a231ce95ca215.zip
ice: Implement basic eswitch bridge setup
With this patch, ice driver is able to track if the port representors or uplink port were added to the linux bridge in switchdev mode. Listen for NETDEV_CHANGEUPPER events in order to detect this. ice_esw_br data structure reflects the linux bridge and stores all the ports of the bridge (ice_esw_br_port) in xarray, it's created when the first port is added to the bridge and freed once the last port is removed. Note that only one bridge is supported per eswitch. Bridge port (ice_esw_br_port) can be either a VF port representor port or uplink port (ice_esw_br_port_type). In both cases bridge port holds a reference to the VSI, VF's VSI in case of the PR and uplink VSI in case of the uplink. VSI's index is used as an index to the xarray in which ports are stored. Add a check which prevents configuring switchdev mode if uplink is already added to any bridge. This is needed because we need to listen for NETDEV_CHANGEUPPER events to record if the uplink was added to the bridge. Netdevice notifier is registered after eswitch mode is changed to switchdev. Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com> Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_repr.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_repr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c
index e30e12321abd..c686ac0935eb 100644
--- a/drivers/net/ethernet/intel/ice/ice_repr.c
+++ b/drivers/net/ethernet/intel/ice/ice_repr.c
@@ -254,7 +254,7 @@ static const struct net_device_ops ice_repr_netdev_ops = {
* ice_is_port_repr_netdev - Check if a given netdevice is a port representor netdev
* @netdev: pointer to netdev
*/
-bool ice_is_port_repr_netdev(struct net_device *netdev)
+bool ice_is_port_repr_netdev(const struct net_device *netdev)
{
return netdev && (netdev->netdev_ops == &ice_repr_netdev_ops);
}