linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: Alex Elder <elder@linaro.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Arnd Bergmann <arnd@arndb.de>
Cc: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>,
	abhishek.esse@gmail.com, Ben Chan <benchan@google.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	cpratapa@codeaurora.org, David Miller <davem@davemloft.net>,
	DTML <devicetree@vger.kernel.org>,
	Eric Caruso <ejcaruso@google.com>,
	evgreen@chromium.org,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	linux-arm-msm@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-soc@vger.kernel.org, Networking <netdev@vger.kernel.org>,
	syadagir@codeaurora.org
Subject: Re: [PATCH v2 00/17] net: introduce Qualcomm IPA driver
Date: Tue, 18 Jun 2019 13:06:13 -0500	[thread overview]
Message-ID: <84153d9e7c903084b492ceccc0dd98cbb32c12ac.camel@redhat.com> (raw)
In-Reply-To: <850eed1d-0fec-c396-6e91-b5f1f8440ded@linaro.org>

On Tue, 2019-06-18 at 10:20 -0500, Alex Elder wrote:
> On 6/17/19 7:25 AM, Johannes Berg wrote:
> > On Mon, 2019-06-17 at 13:42 +0200, Johannes Berg wrote:
> > 
> > > But anyway, as I alluded to above, I had something like this in
> > > mind:
> > 
> > I forgot to state this here, but this was *heavily* influenced by
> > discussions with Dan - many thanks to him.
> 
> Thanks for getting even more concrete with this.  Code is the
> most concise way of describing things, once the general ideas
> seem to be coming together.
> 
> I'm not going to comment on the specific code bits, but I have
> some more general questions and comments on the design.  Some
> of these are simply due to my lack of knowledge of how WWAN/modem
> interactions normally work.
> 
> First, a few terms (correct or improve as you like):
> - WWAN device is a hardware device (like IPA) that presents a
>   connection between AP and modem, and presents an interface
>   that allows the use of that connection to be managed.
> - WWAN netdevice represents a Linux network interface, with its
>   operations and queues, etc., but implements a standardized
>   set of WWAN-specific operations.  It represents a logical
> ' channel whose data is multiplexed over the WWAN device.
> - WWAN channel is a user space abstraction that corresponds
>   with a WWAN netdevice (but I'm not clear on all the ways
>   they differ or interact).

When Johannes and I have talked about "WWAN channel" we mean a control
or data or other channel. That could be QMI, AT, MBIM control, GPS,
PCSC, QMAP, MBIM data, PPP TTY, DM/DIAG, CDC-ETHER, CDC-NCM, Sierra
HIP, etc. Or even voice-call audio :)

A netdev is a Linux abstraction of a WWAN *data* channel, be that QMI
or CDC-ETHER or whatever.

> - The WWAN core is kernel code that presents abstractions
>   for WWAN devices and netdevices, so they can be managed
>   in a generic way.  It is for configuration and communication
>   and is not at all involved in the data path.
> 
> You're saying that the WWAN driver space calls wwan_add()
> to register itself as a new WWAN device.
> 
> You're also saying that a WWAN device "attaches" a WWAN
> netdevice, which is basically notifying the WWAN core
> that the new netdev/channel is available for use.
> - I trust that a "tentative" attachement is necessary.  But
>   I'm not sure what makes it transition into becoming a
>   "real" one, or how that event gets communicated.

Linux usually tries to keep drivers generic and focused; each driver is
written for a specific function. For example, a USB device usually
provides multiple USB interfaces which will be bound to different Linux
drivers like a TTY, cdc-ether, QMI (via qmi_wwan), cdc-acm, etc.

