From owner-p4-projects@FreeBSD.ORG Thu Jul 27 19:33:53 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9F2F716A4DF; Thu, 27 Jul 2006 19:33:53 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C87C16A4E2 for ; Thu, 27 Jul 2006 19:33:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8839143D72 for ; Thu, 27 Jul 2006 19:33:46 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6RJXkbY013166 for ; Thu, 27 Jul 2006 19:33:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6RJXjIT013163 for perforce@freebsd.org; Thu, 27 Jul 2006 19:33:45 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 27 Jul 2006 19:33:45 GMT Message-Id: <200607271933.k6RJXjIT013163@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 102585 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jul 2006 19:33:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=102585 Change 102585 by hselasky@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 */