]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerJakub Kicinski <kuba@kernel.org>
Sun, 4 Jan 2026 18:38:49 +0000 (10:38 -0800)
commit31057979cdadfee9f934746fd84046b43506ba61
tree091d720bba27e6ae0f40cb7bcffd06a6d75fd409
parent02d1e1a3f9239cdb3ecf2c6d365fb959d1bf39df
net/mlx5: Lag, multipath, give priority for routes with smaller network prefix

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>
drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c