Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1375718
| From | "Robert Dobrowolski" <robert.dobrowolski@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v1] net: cdc_ncm: update datagram size after changing mtu |
| Date | 2016-04-11 13:20 +0200 |
| Message-ID | <rmI2T-4Vk-39@gated-at.bofh.it> (permalink) |
| References | <rkU8c-3c1-31@gated-at.bofh.it> <rkWMG-5h0-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> Robert Dobrowolski <robert.dobrowolski@linux.intel.com> writes: > >> From: Rafal Redzimski <rafal.f.redzimski@intel.com> >> >> Current implementation updates the mtu size and notify cdc_ncm >> device using USB_CDC_SET_MAX_DATAGRAM_SIZE request about datagram >> size change instead of changing rx_urb_size. >> >> Whenever mtu is being changed, datagram size should also be >> updated. > > Definitely! Thanks for this. But looking at the code I believe you > need to fix the calculation of maxmtu too. It is currently: > > int maxmtu = ctx->max_datagram_size - cdc_ncm_eth_hlen(dev); > > And cdc_ncm_set_dgram_size() updates ctx->max_datagram_size with the new > mtu, meaning that you can only reduce the mtu. We should probably use > cdc_ncm_max_dgram_size() instead here. > > And cdc_ncm_set_dgram_size() takes the datagram size with header as > input (ref the above maxmtu calucalution), so it probably needs to > called as > > cdc_ncm_set_dgram_size(dev, new_mtu + cdc_ncm_eth_hlen(dev)); > > to get it right. I think. None of this is tested on an actual device > yet... Care to test if I'm right, and do a v2 if necessry? > >> Cc: <stable@vger.kernel.org> > > This should be dropped for net. Ask David to queue it for stable > instead. I usually do that by using a subject prefix like > > [PATCH net,stable v1] ... > > > > > Bjørn > ok, thanks for feedback I will send v2 patch
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v1] net: cdc_ncm: update datagram size after changing mtu Robert Dobrowolski <robert.dobrowolski@linux.intel.com> - 2016-04-06 13:50 +0200
Re: [PATCH v1] net: cdc_ncm: update datagram size after changing mtu Bjørn Mork <bjorn@mork.no> - 2016-04-06 16:40 +0200
Re: [PATCH v1] net: cdc_ncm: update datagram size after changing mtu "Robert Dobrowolski" <robert.dobrowolski@linux.intel.com> - 2016-04-11 13:20 +0200
csiph-web