From: "Bjørn Mork" <bjorn@mork.no>
To: "Carl Yin(殷张成)" <carl.yin@quectel.com>
Cc: Daniele Palmas <dnlplm@gmail.com>,
Greg KH <gregkh@linuxfoundation.org>,
"yzc666\@netease.com" <yzc666@netease.com>,
David Miller <davem@davemloft.net>,
"kuba\@kernel.org" <kuba@kernel.org>,
"netdev\@vger.kernel.org" <netdev@vger.kernel.org>,
linux-usb <linux-usb@vger.kernel.org>
Subject: Re: 答复: [PATCH] qmi_wwan: support modify usbnet's rx_urb_size
Date: Mon, 03 Aug 2020 16:05:52 +0200 [thread overview]
Message-ID: <87d047akov.fsf@miraculix.mork.no> (raw)
In-Reply-To: <HK2PR06MB3507C4CD349BBD29C68F3FCE864D0@HK2PR06MB3507.apcprd06.prod.outlook.com> ("Carl Yin(殷张成)"'s message of "Mon, 3 Aug 2020 12:08:24 +0000")
"Carl Yin(殷张成)" <carl.yin@quectel.com> writes:
> Hi Bjørn,
> You can check cdc_ncm.c.
> cdc ncm driver set 'rx_urb_size' on driver probe time, and the value read from' cdc_ncm_bind_common() 's USB_CDC_GET_NTB_FORMAT '.
> and also allow the userspace to modify 'rx_urb_size' by ' /sys/class/net/wwan0/cdc_ncm/rx_max'.
And I must admit I wrote that code ;-)
NCM has the concept of 'dwNtbInMaxSize' and 'dwNtbOutMaxSize'
controlling the maximum USB buffer size in each direction. The values
are set by the device and provided to the host driver when probing. The
driver then knows it must be prepared to receive up to 'dwNtbInMaxSize'
buffers and set 'rx_urb_size' to this value.
This is fully automatic and will Just Work without user/userspace
intervention for any sane NCM or MBIM device.
'rx_max' was introduced to handle the insane devices, wanting buffers
larger than the host was prepared to give them. The limit used to be
hard coded in the driver. But it was enough for some low end
hosts, so I made it configurable using that sysfs knob.
You are right that the rmnet aggregation situation is similar. But
similar to NCM, I would like a solution which is fully automatic for
most of the users. Or preferably all, if possible. A sysfs knob is a
last resort thing. Let's try to do without it first.
Bjørn
next prev parent reply other threads:[~2020-08-03 14:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-03 6:51 [PATCH] qmi_wwan: support modify usbnet's rx_urb_size yzc666
2020-08-03 8:16 ` Greg KH
2020-08-03 8:26 ` Daniele Palmas
2020-08-03 9:49 ` Greg KH
2020-08-03 10:33 ` Daniele Palmas
2020-08-03 10:40 ` Bjørn Mork
2020-08-03 10:35 ` 答复: " Carl Yin(殷张成)
2020-08-03 10:32 ` Bjørn Mork
2020-08-03 12:08 ` 答复: " Carl Yin(殷张成)
2020-08-03 14:05 ` Bjørn Mork [this message]
2020-08-03 8:38 ` Sergei Shtylyov
2020-08-03 10:01 ` kernel test robot
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=87d047akov.fsf@miraculix.mork.no \
--to=bjorn@mork.no \
--cc=carl.yin@quectel.com \
--cc=davem@davemloft.net \
--cc=dnlplm@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yzc666@netease.com \
/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).