Implicit master interface setup when creating new links?

Aleksander Morgado aleksander at aleksander.es
Tue Feb 16 08:51:55 UTC 2021


Hey,

> > Ok, I've just realized this cannot be done. Creating new links
> > *requires* the interface to be dow
>
> Ouch. Never noticed that before.  Tells you how much I've been using
> this.... Doesn't look quite right to me.
>
> I believe the part we wanted to protect is the modification of the
> master interface.  But there is no reason we couldn't add and/or delete
> links 2+ with master running.  Actually, I am not sure there is any
> reason at all here?  This seems to be just accidentally copied from the
> raw-ip code.  But there we change the header_ops etc on master, so it
> makes sense. We don't do anything like that for muxing - the master is
> left as-is.  So why not just add/del links on the fly without taking
> down master?
>
> A bit late to fix that now, I guess.  At least for your immediate needs.
> But I believe we could loosen up the restrictions without breaking any
> userspace expectations. So it's tempting to fix it in any case.  If
> anyone cares?
>

This limitation doesn't seem to exist when using rmnet.

$ sudo qmicli -d /dev/cdc-wdm0 --set-expected-data-format=qmap-pass-through
[/dev/cdc-wdm0] expected data format set to: qmap-pass-through
$ sudo ip link set up dev wwp0s20f0u8u2i4
$ sudo qmicli -d /dev/cdc-wdm0
--link-add="mux-id=1,iface=wwp0s20f0u8u2i4,prefix=qmapmux"
[/dev/cdc-wdm0] link successfully added:
  iface name: qmapmux0
  mux-id:     1

Until now I was hoping to keep both qmi_wwan-based and rmnet-based
logic in sync everywhere, with more or less luck, but this specific
issue is too big of a change I think. Requiring a new ModemManager API
to pre-create N links before they're used, when it's not strictly
required with rmnet, is a bad limitation. Right now, I'm thinking that
I could limit in ModemManager the amount of different links to use
when using qmi_wwan to a sane default, e.g. 3 or 4? and pre-create
those links before bringing up the master interface. And for rmnet,
keep the logic as it is and only create the link when needed. What do
you think?

At the end, the way I'm working on it right now, the qmi_wwan
add_mux/del_mux logic in MM will be used only for kernels that don't
support the pass-through flag yet.

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list