All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ip route: Do not imply pref and ttl-propagate are per nexthop
@ 2020-02-25 13:12 Donald Sharp
  2020-02-28 18:30 ` Andrea Claudi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Donald Sharp @ 2020-02-25 13:12 UTC (permalink / raw)
  To: netdev, dsahern, roopa

Currently `ip -6 route show` gives us this output:

sharpd@eva ~/i/ip (master)> ip -6 route show
::1 dev lo proto kernel metric 256 pref medium
4:5::6:7 nhid 18 proto static metric 20
        nexthop via fe80::99 dev enp39s0 weight 1
        nexthop via fe80::44 dev enp39s0 weight 1 pref medium

Displaying `pref medium` as the last bit of output implies
that the RTA_PREF is a per nexthop value, when it is infact
a per route piece of data.

Change the output to display RTA_PREF and RTA_TTL_PROPAGATE
before the RTA_MULTIPATH data is shown:

sharpd@eva ~/i/ip (master)> ./ip -6 route show
::1 dev lo proto kernel metric 256 pref medium
4:5::6:7 nhid 18 proto static metric 20 pref medium
        nexthop via fe80::99 dev enp39s0 weight 1
        nexthop via fe80::44 dev enp39s0 weight 1

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
---
 ip/iproute.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ip/iproute.c b/ip/iproute.c
index 93b805c9..07c45169 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -933,9 +933,6 @@ int print_route(struct nlmsghdr *n, void *arg)
 	if (tb[RTA_IIF] && filter.iifmask != -1)
 		print_rta_if(fp, tb[RTA_IIF], "iif");
 
-	if (tb[RTA_MULTIPATH])
-		print_rta_multipath(fp, r, tb[RTA_MULTIPATH]);
-
 	if (tb[RTA_PREF])
 		print_rt_pref(fp, rta_getattr_u8(tb[RTA_PREF]));
 
@@ -951,6 +948,14 @@ int print_route(struct nlmsghdr *n, void *arg)
 				     propagate ? "enabled" : "disabled");
 	}
 
+	if (tb[RTA_MULTIPATH])
+		print_rta_multipath(fp, r, tb[RTA_MULTIPATH]);
+
+	/* If you are adding new route RTA_XXXX then place it above
+	 * the RTA_MULTIPATH else it will appear that the last nexthop
+	 * in the ECMP has new attributes
+	 */
+
 	print_string(PRINT_FP, NULL, "\n", NULL);
 	close_json_object();
 	fflush(fp);
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ip route: Do not imply pref and ttl-propagate are per nexthop
  2020-02-25 13:12 [PATCH] ip route: Do not imply pref and ttl-propagate are per nexthop Donald Sharp
@ 2020-02-28 18:30 ` Andrea Claudi
  2020-02-28 18:54 ` Roopa Prabhu
  2020-02-28 21:47 ` Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Andrea Claudi @ 2020-02-28 18:30 UTC (permalink / raw)
  To: Donald Sharp; +Cc: linux-netdev, David Ahern, roopa

On Tue, Feb 25, 2020 at 2:12 PM Donald Sharp <sharpd@cumulusnetworks.com> wrote:
>
> Currently `ip -6 route show` gives us this output:
>
> sharpd@eva ~/i/ip (master)> ip -6 route show
> ::1 dev lo proto kernel metric 256 pref medium
> 4:5::6:7 nhid 18 proto static metric 20
>         nexthop via fe80::99 dev enp39s0 weight 1
>         nexthop via fe80::44 dev enp39s0 weight 1 pref medium
>
> Displaying `pref medium` as the last bit of output implies
> that the RTA_PREF is a per nexthop value, when it is infact
> a per route piece of data.
>
> Change the output to display RTA_PREF and RTA_TTL_PROPAGATE
> before the RTA_MULTIPATH data is shown:
>
> sharpd@eva ~/i/ip (master)> ./ip -6 route show
> ::1 dev lo proto kernel metric 256 pref medium
> 4:5::6:7 nhid 18 proto static metric 20 pref medium
>         nexthop via fe80::99 dev enp39s0 weight 1
>         nexthop via fe80::44 dev enp39s0 weight 1
>
> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
> ---
>  ip/iproute.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/ip/iproute.c b/ip/iproute.c
> index 93b805c9..07c45169 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -933,9 +933,6 @@ int print_route(struct nlmsghdr *n, void *arg)
>         if (tb[RTA_IIF] && filter.iifmask != -1)
>                 print_rta_if(fp, tb[RTA_IIF], "iif");
>
> -       if (tb[RTA_MULTIPATH])
> -               print_rta_multipath(fp, r, tb[RTA_MULTIPATH]);
> -
>         if (tb[RTA_PREF])
>                 print_rt_pref(fp, rta_getattr_u8(tb[RTA_PREF]));
>
> @@ -951,6 +948,14 @@ int print_route(struct nlmsghdr *n, void *arg)
>                                      propagate ? "enabled" : "disabled");
>         }
>
> +       if (tb[RTA_MULTIPATH])
> +               print_rta_multipath(fp, r, tb[RTA_MULTIPATH]);
> +
> +       /* If you are adding new route RTA_XXXX then place it above
> +        * the RTA_MULTIPATH else it will appear that the last nexthop
> +        * in the ECMP has new attributes
> +        */
> +
>         print_string(PRINT_FP, NULL, "\n", NULL);
>         close_json_object();
>         fflush(fp);
> --
> 2.25.0
>

