* [PATCH 1/1] usb: cdc-ncm: Increase maximum allowed datagram size @ 2012-02-14 14:39 Toby Gray 2012-02-14 19:46 ` David Miller 0 siblings, 1 reply; 5+ messages in thread From: Toby Gray @ 2012-02-14 14:39 UTC (permalink / raw) To: Oliver Neukum, Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Toby Gray Some NCM devices exist which will send datagrams larger than 2k and don't support the GetMaxDatagramSize request, such as the Nokia 701 Mobile Telephone. This sets the maximum limit of datagrams to the theoretical limit for 16-bit NTBs, preventing dropping of large datagrams received from some devices. Signed-off-by: Toby Gray <toby.gray-BiNz9QiKYoNBDgjK7y7TUQ@public.gmane.org> --- drivers/net/usb/cdc_ncm.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 3a539a9..d9be846 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -67,8 +67,10 @@ #define CDC_NCM_MIN_TX_PKT 512 /* bytes */ -/* Default value for MaxDatagramSize */ -#define CDC_NCM_MAX_DATAGRAM_SIZE 2048 /* bytes */ +/* Maximum value for MaxDatagramSize, this is 16k (max NTB size) + * minus NTH size (12 bytes) and minus the smallest possible NDP size + * (16 bytes). */ +#define CDC_NCM_MAX_DATAGRAM_SIZE 16356 /* bytes */ /* * Maximum amount of datagrams in NCM Datagram Pointer Table, not counting -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] usb: cdc-ncm: Increase maximum allowed datagram size 2012-02-14 14:39 [PATCH 1/1] usb: cdc-ncm: Increase maximum allowed datagram size Toby Gray @ 2012-02-14 19:46 ` David Miller 2012-02-14 22:27 ` Alexey Orishko 0 siblings, 1 reply; 5+ messages in thread From: David Miller @ 2012-02-14 19:46 UTC (permalink / raw) To: toby.gray; +Cc: oliver, gregkh, linux-usb, netdev, linux-kernel From: Toby Gray <toby.gray@realvnc.com> Date: Tue, 14 Feb 2012 14:39:35 +0000 > Some NCM devices exist which will send datagrams larger than 2k and > don't support the GetMaxDatagramSize request, such as the Nokia 701 > Mobile Telephone. > > This sets the maximum limit of datagrams to the theoretical limit for > 16-bit NTBs, preventing dropping of large datagrams received from some > devices. > > Signed-off-by: Toby Gray <toby.gray@realvnc.com> Can a USB expert please sanity check this before I apply it? Thanks. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] usb: cdc-ncm: Increase maximum allowed datagram size 2012-02-14 19:46 ` David Miller @ 2012-02-14 22:27 ` Alexey Orishko [not found] ` <CAL_Kpj0VSu-ByUEwTeVG5-5psab3h38bTL=ot7vYD8A+Oeb_Ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Alexey Orishko @ 2012-02-14 22:27 UTC (permalink / raw) To: David Miller, toby.gray; +Cc: oliver, gregkh, linux-usb, netdev, linux-kernel On Tue, Feb 14, 2012 at 8:46 PM, David Miller <davem@davemloft.net> wrote: > > Can a USB expert please sanity check this before I apply it? I would recommend to change CDC_NCM_NTB_MAX_SIZE_TX(RX) to 32K and simply set MAX_DATAGRAM_SIZE to 16K /alexey ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CAL_Kpj0VSu-ByUEwTeVG5-5psab3h38bTL=ot7vYD8A+Oeb_Ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 1/1] usb: cdc-ncm: Increase maximum allowed datagram size [not found] ` <CAL_Kpj0VSu-ByUEwTeVG5-5psab3h38bTL=ot7vYD8A+Oeb_Ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2012-02-15 8:53 ` Oliver Neukum [not found] ` <201202150953.20341.oneukum-l3A5Bk7waGM@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Oliver Neukum @ 2012-02-15 8:53 UTC (permalink / raw) To: Alexey Orishko Cc: David Miller, toby.gray-BiNz9QiKYoNBDgjK7y7TUQ, oliver-Q6YOFhsQ4GZ7tPAFqOLdPg, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Am Dienstag, 14. Februar 2012, 23:27:29 schrieb Alexey Orishko: > On Tue, Feb 14, 2012 at 8:46 PM, David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote: > > > > Can a USB expert please sanity check this before I apply it? > > I would recommend to change CDC_NCM_NTB_MAX_SIZE_TX(RX) to 32K and > simply set MAX_DATAGRAM_SIZE to 16K Have you tried that under severe memory presssure? Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <201202150953.20341.oneukum-l3A5Bk7waGM@public.gmane.org>]
* Re: [PATCH 1/1] usb: cdc-ncm: Increase maximum allowed datagram size [not found] ` <201202150953.20341.oneukum-l3A5Bk7waGM@public.gmane.org> @ 2012-02-15 14:40 ` Alexey Orishko 0 siblings, 0 replies; 5+ messages in thread From: Alexey Orishko @ 2012-02-15 14:40 UTC (permalink / raw) To: Oliver Neukum Cc: David Miller, toby.gray-BiNz9QiKYoNBDgjK7y7TUQ, oliver-Q6YOFhsQ4GZ7tPAFqOLdPg, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Wed, Feb 15, 2012 at 9:53 AM, Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org> wrote: > Have you tried that under severe memory presssure? Well, it is a simplistic view upon host configuration. Developing of NCM spec was done with mind set, that host must be more capable than device. However, proposal above doesn't solve problem completely due to usbnet. Currently I'm testing some improvements/fixes related to data handling and driver latency with the plan to post it in the near future. Regards, Alexey -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-15 14:40 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-02-14 14:39 [PATCH 1/1] usb: cdc-ncm: Increase maximum allowed datagram size Toby Gray 2012-02-14 19:46 ` David Miller 2012-02-14 22:27 ` Alexey Orishko [not found] ` <CAL_Kpj0VSu-ByUEwTeVG5-5psab3h38bTL=ot7vYD8A+Oeb_Ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2012-02-15 8:53 ` Oliver Neukum [not found] ` <201202150953.20341.oneukum-l3A5Bk7waGM@public.gmane.org> 2012-02-15 14:40 ` Alexey Orishko
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).