Commit 284bc559 authored by Eli Britstein's avatar Eli Britstein Committed by Greg Kroah-Hartman

net/mlx5e: Support tagged tunnel over bond

Stacked devices like bond interface may have a VLAN device on top of
them. Detect lag state correctly under this condition, and return the
correct routed net device, according to it the encap header is built.

Fixes: e32ee6c7 ("net/mlx5e: Support tunnel encap over tagged Ethernet")
Signed-off-by: default avatarEli Britstein <elibr@mellanox.com>
Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1bb4eb4e
...@@ -11,24 +11,25 @@ static int get_route_and_out_devs(struct mlx5e_priv *priv, ...@@ -11,24 +11,25 @@ static int get_route_and_out_devs(struct mlx5e_priv *priv,
struct net_device **route_dev, struct net_device **route_dev,
struct net_device **out_dev) struct net_device **out_dev)
{ {
struct net_device *uplink_dev, *uplink_upper, *real_dev;
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
struct net_device *uplink_dev, *uplink_upper;
bool dst_is_lag_dev; bool dst_is_lag_dev;
real_dev = is_vlan_dev(dev) ? vlan_dev_real_dev(dev) : dev;
uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH); uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH);
uplink_upper = netdev_master_upper_dev_get(uplink_dev); uplink_upper = netdev_master_upper_dev_get(uplink_dev);
dst_is_lag_dev = (uplink_upper && dst_is_lag_dev = (uplink_upper &&
netif_is_lag_master(uplink_upper) && netif_is_lag_master(uplink_upper) &&
dev == uplink_upper && real_dev == uplink_upper &&
mlx5_lag_is_sriov(priv->mdev)); mlx5_lag_is_sriov(priv->mdev));
/* if the egress device isn't on the same HW e-switch or /* if the egress device isn't on the same HW e-switch or
* it's a LAG device, use the uplink * it's a LAG device, use the uplink
*/ */
if (!netdev_port_same_parent_id(priv->netdev, dev) || if (!netdev_port_same_parent_id(priv->netdev, real_dev) ||
dst_is_lag_dev) { dst_is_lag_dev) {
*route_dev = uplink_dev; *route_dev = dev;
*out_dev = *route_dev; *out_dev = uplink_dev;
} else { } else {
*route_dev = dev; *route_dev = dev;
if (is_vlan_dev(*route_dev)) if (is_vlan_dev(*route_dev))
......
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