netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Dan Williams" <dcbw@redhat.com>, "Bjørn Mork" <bjorn@mork.no>,
	netdev@vger.kernel.org,
	"Sean Tranchetti" <stranche@codeaurora.org>,
	"Daniele Palmas" <dnlplm@gmail.com>,
	"Aleksander Morgado" <aleksander@aleksander.es>,
	netdev-owner@vger.kernel.org
Subject: Re: cellular modem driver APIs
Date: Wed, 10 Apr 2019 21:54:56 -0600	[thread overview]
Message-ID: <e092a06517ea7ec5ee81aa5035fe09ac@codeaurora.org> (raw)
In-Reply-To: <75f9f963c1d07f5739ce76fcfc832e7e83586bda.camel@sipsolutions.net>

> OK. But it means that you have a very specific encapsulation mode on 
> top
> of the "netdev". I'm still not convinced we should actually make that a
> netdev, but I'll elaborate elsewhere.
> 
>> I recall Daniele also managed to get rmnet working with qmi_wwan
>> (with an additional patch in which I had made qmi_wwan a passthrough)
> 
> I guess that uses the same encapsulation then, yes, I see it now:
> qmi_wwan's struct qmimux_hdr and rmnet's struct rmnet_map_header are
> very similar.
> 
> Btw, I see that struct rmnet_map_header uses a bitfield - this seems to
> go down to the device so probably will not work right on both big and
> little endian.
> 

Yes, I have tested so far in big endian only. I need to add support for
little endian.

>> We need raw IP frames from a embedded device transmitted to a PC
>> and vice versa.
> 
> Sure. But you just need to encap them in some kind of ethernet frame to
> transport them on the wire, but don't really need to care much about
> how.
> 

These packets will be processed as raw IP muxed frames on the PC as 
well,
not as ethernet though.

>> Yes, the underlying netdev itself cannot do much on its own as network
>> stack wont be able to decipher the muxed frames.
> 
> Right.
> 
>> The operation of rmnet was to be agnostic of the underlying driver.
>> The netdev model was chosen for it since it was easy to have a
>> rx_handler attach to the netdevice exposed by any of those drivers.
> 
> I really do think it's the wrong model though:
> 
>    1. The network stack cannot do anything with the muxed data, and so
>       there's no value from that perspective in exposing it that way.
>    2. The rx_handler attach thing is a bit of a red herring - if you 
> have
>       some other abstraction that the driver registers with, you can 
> just
>       say "send packets here" and then demux things properly, without
>       having a netdev. Actually, I'd almost argue that rmnet should've 
> just
>       been a sort of encap/decap library that the drivers like 
> qmi_wwan,
>       rmnet_ipa and mhi use to talk to the device.

Currently, iproute2 can be used to add the underlying dev as real_dev 
and
create rmnet links over it (ip link add link rmnet_ipa0 name rmnet0 type 
rmnet
mux_id 1). Would this continue to work if -
1. the rmnet library were to be included directly as part of the 
underlying
driver itself
2. there is no underlying dev at all

>    3. Having this underlying netdev is actually very limiting. We found
>       this with wifi a long time ago, and I suspect with 5G coming up
>       you'll be in a similar situation. You'll want to do things like
>       multi-queue, different hardware queues for different channels, 
> etc.
>       and muxing it all over a single netdev (and a single queue there)
>       becomes an easily avoidable point of contention.
>    4. (I thought about something else but it escapes me now)
> 
>> > Now, OTOH, this loses a bunch of benefits. We may want to be able to
>> > use
>> > ethtool to flash a modem, start tcpdump on the underlying netdev
>> > directly to see everything, etc.?
>> >
>> 
>> Yes, we use that underlying netdev to view the muxed raw IP frames in
>> tcpdump.
> 
> That's the easiest of all - just make the framework able to add a
> 'sniffer' netdev that can see all the TX/RX for the other channels.
> 

One additional use of underlying netdev is for RPS.
This helps to separate out the processing of the underlying netdev and
rmnet. If rmnet were to be converted into a library, we would still need
this functionality.

Having said this, looking forward to trying out your patches :)

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2019-04-11  3:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 21:15 cellular modem driver APIs Johannes Berg
2019-04-04  8:51 ` Bjørn Mork
2019-04-04  9:00   ` Johannes Berg
2019-04-04 15:52     ` Dan Williams
2019-04-04 19:16       ` Subash Abhinov Kasiviswanathan
2019-04-04 20:38         ` Johannes Berg
2019-04-04 21:00           ` Johannes Berg
2019-04-05  4:45           ` Subash Abhinov Kasiviswanathan
2019-04-06 17:22             ` Daniele Palmas
2019-04-08 19:49             ` Johannes Berg
2019-04-11  3:54               ` Subash Abhinov Kasiviswanathan [this message]
2019-04-12 12:01                 ` Johannes Berg
2019-04-12 14:27                   ` Bjørn Mork
2019-04-12 17:04                     ` Johannes Berg
2019-04-14 19:09                   ` Subash Abhinov Kasiviswanathan
2019-04-15  8:27                     ` Johannes Berg
2019-04-06 17:20     ` Daniele Palmas
2019-04-08 19:51       ` Johannes Berg

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=e092a06517ea7ec5ee81aa5035fe09ac@codeaurora.org \
    --to=subashab@codeaurora.org \
    --cc=aleksander@aleksander.es \
    --cc=bjorn@mork.no \
    --cc=dcbw@redhat.com \
    --cc=dnlplm@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=netdev-owner@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stranche@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).