2021-06-03 04:53:19

by Sergey Ryazanov

[permalink] [raw]
Subject: [RFC 0/6] WWAN netdev creation framework tweaks

This is a follow-up series to the proposed generic WWAN interface
creation framework [1].

The first two patches are small fixes for issues that were spotted
during the original code testing. The 3rd patch completes my suggestion
to make the parent device attribute (IFLA_PARENT_DEV_NAME) generic by
revealing the netdev parent device to userspace using this attribute.
The 4th patch was added to make it easier to test iproute2 changes, in
fact it just copies the definitions from the kernel headers to iproute2.
Finally, 5th and 6th patches provide an example of userspace support for
WWAN links management.

At the moment I do not have access to any WWAN hardware, so the code was
only lightly tested at runtime.

1. https://lore.kernel.org/netdev/[email protected]

2021-06-03 04:53:37

by Sergey Ryazanov

[permalink] [raw]
Subject: [RFC 1/6] rtnetlink: fix alloc() method introduction

RTNL checks for the setup() callback existing in a few place as a sanity
check. The introduction of the alloc() method makes the setup() method
optional. So allow RTNL families that define at least one alloc() or
setup() method.

Fixes: ???? ("rtnetlink: add alloc() method to rtnl_link_ops")
Signed-off-by: Sergey Ryazanov <[email protected]>
net/core/rtnetlink.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 49a27bf6e4a7..56ac16abe0ba 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -376,12 +376,12 @@ int __rtnl_link_register(struct rtnl_link_ops *ops)
if (rtnl_link_ops_get(ops->kind))
return -EEXIST;

- /* The check for setup is here because if ops
+ /* The check for alloc/setup is here because if ops
* does not have that filled up, it is not possible
* to use the ops for creating device. So do not
* fill up dellink as well. That disables rtnl_dellink.
- if (ops->setup && !ops->dellink)
+ if ((ops->alloc || ops->setup) && !ops->dellink)
ops->dellink = unregister_netdevice_queue;

list_add_tail(&ops->list, &link_ops);
@@ -3421,7 +3421,7 @@ static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,

- if (!ops->setup)
+ if (!ops->alloc && !ops->setup)

if (!ifname[0]) {

2021-06-03 04:54:39

by Sergey Ryazanov

[permalink] [raw]
Subject: [RFC 2/6] wwan: fix module initialization

Recover the successful return from the module initialization function
that was accidentally lost during the netdev creation support

Fixes: ???? ("wwan: add interface creation support")
Signed-off-by: Sergey Ryazanov <[email protected]>
drivers/net/wwan/wwan_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
index e2490c73ac33..32b2096c5036 100644
--- a/drivers/net/wwan/wwan_core.c
+++ b/drivers/net/wwan/wwan_core.c
@@ -737,7 +737,8 @@ static int __init wwan_init(void)
goto destroy;

- err = 0;
+ return 0;