mbox series

[net-next,v2,0/4] nexthop: Refactor and fix nexthop selection for multipath routes

Message ID 20230719-nh_select-v2-0-04383e89f868@nvidia.com (mailing list archive)
Headers show
Series nexthop: Refactor and fix nexthop selection for multipath routes | expand

Message

Benjamin Poirier July 19, 2023, 1:57 p.m. UTC
In order to select a nexthop for multipath routes, fib_select_multipath()
is used with legacy nexthops and nexthop_select_path_hthr() is used with
nexthop objects. Those two functions perform a validity test on the
neighbor related to each nexthop but their logic is structured differently.
This causes a divergence in behavior and nexthop_select_path_hthr() may
return a nexthop that failed the neighbor validity test even if there was
one that passed.

Refactor nexthop_select_path_hthr() to make it more similar to
fib_select_multipath() and fix the problem mentioned above.

v2:
Removed unnecessary "first" variable in "nexthop: Do not return invalid
nexthop object during multipath selection".

v1:
https://lore.kernel.org/netdev/20230529201914.69828-1-bpoirier@nvidia.com/

---
Benjamin Poirier (4):
      nexthop: Factor out hash threshold fdb nexthop selection
      nexthop: Factor out neighbor validity check
      nexthop: Do not return invalid nexthop object during multipath selection
      selftests: net: Add test cases for nexthop groups with invalid neighbors

 net/ipv4/nexthop.c                          |  61 +++++++++----
 tools/testing/selftests/net/fib_nexthops.sh | 129 ++++++++++++++++++++++++++++
 2 files changed, 171 insertions(+), 19 deletions(-)
---
base-commit: 36395b2efe905650cd179d67411ffee3b770268b
change-id: 20230719-nh_select-0303d55a1fb0

Best regards,

Comments

patchwork-bot+netdevbpf@kernel.org July 21, 2023, 3:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 19 Jul 2023 13:57:06 +0000 you wrote:
> In order to select a nexthop for multipath routes, fib_select_multipath()
> is used with legacy nexthops and nexthop_select_path_hthr() is used with
> nexthop objects. Those two functions perform a validity test on the
> neighbor related to each nexthop but their logic is structured differently.
> This causes a divergence in behavior and nexthop_select_path_hthr() may
> return a nexthop that failed the neighbor validity test even if there was
> one that passed.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/4] nexthop: Factor out hash threshold fdb nexthop selection
    https://git.kernel.org/netdev/net-next/c/eedd47a6ec9f
  - [net-next,v2,2/4] nexthop: Factor out neighbor validity check
    https://git.kernel.org/netdev/net-next/c/4bb5239b4334
  - [net-next,v2,3/4] nexthop: Do not return invalid nexthop object during multipath selection
    https://git.kernel.org/netdev/net-next/c/75f5f04c7bd2
  - [net-next,v2,4/4] selftests: net: Add test cases for nexthop groups with invalid neighbors
    https://git.kernel.org/netdev/net-next/c/c7e95bbda822

You are awesome, thank you!