net/mlx5e: TC, use the owner eswitch for encap neigh updates
Encap entries are kept in the encap table of the eswitch of the flows
that use them, while the neigh hash entry is attached to the out_dev
uplink. The neigh update and neigh-used paths took the eswitch from
netdev_priv(e->out_dev), assuming out_dev is always the uplink of the
owner eswitch.
Since MPESW peer flows were added, an encap entry of one eswitch can
route through the uplink of another eswitch. A neigh update on that
uplink then:
- takes the wrong encap_tbl_lock,
- adds the slow path rule to the other eswitch's FDB chains, where it
shares a match with the origin flow's rule, while the flow later
removes it from its own eswitch chains. This unbalances the fs_chains
refcount ("Couldn't find table", leaked flow tables on unload) and
with HWS, which emulates same-match NO_APPEND rules with a single
pending rule, fails the origin's slow path update with -EEXIST,
- allocates the packet reformat on the other device, which the owner
eswitch FDB rejects on HWS.
Record the owner eswitch uplink priv in the encap entry and use it for
flow updates and entry release, keeping out_dev for neigh handling.
Fixes: 8ce81fc01b52 ("net/mlx5e: TC, Add peer flow in mpesw mode")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261125210629.239095-1-tariqt@nvidia.com
Signed-off-by: Willem de Bruijn <willemb@google.com>