Skip to content

Commit 1418ddd

Browse files
Aviv HellerSaeed Mahameed
Aviv Heller
authored and
Saeed Mahameed
committed
net/mlx5e: Duplicate offloaded TC eswitch rules under uplink LAG
Under uplink LAG, packets that match a flow might arrive on both uplink ports and transmitted through both as part of supporting aggregation and high-availability. When the netdevs representing the uplinks are set into LAG (bonding, teaming), duplicate the TC flow offloading into each of the per-uplink e-switches. Duplication is not required if the source is the bond device, since in this case it is assumed that the bond and the uplink netdevs share the same TC block, and thus duplication will occur naturally by the stack. Note that under encapsulation scheme, both flows will use the same neighbour and hence both will contribute to the last-used feedback towards the stack. Signed-off-by: Aviv Heller <[email protected]> Signed-off-by: Rabie Loulou <[email protected]> Reviewed-by: Or Gerlitz <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 7ba58ba commit 1418ddd

File tree

1 file changed

+10
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+10
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2710,7 +2710,16 @@ static struct rhashtable *get_tc_ht(struct mlx5e_priv *priv)
27102710

27112711
static bool is_peer_flow_needed(struct mlx5e_tc_flow *flow)
27122712
{
2713-
return false;
2713+
struct mlx5_esw_flow_attr *attr = flow->esw_attr;
2714+
bool is_rep_ingress = attr->in_rep->vport != FDB_UPLINK_VPORT &&
2715+
flow->flags & MLX5E_TC_FLOW_INGRESS;
2716+
bool act_is_encap = !!(attr->action &
2717+
MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT);
2718+
bool esw_paired = mlx5_devcom_is_paired(attr->in_mdev->priv.devcom,
2719+
MLX5_DEVCOM_ESW_OFFLOADS);
2720+
2721+
return esw_paired && mlx5_lag_is_active(attr->in_mdev) &&
2722+
(is_rep_ingress || act_is_encap);
27142723
}
27152724

27162725
static int

0 commit comments

Comments
 (0)