RE: PROBLEM: usbnet / ax88179_178a: Panic in usb_hcd_map_urb_for_dma
From: David Laight <hidden>
Date: 2014-01-13 13:26:17
From: Bjørn Mork [mailto:bjorn@mork.no]
David Laight [off-list ref] writes:quoted
From: Bjørn Morkquoted
David Laight [off-list ref] writes:quoted
The patch you submitted is wrong. Whoever wrote the sg interface was on crack. The 'last' marker needs moving as well.I'm afraid I don't understand what you meant by this. sg_init_table() set the 'last' marker. AFAICS, you don't need to change it unless you want to chain lists. Care to explain with some code?Just assuming that there will be some code, somewhere, that will try to process the entire sg list - so won't like the entry with a NULL pointer and zero length at the end. If all the places that process the list are given an explicit number of entries, or don't care about the NULL it doesn't matter.I believe all processing use the urb->num_sgs field to limit the number of entries. Common interfaces like dma_map_sg() and for_each_sg() limit their processing to "nents" entries, and the USB code use the value of urb->num_sgs for this parameter.
Which mostly means that the sg_xxx functions are doing a whole load
of unnecessary instructions and memory accesses...
This probably has a lot to do with the significant difference in the
cpu use for the usb3 and 'normal' ethernet interfaces.
While each bit doesn't seem significant, they soon add up.
David
�{.n�+�������+%��lzwm��b�맲��r��zX���n)���w*jg���
�����ݢj.�۰\��M��gj��a����' ��ޢ�
���j:+v���w�j�m��������zZ+�����ݢj"��!�i