Skip to contentSkip to conversation

nexthop: Rename artifacts related to legacy multipath nexthop groups

PATCH Applied Petr Machata 3 participants 3 messages Mar 26, 2021 – Mar 29, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nexthop: Rename artifacts related to legacy multipath nexthop groups

After resilient next-hop groups have been added recently, there are two types of multipath next-hop groups: the legacy "mpath", and the new "resilient". Calling the legacy next-hop group type "mpath" is unfortunate, because that describes the fact that a packet could be forwarded in one of several paths, which is also true for the resilient next-hop groups.

Therefore, to make the naming clearer, rename various artifacts to reflect the assumptions made. Therefore as of this patch:

- The flag for multipath groups is nh_grp_entry::is_multipath. This includes the legacy and resilient groups, as well as any future group types that behave as multipath groups.
Functions that assume this have "mpath" in the name.

- The flag for legacy multipath groups is nh_grp_entry::hash_threshold. Functions that assume this have "hthr" in the name.

- The flag for resilient groups is nh_grp_entry::resilient. Functions that assume this have "res" in the name.

Besides the above, struct nh_grp_entry::mpath was renamed to ::hthr as well.

UAPI artifacts were obviously left intact.

---
 include/net/nexthop.h |  4 ++--
 net/ipv4/nexthop.c    | 56 +++++++++++++++++++++----------------------
 2 files changed, 30 insertions(+), 30 deletions(-)
include/net/nexthop.h +2 -2
index ba94868a21d5..ace54bf90b2c 100644
@@ -102,7 +102,7 @@ struct nh_grp_entry {
 	union {
 		struct {
 			atomic_t	upper_bound;
-		} mpath;
+		} hthr;
 		struct {
 			/* Member on uw_nh_entries. */
 			struct list_head	uw_nh_entry;
@@ -120,7 +120,7 @@ struct nh_group {
 	struct nh_group		*spare; /* spare group for removals */
 	u16			num_nh;
 	bool			is_multipath;
-	bool			mpath;
+	bool			hash_threshold;
 	bool			resilient;
 	bool			fdb_nh;
 	bool			has_v4;
net/ipv4/nexthop.c +28 -28

176 lines not on this page · raw message

Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · Petr Machata

After resilient next-hop groups have been added recently, there are two types of multipath next-hop groups: the legacy "mpath", and the new "resilient". Calling the legacy next-hop group type "mpath" is unfortunate, because that describes the fact that a packet could be forwarded in one of several paths, which is also true for the resilient next-hop groups.

Therefore, to make the naming clearer, rename various artifacts to reflect the assumptions made. Therefore as of this patch:

- The flag for multipath groups is nh_grp_entry::is_multipath. This includes the legacy and resilient groups, as well as any future group types that behave as multipath groups.
Functions that assume this have "mpath" in the name.

- The flag for legacy multipath groups is nh_grp_entry::hash_threshold. Functions that assume this have "hthr" in the name.

- The flag for resilient groups is nh_grp_entry::resilient. Functions that assume this have "res" in the name.

Besides the above, struct nh_grp_entry::mpath was renamed to ::hthr as well.

Quoted 9 lines

UAPI artifacts were obviously left intact.

---
 include/net/nexthop.h |  4 ++--
 net/ipv4/nexthop.c    | 56 +++++++++++++++++++++----------------------
 2 files changed, 30 insertions(+), 30 deletions(-)

Thanks for the followup.

#2 lore raw
In reply to Petr Machata
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 10 lines · On Fri, 26 Mar 2021 14:20:22 +0100 you wrote:

After resilient next-hop groups have been added recently, there are two types of multipath next-hop groups: the legacy "mpath", and the new "resilient". Calling the legacy next-hop group type "mpath" is unfortunate, because that describes the fact that a packet could be forwarded in one of several paths, which is also true for the resilient next-hop groups.

Therefore, to make the naming clearer, rename various artifacts to reflect the assumptions made. Therefore as of this patch:

[...]

Here is the summary with links:
- [net-next] nexthop: Rename artifacts related to legacy multipath nexthop groups

    https://git.kernel.org/netdev/net-next/c/de1d1ee3e3e9

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html