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)
commitf42763dbdf043c9996dfabf6d167eab28e016eb8
tree87ac340cfb756e9b725f18f2d7b99be3414e68fd
parent1ba5d0ff36f765a571c83b55b13ec44f4050fb5b
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: 68864abf08f0 ("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