Skip to content

net: nexthop: Increase weight to u16

Petr Machata netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 5 repliesApplied 6/6
  2. v16 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- Patch #1:
- Move the new OP_FLAG to bit 31 to make in/out confusion less likely
- Add a comment to the flag
- Patch #2:
- s/endianes/endianness/

Patches in v2 All 6 applied

#Subject and filesSizeRepliesApplied
1/6net: nexthop: Add flag to assert that NHGRP reserved fields are zeroinclude/uapi/linux/nexthop.h net/ipv4/nexthop.c+12 -31 replyApplied
2/6net: nexthop: Increase weight to u16include/net/nexthop.h include/uapi/linux/nexthop.h net/ipv4/nexthop.c+31 -170 repliesApplied
3/6selftests: router_mpath: Sleep after MZtools/testing/selftests/net/forwarding/router_mpath_nh.sh tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh tools/testing/selftests/net/forwarding/router_multipath.sh+6 -00 repliesApplied
4/6selftests: router_mpath_nh: Test 16-bit next hop weightstools/testing/selftests/net/forwarding/lib.sh tools/testing/selftests/net/forwarding/router_mpath_nh.sh tools/testing/selftests/net/forwarding/router_mpath_nh_lib.sh+50 -80 repliesApplied
5/6selftests: router_mpath_nh_res: Test 16-bit next hop weightstools/testing/selftests/net/forwarding/router_mpath_nh_res.sh+48 -80 repliesApplied
6/6selftests: fib_nexthops: Test 16-bit next hop weightstools/testing/selftests/net/fib_nexthops.sh+54 -10 repliesApplied

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchIdo SchimmelDavid AhernPrzemek Kitszel
1/6R-b
2/6R-b R-b R-b
3/6R-b R-b
4/6R-b R-b
5/6R-b R-b
6/6R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 0/6] net: nexthop: Increase weight to u16

In CLOS networks, as link failures occur at various points in the network, ECMP weights of the involved nodes are adjusted to compensate. With high fan-out of the involved nodes, and overall high number of nodes, a (non-)ECMP weight ratio that we would like to configure does not fit into 8 bits. Instead of, say, 255:254, we might like to configure something like 1000:999. For these deployments, the 8-bit weight may not be enough.

To that end, in this patchset increase the next hop weight from u8 to u16.

Patch #1 adds a flag that indicates whether the reserved fields are zeroed. This is a follow-up to a new fix merged in commit 6d745cd0e972 ("net:
nexthop: Initialize all fields in dumped nexthops"). The theory behind this patch is that there is a strict ordering between the fields actually being zeroed, the kernel declaring that they are, and the kernel repurposing the fields. Thus clients can use the flag to tell if it is safe to interpret the reserved fields in any way.

Patch #2 contains the substantial code and the commit message covers the details of the changes.

Patches #3 to #6 add selftests.

v2:
- Patch #1:
- Move the new OP_FLAG to bit 31 to make in/out confusion less likely
- Add a comment to the flag
- Patch #2:
- s/endianes/endianness/

Petr Machata (6):
net: nexthop: Add flag to assert that NHGRP reserved fields are zero
net: nexthop: Increase weight to u16
selftests: router_mpath: Sleep after MZ
selftests: router_mpath_nh: Test 16-bit next hop weights
selftests: router_mpath_nh_res: Test 16-bit next hop weights
selftests: fib_nexthops: Test 16-bit next hop weights

 include/net/nexthop.h                         |  4 +-
 include/uapi/linux/nexthop.h                  | 10 +++-
 net/ipv4/nexthop.c                            | 49 ++++++++++------
 tools/testing/selftests/net/fib_nexthops.sh   | 55 +++++++++++++++++-
 tools/testing/selftests/net/forwarding/lib.sh |  7 +++
 .../net/forwarding/router_mpath_nh.sh         | 40 ++++++++++---
 .../net/forwarding/router_mpath_nh_lib.sh     | 13 +++++
 .../net/forwarding/router_mpath_nh_res.sh     | 58 ++++++++++++++++---
 .../net/forwarding/router_multipath.sh        |  2 +
 9 files changed, 201 insertions(+), 37 deletions(-)
Signature · 1 line
2.45.2