lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D45EDC1@AcuExch.aculab.com>
Date:	Fri, 17 Jan 2014 14:46:24 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Ming Lei' <tom.leiming@...il.com>
CC:	Bjørn Mork <bjorn@...k.no>,
	Thomas Kear <thomas@...r.co.nz>,
	Ben Hutchings <bhutchings@...arflare.com>,
	netdev <netdev@...r.kernel.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>
Subject: RE: PROBLEM: usbnet / ax88179_178a: Panic in usb_hcd_map_urb_for_dma

From: Ming Lei
> On Mon, Jan 13, 2014 at 9:26 PM, David Laight <David.Laight@...lab.com> wrote:
> >>
> >> 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.
> 
> If you plan to remove the 'nents' parameter, I am wondering if it is
> a good idea, because sg_nents() should be more heavy. Not mention
> sometimes the callers just want to map/unmap part of entries.

I was thinking of using a simple address/length array without all
the extra fields and flags 'overpunched' in the low address bits.

I'm not even sure the current use is strictly correct.
The field names of the scatterlist have a page address and offset
but the buffers passed to xhci (at least by usbnet) can span multiple
pages - they are physically contiguous.

IIRC some traces of requests for USB disks show a separate SG entry
for each 4k page - even for both virtually and physically adjacent
pages.

	David



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