mbox series

[iproute2-next,0/2] ip: wwan links management support

Message ID 20210622003210.22765-1-ryazanov.s.a@gmail.com
Headers show
Series ip: wwan links management support | expand

Message

Sergey Ryazanov June 22, 2021, 12:32 a.m. UTC
This short series introduces support for WWAN links  support.

First patch adds support for new common attributes: parent device name
and parent device bus name. The former attribute required to create a
new WWAN link. Finally, the second patch introduces support for a new
'wwan' link type.

Changelong:
  RFC -> v1
    * drop the kernel headers update patch
    * add a parent device bus attribute support
    * shorten the 'parentdev-name' parameter to just 'parentdev'

Sergey Ryazanov (2):
  iplink: add support for parent device
  iplink: support for WWAN devices

 ip/Makefile      |  2 +-
 ip/ipaddress.c   | 14 ++++++++++
 ip/iplink.c      |  9 ++++--
 ip/iplink_wwan.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 94 insertions(+), 3 deletions(-)
 create mode 100644 ip/iplink_wwan.c

Comments

Loic Poulain June 22, 2021, 6:55 a.m. UTC | #1
Hi Sergey,

On Tue, 22 Jun 2021 at 02:32, Sergey Ryazanov <ryazanov.s.a@gmail.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@gmail.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]));
> +               }
>         }
>