]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: ether: Allow jumbo frames
authorMike Looijmans <mike.looijmans@topic.nl>
Wed, 5 Aug 2015 06:54:55 +0000 (08:54 +0200)
committerFelipe Balbi <balbi@ti.com>
Sun, 27 Sep 2015 15:54:31 +0000 (10:54 -0500)
commit58a80a45b9613c9b87c2436bc5c8d1e72005ab3a
tree4f9d37b42a4dda49678275baa62a82a3689a0bd5
parentf5e3ba18c93d625541762463170fe97e94294fce
usb: gadget: ether: Allow jumbo frames

USB network adapters support Jumbo frames. The only thing blocking
that feature is the code in the gadget driver that disposes of
packets larger than 1518 bytes, and the limit on the ioctl to set
the mtu.

This patch relaxes these limits, and allows up to 15k frames sizes.
The 15k value was chosen because 16k does not work on all platforms,
and usingclose to 16k will result in allocating 5 or 8 4k pages to
store the skb, wasting pages at no measurable performance gain.

On a topic-miami board (Zynq-7000), iperf3 performance reports:
MTU= 1500, PC-to-gadget: 139 Mbps, Gadget-to-PC: 116 Mbps
MTU=15000, PC-to-gadget: 239 Mbps, Gadget-to-PC: 361 Mbps

On boards with slower CPUs the performance improvement will be
relatively much larger, e.g. an OMAP-L138 increased from 40 to
220 Mbps using a similar patch on an  2.6.37 kernel.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/u_ether.c