PERFORCE change 102585 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Thu Jul 27 19:33:54 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=102585
Change 102585 by hselasky at hselasky_mini_itx on 2006/07/27 19:33:41
Optimize UHCI and EHCI drivers by not scanning TD chains from the
beginning, but rather store the position of the last checked TD
and continue on from there.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/ehci.c#7 edit
.. //depot/projects/usb/src/sys/dev/usb/ohci.c#7 edit
.. //depot/projects/usb/src/sys/dev/usb/uhci.c#7 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_subr.h#14 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/ehci.c#7 (text+ko) ====
@@ -1119,7 +1119,7 @@
DPRINTFN(12, ("xfer=%p active\n", xfer));
- for(td = xfer->td_transfer_first;
+ for(td = xfer->td_transfer_cache;
td != NULL;
td = ((td == xfer->td_transfer_last) ? NULL : td->obj_next))
{
@@ -1134,6 +1134,8 @@
{
DPRINTFN(12, ("xfer=%p is still "
"active\n", xfer));
+ /* update cache */
+ xfer->td_transfer_cache = td;
goto done;
}
@@ -1429,7 +1431,8 @@
xfer->address, UE_GET_ADDR(xfer->endpoint),
xfer->length, xfer->udev->speed));
- td = (xfer->td_transfer_first = xfer->td_start);
+ td = (xfer->td_transfer_first =
+ xfer->td_transfer_cache = xfer->td_start);
buf_offset = 0;
usbd_get_page(&(xfer->buf_data), buf_offset, &buf_res);
==== //depot/projects/usb/src/sys/dev/usb/ohci.c#7 (text+ko) ====
==== //depot/projects/usb/src/sys/dev/usb/uhci.c#7 (text+ko) ====
@@ -969,7 +969,7 @@
DPRINTFN(12, ("xfer=%p active\n", xfer));
- for(td = xfer->td_transfer_first;
+ for(td = xfer->td_transfer_cache;
td != NULL;
td = ((td == xfer->td_transfer_last) ? NULL : td->obj_next))
{
@@ -984,6 +984,9 @@
{
DPRINTFN(12, ("xfer=%p is still "
"active\n", xfer));
+
+ /* update cache */
+ xfer->td_transfer_cache = td;
goto done;
}
@@ -1229,7 +1232,8 @@
xfer->address, UE_GET_ADDR(xfer->endpoint),
xfer->length, xfer->udev->speed));
- td = (xfer->td_transfer_first = xfer->td_start);
+ td = (xfer->td_transfer_first =
+ xfer->td_transfer_cache = xfer->td_start);
buf_offset = 0;
usbd_get_page(&(xfer->buf_data), buf_offset, &buf_res);
==== //depot/projects/usb/src/sys/dev/usb/usb_subr.h#14 (text+ko) ====
@@ -405,6 +405,7 @@
void *td_start;
void *td_transfer_first;
void *td_transfer_last;
+ void *td_transfer_cache;
#ifdef USB_COMPAT_OLD
struct usbd_xfer * alloc_xfer; /* the real transfer */
More information about the p4-projects
mailing list