> From: Eric Dumazet [mailto:eric.dumazet@xxxxxxxxx] > On Wed, 2013-11-20 at 09:36 +0000, David Laight wrote: > > > Ben said the largest number of fragments from the current network > > stack will be 17, and that none of them will cross 32k boundaries. > > So the network stack won't send down long SG lists. > > Please note that skb->head itself _might_ cross a 32K or 64K boundary : > > skb->head is kmalloc() provided, and SLUB can be tweaked > (slub_max_order) to use very high order pages. Worth remembering... I suspect the number of fragments (inc 64k boundaries) is still limited because maximum data length is under 64k (for TSO) and the SLUB memory has to be physically contiguous (it is still limited even if not). At the moment the usb bulk tx code calculated the exact number of fragments needed. To do this it has to scan the sg list twice. It would seem more sensible to generate a quick upper bound (ie nfrags*2 + len/65536) and maybe calculate the exact number if this would exceed the maximum number. OTOH the max allowed could be documented that way. In any case this is all aside from the bug itself. David ��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