[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMZdPi9h+EzmCtn9nKE73cKZMWTP0tLLpawxiyTbVVGacHj_iw@mail.gmail.com>
Date: Tue, 22 Jun 2021 08:55:07 +0200
From: Loic Poulain <loic.poulain@...aro.org>
To: Sergey Ryazanov <ryazanov.s.a@...il.com>
Cc: David Ahern <dsahern@...il.com>,
Stephen Hemminger <stephen@...workplumber.org>,
Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH iproute2-next 1/2] iplink: add support for parent device
Hi Sergey,
On Tue, 22 Jun 2021 at 02:32, Sergey Ryazanov <ryazanov.s.a@...il.com> wrote:
>
> Add support for specifying a parent device (struct device) by its name
> during the link creation and printing parent name in the links list.
> This option will be used to create WWAN links and possibly by other
> device classes that do not have a "natural parent netdev".
>
> Add the parent device bus name printing for links list info
> completeness. But do not add a corresponding command line argument, as
> we do not have a use case for this attribute.
>
> Signed-off-by: Sergey Ryazanov <ryazanov.s.a@...il.com>
> ---
> ip/ipaddress.c | 14 ++++++++++++++
> ip/iplink.c | 6 +++++-
> 2 files changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index 06ca7273..7dc38ff1 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -1242,6 +1242,20 @@ int print_linkinfo(struct nlmsghdr *n, void *arg)
> RTA_PAYLOAD(tb[IFLA_PHYS_SWITCH_ID]),
> b1, sizeof(b1)));
> }
> +
> + if (tb[IFLA_PARENT_DEV_BUS_NAME]) {
> + print_string(PRINT_ANY,
> + "parentdevbus",
Parav suggested previously to simply name it 'parentbus'.
> + "parentdevbus %s ",
> + rta_getattr_str(tb[IFLA_PARENT_DEV_BUS_NAME]));
> + }
> +
> + if (tb[IFLA_PARENT_DEV_NAME]) {
> + print_string(PRINT_ANY,
> + "parentdev",
> + "parentdev %s ",
> + rta_getattr_str(tb[IFLA_PARENT_DEV_NAME]));
> + }
> }
>
Powered by blists - more mailing lists