LGTM. Can you please add:
Fixes: f48e14880a0e5 ("iproute: refactor multipath print")

Reviewed-by: Andrea Claudi <aclaudi@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ip route: Do not imply pref and ttl-propagate are per nexthop
  2020-02-25 13:12 [PATCH] ip route: Do not imply pref and ttl-propagate are per nexthop Donald Sharp
  2020-02-28 18:30 ` Andrea Claudi
@ 2020-02-28 18:54 ` Roopa Prabhu
  2020-02-28 21:47 ` Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Roopa Prabhu @ 2020-02-28 18:54 UTC (permalink / raw)
  To: Donald Sharp; +Cc: netdev, David Ahern

On Tue, Feb 25, 2020 at 5:12 AM Donald Sharp <sharpd@cumulusnetworks.com> wrote:
>
> Currently `ip -6 route show` gives us this output:
>
> sharpd@eva ~/i/ip (master)> ip -6 route show
> ::1 dev lo proto kernel metric 256 pref medium
> 4:5::6:7 nhid 18 proto static metric 20
>         nexthop via fe80::99 dev enp39s0 weight 1
>         nexthop via fe80::44 dev enp39s0 weight 1 pref medium
>
> Displaying `pref medium` as the last bit of output implies
> that the RTA_PREF is a per nexthop value, when it is infact
> a per route piece of data.
>
> Change the output to display RTA_PREF and RTA_TTL_PROPAGATE
> before the RTA_MULTIPATH data is shown:
>
> sharpd@eva ~/i/ip (master)> ./ip -6 route show
> ::1 dev lo proto kernel metric 256 pref medium
> 4:5::6:7 nhid 18 proto static metric 20 pref medium
>         nexthop via fe80::99 dev enp39s0 weight 1
>         nexthop via fe80::44 dev enp39s0 weight 1
>
> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>


Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>


> ---
>  ip/iproute.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/ip/iproute.c b/ip/iproute.c
> index 93b805c9..07c45169 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -933,9 +933,6 @@ int print_route(struct nlmsghdr *n, void *arg)
>         if (tb[RTA_IIF] && filter.iifmask != -1)
>                 print_rta_if(fp, tb[RTA_IIF], "iif");
>
> -       if (tb[RTA_MULTIPATH])
> -               print_rta_multipath(fp, r, tb[RTA_MULTIPATH]);
> -
>         if (tb[RTA_PREF])
>                 print_rt_pref(fp, rta_getattr_u8(tb[RTA_PREF]));
>
> @@ -951,6 +948,14 @@ int print_route(struct nlmsghdr *n, void *arg)
>                                      propagate ? "enabled" : "disabled");
>         }
>
> +       if (tb[RTA_MULTIPATH])
> +               print_rta_multipath(fp, r, tb[RTA_MULTIPATH]);
> +
> +       /* If you are adding new route RTA_XXXX then place it above
> +        * the RTA_MULTIPATH else it will appear that the last nexthop
> +        * in the ECMP has new attributes
> +        */
> +
>         print_string(PRINT_FP, NULL, "\n", NULL);
>         close_json_object();
>         fflush(fp);
> --
> 2.25.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ip route: Do not imply pref and ttl-propagate are per nexthop
  2020-02-25 13:12 [PATCH] ip route: Do not imply pref and ttl-propagate are per nexthop Donald Sharp
  2020-02-28 18:30 ` Andrea Claudi
  2020-02-28 18:54 ` Roopa Prabhu
@ 2020-02-28 21:47 ` Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2020-02-28 21:47 UTC (permalink / raw)
  To: Donald Sharp; +Cc: netdev, dsahern, roopa

On Tue, 25 Feb 2020 08:12:13 -0500
Donald Sharp <sharpd@cumulusnetworks.com> wrote:

> Currently `ip -6 route show` gives us this output:
> 
> sharpd@eva ~/i/ip (master)> ip -6 route show
> ::1 dev lo proto kernel metric 256 pref medium
> 4:5::6:7 nhid 18 proto static metric 20
>         nexthop via fe80::99 dev enp39s0 weight 1
>         nexthop via fe80::44 dev enp39s0 weight 1 pref medium
> 
> Displaying `pref medium` as the last bit of output implies
> that the RTA_PREF is a per nexthop value, when it is infact
> a per route piece of data.
> 
> Change the output to display RTA_PREF and RTA_TTL_PROPAGATE
> before the RTA_MULTIPATH data is shown:
> 
> sharpd@eva ~/i/ip (master)> ./ip -6 route show
> ::1 dev lo proto kernel metric 256 pref medium
> 4:5::6:7 nhid 18 proto static metric 20 pref medium
>         nexthop via fe80::99 dev enp39s0 weight 1
>         nexthop via fe80::44 dev enp39s0 weight 1
> 
> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>

Looks good applied

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-28 21:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 13:12 [PATCH] ip route: Do not imply pref and ttl-propagate are per nexthop Donald Sharp
2020-02-28 18:30 ` Andrea Claudi
2020-02-28 18:54 ` Roopa Prabhu
2020-02-28 21:47 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.