]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: Lag, multipath, give priority for routes with smaller network prefix
authorPatrisious Haddad <phaddad@nvidia.com>
Thu, 25 Dec 2025 13:27:13 +0000 (15:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jan 2026 15:35:23 +0000 (16:35 +0100)
commit6584963258249da7fc6aee5ed27e90cf0d4065a8
tree57edb15d0eab6a57b04d2f010cf091c13c7ef55b
parent8bdc624bf33d36763bcc1211e54ff27494de8a6b
net/mlx5: Lag, multipath, give priority for routes with smaller network prefix

[ Upstream commit 31057979cdadfee9f934746fd84046b43506ba61 ]

Today multipath offload is controlled by a single route and the route
controlling is selected if it meets one of the following criteria:
        1. No controlling route is set.
        2. New route destination is the same as old one.
        3. New route metric is lower than old route metric.

This can cause unwanted behaviour in case a new route is added
with a smaller network prefix which should get the priority.

Fix this by adding a new criteria to give priority to new route with
a smaller network prefix.

Fixes: ad11c4f1d8fd ("net/mlx5e: Lag, Only handle events from highest priority multipath entry")
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20251225132717.358820-2-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c