]> git.baikalelectronics.ru Git - kernel.git/commit
net: cdc_ncm: inform usbnet when rx buffers are reduced
authorBjørn Mork <bjorn@mork.no>
Fri, 30 May 2014 07:31:05 +0000 (09:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Jun 2014 23:01:30 +0000 (16:01 -0700)
commitaba179fef9a630717e435cf4bc8ba506e70089dc
tree87ac340cfb756e9b725f18f2d7b99be3414e68fd
parentf8a86bd852f1bcf07c16b79db7f0b69183aaff6a
net: cdc_ncm: inform usbnet when rx buffers are reduced

It doesn't matter whether the buffer size goes up or down.  We have to
keep usbnet and device syncronized to be able to split transfers at the
correct boundaries. The spec allow skipping short packets when using
max sized transfers.  If we don't tell usbnet about our new expected rx
buffer size, then it will merge and/or split NTBs.  The driver does not
support this, and the result will be lots of framing errors.

Fix by always reallocating usbnet rx buffers when the rx_max value
changes.

Fixes: ada0bfdbd7d4 ("net: cdc_ncm: support rx_max/tx_max updates when running")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_ncm.c