These drivers are often generic and we may not have enough information
in one driver to know that the parent of this interface is a WWAN
device. But another driver might. Since probing is asynchronous we may
have cdc-acm bind to a device and provide a TTY before cdc-ether (which
does know it's a WWAN) binds and provides the netdevice.

> Some questions:
> - What causes a new channel to be created?  Is it initiated
>   by the WWAN device driver?  Does the modem request that
>   it get created?  User space?  Both?

Either created at driver bind time in the kernel (usually control
channels) or initiated by userspace when the WWAN management process
has coordinated with the firmware for another channel. Honestly
userspace should probably always create the netdevices (since they are
always useless until userspace coordinates with the firmware about
them) but that's not how things are yet.

[ A concrete example...

Assume a QMI device has an existing packet data connection which is
abstracted by a netdevice on the Linux side. Now the WWAN management
daemon wants to create a second packet data connection with a different
APN (maybe an MMS connection, maybe a VOIP one, maybe an IPv6). It
sends a WDS Start Network request to the modem firmware and receives a
new QMI Packet Data Handle.

The management daemon must somehow get a netdevice associated with this
new Packet Data Handle. It would ask the WWAN kernel device to create a
new data channel with the PDH, and would get back the ifindex of that
netdevice which it would configure with the IP that it gets from the
firmware via the WDS Get Current Settings QMI request.

The WWAN device would forward the request down to IPA (or rmnet) which
would then create the netdevice using the PDH as the QMAP MUX ID for
that netdevice's traffic.]


> - What causes a created channel to be removed?

Driver removal, userspace WWAN daemon terminating the packet data
connection which the channel represents, the modem terminating the
packet data connection (eg network initiated disconnect), etc.

> - You distinguish between attaching a netdevice and (what
>   I'll call) activating it.  What causes activation?

Can you describe what you mean by "activating"? Do you mean
successfully TX/RX packets via the netdev and the outside world?

I read "attach" here as simply associating an existing netdev with the
"parent" WWAN device. A purely Linux operation that is only book-
keeping and may not have any interaction with the modem. 

> - How are the attributes of a WWAN device or channel set,
>   or communicated?

Via netlink attributes when userspace asks the WWAN device to create a
new channel. In the control methods I've seen, only userspace really
knows the channel identifier that it and the modem have agreed on (eg
what the MUX ID in the QMAP header would be, or the MBIM Session ID).

> - Are there any attributes that are only optionally supported,
>   and if so, how are the supported ones communicated?

Yeah, capabilities would be important here and I don't think Johannes
accounted for that yet.

> - Which WWAN channel attributes must be set *before* the
>   channel is activated, and can't be changed?  Are there any
>   that can be changed dynamically?

I would assume userspace must pass the agreed identifier (QMUX ID, MBIM
session ID, etc) when creating the channel and that wouldn't change. I
think a world where you can dynamically change the MUX ID/SessionID/etc
is a more complicated one.

Things like QoS could change but I don't recall if modems allow that;
eg does a +CGEQOS (or equivalent QMI WDS LTE QoS Parameters request)
take effect while the bearer is active, or is it only respected on
bearer creation?

> And while the whole point of this is to make things generic,
> it might be nice to have a way to implement a new feature
> before it can be "standardized".

That would be nice, but I'd rather have the conversation about if/how
to standardize things before they make it into the kernel and have
their API set in stone... which is how we ended up with 5 ways of doing
the same thing already.

Dan

> Thanks.
> 
> 					-Alex
> 
> PS  I don't want to exclude anybody but we could probably start
>     a different mail chain on this topic...
> 
> > > driver_dev
> > >   struct device *dev (USB, PCI, ...)
> > >   net_device NA
> > >   net_device NB
> > >   tty TA
> > >  ...
> > > 
> 
> . . .


  reply	other threads:[~2019-06-18 18:06 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31  3:53 [PATCH v2 00/17] net: introduce Qualcomm IPA driver Alex Elder
2019-05-31  3:53 ` [PATCH v2 01/17] bitfield.h: add FIELD_MAX() and field_max() Alex Elder
2019-05-31  3:53 ` [PATCH v2 02/17] dt-bindings: soc: qcom: add IPA bindings Alex Elder
2019-06-10 22:08   ` Rob Herring
2019-06-11  2:11     ` Alex Elder
2019-07-03 15:09       ` Alex Elder
2019-05-31  3:53 ` [PATCH v2 03/17] soc: qcom: ipa: main code Alex Elder
2019-05-31 21:50   ` David Miller
2019-05-31 22:25     ` Alex Elder
2019-05-31  3:53 ` [PATCH v2 04/17] soc: qcom: ipa: configuration data Alex Elder
2019-05-31  3:53 ` [PATCH v2 05/17] soc: qcom: ipa: clocking, interrupts, and memory Alex Elder
2019-05-31  3:53 ` [PATCH v2 06/17] soc: qcom: ipa: GSI headers Alex Elder
2019-05-31  3:53 ` [PATCH v2 07/17] soc: qcom: ipa: the generic software interface Alex Elder
2019-05-31  3:53 ` [PATCH v2 08/17] soc: qcom: ipa: GSI transactions Alex Elder
2019-05-31  3:53 ` [PATCH v2 09/17] soc: qcom: ipa: IPA interface to GSI Alex Elder
2019-05-31  3:53 ` [PATCH v2 10/17] soc: qcom: ipa: IPA endpoints Alex Elder
2019-05-31  3:53 ` [PATCH v2 11/17] soc: qcom: ipa: immediate commands Alex Elder
2019-05-31  3:53 ` [PATCH v2 12/17] soc: qcom: ipa: IPA network device and microcontroller Alex Elder
2019-05-31  3:53 ` [PATCH v2 13/17] soc: qcom: ipa: AP/modem communications Alex Elder
2019-05-31  3:53 ` [PATCH v2 14/17] soc: qcom: ipa: support build of IPA code Alex Elder
2019-05-31  3:53 ` [PATCH v2 15/17] MAINTAINERS: add entry for the Qualcomm IPA driver Alex Elder
2019-05-31  3:53 ` [PATCH v2 16/17] arm64: dts: sdm845: add IPA information Alex Elder
2019-05-31  3:53 ` [PATCH v2 17/17] arm64: defconfig: enable build of IPA code Alex Elder
2019-05-31 14:58 ` [PATCH v2 00/17] net: introduce Qualcomm IPA driver Dan Williams
2019-05-31 16:36   ` Alex Elder
2019-05-31 19:19     ` Arnd Bergmann
2019-05-31 20:47       ` Alex Elder
2019-05-31 21:12         ` Arnd Bergmann
2019-05-31 22:08           ` Alex Elder
2019-06-07 17:43             ` Alex Elder
2019-05-31 23:33         ` Bjorn Andersson
2019-05-31 23:59           ` Subash Abhinov Kasiviswanathan
2019-06-03 10:04             ` Arnd Bergmann
2019-06-03 13:32               ` Alex Elder
2019-06-04  8:13                 ` Arnd Bergmann
2019-06-04 15:18                   ` Dan Williams
2019-06-04 20:04                     ` Arnd Bergmann
2019-06-04 21:29                       ` Dan Williams
2019-06-06 17:42                         ` Alex Elder
2019-06-11  8:12                           ` Johannes Berg
2019-06-11 11:56                             ` Arnd Bergmann
2019-06-11 15:53                               ` Dan Williams
2019-06-11 16:52                                 ` Subash Abhinov Kasiviswanathan
2019-06-11 17:22                                   ` Dan Williams
2019-06-12  8:31                                     ` Arnd Bergmann
2019-06-12 14:27                                       ` Dan Williams
2019-06-12 15:06                                         ` Arnd Bergmann
2019-06-17 11:42                                           ` Johannes Berg
2019-06-17 12:25                                             ` Johannes Berg
2019-06-18 15:20                                               ` Alex Elder
2019-06-18 18:06                                                 ` Dan Williams [this message]
2019-06-24 16:21                                                   ` Alex Elder
2019-06-25 14:14                                                     ` Johannes Berg
2019-06-26 13:36                                                       ` Alex Elder
2019-06-26 17:55                                                         ` Johannes Berg
2019-06-18 18:48                                                 ` Johannes Berg
2019-06-24 16:21                                                   ` Alex Elder
2019-06-18 13:45                                             ` Alex Elder
2019-06-18 19:03                                               ` Johannes Berg
2019-06-18 20:09                                                 ` Arnd Bergmann
2019-06-18 20:15                                                   ` Johannes Berg
2019-06-18 20:33                                                     ` Arnd Bergmann
2019-06-18 20:39                                                       ` Johannes Berg
2019-06-18 21:06                                                         ` Arnd Bergmann
2019-06-19 20:56                                                           ` Dan Williams
2019-06-24 16:21                                                 ` Alex Elder
2019-06-24 16:40                                                   ` Arnd Bergmann
2019-06-25 14:19                                                     ` Johannes Berg
2019-06-26 13:39                                                       ` Alex Elder
2019-06-26 13:58                                                         ` Arnd Bergmann
2019-06-26 17:48                                                           ` Johannes Berg
2019-06-26 17:45                                                         ` Johannes Berg
2019-06-26 13:51                                                     ` Alex Elder
2019-06-17 11:28                               ` Johannes Berg
2019-06-18 13:16                                 ` Alex Elder
2019-06-18 13:48                                   ` Arnd Bergmann
2019-06-18 19:14                                   ` Johannes Berg
2019-06-18 19:59                                     ` Arnd Bergmann
2019-06-18 20:36                                       ` Johannes Berg
2019-06-18 20:55                                         ` Arnd Bergmann
2019-06-18 21:02                                           ` Johannes Berg
2019-06-18 21:15                                           ` Subash Abhinov Kasiviswanathan
2019-06-19 12:23                                             ` Arnd Bergmann
2019-06-19 18:47                                               ` Subash Abhinov Kasiviswanathan
2019-06-20  1:25                                                 ` Dan Williams
2019-06-24 16:21                                     ` Alex Elder
2019-06-17 12:14                               ` Johannes Berg
2019-06-18 14:00                                 ` Alex Elder
2019-06-18 19:22                                   ` Johannes Berg
2019-06-24 16:21                                     ` Alex Elder
2019-06-03 14:50             ` Dan Williams
2019-06-03 14:54         ` Dan Williams
2019-06-03 15:52           ` Alex Elder
2019-06-03 16:18             ` Dan Williams
2019-06-03 19:04               ` Subash Abhinov Kasiviswanathan
2019-06-04 15:21                 ` Dan Williams
2019-05-31 23:27       ` Bjorn Andersson
2019-06-10  2:44 ` Alex Elder
2019-06-24 16:30 ` WWAN Controller Framework (was IPA [PATCH v2 00/17]) Alex Elder
2019-06-24 17:06   ` Alex Elder
2019-06-25 14:34     ` Johannes Berg
2019-06-26 13:40       ` Alex Elder
2019-06-26 17:58         ` Johannes Berg
2019-06-24 19:54   ` Dan Williams
2019-06-24 21:16     ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84153d9e7c903084b492ceccc0dd98cbb32c12ac.camel@redhat.com \
    --to=dcbw@redhat.com \
    --cc=abhishek.esse@gmail.com \
    --cc=arnd@arndb.de \
    --cc=benchan@google.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=cpratapa@codeaurora.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=ejcaruso@google.com \
    --cc=elder@linaro.org \
    --cc=evgreen@chromium.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=subashab@codeaurora.org \
    --cc=syadagir@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).