From owner-p4-projects@FreeBSD.ORG Mon Jul 11 16:39:32 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 033CE1065674; Mon, 11 Jul 2011 16:39:32 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1D05106566B for ; Mon, 11 Jul 2011 16:39:31 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3E88FC08 for ; Mon, 11 Jul 2011 16:39:31 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6BGdVXW019409 for ; Mon, 11 Jul 2011 16:39:31 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6BGdVlk019406 for perforce@freebsd.org; Mon, 11 Jul 2011 16:39:31 GMT (envelope-from rene@FreeBSD.org) Date: Mon, 11 Jul 2011 16:39:31 GMT Message-Id: <201107111639.p6BGdVlk019406@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196021 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2011 16:39:32 -0000 http://p4web.freebsd.org/@@196021?ac=10 Change 196021 by rene@rene_acer on 2011/07/11 16:38:29 IFC Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#96 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/eresources/chapter.sgml#22 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/install/chapter.sgml#21 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/Makefile#2 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/share/sgml/mailing-lists.ent#20 integrate .. //depot/projects/docproj_nl/www/en/java/install.sgml#3 integrate .. //depot/projects/docproj_nl/www/en/java/news.xml#8 integrate .. //depot/projects/docproj_nl/www/en/releases/9.0R/Makefile#1 branch .. //depot/projects/docproj_nl/www/en/releases/9.0R/docbook.css#1 branch .. //depot/projects/docproj_nl/www/en/releases/9.0R/schedule.sgml#1 branch .. //depot/projects/docproj_nl/www/en/releases/Makefile#8 integrate .. //depot/projects/docproj_nl/www/en/releng/index.sgml#43 integrate .. //depot/projects/docproj_nl/www/share/sgml/usergroups.xml#24 integrate Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#96 (text+ko) ==== @@ -1,4 +1,4 @@ - + @@ -600,7 +600,7 @@ &a.wireless.name; - Discussions of 802.11 stack, tools device driver + Discussions of 802.11 stack, tools, device driver development ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/install/chapter.sgml#21 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -678,7 +678,7 @@ Image Writer for Windows is a free application that can correctly write an image file to a memory stick. Download it from - + and extract it into a folder. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/Makefile#2 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: doc/en_US.ISO8859-1/books/porters-handbook/Makefile,v 1.7 2004/08/05 10:04:30 den Exp $ +# $FreeBSD: doc/en_US.ISO8859-1/books/porters-handbook/Makefile,v 1.8 2011/07/08 16:08:33 ryusuke Exp $ # # Build the FreeBSD Porter's Handbook. # @@ -36,6 +36,11 @@ IMAGES_LIB+= callouts/8.png IMAGES_LIB+= callouts/9.png IMAGES_LIB+= callouts/10.png +IMAGES_LIB+= callouts/11.png +IMAGES_LIB+= callouts/12.png +IMAGES_LIB+= callouts/13.png +IMAGES_LIB+= callouts/14.png +IMAGES_LIB+= callouts/15.png URL_RELPREFIX?= ../../../.. DOC_PREFIX?= ${.CURDIR}/../../.. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/share/sgml/mailing-lists.ent#20 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -517,7 +517,7 @@ freebsd-wip-status"> -Discussions of 802.11 stack, tools device driver development"> +Discussions of 802.11 stack, tools, device driver development"> freebsd-wireless"> ==== //depot/projects/docproj_nl/www/en/java/install.sgml#3 (text+ko) ==== @@ -1,6 +1,6 @@ - + ]> @@ -43,7 +43,7 @@

Oracle JDK for Linux

-

This port installs the Java Developement Kit from Oracle which was built for Linux. It will run under FreeBSD using the Linux compatibility.

+

This port installs the Java Development Kit from Oracle which was built for Linux. It will run under FreeBSD using the Linux compatibility.

cd /usr/ports/java/linux-sun-jdk16
make install clean ==== //depot/projects/docproj_nl/www/en/java/news.xml#8 (text+ko) ==== @@ -7,7 +7,7 @@ Divide time in to , , and elements, each of which has a . - each element contains one or more elements. + Each element contains one or more elements. Each contains an optional , and then a <p>. <p> elements can contain <a> anchors. @@ -20,7 +20,7 @@ <news> <cvs:keywords xmlns:cvs="http://www.FreeBSD.org/XML/CVS" version="1.0"> <cvs:keyword name="freebsd"> - $FreeBSD: www/en/java/news.xml,v 1.12 2011/02/19 03:55:41 ryusuke Exp $ + $FreeBSD: www/en/java/news.xml,v 1.13 2011/07/08 19:54:33 uqs Exp $ </cvs:keyword> </cvs:keywords> @@ -910,7 +910,7 @@ <name>10</name> <event> - <title>Sun Java Compability Kit Testing + Sun Java Compatibility Kit Testing

On August 7th, 2000, the FreeBSD &jdk; team was given access to Sun's JCK (Java Compatibility Kit), which will ==== //depot/projects/docproj_nl/www/en/releases/Makefile#8 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: www/en/releases/Makefile,v 1.57 2010/10/22 14:32:47 kensmith Exp $ +# $FreeBSD: www/en/releases/Makefile,v 1.58 2011/07/10 17:12:24 hrs Exp $ .if exists(../Makefile.conf) .include "../Makefile.conf" @@ -17,6 +17,7 @@ SUBDIR+= 6.0R 6.1R 6.2R 6.3R 6.4R SUBDIR+= 7.0R 7.1R 7.2R 7.3R 7.4R SUBDIR+= 8.0R 8.1R 8.2R +SUBDIR+= 9.0R .if defined $(NEW_BUILD) SUBDIR= ==== //depot/projects/docproj_nl/www/en/releng/index.sgml#43 (text+ko) ==== @@ -1,6 +1,6 @@ - + @@ -48,6 +48,14 @@ + September 2011 + &os; 9.0 + In "Code Slush" (feature freeze) now. The release + schedule is available. + + + February 2011 &os; 8.2 Released on February 24, 2011 @@ -79,9 +87,12 @@ HEAD - Open + Slush committers - Active development branch for 9-CURRENT. + + Active development branch for 9-CURRENT. No approval from + RE is required in "Code Slush" period though major ongoing + work such as new features must be notified to RE. ==== //depot/projects/docproj_nl/www/share/sgml/usergroups.xml#24 (text+ko) ==== @@ -5,7 +5,7 @@ - $FreeBSD: www/share/sgml/usergroups.xml,v 1.106 2011/05/21 12:39:11 jkois Exp $ + $FreeBSD: www/share/sgml/usergroups.xml,v 1.107 2011/07/11 11:51:24 jkois Exp $ @@ -483,12 +483,12 @@ FreeBSD UK Users group (FreeBSD UKUG) - http://ukug.uk.FreeBSD.org/ + http://mailman.uk.freebsd.org/mailman/listinfo/ukfreebsd The FreeBSD UKUG (FreeBSD UK User's Group) exists for the benefit of FreeBSD users in the United Kingdom. - Please follow the link for details. Located in The United - Kingdom. + Please follow the link for more information. Located in + the United Kingdom. From owner-p4-projects@FreeBSD.ORG Mon Jul 11 19:08:41 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 95F9B1065678; Mon, 11 Jul 2011 19:08:41 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58E741065676 for ; Mon, 11 Jul 2011 19:08:41 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 465A58FC08 for ; Mon, 11 Jul 2011 19:08:41 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6BJ8f1U048838 for ; Mon, 11 Jul 2011 19:08:41 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6BJ8fs8048835 for perforce@freebsd.org; Mon, 11 Jul 2011 19:08:41 GMT (envelope-from rene@FreeBSD.org) Date: Mon, 11 Jul 2011 19:08:41 GMT Message-Id: <201107111908.p6BJ8fs8048835@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196024 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2011 19:08:41 -0000 http://p4web.freebsd.org/@@196024?ac=10 Change 196024 by rene@rene_acer on 2011/07/11 19:08:31 MFen the Handbook: - eresources 1.207 -> 1.208 - install 1.425 -> 1.426 - mailing-lists.ent 1.78 -> 1.79 While here fix whitespace errors Affected files ... .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/eresources/chapter.sgml#37 edit .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/install/chapter.sgml#25 edit .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/share/sgml/mailing-lists.ent#27 edit Differences ... ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/eresources/chapter.sgml#37 (text+ko) ==== @@ -5,7 +5,7 @@ Vertaald door: Siebrand Mazeland %SOURCE% en_US.ISO8859-1/books/handbook/eresources/chapter.sgml - %SRCID% 1.207 + %SRCID% 1.208 --> @@ -135,7 +135,7 @@ - + &a.chromium.name; &os; specifieke Chromium problemen @@ -726,8 +726,8 @@ &a.wireless.name; - Discussies over de 802.11-stack, de ontwikkeling van - gereedschappen voor stuurprogramma's. + Discussies over de ontwikkeling van de 802.11-stack, + gereedschappen en stuurprogramma's. ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/install/chapter.sgml#25 (text+ko) ==== @@ -4,7 +4,7 @@ $FreeBSD: doc/nl_NL.ISO8859-1/books/handbook/install/chapter.sgml,v 1.23 2011/05/15 04:11:46 rene Exp $ %SOURCE% en_US.ISO8859-1/books/handbook/install/chapter.sgml - %SRCID% 1.425 + %SRCID% 1.426 --> @@ -689,7 +689,7 @@ doelapparaat van waar af u zal opstarten. Zorg er voor dat u het juiste apparaat als het uitvoerapparaat opgeeft om te voorkomen dat u uw bestaande gegevens vernietigd. - + Het beeldbestand schrijven door middel van &man.dd.1; @@ -701,16 +701,16 @@ &prompt.root; sysctl kern.geom.debugflags=16 Het .img-bestand is - geen gewoon bestand dat u naar de geheugenstick - kopieert. Het is een afbeelding van de complete inhoud van de - stick. Dit betekent dat u de bestanden niet - op de gewone manier van de ene schijf naar de andere kopieëren. - U dient in plaats hiervan &man.dd.1; gebruiken om de afbeelding - direct naar de schijf te schrijven: + geen gewoon bestand dat u naar de geheugenstick + kopieert. Het is een afbeelding van de complete inhoud van de + stick. Dit betekent dat u de bestanden niet + op de gewone manier van de ene schijf naar de andere kopieëren. + U dient in plaats hiervan &man.dd.1; gebruiken om de afbeelding + direct naar de schijf te schrijven: &prompt.root; dd if=&os;-&rel.current;-RELEASE-&arch.i386;-memstick.img of=/dev/da0 bs=64k - + &windows; gebruiken om het beeldbestand te schrijven @@ -725,7 +725,7 @@ Image Writer for Windows is een gratis applicatie die een beeld bestand correct naar een geheugen-stick kan schrijven. Download deze van - + en pak deze uit in een map. ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/share/sgml/mailing-lists.ent#27 (text+ko) ==== @@ -5,7 +5,7 @@ Vertaald door: Siebrand Mazeland %SOURCE% en_US.ISO8859-1/share/sgml/mailing-lists.ent - %SRCID% 1.78 + %SRCID% 1.79 --> @@ -520,7 +520,7 @@ freebsd-wip-status"> -Discussies over de 802.11-stack en de ontwikkeling van gereedschappen en stuurprogramma's"> +Discussies over de ontwikkeling van de 802.11-stack, gereedschappen en stuurprogramma's"> freebsd-wireless"> From owner-p4-projects@FreeBSD.ORG Mon Jul 11 21:40:59 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B6C7E106566C; Mon, 11 Jul 2011 21:40:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79979106564A for ; Mon, 11 Jul 2011 21:40:59 +0000 (UTC) (envelope-from cnicutar@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 6744A8FC14 for ; Mon, 11 Jul 2011 21:40:59 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6BLexDU080677 for ; Mon, 11 Jul 2011 21:40:59 GMT (envelope-from cnicutar@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6BLexFt080674 for perforce@freebsd.org; Mon, 11 Jul 2011 21:40:59 GMT (envelope-from cnicutar@freebsd.org) Date: Mon, 11 Jul 2011 21:40:59 GMT Message-Id: <201107112140.p6BLexFt080674@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to cnicutar@freebsd.org using -f From: Catalin Nicutar To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196032 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2011 21:41:00 -0000 http://p4web.freebsd.org/@@196032?ac=10 Change 196032 by cnicutar@cnicutar_cronos on 2011/07/11 21:40:58 Add first attempt at tcp UTO tests in tools/regression/netinet/tcputo. Affected files ... .. //depot/projects/soc2011/cnicutar_tcputo_8/src/tools/regression/netinet/tcputo/Makefile.long_uto#1 add .. //depot/projects/soc2011/cnicutar_tcputo_8/src/tools/regression/netinet/tcputo/Makefile.send_uto#1 add .. //depot/projects/soc2011/cnicutar_tcputo_8/src/tools/regression/netinet/tcputo/Makefile.short_uto#1 add .. //depot/projects/soc2011/cnicutar_tcputo_8/src/tools/regression/netinet/tcputo/long_uto.c#1 add .. //depot/projects/soc2011/cnicutar_tcputo_8/src/tools/regression/netinet/tcputo/runtest.sh#1 add .. //depot/projects/soc2011/cnicutar_tcputo_8/src/tools/regression/netinet/tcputo/send_uto.c#1 add .. //depot/projects/soc2011/cnicutar_tcputo_8/src/tools/regression/netinet/tcputo/short_uto.c#1 add .. //depot/projects/soc2011/cnicutar_tcputo_8/src/tools/regression/netinet/tcputo/test_utils.c#1 add .. //depot/projects/soc2011/cnicutar_tcputo_8/src/tools/regression/netinet/tcputo/test_utils.h#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Tue Jul 12 07:03:11 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B1A26106566C; Tue, 12 Jul 2011 07:03:10 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B49E106564A for ; Tue, 12 Jul 2011 07:03:10 +0000 (UTC) (envelope-from cnicutar@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 2FBDF8FC12 for ; Tue, 12 Jul 2011 07:03:10 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6C73A7Y091242 for ; Tue, 12 Jul 2011 07:03:10 GMT (envelope-from cnicutar@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6C73Avb091239 for perforce@freebsd.org; Tue, 12 Jul 2011 07:03:10 GMT (envelope-from cnicutar@freebsd.org) Date: Tue, 12 Jul 2011 07:03:10 GMT Message-Id: <201107120703.p6C73Avb091239@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to cnicutar@freebsd.org using -f From: Catalin Nicutar To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196047 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 07:03:11 -0000 http://p4web.freebsd.org/@@196047?ac=10 Change 196047 by cnicutar@cnicutar_cronos on 2011/07/12 07:02:07 Add TCP UTO options and sysctls to tcp.4. Affected files ... .. //depot/projects/soc2011/cnicutar_tcputo_8/src/share/man/man4/tcp.4#2 edit Differences ... ==== //depot/projects/soc2011/cnicutar_tcputo_8/src/share/man/man4/tcp.4#2 (text+ko) ==== @@ -116,7 +116,7 @@ .Xr setsockopt 2 and tested with .Xr getsockopt 2 : -.Bl -tag -width ".Dv TCP_NODELAY" +.Bl -tag -width ".Dv TCP_SNDUTO_TIMEOUT" .It Dv TCP_INFO Information about a socket's underlying TCP session may be retrieved by passing the read-only option @@ -210,6 +210,46 @@ will have an invalid digest option prepended, and the following error message will be visible on the system console: .Em "tcp_signature_compute: SADB lookup failed for %d.%d.%d.%d" . +.It Dv TCP_SNDUTO_TIMEOUT +By setting this option the user controls the exact time (in seconds) TCP will +wait for an ACK before tearing the connection. +.Pp +Traditionally, a fixed number of retransmits +.Dv TCP_MAXRXTSHIFT +are performed before giving up. +Using UTO completely overrides this and allows connections with stringent or +relaxed timeouts. +.Pp +After setting the option the first subsequent segment will carry the specified +value. +This option is silently left out if (due to other options) not enough space +is available. +.It Dv TCP_RCVUTO_TIMEOUT +By setting this option to a value larger than 1 the user allows a TCP to +accept the timeout suggestion sent by the peer. +The default value is 0. +By getting this option the user can determine the actual timeout (in seconds) +as advertised by the peer. +.Pp +When using both +.Dv TCP_RCVUTO_TIMEOUT +and +.Dv TCP_SNDUTO_TIMEOUT, +the larger value is chosen as User Timeout for the connection. +.Pp +The peer is allowed to send this option any number of times. +Each time the user calls +.Xr getsockopt 2 +the most recent value received is returned. +.Pp +A possible use of this option is allowing a user to request a large timeout +(several hours) for a connection. +Even if the user is offline for long periods of time the connection will be +maintained. +.Pp +This option has security implications. +An application must *not* enable this option before the user has +authenticated in order to prevent DoS attacks. .El .Pp The option level for the @@ -482,6 +522,13 @@ .It Va sack.globalmaxholes Maximum number of SACK holes per system, across all connections. Defaults to 65536. +.It Va uto.enable +Globally permit or deny using UTO. +.It Va uto.max_timeout +Maximum value for TCP_SNDUTO_TIMEOUT for any connection. Setting this to a +large value has security implications. +.It Va uto.min_timeout +Minimum value for TCP_RCVUTO_TIMEOUT for any connection. .It Va maxtcptw When a TCP connection enters the .Dv TIME_WAIT From owner-p4-projects@FreeBSD.ORG Tue Jul 12 20:23:29 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7FED81065672; Tue, 12 Jul 2011 20:23:29 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42DCF106566C for ; Tue, 12 Jul 2011 20:23:29 +0000 (UTC) (envelope-from syuu@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 180448FC0A for ; Tue, 12 Jul 2011 20:23:29 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6CKNSRR052887 for ; Tue, 12 Jul 2011 20:23:28 GMT (envelope-from syuu@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6CKNSWN052884 for perforce@freebsd.org; Tue, 12 Jul 2011 20:23:28 GMT (envelope-from syuu@FreeBSD.org) Date: Tue, 12 Jul 2011 20:23:28 GMT Message-Id: <201107122023.p6CKNSWN052884@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to syuu@FreeBSD.org using -f From: Takuya ASADA To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196076 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 20:23:29 -0000 http://p4web.freebsd.org/@@196076?ac=10 Change 196076 by syuu@kikurage on 2011/07/12 20:23:18 ifqueue test, bpf test(single queue version) implemented. Affected files ... .. //depot/projects/soc2011/mq_bpf/tests/Makefile#1 add .. //depot/projects/soc2011/mq_bpf/tests/queue_affinity.c#4 delete .. //depot/projects/soc2011/mq_bpf/tests/test_ifqueue.c#1 add .. //depot/projects/soc2011/mq_bpf/tests/test_sqbpf.c#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Thu Jul 14 00:13:30 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 225841065670; Thu, 14 Jul 2011 00:13:30 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6DF9106564A for ; Thu, 14 Jul 2011 00:13:29 +0000 (UTC) (envelope-from jceel@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id C3B438FC19 for ; Thu, 14 Jul 2011 00:13:29 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6E0DTYU088916 for ; Thu, 14 Jul 2011 00:13:29 GMT (envelope-from jceel@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6E0DT06088903 for perforce@freebsd.org; Thu, 14 Jul 2011 00:13:29 GMT (envelope-from jceel@freebsd.org) Date: Thu, 14 Jul 2011 00:13:29 GMT Message-Id: <201107140013.p6E0DT06088903@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jceel@freebsd.org using -f From: Jakub Wojciech Klama To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196124 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 00:13:30 -0000 http://p4web.freebsd.org/@@196124?ac=10 Change 196124 by jceel@jceel_cyclone on 2011/07/14 00:12:59 MMC/SD driver. Detects card, but data transfer is broken. Affected files ... .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/EA3250#5 edit .. //depot/projects/soc2011/jceel_lpc/sys/arm/lpc/files.lpc#4 edit .. //depot/projects/soc2011/jceel_lpc/sys/arm/lpc/lpc_mmc.c#2 edit .. //depot/projects/soc2011/jceel_lpc/sys/arm/lpc/lpcreg.h#3 edit .. //depot/projects/soc2011/jceel_lpc/sys/boot/fdt/dts/ea3250.dts#5 edit .. //depot/projects/soc2011/jceel_lpc/sys/dev/mmc/mmc.c#2 edit Differences ... ==== //depot/projects/soc2011/jceel_lpc/sys/arm/conf/EA3250#5 (text+ko) ==== @@ -18,13 +18,13 @@ options FFS #Berkeley Fast Filesystem options NFSCL #Network Filesystem Client options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT -options BOOTP -options BOOTP_NFSROOT -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=lpe0 +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=lpe0 -#options ROOTDEVNAME=\"ufs:/dev/da0a\" +options ROOTDEVNAME=\"ufs:/dev/da0a\" #options MD_ROOT # MD is a potential root device #options MD_ROOT_SIZE=8192 # 8MB ram disk @@ -82,6 +82,10 @@ device pass device da +device mmc +device mmcsd +device lpcmmc + # Flattened Device Tree options FDT options FDT_DTB_STATIC ==== //depot/projects/soc2011/jceel_lpc/sys/arm/lpc/files.lpc#4 (text+ko) ==== @@ -11,5 +11,6 @@ arm/lpc/lpc_rtc.c standard arm/lpc/if_lpe.c optional lpe arm/lpc/lpc_ohci.c optional ohci +arm/lpc/lpc_mmc.c optional lpcmmc dev/uart/uart_dev_ns8250.c optional uart kern/kern_clocksource.c standard ==== //depot/projects/soc2011/jceel_lpc/sys/arm/lpc/lpc_mmc.c#2 (text+ko) ==== @@ -46,6 +46,8 @@ #include #include +#include + #include #include #include @@ -53,10 +55,16 @@ #include #include +#include +#include + #include #include #include +#include +#include + struct lpc_mmc_softc { device_t lm_dev; struct mtx lm_mtx; @@ -68,15 +76,48 @@ struct mmc_host lm_host; struct mmc_request * lm_req; struct mmc_data * lm_data; + uint32_t lm_flags; +#define LPC_SD_FLAGS_IGNORECRC (1 << 0) + int lm_xfer_direction; +#define DIRECTION_READ 0 +#define DIRECTION_WRITE 1 + int lm_xfer_done; + int lm_bus_busy; }; +#define LPC_SD_BLOCKSIZE 512 + static int lpc_mmc_probe(device_t); static int lpc_mmc_attach(device_t); static int lpc_mmc_detach(device_t); +static void lpc_mmc_intr(void *); +static void lpc_mmc_cmd(struct lpc_mmc_softc *, struct mmc_command *); +static void lpc_mmc_setup_xfer(struct lpc_mmc_softc *, struct mmc_data *); +static void lpc_mmc_fifo_read(struct lpc_mmc_softc *); +static void lpc_mmc_fifo_write(struct lpc_mmc_softc *); + +static int lpc_mmc_update_ios(device_t, device_t); +static int lpc_mmc_request(device_t, device_t, struct mmc_request *); +static int lpc_mmc_get_ro(device_t, device_t); +static int lpc_mmc_acquire_host(device_t, device_t); +static int lpc_mmc_release_host(device_t, device_t); + +#define lpc_mmc_lock(_sc) \ + mtx_lock(&_sc->lm_mtx); +#define lpc_mmc_unlock(_sc) \ + mtx_unlock(&_sc->lm_mtx); +#define lpc_mmc_read_4(_sc, _reg) \ + bus_space_read_4(_sc->lm_bst, _sc->lm_bsh, _reg) +#define lpc_mmc_write_4(_sc, _reg, _value) \ + bus_space_write_4(_sc->lm_bst, _sc->lm_bsh, _reg, _value) + static int lpc_mmc_probe(device_t dev) { + if (!ofw_bus_is_compatible(dev, "lpc,mmc")) + return (ENXIO); + device_set_desc(dev, "LPC32x0 MMC/SD controller"); return (BUS_PROBE_DEFAULT); } @@ -85,8 +126,14 @@ lpc_mmc_attach(device_t dev) { struct lpc_mmc_softc *sc = device_get_softc(dev); + device_t child; int rid; + sc->lm_dev = dev; + sc->lm_req = NULL; + + mtx_init(&sc->lm_mtx, "lpcmmc", "mmc", MTX_DEF); + rid = 0; sc->lm_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -98,6 +145,8 @@ sc->lm_bst = rman_get_bustag(sc->lm_mem_res); sc->lm_bsh = rman_get_bushandle(sc->lm_mem_res); + device_printf(dev, "virtual register space: 0x%08lx\n", sc->lm_bsh); + rid = 0; sc->lm_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); @@ -116,7 +165,16 @@ return (ENXIO); } - device_set_ivars(dev, &sc->dm_host); + sc->lm_host.f_min = 312500; + sc->lm_host.f_max = 25000000; + sc->lm_host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; + sc->lm_host.caps = MMC_CAP_4_BIT_DATA; + + lpc_pwr_write(dev, LPC_CLKPWR_MS_CTRL, + LPC_CLKPWR_MS_CTRL_CLOCK_EN | LPC_CLKPWR_MS_CTRL_SD_CLOCK | 1); + lpc_mmc_write_4(sc, LPC_SD_POWER, LPC_SD_POWER_CTRL_ON); + + device_set_ivars(dev, &sc->lm_host); child = device_add_child(dev, "mmc", -1); if (!child) { @@ -130,6 +188,14 @@ bus_generic_probe(dev); bus_generic_attach(dev); + device_printf(dev, "attached\n"); + + return (0); +} + +static int +lpc_mmc_detach(device_t dev) +{ return (0); } @@ -137,23 +203,51 @@ lpc_mmc_intr(void *arg) { struct lpc_mmc_softc *sc = (struct lpc_mmc_softc *)arg; + struct mmc_command *cmd; + uint32_t status; - if (status & LPC_SD_STATUS_CMDCRCFAIL) { + status = lpc_mmc_read_4(sc, LPC_SD_STATUS); + + device_printf(sc->lm_dev, "interrupt: 0x%08x\n", status); + + if (status & LPC_SD_STATUS_TXACTIVE) { + device_printf(sc->lm_dev, "TX active\n"); + lpc_mmc_fifo_write(sc); + } + if (status & LPC_SD_STATUS_RXACTIVE) { + device_printf(sc->lm_dev, "RX active\n"); + lpc_mmc_fifo_read(sc); } + if (status & LPC_SD_STATUS_CMDCRCFAIL) { + device_printf(sc->lm_dev, "command CRC error\n"); + cmd = sc->lm_req->cmd; + cmd->error = MMC_ERR_NONE; + cmd->resp[0] = lpc_mmc_read_4(sc, LPC_SD_RESP0); + sc->lm_req->done(sc->lm_req); + sc->lm_req = NULL; + lpc_mmc_write_4(sc, LPC_SD_CLEAR, LPC_SD_STATUS_CMDCRCFAIL); + } +#if 0 if (status & LPC_SD_STATUS_DATACRCFAIL) { } - - if (status & LPC_SD_STATUS_CMDTIMEOUT) { - +#endif + if (status & LPC_SD_STATUS_CMDACTIVE) + { + device_printf(sc->lm_dev, "command active\n"); + cmd = sc->lm_req->cmd; + cmd->resp[0] = lpc_mmc_read_4(sc, LPC_SD_RESP0); + sc->lm_req->done(sc->lm_req); + sc->lm_req = NULL; } - + if (status & LPC_SD_STATUS_DATATIMEOUT) { - + device_printf(sc->lm_dev, "data timeout\n"); + lpc_mmc_write_4(sc, LPC_SD_CLEAR, LPC_SD_STATUS_DATATIMEOUT); } - +#if 0 if (status & LPC_SD_STATUS_TXUNDERRUN) { } @@ -161,15 +255,36 @@ if (status & LPC_SD_STATUS_RXOVERRUN) { } - +#endif if (status & LPC_SD_STATUS_CMDRESPEND) { + device_printf(sc->lm_dev, "command response\n"); + device_printf(sc->lm_dev, "req: %p\n", sc->lm_req); + device_printf(sc->lm_dev, "cmd: %p\n", sc->lm_req->cmd); + cmd = sc->lm_req->cmd; + if (cmd->flags & MMC_RSP_136) { + cmd->resp[3] = lpc_mmc_read_4(sc, LPC_SD_RESP3); + cmd->resp[2] = lpc_mmc_read_4(sc, LPC_SD_RESP2); + cmd->resp[1] = lpc_mmc_read_4(sc, LPC_SD_RESP1); + } + cmd->resp[0] = lpc_mmc_read_4(sc, LPC_SD_RESP0); + cmd->error = MMC_ERR_NONE; + + sc->lm_req->done(sc->lm_req); + sc->lm_req = NULL; + lpc_mmc_write_4(sc, LPC_SD_CLEAR, LPC_SD_STATUS_CMDRESPEND); + device_printf(sc->lm_dev, "command response done\n"); } if (status & LPC_SD_STATUS_CMDSENT) { - + device_printf(sc->lm_dev, "command sent\n"); + cmd = sc->lm_req->cmd; + cmd->error = MMC_ERR_NONE; + sc->lm_req->done(sc->lm_req); + sc->lm_req = NULL; + lpc_mmc_write_4(sc, LPC_SD_CLEAR, LPC_SD_STATUS_CMDSENT); } - +#if 0 if (status & LPC_SD_STATUS_DATAEND) { } @@ -183,41 +298,87 @@ } if (status & LPC_SD_STATUS_CMDACTIVE) { + if (sc->lm_req == NULL) + return; + + cmd = sc->lm_req->cmd; + printf("sc=%p req=%p\n", sc, sc->lm_req); + printf("cmd=%p\n", cmd); + cmd->resp[0] = lpc_mmc_read_4(sc, LPC_SD_RESP0); + cmd->error = MMC_ERR_NONE; + sc->lm_req->done(sc->lm_req); + sc->lm_req = NULL; + lpc_mmc_write_4(sc, LPC_SD_MASK0, (0xffffffff & ~LPC_SD_STATUS_CMDACTIVE)); } +#endif + + lpc_mmc_write_4(sc, LPC_SD_CLEAR, 0xfff); + lpc_mmc_write_4(sc, LPC_SD_MASK0, 0); + device_printf(sc->lm_dev, "isr done\n"); +} + +static int +lpc_mmc_request(device_t bus, device_t child, struct mmc_request *req) +{ + struct lpc_mmc_softc *sc = device_get_softc(bus); - if (status & LPC_SD_STATUS_TXACTIVE) { + device_printf(bus, "lpc_mmc_request: %p\n", req); - } + lpc_mmc_lock(sc); + if (sc->lm_req) + return (EBUSY); - if (status & LPC_SD_STATUS_RXACTIVE) { + sc->lm_req = req; + //sc->lm_state = STARTED_CMD; - } + if (req->cmd->data) + lpc_mmc_setup_xfer(sc, req->cmd->data); + lpc_mmc_cmd(sc, req->cmd); + lpc_mmc_unlock(sc); + return (0); } static void lpc_mmc_cmd(struct lpc_mmc_softc *sc, struct mmc_command *cmd) { - struct mmc_data *data = cmd->data; - uint32_t cmd = 0; + //struct mmc_data *data = cmd->data; + uint32_t cmdreg = 0; + + device_printf(sc->lm_dev, "cmd: %d arg: 0x%08x\n", cmd->opcode, cmd->arg); - if (MMC_RSP(cmd->flags) != 0) - cmd |= LPC_SD_COMMAND_RESPONSE; + if (cmd->flags & MMC_RSP_PRESENT) + cmdreg |= LPC_SD_COMMAND_RESPONSE; if (MMC_RSP(cmd->flags) == MMC_RSP_R2) - cmd |= LPC_SD_COMMAND_LONGRSP; + cmdreg |= LPC_SD_COMMAND_LONGRSP; + + if (MMC_RSP(cmd->flags) == MMC_RSP_R3) + sc->lm_flags |= LPC_SD_FLAGS_IGNORECRC; + + cmdreg |= LPC_SD_COMMAND_ENABLE; + cmdreg |= (cmd->opcode & LPC_SD_COMMAND_CMDINDEXMASK); + lpc_mmc_write_4(sc, LPC_SD_MASK0, 0xffffffff); + lpc_mmc_write_4(sc, LPC_SD_MASK1, 0xffffffff); lpc_mmc_write_4(sc, LPC_SD_ARGUMENT, cmd->arg); - lpc_mmc_write_4(sc, LPC_SD_COMMAND, cmd); + lpc_mmc_write_4(sc, LPC_SD_COMMAND, cmdreg); + + device_printf(sc->lm_dev, "cmdarg: 0x%08x, cmdreg: 0x%08x\n", cmd->arg, cmdreg); } static void -lpc_mmc_setup_xfer(struct lpc_mmc_softc *sc, struct mmc_data *data +lpc_mmc_setup_xfer(struct lpc_mmc_softc *sc, struct mmc_data *data) { uint32_t datactrl = 0; + sc->lm_data = data; + sc->lm_xfer_done = 0; + + device_printf(sc->lm_dev, "setup_xfer data: %p\n", data); + if (data->flags & MMC_DATA_READ) sc->lm_xfer_direction = DIRECTION_READ; @@ -227,6 +388,62 @@ datactrl |= (sc->lm_xfer_direction ? LPC_SD_DATACTRL_WRITE : LPC_SD_DATACTRL_READ); + + datactrl |= LPC_SD_DATACTRL_ENABLE; + + if (data->len > LPC_SD_BLOCKSIZE) + datactrl |= 0x90; + + device_printf(sc->lm_dev, "setup_xfer: datactrl=0x%08x\n", datactrl); + + lpc_mmc_write_4(sc, LPC_SD_DATATIMER, 0x100000); + lpc_mmc_write_4(sc, LPC_SD_DATALENGTH, data->len); + lpc_mmc_write_4(sc, LPC_SD_DATACTRL, datactrl); + + if (sc->lm_xfer_direction == DIRECTION_WRITE) + lpc_mmc_fifo_write(sc); +} + +static void +lpc_mmc_fifo_read(struct lpc_mmc_softc *sc) +{ + do { + uint32_t *data = sc->lm_data->data; + int i; + int todo = sc->lm_data->len > 16 ? 16 : (sc->lm_data->len / 4) - sc->lm_xfer_done; + device_printf(sc->lm_dev, "reading from fifo %d words [%d of %d words done]\n", + todo, sc->lm_xfer_done, (sc->lm_data->len / 4)); + + for (i = 0; i < 16; i++) { + data[sc->lm_xfer_done] = + lpc_mmc_read_4(sc, LPC_SD_FIFO); + sc->lm_xfer_done++; + } + + /* + bus_space_read_region_4(sc->lm_bst, sc->lm_bsh, + LPC_SD_FIFO, + &data[sc->lm_xfer_done], + todo); + */ + + //sc->lm_xfer_done += 16; + device_printf(sc->lm_dev, "currently done %d\n", sc->lm_xfer_done); + kdb_enter("data read", "data read"); + } while (lpc_mmc_read_4(sc, LPC_SD_STATUS) & LPC_SD_STATUS_RXDATAAVLBL); + + device_printf(sc->lm_dev, "partial read done\n"); +} + +static void +lpc_mmc_fifo_write(struct lpc_mmc_softc *sc) +{ + do { + lpc_mmc_write_4(sc, LPC_SD_FIFO, + ((uint32_t *)sc->lm_data->data)[sc->lm_xfer_done]); + + sc->lm_xfer_done++; + } while (lpc_mmc_read_4(sc, LPC_SD_STATUS) & LPC_SD_STATUS_TXDATAAVLBL); } static int @@ -283,25 +500,6 @@ } static int -lpc_mmc_request(device_t bus, device_t child, struct mmc_request *req) -{ - struct lpc_mmc_softc *sc = device_get_softc(bus); - - lpc_mmc_lock(sc); - if (sc->lm_req) - return (EBUSY); - - sc->lm_req = req; - sc->lm_state = STARTED_CMD; - - if (req->cmd->data) - lpc_mmc_setup_xfer(sc, req->cmd->data); - - lpc_mmc_cmd(sc, req->cmd); - lpc_mmc_unlosck(sc); -} - -static int lpc_mmc_write_ivar(device_t bus, device_t child, int which, uintptr_t value) { @@ -345,6 +543,63 @@ return (0); } +static int +lpc_mmc_update_ios(device_t bus, device_t child) +{ + struct lpc_mmc_softc *sc = device_get_softc(bus); + struct mmc_ios *ios = &sc->lm_host.ios; + uint32_t clkdiv = 0; + + if (ios->bus_width == bus_width_4) + clkdiv |= LPC_SD_CLOCK_WIDEBUS; + + /* Calculate clock divider */ + clkdiv = (LPC_SD_CLK / (2 * ios->clock)) - 1; + + /* Clock rate should not exceed rate requested in ios */ + if ((LPC_SD_CLK / (2 * (clkdiv + 1))) > ios->clock) + clkdiv++; + + device_printf(bus, "clock: %dHz, clkdiv: %d\n", ios->clock, clkdiv); + + lpc_mmc_write_4(sc, LPC_SD_CLOCK, clkdiv | LPC_SD_CLOCK_ENABLE); + return (0); +} + +static int +lpc_mmc_get_ro(device_t bus, device_t child) +{ + + return (0); +} + +static int +lpc_mmc_acquire_host(device_t bus, device_t child) +{ + struct lpc_mmc_softc *sc = device_get_softc(bus); + int error = 0; + + lpc_mmc_lock(sc); + while (sc->lm_bus_busy) + error = mtx_sleep(sc, &sc->lm_mtx, PZERO, "mmcah", 0); + + sc->lm_bus_busy++; + lpc_mmc_unlock(sc); + return (error); +} + +static int +lpc_mmc_release_host(device_t bus, device_t child) +{ + struct lpc_mmc_softc *sc = device_get_softc(bus); + + lpc_mmc_lock(sc); + sc->lm_bus_busy--; + wakeup(sc); + lpc_mmc_unlock(sc); + return (0); +} + static device_method_t lpc_mmc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, lpc_mmc_probe), ==== //depot/projects/soc2011/jceel_lpc/sys/arm/lpc/lpcreg.h#3 (text+ko) ==== @@ -133,6 +133,13 @@ #define LPC_CLKPWR_USB_CTRL_PLL_LOCK (1 << 0) #define LPC_CLKPWR_USBDIV_CTRL 0x1c #define LPC_CLKPWR_MS_CTRL 0x80 +#define LPC_CLKPWR_MS_CTRL_DISABLE_SD (1 << 10) +#define LPC_CLKPWR_MS_CTRL_CLOCK_EN (1 << 9) +#define LPC_CLKPWR_MS_CTRL_MSSDIO23_PAD (1 << 8) +#define LPC_CLKPWR_MS_CTRL_MSSDIO1_PAD (1 << 7) +#define LPC_CLKPWR_MS_CTRL_MSSDIO0_PAD (1 << 6) +#define LPC_CLKPWR_MS_CTRL_SD_CLOCK (1 << 5) +#define LPC_CLKPWR_MS_CTRL_CLKDIV_MASK 0xf #define LPC_CLKPWR_DMACLK_CTRL 0xe8 #define LPC_CLKPWR_FLASHCLK_CTRL 0xc8 #define LPC_CLKPWR_MACCLK_CTRL 0x90 @@ -183,32 +190,42 @@ /* * MMC/SD controller. (from UM10326: LPC32x0 User manual, page 436) */ -#define LPC_SD_POWER 0x8000 -#define LPC_SD_CLOCK 0x8004 -#define LPC_SD_ARGUMENT 0x8008 -#define LPC_SD_COMMAND 0x800c +#define LPC_SD_CLK (13 * 1000 * 1000) // 13Mhz +#define LPC_SD_POWER 0x00 +#define LPC_SD_POWER_OPENDRAIN (1 << 6) +#define LPC_SD_POWER_CTRL_OFF 0x00 +#define LPC_SD_POWER_CTRL_ON 0x03 +#define LPC_SD_CLOCK 0x04 +#define LPC_SD_CLOCK_WIDEBUS (1 << 11) +#define LPC_SD_CLOCK_BYPASS (1 << 10) +#define LPC_SD_CLOCK_PWRSAVE (1 << 9) +#define LPC_SD_CLOCK_ENABLE (1 << 8) +#define LPC_SD_CLOCK_CLKDIVMASK 0xff +#define LPC_SD_ARGUMENT 0x08 +#define LPC_SD_COMMAND 0x0c #define LPC_SD_COMMAND_ENABLE (1 << 10) #define LPC_SD_COMMAND_PENDING (1 << 9) #define LPC_SD_COMMAND_INTERRUPT (1 << 8) #define LPC_SD_COMMAND_LONGRSP (1 << 7) #define LPC_SD_COMMAND_RESPONSE (1 << 6) -#define LPC_SD_COMMAND_CMDINDEXMASK 0x1f -#define LPC_SD_RESPCMD 0x8010 -#define LPC_SD_RESP0 0x8014 -#define LPC_SD_RESP1 0x8018 -#define LPC_SD_RESP2 0x801c -#define LPC_SD_RESP3 0x8020 -#define LPC_SD_DATATIMER 0x8024 -#define LPC_SD_DATALENGTH 0x8028 -#define LPC_SD_DATACTRL 0x802c +#define LPC_SD_COMMAND_CMDINDEXMASK 0x3f +#define LPC_SD_RESPCMD 0x10 +#define LPC_SD_RESP0 0x14 +#define LPC_SD_RESP1 0x18 +#define LPC_SD_RESP2 0x1c +#define LPC_SD_RESP3 0x20 +#define LPC_SD_DATATIMER 0x24 +#define LPC_SD_DATALENGTH 0x28 +#define LPC_SD_DATACTRL 0x2c #define LPC_SD_DATACTRL_BLOCKSIZESHIFT 4 #define LPC_SD_DATACTRL_BLOCKSIZEMASK 0xf #define LPC_SD_DATACTRL_DMAENABLE (1 << 3) #define LPC_SD_DATACTRL_MODE (1 << 2) -#define LPC_SD_DATACTRL_DIRECTION (1 << 1) +#define LPC_SD_DATACTRL_WRITE (0 << 1) +#define LPC_SD_DATACTRL_READ (1 << 1) #define LPC_SD_DATACTRL_ENABLE (1 << 0) -#define LPC_SD_DATACNT 0x8030 -#define LPC_SD_STATUS 0x8034 +#define LPC_SD_DATACNT 0x30 +#define LPC_SD_STATUS 0x34 #define LPC_SD_STATUS_RXDATAAVLBL (1 << 21) #define LPC_SD_STATUS_TXDATAAVLBL (1 << 20) #define LPC_SD_STATUS_RXFIFOEMPTY (1 << 19) @@ -219,11 +236,23 @@ #define LPC_SD_STATUS_TXFIFOHALFEMPTY (1 << 14) #define LPC_SD_STATUS_RXACTIVE (1 << 13) #define LPC_SD_STATUS_TXACTIVE (1 << 12) -#define LPC_SD_CLEAR 0x8038 -#define LPC_SD_MASK0 0x803c -#define LPC_SD_MASK1 0x8040 -#define LPC_SD_FIFOCNT 0x8048 -#define LPC_SD_FIFO 0x8080 +#define LPC_SD_STATUS_CMDACTIVE (1 << 11) +#define LPC_SD_STATUS_DATABLOCKEND (1 << 10) +#define LPC_SD_STATUS_STARTBITERR (1 << 9) +#define LPC_SD_STATUS_DATAEND (1 << 8) +#define LPC_SD_STATUS_CMDSENT (1 << 7) +#define LPC_SD_STATUS_CMDRESPEND (1 << 6) +#define LPC_SD_STATUS_RXOVERRUN (1 << 5) +#define LPC_SD_STATUS_TXUNDERRUN (1 << 4) +#define LPC_SD_STATUS_DATATIMEOUT (1 << 3) +#define LPC_SD_STATUS_CMDTIMEOUT (1 << 2) +#define LPC_SD_STATUS_DATACRCFAIL (1 << 1) +#define LPC_SD_STATUS_CMDCRCFAIL (1 << 0) +#define LPC_SD_CLEAR 0x38 +#define LPC_SD_MASK0 0x03c +#define LPC_SD_MASK1 0x40 +#define LPC_SD_FIFOCNT 0x48 +#define LPC_SD_FIFO 0x80 /* * USB OTG controller (from UM10326: LPC32x0 User manual, page 410) ==== //depot/projects/soc2011/jceel_lpc/sys/boot/fdt/dts/ea3250.dts#5 (text+ko) ==== @@ -205,6 +205,13 @@ #size-cells = <1>; compatible = "simple-bus"; ranges = <0x0 0x20000000 0x10000000>; + + lpcmmc@98000 { + compatible = "lpc,mmc"; + reg = <0x98000 0x4000>; + interrupts = <15>; + interrupt-parent = <&PIC>; + }; }; chosen { ==== //depot/projects/soc2011/jceel_lpc/sys/dev/mmc/mmc.c#2 (text+ko) ==== @@ -107,7 +107,7 @@ SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); -static int mmc_debug; +static int mmc_debug = 3; SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RW, &mmc_debug, 0, "Debug level"); /* bus entry points */ @@ -1540,3 +1540,4 @@ DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, lpcmmc, mmc_driver, mmc_devclass, NULL, NULL); From owner-p4-projects@FreeBSD.ORG Thu Jul 14 07:11:08 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 47EA21065670; Thu, 14 Jul 2011 07:11:08 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6808106566B for ; Thu, 14 Jul 2011 07:11:07 +0000 (UTC) (envelope-from cnicutar@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id BD45E8FC08 for ; Thu, 14 Jul 2011 07:11:07 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6E7B79O070439 for ; Thu, 14 Jul 2011 07:11:07 GMT (envelope-from cnicutar@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6E7B77Y070434 for perforce@freebsd.org; Thu, 14 Jul 2011 07:11:07 GMT (envelope-from cnicutar@freebsd.org) Date: Thu, 14 Jul 2011 07:11:07 GMT Message-Id: <201107140711.p6E7B77Y070434@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to cnicutar@freebsd.org using -f From: Catalin Nicutar To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196134 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 07:11:08 -0000 http://p4web.freebsd.org/@@196134?ac=10 Change 196134 by cnicutar@cnicutar_cronos on 2011/07/14 07:10:33 Record the exact UTO value received, whether or not the user chose to accept it. The TF_RCV_UTO flag will later tell if ne need to use it or not. Affected files ... .. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_input.c#5 edit .. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_timer.c#7 edit Differences ... ==== //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_input.c#5 (text+ko) ==== @@ -1091,14 +1091,12 @@ tcp_dooptions(&to, optp, optlen, TO_SYN); if (to.to_flags & TOF_UTO) { - if (tp->t_flags & TF_RCV_UTO) { - tp->rcv_uto = (to.to_uto & UTO_MINS) ? - (to.to_uto & ~(UTO_MINS)) * 60 : to.to_uto; - /* silently make it fit between min-max */ - tp->rcv_uto = min(V_uto_max_timeout, - max(V_uto_min_timeout, tp->rcv_uto)); - } - + /* + * Storing the value even if the user might not + * accept it. Also, not clamping it just yet. + */ + tp->rcv_uto = (to.to_uto & UTO_MINS) ? + (to.to_uto & ~(UTO_MINS)) * 60 : to.to_uto; /* * XXX-CN Using option both for send and receive. * Clear it for syncache. @@ -1288,13 +1286,16 @@ (th->th_off << 2) - sizeof(struct tcphdr), (thflags & TH_SYN) ? TO_SYN : 0); - /* Processing received UTO. */ - if ((to.to_flags & TOF_UTO) && (tp->t_flags & TF_RCV_UTO)) { - /* convert to seconds if granularity is set */ + /* + * Processing received UTO even if the user doesn't accept it + * yet. The user might wants to accept it later (perhaps after + * authentication ) but the peer need not send it again. + * The value is converter to seconds and not clamped (the user + * needs to know the real value received). + */ + if (to.to_flags & TOF_UTO) { tp->rcv_uto = (to.to_uto & UTO_MINS) ? (to.to_uto & ~(UTO_MINS)) * 60 : to.to_uto; - tp->rcv_uto = min(V_uto_max_timeout, - max(V_uto_min_timeout, tp->rcv_uto)); } /* ==== //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_timer.c#7 (text+ko) ==== @@ -490,14 +490,23 @@ if (tp->t_rxtshift == 0) /* UTO starting again since it's the first retransmit. */ - tp->t_suto = 0; + tp->t_suto = 0; if (tp->snd_uto || ((tp->t_flags & TF_RCV_UTO) && tp->rcv_uto)) { /* * Since we're using UTO for this connection we need to * compute how much time we've got left. */ - uto_left = max(tp->snd_uto, tp->rcv_uto); + uto_left = 0; + if (tp->t_flags & TF_RCV_UTO) + /* Clamping the received value. */ + uto_left = min(V_uto_max_timeout, + max(V_uto_min_timeout, tp->rcv_uto)); + + /* Taking the longer timeout. */ + uto_left = max(tp->snd_uto, uto_left); + + /* Subtract time that has passed since the first retransmit. */ if (tp->t_suto) uto_left -= ticks_to_secs(ticks - tp->t_suto); @@ -560,7 +569,9 @@ rexmt = TCPTV_REXMTMAX; } /* We might want to wait less than an entire backoff. */ - rexmt = min(rexmt, uto_left * hz); + if (uto_left) + rexmt = min(rexmt, uto_left * hz); + TCPT_RANGESET(tp->t_rxtcur, rexmt, tp->t_rttmin, TCPTV_REXMTMAX); /* From owner-p4-projects@FreeBSD.ORG Thu Jul 14 12:27:45 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5B8F9106566C; Thu, 14 Jul 2011 12:27:45 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E15B106566B for ; Thu, 14 Jul 2011 12:27:45 +0000 (UTC) (envelope-from syuu@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 0D3CC8FC14 for ; Thu, 14 Jul 2011 12:27:45 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ECRicP035546 for ; Thu, 14 Jul 2011 12:27:44 GMT (envelope-from syuu@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6ECRiGT035543 for perforce@freebsd.org; Thu, 14 Jul 2011 12:27:44 GMT (envelope-from syuu@FreeBSD.org) Date: Thu, 14 Jul 2011 12:27:44 GMT Message-Id: <201107141227.p6ECRiGT035543@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to syuu@FreeBSD.org using -f From: Takuya ASADA To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196144 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 12:27:45 -0000 http://p4web.freebsd.org/@@196144?ac=10 Change 196144 by syuu@kikurage on 2011/07/14 12:27:25 little fix for flag check Affected files ... .. //depot/projects/soc2011/mq_bpf/src/sys/net/if.c#4 edit Differences ... ==== //depot/projects/soc2011/mq_bpf/src/sys/net/if.c#4 (text+ko) ==== @@ -2419,8 +2419,8 @@ } case SIOCGIFQLEN: - if (!ifp->if_capabilities & IFCAP_MULTIQUEUE && - !ifp->if_capabilities & IFCAP_SOFT_MULTIQUEUE) + if (!ifp->if_capabilities & + (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE)) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_len, ("if_get_rxqueue_len not set")); KASSERT(ifp->if_get_txqueue_len, ("if_get_txqueue_len not set")); @@ -2429,8 +2429,8 @@ break; case SIOCGIFRXQAFFINITY: - if (!ifp->if_capabilities & IFCAP_MULTIQUEUE && - !ifp->if_capabilities & IFCAP_SOFT_MULTIQUEUE) + if (!ifp->if_capabilities & + (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE)) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_affinity, ("if_get_rxqueue_affinity not set")); log(LOG_DEBUG, "%s: SIOCGIFRXQAFFINITY ifr_queue_affinity_index:%d\n", __func__, ifr->ifr_queue_affinity_index); @@ -2439,8 +2439,8 @@ break; case SIOCGIFTXQAFFINITY: - if (!ifp->if_capabilities & IFCAP_MULTIQUEUE && - !ifp->if_capabilities & IFCAP_SOFT_MULTIQUEUE) + if (!ifp->if_capabilities & + (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE)) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_affinity, ("if_get_rxqueue_affinity not set")); log(LOG_DEBUG, "%s: SIOCGIFTXQAFFINITY ifr_queue_affinity_index:%d\n", __func__, ifr->ifr_queue_affinity_index); From owner-p4-projects@FreeBSD.ORG Fri Jul 15 08:59:55 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7CA5B1065670; Fri, 15 Jul 2011 08:59:55 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D1331065675 for ; Fri, 15 Jul 2011 08:59:55 +0000 (UTC) (envelope-from syuu@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 03A9C8FC18 for ; Fri, 15 Jul 2011 08:59:55 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6F8xsAS080338 for ; Fri, 15 Jul 2011 08:59:54 GMT (envelope-from syuu@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6F8xs5J080335 for perforce@freebsd.org; Fri, 15 Jul 2011 08:59:54 GMT (envelope-from syuu@FreeBSD.org) Date: Fri, 15 Jul 2011 08:59:54 GMT Message-Id: <201107150859.p6F8xs5J080335@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to syuu@FreeBSD.org using -f From: Takuya ASADA To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196193 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 08:59:55 -0000 http://p4web.freebsd.org/@@196193?ac=10 Change 196193 by syuu@kikurage on 2011/07/15 08:59:51 test_mqbpf implemented. Affected files ... .. //depot/projects/soc2011/mq_bpf/src/sys/net/bpf.c#12 edit .. //depot/projects/soc2011/mq_bpf/src/sys/net/if.c#5 edit .. //depot/projects/soc2011/mq_bpf/tests/Makefile#2 edit .. //depot/projects/soc2011/mq_bpf/tests/test_mqbpf.c#1 add .. //depot/projects/soc2011/mq_bpf/tests/test_sqbpf.c#2 edit Differences ... ==== //depot/projects/soc2011/mq_bpf/src/sys/net/bpf.c#12 (text+ko) ==== @@ -1556,14 +1556,15 @@ break; } ifp = d->bd_bif->bif_ifp; - if (!((ifp->if_capabilities & IFCAP_MULTIQUEUE) | - (ifp->if_capabilities & IFCAP_SOFT_MULTIQUEUE))) { - log(LOG_ERR, "if doesn't support multiqueue"); + if (!(ifp->if_capabilities & + (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE))) { + log(LOG_ERR, "if doesn't support multiqueue\n"); error = EINVAL; SDT_PROBE1(bpf, functions, bpfioctl_biocenaqmask, entry, -1); break; - } + KASSERT(ifp->if_get_rxqueue_len, ("ifp->if_get_rxqueue_len not set\n")); + KASSERT(ifp->if_get_txqueue_len, ("ifp->if_get_rxqueue_len not set\n")); d->bd_qmask.qm_enabled = TRUE; d->bd_qmask.qm_rxq_mask = malloc(ifp->if_get_rxqueue_len(ifp) * sizeof(boolean_t), M_BPF, ==== //depot/projects/soc2011/mq_bpf/src/sys/net/if.c#5 (text+ko) ==== @@ -2419,8 +2419,8 @@ } case SIOCGIFQLEN: - if (!ifp->if_capabilities & - (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE)) + if (!(ifp->if_capabilities & + (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE))) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_len, ("if_get_rxqueue_len not set")); KASSERT(ifp->if_get_txqueue_len, ("if_get_txqueue_len not set")); @@ -2429,8 +2429,8 @@ break; case SIOCGIFRXQAFFINITY: - if (!ifp->if_capabilities & - (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE)) + if (!(ifp->if_capabilities & + (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE))) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_affinity, ("if_get_rxqueue_affinity not set")); log(LOG_DEBUG, "%s: SIOCGIFRXQAFFINITY ifr_queue_affinity_index:%d\n", __func__, ifr->ifr_queue_affinity_index); @@ -2439,8 +2439,8 @@ break; case SIOCGIFTXQAFFINITY: - if (!ifp->if_capabilities & - (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE)) + if (!(ifp->if_capabilities & + (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE))) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_affinity, ("if_get_rxqueue_affinity not set")); log(LOG_DEBUG, "%s: SIOCGIFTXQAFFINITY ifr_queue_affinity_index:%d\n", __func__, ifr->ifr_queue_affinity_index); ==== //depot/projects/soc2011/mq_bpf/tests/Makefile#2 (text+ko) ==== @@ -1,4 +1,10 @@ -TARGETS = test_ifqueue test_sqbpf +TARGETS = test_ifqueue test_sqbpf test_mqbpf CFLAGS = -Wall -Werror -g +test_mqbpf: + $(CC) $(CFLAGS) -lpthread -o $@ test_mqbpf.c + all: $(TARGETS) + +clean: + rm -f $(TARGETS) *.o ==== //depot/projects/soc2011/mq_bpf/tests/test_sqbpf.c#2 (text+ko) ==== @@ -132,11 +132,6 @@ return -1; } - if (ioctl(bpf, BIOCLOCK, NULL) < 0) { - perror("lock"); - return -1; - } - gettimeofday(&start, NULL); /* From owner-p4-projects@FreeBSD.ORG Fri Jul 15 18:09:19 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4482D1065673; Fri, 15 Jul 2011 18:09:19 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0659E106566C for ; Fri, 15 Jul 2011 18:09:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id CF59B8FC08 for ; Fri, 15 Jul 2011 18:09:18 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6FI9IA3092629 for ; Fri, 15 Jul 2011 18:09:18 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6FI9Ima092626 for perforce@freebsd.org; Fri, 15 Jul 2011 18:09:18 GMT (envelope-from jhb@freebsd.org) Date: Fri, 15 Jul 2011 18:09:18 GMT Message-Id: <201107151809.p6FI9Ima092626@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196206 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 18:09:19 -0000 http://p4web.freebsd.org/@@196206?ac=10 Change 196206 by jhb@jhb_jhbbsd on 2011/07/15 18:08:28 Add an adjust resource method to the ia64 nexus. I think this is all that ia64 needs to support NEW_PCIB. Affected files ... .. //depot/projects/pci/sys/ia64/ia64/nexus.c#4 edit Differences ... ==== //depot/projects/pci/sys/ia64/ia64/nexus.c#4 (text+ko) ==== @@ -86,6 +86,8 @@ int unit); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); +static int nexus_adjust_resource(device_t, device_t, int, struct resource *, + u_long, u_long); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_deactivate_resource(device_t, device_t, int, int, @@ -122,6 +124,7 @@ DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), @@ -238,6 +241,20 @@ return(child); } +static struct rman * +nexus_rman(int type) +{ + switch (type) { + case SYS_RES_IRQ: + return (&irq_rman); + case SYS_RES_IOPORT: + return (&port_rman); + case SYS_RES_MEMORY: + return (&mem_rman); + default: + return (NULL); + } +} /* * Allocate a resource on behalf of child. NB: child is usually going to be a @@ -271,24 +288,10 @@ } flags &= ~RF_ACTIVE; + rm = nexus_rman(type); + if (rm == NULL) + return (NULL); - switch (type) { - case SYS_RES_IRQ: - rm = &irq_rman; - break; - - case SYS_RES_IOPORT: - rm = &port_rman; - break; - - case SYS_RES_MEMORY: - rm = &mem_rman; - break; - - default: - return 0; - } - rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == 0) return 0; @@ -305,6 +308,20 @@ } static int +nexus_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, u_long start, u_long end) +{ + struct rman *rm; + + rm = nexus_rman(type); + if (rm == NULL) + return (ENXIO); + if (!rman_is_region_manager(r, rm)) + return (EINVAL); + return (rman_adjust_resource(r, start, end)); +} + +static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { From owner-p4-projects@FreeBSD.ORG Fri Jul 15 21:18:04 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CEFD51065672; Fri, 15 Jul 2011 21:18:04 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90C5A106566C for ; Fri, 15 Jul 2011 21:18:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3718FC0C for ; Fri, 15 Jul 2011 21:18:04 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6FLI4di032219 for ; Fri, 15 Jul 2011 21:18:04 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6FLHwTf032215 for perforce@freebsd.org; Fri, 15 Jul 2011 21:17:58 GMT (envelope-from jhb@freebsd.org) Date: Fri, 15 Jul 2011 21:17:58 GMT Message-Id: <201107152117.p6FLHwTf032215@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196215 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 21:18:05 -0000 http://p4web.freebsd.org/@@196215?ac=10 Change 196215 by jhb@jhb_jhbbsd on 2011/07/15 21:17:02 IFC @196214 Affected files ... .. //depot/projects/pci/sys/amd64/acpica/acpi_wakeup.c#3 integrate .. //depot/projects/pci/sys/amd64/amd64/mp_machdep.c#4 integrate .. //depot/projects/pci/sys/amd64/amd64/pmap.c#4 integrate .. //depot/projects/pci/sys/amd64/amd64/sys_machdep.c#3 integrate .. //depot/projects/pci/sys/amd64/amd64/vm_machdep.c#3 integrate .. //depot/projects/pci/sys/amd64/include/cpufunc.h#3 integrate .. //depot/projects/pci/sys/arm/arm/pmap.c#3 integrate .. //depot/projects/pci/sys/arm/arm/sys_machdep.c#2 integrate .. //depot/projects/pci/sys/arm/at91/at91_machdep.c#2 integrate .. //depot/projects/pci/sys/arm/mv/common.c#2 integrate .. //depot/projects/pci/sys/arm/mv/gpio.c#3 integrate .. //depot/projects/pci/sys/arm/mv/mv_machdep.c#2 integrate .. //depot/projects/pci/sys/arm/sa11x0/assabet_machdep.c#2 integrate .. //depot/projects/pci/sys/arm/sa11x0/sa11x0.c#2 integrate .. //depot/projects/pci/sys/boot/Makefile#3 integrate .. //depot/projects/pci/sys/boot/Makefile.amd64#2 integrate .. //depot/projects/pci/sys/boot/Makefile.arm#2 integrate .. //depot/projects/pci/sys/boot/Makefile.powerpc#2 integrate .. //depot/projects/pci/sys/boot/common/Makefile.inc#4 integrate .. //depot/projects/pci/sys/boot/common/disk.c#1 branch .. //depot/projects/pci/sys/boot/common/disk.h#1 branch .. //depot/projects/pci/sys/boot/common/load_elf.c#3 integrate .. //depot/projects/pci/sys/boot/common/reloc_elf.c#2 integrate .. //depot/projects/pci/sys/boot/common/ufsread.c#3 integrate .. //depot/projects/pci/sys/boot/ficl/amd64/sysdep.c#1 branch .. //depot/projects/pci/sys/boot/ficl/amd64/sysdep.h#1 branch .. //depot/projects/pci/sys/boot/i386/libi386/bioscd.c#2 integrate .. //depot/projects/pci/sys/boot/i386/zfsboot/Makefile#5 integrate .. //depot/projects/pci/sys/boot/i386/zfsboot/zfsldr.S#5 integrate .. //depot/projects/pci/sys/boot/sparc64/loader/main.c#4 integrate .. //depot/projects/pci/sys/boot/userboot/Makefile#1 branch .. //depot/projects/pci/sys/boot/userboot/ficl/Makefile#1 branch .. //depot/projects/pci/sys/boot/userboot/libstand/Makefile#1 branch .. //depot/projects/pci/sys/boot/userboot/libstand/amd64/_setjmp.S#1 branch .. //depot/projects/pci/sys/boot/userboot/test/Makefile#1 branch .. //depot/projects/pci/sys/boot/userboot/test/test.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot.h#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/Makefile#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/autoload.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/bootinfo.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/bootinfo32.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/bootinfo64.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/conf.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/copy.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/devicename.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/elf32_freebsd.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/elf64_freebsd.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/host.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/libuserboot.h#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/main.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/userboot_cons.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/userboot_disk.c#1 branch .. //depot/projects/pci/sys/boot/userboot/userboot/version#1 branch .. //depot/projects/pci/sys/cam/cam_xpt.c#5 integrate .. //depot/projects/pci/sys/cam/scsi/scsi_cd.c#4 integrate .. //depot/projects/pci/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c#2 integrate .. //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c#3 integrate .. //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c#2 integrate .. //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h#2 integrate .. //depot/projects/pci/sys/cddl/dev/dtrace/amd64/dtrace_subr.c#4 integrate .. //depot/projects/pci/sys/cddl/dev/dtrace/i386/dtrace_subr.c#4 integrate .. //depot/projects/pci/sys/compat/freebsd32/freebsd32_proto.h#5 integrate .. //depot/projects/pci/sys/compat/freebsd32/freebsd32_syscall.h#5 integrate .. //depot/projects/pci/sys/compat/freebsd32/freebsd32_syscalls.c#5 integrate .. //depot/projects/pci/sys/compat/freebsd32/freebsd32_sysent.c#5 integrate .. //depot/projects/pci/sys/compat/freebsd32/freebsd32_systrace_args.c#3 integrate .. //depot/projects/pci/sys/compat/freebsd32/syscalls.master#5 integrate .. //depot/projects/pci/sys/compat/linux/linux_ipc.c#3 integrate .. //depot/projects/pci/sys/conf/NOTES#5 integrate .. //depot/projects/pci/sys/conf/files#7 integrate .. //depot/projects/pci/sys/conf/files.mips#4 integrate .. //depot/projects/pci/sys/conf/options#7 integrate .. //depot/projects/pci/sys/conf/options.mips#3 integrate .. //depot/projects/pci/sys/contrib/altq/altq/altq_red.c#3 integrate .. //depot/projects/pci/sys/contrib/pf/net/if_pflog.c#3 integrate .. //depot/projects/pci/sys/contrib/pf/net/if_pflog.h#2 integrate .. //depot/projects/pci/sys/contrib/pf/net/if_pflow.h#1 branch .. //depot/projects/pci/sys/contrib/pf/net/if_pfsync.c#2 integrate .. //depot/projects/pci/sys/contrib/pf/net/if_pfsync.h#2 integrate .. //depot/projects/pci/sys/contrib/pf/net/pf.c#4 integrate .. //depot/projects/pci/sys/contrib/pf/net/pf_if.c#2 integrate .. //depot/projects/pci/sys/contrib/pf/net/pf_ioctl.c#4 integrate .. //depot/projects/pci/sys/contrib/pf/net/pf_lb.c#1 branch .. //depot/projects/pci/sys/contrib/pf/net/pf_mtag.h#2 integrate .. //depot/projects/pci/sys/contrib/pf/net/pf_norm.c#3 integrate .. //depot/projects/pci/sys/contrib/pf/net/pf_osfp.c#2 integrate .. //depot/projects/pci/sys/contrib/pf/net/pf_ruleset.c#2 integrate .. //depot/projects/pci/sys/contrib/pf/net/pf_subr.c#2 delete .. //depot/projects/pci/sys/contrib/pf/net/pf_table.c#2 integrate .. //depot/projects/pci/sys/contrib/pf/net/pfvar.h#2 integrate .. //depot/projects/pci/sys/dev/acpica/acpi_pcib_acpi.c#26 integrate .. //depot/projects/pci/sys/dev/acpica/acpi_thermal.c#3 integrate .. //depot/projects/pci/sys/dev/ahci/ahci.c#5 integrate .. //depot/projects/pci/sys/dev/aic7xxx/aicasm/aicasm.c#2 integrate .. //depot/projects/pci/sys/dev/aic7xxx/aicasm/aicasm.h#2 integrate .. //depot/projects/pci/sys/dev/aic7xxx/aicasm/aicasm_gram.y#2 integrate .. //depot/projects/pci/sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y#2 integrate .. //depot/projects/pci/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l#2 integrate .. //depot/projects/pci/sys/dev/aic7xxx/aicasm/aicasm_scan.l#2 integrate .. //depot/projects/pci/sys/dev/aic7xxx/aicasm/aicasm_symbol.c#2 integrate .. //depot/projects/pci/sys/dev/aic7xxx/aicasm/aicasm_symbol.h#2 integrate .. //depot/projects/pci/sys/dev/an/if_an.c#2 integrate .. //depot/projects/pci/sys/dev/ath/ah_osdep.c#6 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ah_eeprom_9287.h#2 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c#3 integrate .. //depot/projects/pci/sys/dev/ath/if_ath.c#6 integrate .. //depot/projects/pci/sys/dev/cas/if_cas.c#3 integrate .. //depot/projects/pci/sys/dev/cas/if_casvar.h#2 integrate .. //depot/projects/pci/sys/dev/dc/dcphy.c#3 integrate .. //depot/projects/pci/sys/dev/dc/pnphy.c#3 integrate .. //depot/projects/pci/sys/dev/e1000/if_em.c#4 integrate .. //depot/projects/pci/sys/dev/e1000/if_igb.c#7 integrate .. //depot/projects/pci/sys/dev/e1000/if_igb.h#6 integrate .. //depot/projects/pci/sys/dev/en/if_en_pci.c#2 integrate .. //depot/projects/pci/sys/dev/et/if_et.c#4 integrate .. //depot/projects/pci/sys/dev/fdc/fdc_pccard.c#2 integrate .. //depot/projects/pci/sys/dev/fxp/if_fxp.c#4 integrate .. //depot/projects/pci/sys/dev/gem/if_gem.c#4 integrate .. //depot/projects/pci/sys/dev/gem/if_gem_pci.c#2 integrate .. //depot/projects/pci/sys/dev/gem/if_gemreg.h#2 integrate .. //depot/projects/pci/sys/dev/gem/if_gemvar.h#2 integrate .. //depot/projects/pci/sys/dev/iicbus/if_ic.c#2 integrate .. //depot/projects/pci/sys/dev/lmc/if_lmc.c#2 integrate .. //depot/projects/pci/sys/dev/md/md.c#4 integrate .. //depot/projects/pci/sys/dev/mfi/mfi.c#3 integrate .. //depot/projects/pci/sys/dev/mfi/mfi_cam.c#2 integrate .. //depot/projects/pci/sys/dev/mfi/mfireg.h#3 integrate .. //depot/projects/pci/sys/dev/mii/e1000phy.c#4 integrate .. //depot/projects/pci/sys/dev/mii/miidevs#4 integrate .. //depot/projects/pci/sys/dev/mpt/mpt.h#3 integrate .. //depot/projects/pci/sys/dev/mpt/mpt_pci.c#3 integrate .. //depot/projects/pci/sys/dev/mxge/eth_z8e.h#2 integrate .. //depot/projects/pci/sys/dev/mxge/ethp_z8e.h#2 integrate .. //depot/projects/pci/sys/dev/mxge/if_mxge.c#4 integrate .. //depot/projects/pci/sys/dev/mxge/rss_eth_z8e.h#2 integrate .. //depot/projects/pci/sys/dev/mxge/rss_ethp_z8e.h#2 integrate .. //depot/projects/pci/sys/dev/my/if_my.c#2 integrate .. //depot/projects/pci/sys/dev/pci/pci.c#24 integrate .. //depot/projects/pci/sys/dev/pci/pci_pci.c#26 integrate .. //depot/projects/pci/sys/dev/pci/pci_subr.c#4 integrate .. //depot/projects/pci/sys/dev/pci/pcib_private.h#19 integrate .. //depot/projects/pci/sys/dev/pci/pcivar.h#6 integrate .. //depot/projects/pci/sys/dev/ppbus/if_plip.c#2 integrate .. //depot/projects/pci/sys/dev/pty/pty.c#2 integrate .. //depot/projects/pci/sys/dev/rt/if_rt.c#1 branch .. //depot/projects/pci/sys/dev/rt/if_rtreg.h#1 branch .. //depot/projects/pci/sys/dev/rt/if_rtvar.h#1 branch .. //depot/projects/pci/sys/dev/sis/if_sis.c#4 integrate .. //depot/projects/pci/sys/dev/snp/snp.c#2 integrate .. //depot/projects/pci/sys/dev/sound/macio/i2s.c#2 integrate .. //depot/projects/pci/sys/dev/sound/usb/uaudio.c#5 integrate .. //depot/projects/pci/sys/dev/syscons/scterm-teken.c#2 integrate .. //depot/projects/pci/sys/dev/tdfx/tdfx_pci.c#2 integrate .. //depot/projects/pci/sys/dev/uart/uart_bus_pci.c#2 integrate .. //depot/projects/pci/sys/dev/usb/input/uhid.c#4 integrate .. //depot/projects/pci/sys/dev/usb/input/ukbd.c#4 integrate .. //depot/projects/pci/sys/dev/usb/net/if_axe.c#4 integrate .. //depot/projects/pci/sys/dev/usb/net/if_axereg.h#2 integrate .. //depot/projects/pci/sys/dev/usb/net/if_usie.c#1 branch .. //depot/projects/pci/sys/dev/usb/net/if_usievar.h#1 branch .. //depot/projects/pci/sys/dev/usb/net/uhso.c#3 integrate .. //depot/projects/pci/sys/dev/usb/quirk/usb_quirk.c#2 integrate .. //depot/projects/pci/sys/dev/usb/quirk/usb_quirk.h#2 integrate .. //depot/projects/pci/sys/dev/usb/usb_hid.c#2 integrate .. //depot/projects/pci/sys/dev/usb/usb_lookup.c#3 integrate .. //depot/projects/pci/sys/dev/usb/usb_msctest.c#3 integrate .. //depot/projects/pci/sys/dev/usb/usbdevs#5 integrate .. //depot/projects/pci/sys/dev/usb/usbdi.h#5 integrate .. //depot/projects/pci/sys/dev/usb/usbhid.h#2 integrate .. //depot/projects/pci/sys/dev/usb/wlan/if_uath.c#3 integrate .. //depot/projects/pci/sys/dev/usb/wlan/if_zyd.c#4 integrate .. //depot/projects/pci/sys/dev/xen/control/control.c#3 integrate .. //depot/projects/pci/sys/fs/devfs/devfs_vnops.c#2 integrate .. //depot/projects/pci/sys/fs/nfs/nfs_var.h#4 integrate .. //depot/projects/pci/sys/fs/nfs/nfsproto.h#4 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clport.c#6 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clrpcops.c#5 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clstate.c#4 integrate .. //depot/projects/pci/sys/fs/smbfs/smbfs_smb.c#2 integrate .. //depot/projects/pci/sys/fs/tmpfs/tmpfs_subr.c#2 integrate .. //depot/projects/pci/sys/geom/cache/g_cache.c#3 integrate .. //depot/projects/pci/sys/geom/concat/g_concat.c#4 integrate .. //depot/projects/pci/sys/geom/eli/g_eli.c#5 integrate .. //depot/projects/pci/sys/geom/gate/g_gate.c#4 integrate .. //depot/projects/pci/sys/geom/geom.h#5 integrate .. //depot/projects/pci/sys/geom/geom_bsd.c#2 integrate .. //depot/projects/pci/sys/geom/geom_ccd.c#2 integrate .. //depot/projects/pci/sys/geom/geom_disk.c#4 integrate .. //depot/projects/pci/sys/geom/geom_pc98.c#2 integrate .. //depot/projects/pci/sys/geom/geom_sunlabel.c#2 integrate .. //depot/projects/pci/sys/geom/geom_vfs.c#2 integrate .. //depot/projects/pci/sys/geom/label/g_label_gpt.c#2 integrate .. //depot/projects/pci/sys/geom/mirror/g_mirror.c#3 integrate .. //depot/projects/pci/sys/geom/mountver/g_mountver.c#3 integrate .. //depot/projects/pci/sys/geom/multipath/g_multipath.c#3 integrate .. //depot/projects/pci/sys/geom/nop/g_nop.c#3 integrate .. //depot/projects/pci/sys/geom/part/g_part_ebr.c#3 integrate .. //depot/projects/pci/sys/geom/part/g_part_gpt.c#2 integrate .. //depot/projects/pci/sys/geom/part/g_part_mbr.c#3 integrate .. //depot/projects/pci/sys/geom/raid/g_raid.c#3 integrate .. //depot/projects/pci/sys/geom/raid3/g_raid3.c#3 integrate .. //depot/projects/pci/sys/geom/sched/g_sched.c#3 integrate .. //depot/projects/pci/sys/geom/sched/gs_rr.c#2 integrate .. //depot/projects/pci/sys/geom/shsec/g_shsec.c#4 integrate .. //depot/projects/pci/sys/geom/stripe/g_stripe.c#4 integrate .. //depot/projects/pci/sys/geom/vinum/geom_vinum.c#2 integrate .. //depot/projects/pci/sys/geom/vinum/geom_vinum_drive.c#3 integrate .. //depot/projects/pci/sys/geom/vinum/geom_vinum_list.c#2 integrate .. //depot/projects/pci/sys/geom/vinum/geom_vinum_subr.c#2 integrate .. //depot/projects/pci/sys/geom/virstor/g_virstor.c#3 integrate .. //depot/projects/pci/sys/i386/Makefile#2 integrate .. //depot/projects/pci/sys/i386/i386/mp_machdep.c#3 integrate .. //depot/projects/pci/sys/i386/i386/pmap.c#4 integrate .. //depot/projects/pci/sys/i386/i386/sys_machdep.c#2 integrate .. //depot/projects/pci/sys/i386/i386/vm_machdep.c#3 integrate .. //depot/projects/pci/sys/i386/include/cpufunc.h#3 integrate .. //depot/projects/pci/sys/i386/xen/mp_machdep.c#3 integrate .. //depot/projects/pci/sys/i386/xen/pmap.c#3 integrate .. //depot/projects/pci/sys/ia64/conf/GENERIC#4 integrate .. //depot/projects/pci/sys/ia64/ia64/clock.c#3 integrate .. //depot/projects/pci/sys/ia64/ia64/exception.S#5 integrate .. //depot/projects/pci/sys/ia64/ia64/mp_machdep.c#5 integrate .. //depot/projects/pci/sys/ia64/ia64/pmap.c#5 integrate .. //depot/projects/pci/sys/ia64/include/pmap.h#4 integrate .. //depot/projects/pci/sys/ia64/include/sf_buf.h#2 integrate .. //depot/projects/pci/sys/kern/Make.tags.inc#2 integrate .. //depot/projects/pci/sys/kern/imgact_elf.c#3 integrate .. //depot/projects/pci/sys/kern/init_sysent.c#4 integrate .. //depot/projects/pci/sys/kern/kern_descrip.c#5 integrate .. //depot/projects/pci/sys/kern/kern_exec.c#2 integrate .. //depot/projects/pci/sys/kern/kern_exit.c#5 integrate .. //depot/projects/pci/sys/kern/kern_fail.c#2 integrate .. //depot/projects/pci/sys/kern/kern_fork.c#3 integrate .. //depot/projects/pci/sys/kern/kern_jail.c#4 integrate .. //depot/projects/pci/sys/kern/kern_racct.c#5 integrate .. //depot/projects/pci/sys/kern/kern_rctl.c#5 integrate .. //depot/projects/pci/sys/kern/kern_rmlock.c#3 integrate .. //depot/projects/pci/sys/kern/kern_tc.c#2 integrate .. //depot/projects/pci/sys/kern/kern_thr.c#3 integrate .. //depot/projects/pci/sys/kern/sched_4bsd.c#5 integrate .. //depot/projects/pci/sys/kern/subr_kdb.c#4 integrate .. //depot/projects/pci/sys/kern/subr_pcpu.c#3 integrate .. //depot/projects/pci/sys/kern/subr_smp.c#4 integrate .. //depot/projects/pci/sys/kern/subr_trap.c#2 integrate .. //depot/projects/pci/sys/kern/subr_uio.c#3 integrate .. //depot/projects/pci/sys/kern/sys_capability.c#3 integrate .. //depot/projects/pci/sys/kern/syscalls.c#4 integrate .. //depot/projects/pci/sys/kern/syscalls.master#4 integrate .. //depot/projects/pci/sys/kern/systrace_args.c#4 integrate .. //depot/projects/pci/sys/kern/sysv_msg.c#3 integrate .. //depot/projects/pci/sys/kern/sysv_sem.c#3 integrate .. //depot/projects/pci/sys/kern/sysv_shm.c#3 integrate .. //depot/projects/pci/sys/kern/tty.c#2 integrate .. //depot/projects/pci/sys/kern/tty_inq.c#2 integrate .. //depot/projects/pci/sys/kern/tty_outq.c#2 integrate .. //depot/projects/pci/sys/kern/tty_pts.c#3 integrate .. //depot/projects/pci/sys/kern/tty_ttydisc.c#2 integrate .. //depot/projects/pci/sys/kern/uipc_shm.c#3 integrate .. //depot/projects/pci/sys/kern/uipc_socket.c#3 integrate .. //depot/projects/pci/sys/kern/uipc_syscalls.c#4 integrate .. //depot/projects/pci/sys/kern/vfs_bio.c#3 integrate .. //depot/projects/pci/sys/kern/vfs_mount.c#5 integrate .. //depot/projects/pci/sys/kern/vfs_mountroot.c#2 integrate .. //depot/projects/pci/sys/kern/vfs_subr.c#6 integrate .. //depot/projects/pci/sys/mips/atheros/ar71xx_chip.c#3 integrate .. //depot/projects/pci/sys/mips/atheros/ar71xx_machdep.c#3 integrate .. //depot/projects/pci/sys/mips/atheros/ar71xx_ohci.c#2 integrate .. //depot/projects/pci/sys/mips/atheros/ar71xx_setup.c#2 integrate .. //depot/projects/pci/sys/mips/atheros/ar724x_chip.c#4 integrate .. //depot/projects/pci/sys/mips/atheros/ar91xx_chip.c#4 integrate .. //depot/projects/pci/sys/mips/conf/RT305X#3 integrate .. //depot/projects/pci/sys/mips/conf/RT305X.hints#2 integrate .. //depot/projects/pci/sys/mips/mips/genassym.c#2 integrate .. //depot/projects/pci/sys/mips/mips/mp_machdep.c#3 integrate .. //depot/projects/pci/sys/mips/mips/pmap.c#3 integrate .. //depot/projects/pci/sys/mips/mips/trap.c#2 integrate .. //depot/projects/pci/sys/mips/rmi/dev/xlr/rge.c#2 integrate .. //depot/projects/pci/sys/mips/rmi/fmn.c#2 integrate .. //depot/projects/pci/sys/mips/rmi/iodi.c#2 integrate .. //depot/projects/pci/sys/mips/sentry5/s5_machdep.c#2 integrate .. //depot/projects/pci/sys/mips/sibyte/sb_machdep.c#2 integrate .. //depot/projects/pci/sys/modules/Makefile#6 integrate .. //depot/projects/pci/sys/modules/ipdivert/Makefile#2 integrate .. //depot/projects/pci/sys/modules/pf/Makefile#2 integrate .. //depot/projects/pci/sys/modules/pflog/Makefile#2 integrate .. //depot/projects/pci/sys/modules/pfsync/Makefile#1 branch .. //depot/projects/pci/sys/modules/usb/Makefile#3 integrate .. //depot/projects/pci/sys/modules/usb/usie/Makefile#1 branch .. //depot/projects/pci/sys/net/bpf_filter.c#2 integrate .. //depot/projects/pci/sys/net/if.c#3 integrate .. //depot/projects/pci/sys/net/if.h#3 integrate .. //depot/projects/pci/sys/net/if_arcsubr.c#2 integrate .. //depot/projects/pci/sys/net/if_atmsubr.c#2 integrate .. //depot/projects/pci/sys/net/if_debug.c#2 integrate .. //depot/projects/pci/sys/net/if_ethersubr.c#3 integrate .. //depot/projects/pci/sys/net/if_fddisubr.c#2 integrate .. //depot/projects/pci/sys/net/if_fwsubr.c#2 integrate .. //depot/projects/pci/sys/net/if_gif.c#2 integrate .. //depot/projects/pci/sys/net/if_iso88025subr.c#2 integrate .. //depot/projects/pci/sys/net/if_lagg.c#4 integrate .. //depot/projects/pci/sys/net/if_llatbl.h#4 integrate .. //depot/projects/pci/sys/net/if_spppfr.c#2 integrate .. //depot/projects/pci/sys/net/if_spppsubr.c#2 integrate .. //depot/projects/pci/sys/net/if_stf.c#2 integrate .. //depot/projects/pci/sys/net/if_tun.c#3 integrate .. //depot/projects/pci/sys/net/if_var.h#3 integrate .. //depot/projects/pci/sys/net80211/ieee80211_ageq.c#2 integrate .. //depot/projects/pci/sys/net80211/ieee80211_dfs.c#2 integrate .. //depot/projects/pci/sys/net80211/ieee80211_power.c#2 integrate .. //depot/projects/pci/sys/netgraph/netflow/netflow.c#3 integrate .. //depot/projects/pci/sys/netgraph/netflow/netflow_v9.c#2 integrate .. //depot/projects/pci/sys/netgraph/netflow/ng_netflow.c#3 integrate .. //depot/projects/pci/sys/netgraph/netflow/ng_netflow.h#3 integrate .. //depot/projects/pci/sys/netgraph/netgraph.h#2 integrate .. //depot/projects/pci/sys/netgraph/ng_base.c#4 integrate .. //depot/projects/pci/sys/netgraph/ng_iface.c#4 integrate .. //depot/projects/pci/sys/netgraph/ng_socket.c#2 integrate .. //depot/projects/pci/sys/netinet/if_ether.c#4 integrate .. //depot/projects/pci/sys/netinet/in.c#4 integrate .. //depot/projects/pci/sys/netinet/in_gif.c#2 integrate .. //depot/projects/pci/sys/netinet/in_proto.c#4 integrate .. //depot/projects/pci/sys/netinet/ip_divert.c#3 integrate .. //depot/projects/pci/sys/netinet/ip_fw.h#3 integrate .. //depot/projects/pci/sys/netinet/ip_icmp.c#3 integrate .. //depot/projects/pci/sys/netinet/ip_var.h#3 integrate .. //depot/projects/pci/sys/netinet/ipfw/ip_fw2.c#5 integrate .. //depot/projects/pci/sys/netinet/ipfw/ip_fw_log.c#2 integrate .. //depot/projects/pci/sys/netinet/ipfw/ip_fw_pfil.c#3 integrate .. //depot/projects/pci/sys/netinet/ipfw/ip_fw_sockopt.c#3 integrate .. //depot/projects/pci/sys/netinet/libalias/libalias.3#4 integrate .. //depot/projects/pci/sys/netinet/raw_ip.c#4 integrate .. //depot/projects/pci/sys/netinet/sctp_pcb.c#5 integrate .. //depot/projects/pci/sys/netinet/sctp_uio.h#3 integrate .. //depot/projects/pci/sys/netinet/sctp_usrreq.c#4 integrate .. //depot/projects/pci/sys/netinet/tcp_lro.c#3 integrate .. //depot/projects/pci/sys/netinet/tcp_output.c#6 integrate .. //depot/projects/pci/sys/netinet/tcp_subr.c#4 integrate .. //depot/projects/pci/sys/netinet6/icmp6.c#2 integrate .. //depot/projects/pci/sys/netinet6/in6.c#4 integrate .. //depot/projects/pci/sys/netinet6/in6_gif.c#2 integrate .. //depot/projects/pci/sys/netinet6/in6_proto.c#4 integrate .. //depot/projects/pci/sys/netipsec/ipsec_input.c#3 integrate .. //depot/projects/pci/sys/netipsec/ipsec_output.c#4 integrate .. //depot/projects/pci/sys/netipsec/xform_ipip.c#3 integrate .. //depot/projects/pci/sys/nfs/bootp_subr.c#2 integrate .. //depot/projects/pci/sys/powerpc/aim/mmu_oea.c#4 integrate .. //depot/projects/pci/sys/powerpc/aim/mmu_oea64.c#5 integrate .. //depot/projects/pci/sys/powerpc/aim/trap_subr32.S#3 integrate .. //depot/projects/pci/sys/powerpc/aim/trap_subr64.S#4 integrate .. //depot/projects/pci/sys/powerpc/booke/pmap.c#3 integrate .. //depot/projects/pci/sys/powerpc/conf/GENERIC#4 integrate .. //depot/projects/pci/sys/powerpc/conf/GENERIC64#4 integrate .. //depot/projects/pci/sys/powerpc/ofw/rtas.c#2 integrate .. //depot/projects/pci/sys/powerpc/powermac/fcu.c#3 integrate .. //depot/projects/pci/sys/powerpc/powerpc/mp_machdep.c#5 integrate .. //depot/projects/pci/sys/powerpc/ps3/if_glc.c#3 integrate .. //depot/projects/pci/sys/sparc64/include/cache.h#2 integrate .. //depot/projects/pci/sys/sparc64/include/cpu.h#2 integrate .. //depot/projects/pci/sys/sparc64/include/pmap.h#3 integrate .. //depot/projects/pci/sys/sparc64/include/tlb.h#2 integrate .. //depot/projects/pci/sys/sparc64/pci/fire.c#3 integrate .. //depot/projects/pci/sys/sparc64/pci/schizo.c#3 integrate .. //depot/projects/pci/sys/sparc64/sparc64/cache.c#2 integrate .. //depot/projects/pci/sys/sparc64/sparc64/cheetah.c#2 integrate .. //depot/projects/pci/sys/sparc64/sparc64/counter.c#2 integrate .. //depot/projects/pci/sys/sparc64/sparc64/exception.S#4 integrate .. //depot/projects/pci/sys/sparc64/sparc64/interrupt.S#2 integrate .. //depot/projects/pci/sys/sparc64/sparc64/machdep.c#4 integrate .. //depot/projects/pci/sys/sparc64/sparc64/mp_exception.S#3 integrate .. //depot/projects/pci/sys/sparc64/sparc64/mp_machdep.c#4 integrate .. //depot/projects/pci/sys/sparc64/sparc64/pmap.c#6 integrate .. //depot/projects/pci/sys/sparc64/sparc64/spitfire.c#2 integrate .. //depot/projects/pci/sys/sparc64/sparc64/sys_machdep.c#2 integrate .. //depot/projects/pci/sys/sparc64/sparc64/tick.c#3 integrate .. //depot/projects/pci/sys/sparc64/sparc64/vm_machdep.c#3 integrate .. //depot/projects/pci/sys/sparc64/sparc64/zeus.c#2 integrate .. //depot/projects/pci/sys/sys/_types.h#2 integrate .. //depot/projects/pci/sys/sys/bus.h#6 integrate .. //depot/projects/pci/sys/sys/capability.h#2 integrate .. //depot/projects/pci/sys/sys/cpuset.h#3 integrate .. //depot/projects/pci/sys/sys/diskmbr.h#2 integrate .. //depot/projects/pci/sys/sys/file.h#3 integrate .. //depot/projects/pci/sys/sys/filedesc.h#3 integrate .. //depot/projects/pci/sys/sys/mbuf.h#3 integrate .. //depot/projects/pci/sys/sys/param.h#6 integrate .. //depot/projects/pci/sys/sys/pcpu.h#3 integrate .. //depot/projects/pci/sys/sys/priv.h#4 integrate .. //depot/projects/pci/sys/sys/proc.h#5 integrate .. //depot/projects/pci/sys/sys/racct.h#3 integrate .. //depot/projects/pci/sys/sys/sem.h#3 integrate .. //depot/projects/pci/sys/sys/sockio.h#2 integrate .. //depot/projects/pci/sys/sys/soundcard.h#3 integrate .. //depot/projects/pci/sys/sys/syscall.h#4 integrate .. //depot/projects/pci/sys/sys/syscall.mk#4 integrate .. //depot/projects/pci/sys/sys/sysproto.h#4 integrate .. //depot/projects/pci/sys/sys/systm.h#6 integrate .. //depot/projects/pci/sys/sys/timetc.h#2 integrate .. //depot/projects/pci/sys/sys/tty.h#2 integrate .. //depot/projects/pci/sys/sys/ttydevsw.h#2 integrate .. //depot/projects/pci/sys/sys/types.h#3 integrate .. //depot/projects/pci/sys/sys/uio.h#3 integrate .. //depot/projects/pci/sys/sys/unistd.h#2 integrate .. //depot/projects/pci/sys/sys/vnode.h#4 integrate .. //depot/projects/pci/sys/teken/demo/teken_demo.c#2 integrate .. //depot/projects/pci/sys/teken/gensequences#2 integrate .. //depot/projects/pci/sys/teken/libteken/teken.3#2 integrate .. //depot/projects/pci/sys/teken/teken.c#3 integrate .. //depot/projects/pci/sys/teken/teken_subr.h#2 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_alloc.c#6 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_balloc.c#3 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_inode.c#3 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_softdep.c#6 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_vfsops.c#4 integrate .. //depot/projects/pci/sys/ufs/ffs/fs.h#3 integrate .. //depot/projects/pci/sys/ufs/ffs/softdep.h#4 integrate .. //depot/projects/pci/sys/ufs/ufs/ufs_inode.c#3 integrate .. //depot/projects/pci/sys/ufs/ufs/ufsmount.h#4 integrate .. //depot/projects/pci/sys/vm/device_pager.c#3 integrate .. //depot/projects/pci/sys/vm/swap_pager.c#3 integrate .. //depot/projects/pci/sys/vm/vm_extern.h#2 integrate .. //depot/projects/pci/sys/vm/vm_fault.c#5 integrate .. //depot/projects/pci/sys/vm/vm_glue.c#3 integrate .. //depot/projects/pci/sys/vm/vm_map.c#4 integrate .. //depot/projects/pci/sys/vm/vm_mmap.c#3 integrate .. //depot/projects/pci/sys/vm/vm_object.c#4 integrate .. //depot/projects/pci/sys/vm/vm_object.h#2 integrate .. //depot/projects/pci/sys/vm/vm_pageout.c#4 integrate .. //depot/projects/pci/sys/vm/vm_unix.c#3 integrate .. //depot/projects/pci/sys/vm/vnode_pager.c#3 integrate .. //depot/projects/pci/sys/x86/include/mptable.h#5 integrate .. //depot/projects/pci/sys/x86/x86/mptable.c#9 integrate .. //depot/projects/pci/sys/x86/x86/mptable_pci.c#15 integrate .. //depot/projects/pci/sys/x86/x86/tsc.c#8 integrate Differences ... ==== //depot/projects/pci/sys/amd64/acpica/acpi_wakeup.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_wakeup.c,v 1.41 2011/06/07 08:46:13 attilio Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_wakeup.c,v 1.42 2011/07/04 12:04:52 attilio Exp $"); #include #include @@ -226,7 +226,8 @@ return (ret); #ifdef SMP - wakeup_cpus = PCPU_GET(other_cpus); + wakeup_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus); #endif AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); ==== //depot/projects/pci/sys/amd64/amd64/mp_machdep.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.344 2011/06/08 08:12:15 avg Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.345 2011/07/04 12:04:52 attilio Exp $"); #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -604,10 +604,10 @@ void init_secondary(void) { - cpuset_t tcpuset, tallcpus; struct pcpu *pc; struct nmi_pcpu *np; u_int64_t msr, cr0; + u_int cpuid; int cpu, gsel_tss, x; struct region_descriptor ap_gdt; @@ -711,8 +711,9 @@ fpuinit(); /* A quick check from sanity claus */ + cpuid = PCPU_GET(cpuid); if (PCPU_GET(apic_id) != lapic_id()) { - printf("SMP: cpuid = %d\n", PCPU_GET(cpuid)); + printf("SMP: cpuid = %d\n", cpuid); printf("SMP: actual apic_id = %d\n", lapic_id()); printf("SMP: correct apic_id = %d\n", PCPU_GET(apic_id)); panic("cpuid mismatch! boom!!"); @@ -734,19 +735,13 @@ smp_cpus++; - CTR1(KTR_SMP, "SMP: AP CPU #%d Launched", PCPU_GET(cpuid)); - printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid)); - tcpuset = PCPU_GET(cpumask); + CTR1(KTR_SMP, "SMP: AP CPU #%d Launched", cpuid); + printf("SMP: AP CPU #%d Launched!\n", cpuid); /* Determine if we are a logical CPU. */ /* XXX Calculation depends on cpu_logical being a power of 2, e.g. 2 */ if (cpu_logical > 1 && PCPU_GET(apic_id) % cpu_logical != 0) - CPU_OR(&logical_cpus_mask, &tcpuset); - - /* Build our map of 'other' CPUs. */ - tallcpus = all_cpus; - CPU_NAND(&tallcpus, &tcpuset); - PCPU_SET(other_cpus, tallcpus); + CPU_SET(cpuid, &logical_cpus_mask); if (bootverbose) lapic_dump("AP"); @@ -893,7 +888,6 @@ static int start_all_aps(void) { - cpuset_t tallcpus, tcpuset; vm_offset_t va = boot_address + KERNBASE; u_int64_t *pt4, *pt3, *pt2; u_int32_t mpbioswarmvec; @@ -961,12 +955,6 @@ CPU_SET(cpu, &all_cpus); /* record AP in CPU map */ } - /* build our map of 'other' CPUs */ - tallcpus = all_cpus; - tcpuset = PCPU_GET(cpumask); - CPU_NAND(&tallcpus, &tcpuset); - PCPU_SET(other_cpus, tallcpus); - /* restore the warmstart vector */ *(u_int32_t *) WARMBOOT_OFF = mpbioswarmvec; @@ -1150,9 +1138,7 @@ if (othercpus < 1) return; } else { - sched_pin(); - CPU_NAND(&mask, PCPU_PTR(cpumask)); - sched_unpin(); + CPU_CLR(PCPU_GET(cpuid), &mask); if (CPU_EMPTY(&mask)) return; } @@ -1349,11 +1335,13 @@ void ipi_all_but_self(u_int ipi) { + cpuset_t other_cpus; - sched_pin(); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); + if (IPI_IS_BITMAPED(ipi)) { - ipi_selected(PCPU_GET(other_cpus), ipi); - sched_unpin(); + ipi_selected(other_cpus, ipi); return; } @@ -1363,8 +1351,7 @@ * Set the mask of receiving CPUs for this purpose. */ if (ipi == IPI_STOP_HARD) - CPU_OR_ATOMIC(&ipi_nmi_pending, PCPU_PTR(other_cpus)); - sched_unpin(); + CPU_OR_ATOMIC(&ipi_nmi_pending, &other_cpus); CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); @@ -1373,7 +1360,7 @@ int ipi_nmi_handler() { - cpuset_t cpumask; + u_int cpuid; /* * As long as there is not a simple way to know about a NMI's @@ -1381,13 +1368,11 @@ * the global pending bitword an IPI_STOP_HARD has been issued * and should be handled. */ - sched_pin(); - cpumask = PCPU_GET(cpumask); - sched_unpin(); - if (!CPU_OVERLAP(&ipi_nmi_pending, &cpumask)) + cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &ipi_nmi_pending)) return (1); - CPU_NAND_ATOMIC(&ipi_nmi_pending, &cpumask); + CPU_CLR_ATOMIC(cpuid, &ipi_nmi_pending); cpustop_handler(); return (0); } @@ -1399,25 +1384,21 @@ void cpustop_handler(void) { - cpuset_t cpumask; u_int cpu; - sched_pin(); cpu = PCPU_GET(cpuid); - cpumask = PCPU_GET(cpumask); - sched_unpin(); savectx(&stoppcbs[cpu]); /* Indicate that we are stopped */ - CPU_OR_ATOMIC(&stopped_cpus, &cpumask); + CPU_SET_ATOMIC(cpu, &stopped_cpus); /* Wait for restart */ - while (!CPU_OVERLAP(&started_cpus, &cpumask)) + while (!CPU_ISSET(cpu, &started_cpus)) ia32_pause(); - CPU_NAND_ATOMIC(&started_cpus, &cpumask); - CPU_NAND_ATOMIC(&stopped_cpus, &cpumask); + CPU_CLR_ATOMIC(cpu, &started_cpus); + CPU_CLR_ATOMIC(cpu, &stopped_cpus); if (cpu == 0 && cpustop_restartfunc != NULL) { cpustop_restartfunc(); @@ -1432,19 +1413,17 @@ void cpususpend_handler(void) { - cpuset_t cpumask; register_t cr3, rf; u_int cpu; cpu = PCPU_GET(cpuid); - cpumask = PCPU_GET(cpumask); rf = intr_disable(); cr3 = rcr3(); if (savectx(susppcbs[cpu])) { wbinvd(); - CPU_OR_ATOMIC(&stopped_cpus, &cpumask); + CPU_SET_ATOMIC(cpu, &stopped_cpus); } else { pmap_init_pat(); PCPU_SET(switchtime, 0); @@ -1452,11 +1431,11 @@ } /* Wait for resume */ - while (!CPU_OVERLAP(&started_cpus, &cpumask)) + while (!CPU_ISSET(cpu, &started_cpus)) ia32_pause(); - CPU_NAND_ATOMIC(&started_cpus, &cpumask); - CPU_NAND_ATOMIC(&stopped_cpus, &cpumask); + CPU_CLR_ATOMIC(cpu, &started_cpus); + CPU_CLR_ATOMIC(cpu, &stopped_cpus); /* Restore CR3 and enable interrupts */ load_cr3(cr3); ==== //depot/projects/pci/sys/amd64/amd64/pmap.c#4 (text+ko) ==== @@ -77,7 +77,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.721 2011/06/07 08:46:13 attilio Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.724 2011/07/04 12:04:52 attilio Exp $"); /* * Manages physical address maps. @@ -925,16 +925,18 @@ void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - cpuset_t cpumask, other_cpus; + cpuset_t other_cpus; + u_int cpuid; sched_pin(); if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { invlpg(va); smp_invlpg(va); } else { - cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); - if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) + cpuid = PCPU_GET(cpuid); + other_cpus = all_cpus; + CPU_CLR(cpuid, &other_cpus); + if (CPU_ISSET(cpuid, &pmap->pm_active)) invlpg(va); CPU_AND(&other_cpus, &pmap->pm_active); if (!CPU_EMPTY(&other_cpus)) @@ -946,8 +948,9 @@ void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - cpuset_t cpumask, other_cpus; + cpuset_t other_cpus; vm_offset_t addr; + u_int cpuid; sched_pin(); if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { @@ -955,9 +958,10 @@ invlpg(addr); smp_invlpg_range(sva, eva); } else { - cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); - if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) + cpuid = PCPU_GET(cpuid); + other_cpus = all_cpus; + CPU_CLR(cpuid, &other_cpus); + if (CPU_ISSET(cpuid, &pmap->pm_active)) for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); CPU_AND(&other_cpus, &pmap->pm_active); @@ -970,16 +974,18 @@ void pmap_invalidate_all(pmap_t pmap) { - cpuset_t cpumask, other_cpus; + cpuset_t other_cpus; + u_int cpuid; sched_pin(); if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { invltlb(); smp_invltlb(); } else { - cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); - if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) + cpuid = PCPU_GET(cpuid); + other_cpus = all_cpus; + CPU_CLR(cpuid, &other_cpus); + if (CPU_ISSET(cpuid, &pmap->pm_active)) invltlb(); CPU_AND(&other_cpus, &pmap->pm_active); if (!CPU_EMPTY(&other_cpus)) @@ -999,11 +1005,11 @@ } struct pde_action { - cpuset_t store; /* processor that updates the PDE */ cpuset_t invalidate; /* processors that invalidate their TLB */ vm_offset_t va; pd_entry_t *pde; pd_entry_t newpde; + u_int store; /* processor that updates the PDE */ }; static void @@ -1011,12 +1017,8 @@ { struct pde_action *act = arg; - sched_pin(); - if (!CPU_CMP(&act->store, PCPU_PTR(cpumask))) { - sched_unpin(); + if (act->store == PCPU_GET(cpuid)) pde_store(act->pde, act->newpde); - } else - sched_unpin(); } static void @@ -1024,12 +1026,8 @@ { struct pde_action *act = arg; - sched_pin(); - if (CPU_OVERLAP(&act->invalidate, PCPU_PTR(cpumask))) { - sched_unpin(); + if (CPU_ISSET(PCPU_GET(cpuid), &act->invalidate)) pmap_update_pde_invalidate(act->va, act->newpde); - } else - sched_unpin(); } /* @@ -1044,28 +1042,30 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde) { struct pde_action act; - cpuset_t active, cpumask, other_cpus; + cpuset_t active, other_cpus; + u_int cpuid; sched_pin(); - cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + cpuid = PCPU_GET(cpuid); + other_cpus = all_cpus; + CPU_CLR(cpuid, &other_cpus); if (pmap == kernel_pmap) active = all_cpus; else active = pmap->pm_active; if (CPU_OVERLAP(&active, &other_cpus)) { - act.store = cpumask; + act.store = cpuid; act.invalidate = active; act.va = va; act.pde = pde; act.newpde = newpde; - CPU_OR(&cpumask, &active); - smp_rendezvous_cpus(cpumask, + CPU_SET(cpuid, &active); + smp_rendezvous_cpus(active, smp_no_rendevous_barrier, pmap_update_pde_action, pmap_update_pde_teardown, &act); } else { pde_store(pde, newpde); - if (CPU_OVERLAP(&active, &cpumask)) + if (CPU_ISSET(cpuid, &active)) pmap_update_pde_invalidate(va, newpde); } sched_unpin(); @@ -2104,7 +2104,7 @@ vm_page_t m, free; TAILQ_FOREACH(m, &vpq->pl, pageq) { - if (m->hold_count || m->busy) + if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy) continue; TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) { va = pv->pv_va; @@ -2847,8 +2847,8 @@ vm_offset_t va; vm_page_t free; - KASSERT((m->flags & PG_FICTITIOUS) == 0, - ("pmap_remove_all: page %p is fictitious", m)); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_remove_all: page %p is not managed", m)); free = NULL; vm_page_lock_queues(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -5095,17 +5095,19 @@ pmap_activate(struct thread *td) { pmap_t pmap, oldpmap; + u_int cpuid; u_int64_t cr3; critical_enter(); pmap = vmspace_pmap(td->td_proc->p_vmspace); oldpmap = PCPU_GET(curpmap); + cpuid = PCPU_GET(cpuid); #ifdef SMP - CPU_NAND_ATOMIC(&oldpmap->pm_active, PCPU_PTR(cpumask)); - CPU_OR_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask)); + CPU_CLR_ATOMIC(cpuid, &oldpmap->pm_active); + CPU_SET_ATOMIC(cpuid, &pmap->pm_active); #else - CPU_NAND(&oldpmap->pm_active, PCPU_PTR(cpumask)); - CPU_OR(&pmap->pm_active, PCPU_PTR(cpumask)); + CPU_CLR(cpuid, &oldpmap->pm_active); + CPU_SET(cpuid, &pmap->pm_active); #endif cr3 = DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4); td->td_pcb->pcb_cr3 = cr3; ==== //depot/projects/pci/sys/amd64/amd64/sys_machdep.c#3 (text+ko) ==== @@ -31,9 +31,9 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/sys_machdep.c,v 1.102 2011/04/08 21:27:31 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/sys_machdep.c,v 1.104 2011/06/30 10:56:02 jonathan Exp $"); -#include "opt_capabilities.h" +#include "opt_capsicum.h" #include #include @@ -180,28 +180,30 @@ uint64_t a64base; struct i386_ioperm_args iargs; -#ifdef CAPABILITIES +#ifdef CAPABILITY_MODE /* - * Whitelist of operations which are safe enough for capability mode. + * When adding new operations, add a new case statement here to + * explicitly indicate whether or not the operation is safe to + * perform in capability mode. */ if (IN_CAPABILITY_MODE(td)) { switch (uap->op) { - case I386_GET_LDT: - case I386_SET_LDT: - case I386_GET_IOPERM: - case I386_GET_FSBASE: - case I386_SET_FSBASE: - case I386_GET_GSBASE: - case I386_SET_GSBASE: - case AMD64_GET_FSBASE: - case AMD64_SET_FSBASE: - case AMD64_GET_GSBASE: - case AMD64_SET_GSBASE: - break; + case I386_GET_LDT: + case I386_SET_LDT: + case I386_GET_IOPERM: + case I386_GET_FSBASE: + case I386_SET_FSBASE: + case I386_GET_GSBASE: + case I386_SET_GSBASE: + case AMD64_GET_FSBASE: + case AMD64_SET_FSBASE: + case AMD64_GET_GSBASE: + case AMD64_SET_GSBASE: + break; - case I386_SET_IOPERM: - default: - return (ECAPMODE); + case I386_SET_IOPERM: + default: + return (ECAPMODE); } } #endif ==== //depot/projects/pci/sys/amd64/amd64/vm_machdep.c#3 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.276 2011/06/07 08:46:13 attilio Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.277 2011/07/04 12:04:52 attilio Exp $"); #include "opt_isa.h" #include "opt_cpu.h" @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -535,8 +534,8 @@ u_int cnt; if (smp_active) { - sched_pin(); - map = PCPU_GET(other_cpus); + map = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &map); CPU_NAND(&map, &stopped_cpus); if (!CPU_EMPTY(&map)) { printf("cpu_reset: Stopping other CPUs\n"); @@ -545,7 +544,6 @@ if (PCPU_GET(cpuid) != 0) { cpu_reset_proxyid = PCPU_GET(cpuid); - sched_unpin(); cpustop_restartfunc = cpu_reset_proxy; cpu_reset_proxy_active = 0; printf("cpu_reset: Restarting BSP\n"); @@ -564,8 +562,7 @@ while (1); /* NOTREACHED */ - } else - sched_unpin(); + } DELAY(1000000); } ==== //depot/projects/pci/sys/amd64/include/cpufunc.h#3 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/cpufunc.h,v 1.160 2011/04/14 16:53:32 jkim Exp $ + * $FreeBSD: src/sys/amd64/include/cpufunc.h,v 1.161 2011/07/05 18:42:10 jkim Exp $ */ >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Jul 15 22:26:09 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 925FF1065675; Fri, 15 Jul 2011 22:26:09 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 549D9106566C for ; Fri, 15 Jul 2011 22:26:09 +0000 (UTC) (envelope-from syuu@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 411D28FC14 for ; Fri, 15 Jul 2011 22:26:09 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6FMQ9gT046367 for ; Fri, 15 Jul 2011 22:26:09 GMT (envelope-from syuu@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6FMQ8Lc046364 for perforce@freebsd.org; Fri, 15 Jul 2011 22:26:09 GMT (envelope-from syuu@FreeBSD.org) Date: Fri, 15 Jul 2011 22:26:09 GMT Message-Id: <201107152226.p6FMQ8Lc046364@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to syuu@FreeBSD.org using -f From: Takuya ASADA To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196219 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 22:26:09 -0000 http://p4web.freebsd.org/@@196219?ac=10 Change 196219 by syuu@kikurage on 2011/07/15 22:25:26 test_mqbpf fix, BPFIF_LOCK reverted to mtx to stabilize, remove LOG_DEBUG and SDT for debugging, HASHTYPE support for igb Affected files ... .. //depot/projects/soc2011/mq_bpf/src/sys/dev/e1000/if_igb.c#9 edit .. //depot/projects/soc2011/mq_bpf/src/sys/net/bpf.c#13 edit .. //depot/projects/soc2011/mq_bpf/src/sys/net/bpfdesc.h#5 edit .. //depot/projects/soc2011/mq_bpf/src/sys/net/if.c#6 edit .. //depot/projects/soc2011/mq_bpf/src/sys/net/if_ethersubr.c#6 edit .. //depot/projects/soc2011/mq_bpf/src/sys/netinet/in_rss.c#3 edit .. //depot/projects/soc2011/mq_bpf/tests/Makefile#3 edit .. //depot/projects/soc2011/mq_bpf/tests/packet_trace.d#2 delete .. //depot/projects/soc2011/mq_bpf/tests/test_mqbpf.c#2 edit .. //depot/projects/soc2011/mq_bpf/tests/test_sqbpf.c#3 edit Differences ... ==== //depot/projects/soc2011/mq_bpf/src/sys/dev/e1000/if_igb.c#9 (text+ko) ==== @@ -37,6 +37,7 @@ #include "opt_device_polling.h" #include "opt_inet.h" #include "opt_altq.h" +#include "opt_rss.h" #endif #include @@ -59,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -82,6 +82,7 @@ #include #include #include +#include #include #include @@ -2268,6 +2269,7 @@ #if __FreeBSD_version >= 800504 bus_describe_intr(dev, que->res, que->tag, "que %d", i); #endif + printf("%s: que->msix:%d i:%d\n", __func__, que->msix, i); que->msix = vector; if (adapter->hw.mac.type == e1000_82575) que->eims = E1000_EICR_TX_QUEUE0 << i; @@ -4105,13 +4107,17 @@ */ rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (adapter->num_queues >1) { - u32 random[10], mrqc, shift = 0; + u32 rsskey[10], mrqc, shift = 0; union igb_reta { u32 dword; u8 bytes[4]; } reta; - arc4rand(&random, sizeof(random), 0); +#ifdef RSS + rss_getkey((uint8_t *)rsskey); +#else + arc4rand(&rsskey, sizeof(rsskey), 0); +#endif if (adapter->hw.mac.type == e1000_82575) shift = 6; /* Warning FM follows */ @@ -4126,7 +4132,7 @@ mrqc = E1000_MRQC_ENABLE_RSS_4Q; for (int i = 0; i < 10; i++) E1000_WRITE_REG_ARRAY(hw, - E1000_RSSRK(0), i, random[i]); + E1000_RSSRK(0), i, rsskey[i]); mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 | E1000_MRQC_RSS_FIELD_IPV4_TCP); @@ -4370,6 +4376,9 @@ struct mbuf *sendmp, *mh, *mp; struct igb_rx_buf *rxbuf; u16 hlen, plen, hdr, vtag; + u16 pkt; + u32 rss; + u8 rsstype; bool eop = FALSE; cur = &rxr->rx_base[i]; @@ -4390,6 +4399,9 @@ else vtag = le16toh(cur->wb.upper.vlan); hdr = le16toh(cur->wb.lower.lo_dword.hs_rss.hdr_info); + pkt = le16toh(cur->wb.lower.lo_dword.hs_rss.pkt_info); + rss = le32toh(cur->wb.lower.hi_dword.rss); + rsstype = (u8)(pkt & E1000_RXDADV_RSSTYPE_MASK); eop = ((staterr & E1000_RXD_STAT_EOP) == E1000_RXD_STAT_EOP); /* Make sure all segments of a bad packet are discarded */ @@ -4487,14 +4499,29 @@ rxr->fmp->m_pkthdr.ether_vtag = vtag; rxr->fmp->m_flags |= M_VLANTAG; } - const char *rsstype_str[] = {"NONE", "IPV4_TCP", "IPV4", "IPV6_TCP", "IPV6_EX", "IPV6", "IPV6_TCP_EX", "IPV4_UDP", "IPV6_UDP", "IPV6_UDP_EX"}; - u16 pkt = le16toh(cur->wb.lower.lo_dword.hs_rss.pkt_info); - u32 rss = le32toh(cur->wb.lower.hi_dword.rss); - u8 rsstype = (u8)(pkt & E1000_RXDADV_RSSTYPE_MASK); - log(LOG_DEBUG, "[%d]msix:%d rsstype:%s ptype:%u plen:%u hdr_info:%x rss:%x\n", PCPU_GET(cpuid), que->msix, rsstype_str[rsstype], ptype, plen, hdr, rss); #if __FreeBSD_version >= 800000 - rxr->fmp->m_pkthdr.flowid = que->msix; + rxr->fmp->m_pkthdr.flowid = rss; rxr->fmp->m_flags |= M_FLOWID; + switch (rsstype) { + case 1: + M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_TCP_IPV4); + break; + case 2: + case 7: + M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_IPV4); + break; + case 3: + case 6: + M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_TCP_IPV6); + break; + case 4: + case 8: + case 9: + M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_IPV6); + break; + default: + M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_NONE); + } #endif rxr->fmp->m_pkthdr.rxqid = que->msix; rxr->fmp->m_pkthdr.txqid = (uint32_t)-1; ==== //depot/projects/soc2011/mq_bpf/src/sys/net/bpf.c#13 (text+ko) ==== @@ -40,7 +40,6 @@ #include "opt_bpf.h" #include "opt_compat.h" #include "opt_netgraph.h" -#include "opt_kdtrace.h" #include #include @@ -80,7 +79,6 @@ #include #include #include -#include #include @@ -199,25 +197,6 @@ .f_event = filt_bpfread, }; -SDT_PROVIDER_DECLARE(bpf); -SDT_PROVIDER_DEFINE(bpf); -SDT_PROBE_DEFINE2(bpf, functions, bpf_tap, entry, entry, "void*", "boolean_t"); -SDT_PROBE_DEFINE3(bpf, functions, bpf_mtap_rx, entry, entry, "void *", "uint32_t", "uint32_t"); -SDT_PROBE_DEFINE3(bpf, functions, bpf_mtap_tx, entry, entry, "void *", "uint32_t", "uint32_t"); -SDT_PROBE_DEFINE3(bpf, functions, bpf_mtap2_rx, entry, entry, "void *", "uint32_t", "uint32_t"); -SDT_PROBE_DEFINE3(bpf, functions, bpf_mtap2_tx, entry, entry, "void *", "uint32_t", "uint32_t"); -SDT_PROBE_DEFINE1(bpf, functions, bpfioctl_biocenaqmask, entry, entry, "int"); -SDT_PROBE_DEFINE1(bpf, functions, bpfioctl_biocdisqmask, entry, entry, "int"); -SDT_PROBE_DEFINE1(bpf, functions, bpfioctl_biocstrxqmask, entry, entry, "int"); -SDT_PROBE_DEFINE1(bpf, functions, bpfioctl_bioccrrxqmask, entry, entry, "int"); -SDT_PROBE_DEFINE2(bpf, functions, bpfioctl_biocgtrxqmask, entry, entry, "int", "int"); -SDT_PROBE_DEFINE1(bpf, functions, bpfioctl_biocsttxqmask, entry, entry, "int"); -SDT_PROBE_DEFINE1(bpf, functions, bpfioctl_bioccrtxqmask, entry, entry, "int"); -SDT_PROBE_DEFINE2(bpf, functions, bpfioctl_biocgttxqmask, entry, entry, "int", "int"); -SDT_PROBE_DEFINE1(bpf, functions, bpfioctl_biocstothermask, entry, entry, "int"); -SDT_PROBE_DEFINE1(bpf, functions, bpfioctl_bioccrothermask, entry, entry, "int"); -SDT_PROBE_DEFINE1(bpf, functions, bpfioctl_biocgtothermask, entry, entry, "int"); - /* * Wrapper functions for various buffering methods. If the set of buffer * modes expands, we will probably want to introduce a switch data structure @@ -1546,13 +1525,11 @@ * No interface attached yet. */ error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocenaqmask, entry, -1); break; } if (d->bd_qmask.qm_enabled) { log(LOG_ERR, "d->bd_qmask.qm_enabled\n"); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocenaqmask, entry, -1); break; } ifp = d->bd_bif->bif_ifp; @@ -1560,7 +1537,6 @@ (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE))) { log(LOG_ERR, "if doesn't support multiqueue\n"); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocenaqmask, entry, -1); break; } KASSERT(ifp->if_get_rxqueue_len, ("ifp->if_get_rxqueue_len not set\n")); @@ -1573,7 +1549,6 @@ malloc(ifp->if_get_txqueue_len(ifp) * sizeof(boolean_t), M_BPF, M_WAITOK | M_ZERO); d->bd_qmask.qm_other_mask = FALSE; - SDT_PROBE1(bpf, functions, bpfioctl_biocenaqmask, entry, ifp->if_get_rxqueue_len(ifp)); break; } @@ -1585,19 +1560,16 @@ * No interface attached yet. */ error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocdisqmask, entry, -1); break; } if (!d->bd_qmask.qm_enabled) { log(LOG_ERR, "!d->bd_qmask.qm_enabled\n"); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocdisqmask, entry, -1); break; } d->bd_qmask.qm_enabled = FALSE; free(d->bd_qmask.qm_rxq_mask, M_BPF); free(d->bd_qmask.qm_txq_mask, M_BPF); - SDT_PROBE1(bpf, functions, bpfioctl_biocdisqmask, entry, 0); break; } @@ -1612,13 +1584,11 @@ * No interface attached yet. */ error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocstrxqmask, entry, -1); break; } if (!d->bd_qmask.qm_enabled) { log(LOG_ERR, "!d->bd_qmask.qm_enabled\n"); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocstrxqmask, entry, -1); break; } ifp = d->bd_bif->bif_ifp; @@ -1626,11 +1596,9 @@ if (index > ifp->if_get_rxqueue_len(ifp)) { log(LOG_ERR, "BIOCSTRXQMASK: index too large index:%x rxq_num:%x\n", index, ifp->if_get_rxqueue_len(ifp)); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocstrxqmask, entry, -1); break; } d->bd_qmask.qm_rxq_mask[index] = TRUE; - SDT_PROBE1(bpf, functions, bpfioctl_biocstrxqmask, entry, index); break; } @@ -1645,13 +1613,11 @@ * No interface attached yet. */ error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_bioccrrxqmask, entry, -1); break; } if (!d->bd_qmask.qm_enabled) { log(LOG_ERR, "!d->bd_qmask.qm_enabled\n"); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_bioccrrxqmask, entry, -1); break; } ifp = d->bd_bif->bif_ifp; @@ -1659,11 +1625,9 @@ if (index > ifp->if_get_rxqueue_len(ifp)) { log(LOG_ERR, "BIOCCRRXQMASK: index too large index:%x rxq_num:%x\n", index, ifp->if_get_rxqueue_len(ifp)); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_bioccrrxqmask, entry, -1); break; } d->bd_qmask.qm_rxq_mask[index] = FALSE; - SDT_PROBE1(bpf, functions, bpfioctl_bioccrrxqmask, entry, index); break; } @@ -1678,13 +1642,11 @@ * No interface attached yet. */ error = EINVAL; - SDT_PROBE2(bpf, functions, bpfioctl_biocgtrxqmask, entry, -1, -1); break; } if (!d->bd_qmask.qm_enabled) { log(LOG_ERR, "!d->bd_qmask.qm_enabled\n"); error = EINVAL; - SDT_PROBE2(bpf, functions, bpfioctl_biocgtrxqmask, entry, -1, -1); break; } ifp = d->bd_bif->bif_ifp; @@ -1692,11 +1654,9 @@ if (index > ifp->if_get_rxqueue_len(ifp)) { log(LOG_ERR, "BIOCGTRXQMASK: index too large index:%x rxq_num:%x\n", index, ifp->if_get_rxqueue_len(ifp)); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocgtrxqmask, entry, -1); break; } *(uint32_t *)addr = d->bd_qmask.qm_rxq_mask[index]; - SDT_PROBE2(bpf, functions, bpfioctl_biocgtrxqmask, entry, index, d->bd_qmask.qm_rxq_mask[index]); break; } @@ -1711,13 +1671,11 @@ * No interface attached yet. */ error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocsttxqmask, entry, -1); break; } if (!d->bd_qmask.qm_enabled) { log(LOG_ERR, "!d->bd_qmask.qm_enabled\n"); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocsttxqmask, entry, -1); break; } @@ -1726,11 +1684,9 @@ if (index > ifp->if_get_txqueue_len(ifp)) { log(LOG_ERR, "BIOCSTTXQMASK: index too large index:%x txq_num:%x\n", index, ifp->if_get_txqueue_len(ifp)); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_biocsttxqmask, entry, -1); break; } d->bd_qmask.qm_txq_mask[index] = TRUE; - SDT_PROBE1(bpf, functions, bpfioctl_biocsttxqmask, entry, index); break; } @@ -1745,13 +1701,11 @@ * No interface attached yet. */ error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_bioccrtxqmask, entry, -1); break; } if (!d->bd_qmask.qm_enabled) { log(LOG_ERR, "!d->bd_qmask.qm_enabled\n"); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_bioccrtxqmask, entry, -1); break; } @@ -1760,11 +1714,9 @@ if (index > ifp->if_get_txqueue_len(ifp)) { log(LOG_ERR, "BIOCCRTXQMASK: index too large index:%x txq_num:%x\n", index, ifp->if_get_txqueue_len(ifp)); error = EINVAL; - SDT_PROBE1(bpf, functions, bpfioctl_bioccrtxqmask, entry, -1); break; } d->bd_qmask.qm_txq_mask[index] = FALSE; - SDT_PROBE1(bpf, functions, bpfioctl_bioccrtxqmask, entry, index); break; } @@ -1779,13 +1731,11 @@ * No interface attached yet. */ error = EINVAL; - SDT_PROBE2(bpf, functions, bpfioctl_biocgttxqmask, entry, -1, -1); break; } if (!d->bd_qmask.qm_enabled) { log(LOG_ERR, "!d->bd_qmask.qm_enabled\n"); error = EINVAL; - SDT_PROBE2(bpf, functions, bpfioctl_biocgttxqmask, entry, -1, -1); break; } ifp = d->bd_bif->bif_ifp; @@ -1793,27 +1743,22 @@ if (index > ifp->if_get_txqueue_len(ifp)) { log(LOG_ERR, "BIOCGTTXQMASK: index too large index:%x txq_num:%x\n", index, ifp->if_get_txqueue_len(ifp)); error = EINVAL; - SDT_PROBE2(bpf, functions, bpfioctl_biocgttxqmask, entry, -1, -1); break; } *(uint32_t *)addr = d->bd_qmask.qm_txq_mask[index]; - SDT_PROBE2(bpf, functions, bpfioctl_biocgttxqmask, entry, index, d->bd_qmask.qm_txq_mask[index]); break; } case BIOCSTOTHERMASK: d->bd_qmask.qm_other_mask = TRUE; - SDT_PROBE1(bpf, functions, bpfioctl_biocstothermask, entry, 1); break; case BIOCCROTHERMASK: d->bd_qmask.qm_other_mask = FALSE; - SDT_PROBE1(bpf, functions, bpfioctl_bioccrothermask, entry, 0); break; case BIOCGTOTHERMASK: *(uint32_t *)addr = (uint32_t)d->bd_qmask.qm_other_mask; - SDT_PROBE1(bpf, functions, bpfioctl_biocgtothermask, entry, d->bd_qmask.qm_other_mask); break; } CURVNET_RESTORE(); @@ -2122,13 +2067,12 @@ #endif u_int slen; int gottime; - struct rm_priotracker tracker; +// struct rm_priotracker tracker; gottime = BPF_TSTAMP_NONE; BPFIF_RLOCK(bp, &tracker); LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (d->bd_qmask.qm_enabled) { - SDT_PROBE2(bpf, functions, bpf_tap, entry, d, d->bd_qmask.qm_other_mask); if (!d->bd_qmask.qm_other_mask) continue; } @@ -2177,7 +2121,7 @@ #endif u_int pktlen, slen; int gottime; - struct rm_priotracker tracker; +// struct rm_priotracker tracker; /* Skip outgoing duplicate packets. */ if ((m->m_flags & M_PROMISC) != 0 && m->m_pkthdr.rcvif == NULL) { @@ -2189,26 +2133,25 @@ gottime = BPF_TSTAMP_NONE; BPFIF_RLOCK(bp, &tracker); + struct ifnet *ifp = bp->bif_ifp; LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (d->bd_qmask.qm_enabled) { if (!(m->m_flags & M_FLOWID)) { - log(LOG_DEBUG, "m:%p ifp:%p !(m->flags & M_FLOWID)\n", - m, m->m_pkthdr.rcvif); if (!d->bd_qmask.qm_other_mask) continue; } else { - struct ifnet *ifp = bp->bif_ifp; - if (m->m_pkthdr.rxqid != (uint32_t)-1) - KASSERT(m->m_pkthdr.rxqid < ifp->if_get_rxqueue_len(ifp), - ("rxqid is not vaild rxqid:%x rxq_num:%x", - m->m_pkthdr.rxqid, ifp->if_get_rxqueue_len(ifp))); - if (m->m_pkthdr.txqid != (uint32_t)-1) - KASSERT(m->m_pkthdr.txqid < ifp->if_get_txqueue_len(ifp), - ("txqid is not vaild txqid:%x txq_num:%x", - m->m_pkthdr.txqid, ifp->if_get_txqueue_len(ifp))); - - SDT_PROBE3(bpf, functions, bpf_mtap_rx, entry, d, m->m_pkthdr.rxqid, ifp->if_get_rxqueue_len(ifp)); - SDT_PROBE3(bpf, functions, bpf_mtap_tx, entry, d, m->m_pkthdr.txqid, ifp->if_get_txqueue_len(ifp)); + log(LOG_DEBUG, "%s: ifp->if_get_rxqueue_len:%p\n", __func__, ifp->if_get_rxqueue_len); + if (m->m_pkthdr.rxqid != (uint32_t)-1 && m->m_pkthdr.rxqid >= ifp->if_get_rxqueue_len(ifp)) { + log(LOG_DEBUG, "rxqid is not vaild rxqid:%x rxq_num:%x\n", m->m_pkthdr.rxqid, ifp->if_get_rxqueue_len(ifp)); + BPFIF_RUNLOCK(bp, &tracker); + return; + } + log(LOG_DEBUG, "%s: ifp->if_get_txqueue_len:%p\n", __func__, ifp->if_get_txqueue_len); + if (m->m_pkthdr.txqid != (uint32_t)-1 && m->m_pkthdr.txqid >= ifp->if_get_txqueue_len(ifp)) { + log(LOG_DEBUG, "txqid is not vaild txqid:%x txq_num:%x\n", m->m_pkthdr.txqid, ifp->if_get_txqueue_len(ifp)); + BPFIF_RUNLOCK(bp, &tracker); + return; + } if (m->m_pkthdr.rxqid != (uint32_t)-1 && !d->bd_qmask.qm_rxq_mask[m->m_pkthdr.rxqid]) continue; @@ -2256,7 +2199,7 @@ struct bpf_d *d; u_int pktlen, slen; int gottime; - struct rm_priotracker tracker; +// struct rm_priotracker tracker; /* Skip outgoing duplicate packets. */ if ((m->m_flags & M_PROMISC) != 0 && m->m_pkthdr.rcvif == NULL) { @@ -2279,10 +2222,6 @@ BPFIF_RLOCK(bp, &tracker); LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (d->bd_qmask.qm_enabled) { - struct ifnet *ifp = bp->bif_ifp; - SDT_PROBE3(bpf, functions, bpf_mtap2_rx, entry, d, m->m_pkthdr.rxqid, ifp->if_get_rxqueue_len(ifp)); - SDT_PROBE3(bpf, functions, bpf_mtap2_tx, entry, d, m->m_pkthdr.txqid, ifp->if_get_txqueue_len(ifp)); - if (m->m_pkthdr.rxqid != (uint32_t)-1 && !d->bd_qmask.qm_rxq_mask[m->m_pkthdr.rxqid]) continue; @@ -2732,7 +2671,7 @@ { struct bpf_if *bp; struct bpf_d *bd; - struct rm_priotracker tracker; +// struct rm_priotracker tracker; mtx_lock(&bpf_mtx); LIST_FOREACH(bp, &bpf_iflist, bif_next) { @@ -2790,7 +2729,7 @@ int index, error; struct bpf_if *bp; struct bpf_d *bd; - struct rm_priotracker tracker; +// struct rm_priotracker tracker; /* * XXX This is not technically correct. It is possible for non ==== //depot/projects/soc2011/mq_bpf/src/sys/net/bpfdesc.h#5 (text+ko) ==== @@ -153,11 +153,11 @@ }; #define BPFIF_LOCK_INIT(bif, d) \ - rm_init_flags(&(bif)->bif_lock, (d), RM_NOWITNESS | RM_RECURSE); -#define BPFIF_LOCK_DESTROY(bif) rm_destroy(&(bif)->bif_lock) -#define BPFIF_RLOCK(bif, tracker) rm_rlock(&(bif)->bif_lock, tracker) -#define BPFIF_RUNLOCK(bif, tracker) rm_runlock(&(bif)->bif_lock, tracker) -#define BPFIF_WLOCK(bif) rm_wlock(&(bif)->bif_lock) -#define BPFIF_WUNLOCK(bif) rm_wunlock(&(bif)->bif_lock) + mtx_init(&(bif)->bif_lock, (d), "bpf if lock", MTX_DEF); +#define BPFIF_LOCK_DESTROY(bif) mtx_destroy(&(bif)->bif_lock) +#define BPFIF_RLOCK(bif, tracker) mtx_lock(&(bif)->bif_lock) +#define BPFIF_RUNLOCK(bif, tracker) mtx_unlock(&(bif)->bif_lock) +#define BPFIF_WLOCK(bif) mtx_lock(&(bif)->bif_lock) +#define BPFIF_WUNLOCK(bif) mtx_unlock(&(bif)->bif_lock) #endif ==== //depot/projects/soc2011/mq_bpf/src/sys/net/if.c#6 (text+ko) ==== @@ -2433,9 +2433,8 @@ (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE))) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_affinity, ("if_get_rxqueue_affinity not set")); - log(LOG_DEBUG, "%s: SIOCGIFRXQAFFINITY ifr_queue_affinity_index:%d\n", __func__, ifr->ifr_queue_affinity_index); - ifr->ifr_queue_affinity_cpu = ifp->if_get_rxqueue_affinity(ifp, ifr->ifr_queue_affinity_index); - log(LOG_DEBUG, "%s: SIOCGIFRXQAFFINITY ifr_queue_affinity_cpu:%d\n", __func__, ifr->ifr_queue_affinity_cpu); + ifr->ifr_queue_affinity_cpu = + ifp->if_get_rxqueue_affinity(ifp, ifr->ifr_queue_affinity_index); break; case SIOCGIFTXQAFFINITY: @@ -2443,9 +2442,8 @@ (IFCAP_MULTIQUEUE | IFCAP_SOFT_MULTIQUEUE))) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_affinity, ("if_get_rxqueue_affinity not set")); - log(LOG_DEBUG, "%s: SIOCGIFTXQAFFINITY ifr_queue_affinity_index:%d\n", __func__, ifr->ifr_queue_affinity_index); - ifr->ifr_queue_affinity_cpu = ifp->if_get_rxqueue_affinity(ifp, ifr->ifr_queue_affinity_index); - log(LOG_DEBUG, "%s: SIOCGIFTXQAFFINITY ifr_queue_affinity_cpu:%d\n", __func__, ifr->ifr_queue_affinity_cpu); + ifr->ifr_queue_affinity_cpu = + ifp->if_get_rxqueue_affinity(ifp, ifr->ifr_queue_affinity_index); break; default: ==== //depot/projects/soc2011/mq_bpf/src/sys/net/if_ethersubr.c#6 (text+ko) ==== @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -453,6 +454,7 @@ #ifdef SOFTRSS if (ifp->if_capenable & IFCAP_SOFT_MULTIQUEUE) { + log(LOG_DEBUG, "%s SOFTRSS setting txqid:0\n", __func__); m->m_pkthdr.rxqid = (uint32_t)-1; m->m_pkthdr.txqid = 0; } @@ -1061,17 +1063,13 @@ if_printf(ifp, "Ethernet address: %6D\n", lla, ":"); #ifdef SOFTRSS - printf("%s: SOFTRSS if:%s\n", __func__, ifp->if_xname); if (!(ifp->if_capabilities & IFCAP_MULTIQUEUE)) { - printf("%s: !IFCAP_MULTIQUEUE if:%s\n", __func__, ifp->if_xname); ifp->if_capabilities |= IFCAP_SOFT_MULTIQUEUE; ifp->if_capenable |= IFCAP_SOFT_MULTIQUEUE; ifp->if_get_rxqueue_len = softrss_get_rxqueue_len; ifp->if_get_txqueue_len = softrss_get_txqueue_len; ifp->if_get_rxqueue_affinity = softrss_get_rxqueue_affinity; ifp->if_get_txqueue_affinity = softrss_get_txqueue_affinity; - }else{ - printf("%s: IFCAP_MULTIQUEUE if:%s\n", __func__, ifp->if_xname); } #endif } ==== //depot/projects/soc2011/mq_bpf/src/sys/netinet/in_rss.c#3 (text+ko) ==== @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" -#include "opt_kdtrace.h" #include "opt_rss.h" #include @@ -438,6 +437,7 @@ case M_HASHTYPE_RSS_TCP_IPV4: *cpuid = rss_getcpu(rss_getbucket(m->m_pkthdr.flowid)); #ifdef SOFTRSS + log(LOG_DEBUG, "%s SOFTRSS set rxqid:%d\n", __func__, *cpuid); m->m_pkthdr.rxqid = *cpuid; m->m_pkthdr.txqid = (uint32_t)-1; SDT_PROBE2(rss, functions, rss_m2cpuid, entry, m->m_pkthdr.rxqid, m->m_pkthdr.txqid); @@ -447,6 +447,7 @@ default: *cpuid = NETISR_CPUID_NONE; #ifdef SOFTRSS + log(LOG_DEBUG, "%s SOFTRSS set rxqid:%d\n", __func__, *cpuid); m->m_pkthdr.rxqid = curcpu; m->m_pkthdr.txqid = (uint32_t)-1; SDT_PROBE2(rss, functions, rss_m2cpuid, entry, m->m_pkthdr.rxqid, m->m_pkthdr.txqid); ==== //depot/projects/soc2011/mq_bpf/tests/Makefile#3 (text+ko) ==== @@ -1,10 +1,16 @@ TARGETS = test_ifqueue test_sqbpf test_mqbpf CFLAGS = -Wall -Werror -g -test_mqbpf: - $(CC) $(CFLAGS) -lpthread -o $@ test_mqbpf.c +all: $(TARGETS) + +test_mqbpf: test_mqbpf.c + $(CC) $(CFLAGS) -lpthread -o $@ $< + +test_sqbpf: test_sqbpf.c + $(CC) $(CFLAGS) -o $@ $< -all: $(TARGETS) +test_ifqueue: test_ifqueue.c + $(CC) $(CFLAGS) -o $@ $< clean: rm -f $(TARGETS) *.o ==== //depot/projects/soc2011/mq_bpf/tests/test_mqbpf.c#2 (text+ko) ==== @@ -64,6 +64,7 @@ #include #include #include +#include #define CAP_FORMAT "cap.dat.%d" #define BPF_FORMAT "/dev/bpf%d" @@ -78,9 +79,14 @@ int queue; int cpu; cpuset_t cpuset; + int fd; + int wrote; }; -char *ifname = NULL; +static char *ifname = NULL; +static struct bpf_thread_instance *instances; +static int rxqlen, txqlen; +static struct timeval start; int bpf_thread(struct bpf_thread_instance *instance) { @@ -91,13 +97,9 @@ int rbuf_offset = 0; int rbuf_len = 0; int length = 0; - int wrote = 0; struct bpf_hdr *hdr; - struct timeval start, curr; - time_t sec; struct ifreq ifr; - printf("%d:%d ifname:%s\n", instance->type, instance->queue, ifname); ifr.ifr_addr.sa_family = AF_LOCAL; strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); @@ -108,10 +110,10 @@ sizeof(cpuset_t), &instance->cpuset); } snprintf(filename, sizeof(filename), CAP_FORMAT, instance->queue); - int fd = open(filename, O_RDWR | O_CREAT); - if (fd < 0) { + instance->fd = open(filename, O_RDWR | O_CREAT); + if (instance->fd < 0) { perror("open"); - return fd; + return instance->fd; } /* Open a BPF device */ for (b = 0; 1; b++) { @@ -180,19 +182,9 @@ break; } - gettimeofday(&start, NULL); + instance->wrote = 0; - /* - * All this complexity is because BPF doesn't guarantee that - * only one packet will be returned at a time. We're getting - * what we deserve, though - this is a terrible abuse of the BPF - * interface. Sigh. - */ - - /* Process packets until we get one we can return or until we've - * done a read and gotten nothing we can return... - */ - do { + while(1) { /* If the buffer is empty, fill it. */ if (rbuf_offset >= rbuf_len) { length = read(bpf, rbuf, @@ -246,30 +238,54 @@ continue; } - struct ether_header *eh = (struct ether_header *)(rbuf + rbuf_offset); - printf("%d:%d type:%x\n", - instance->type, instance->queue, eh->ether_type); /* Copy out the data in the packet... */ - write(fd, rbuf + rbuf_offset, hdr->bh_caplen); - wrote += hdr->bh_caplen; + write(instance->fd, rbuf + rbuf_offset, hdr->bh_caplen); + instance->wrote += hdr->bh_caplen; rbuf_offset = BPF_WORDALIGN(rbuf_offset + hdr->bh_caplen); - gettimeofday(&curr, NULL); - sec = curr.tv_sec - start.tv_sec; - } while (sec < 60); + } + return 0; +} + +static void timer_handler(int arg) +{ + struct timeval curr; + time_t sec; + int i, ret; + int wrote = 0; + + for (i = 0; i < (rxqlen + txqlen + 1); i++) { + pthread_cancel(instances[i].thread); + pthread_join(instances[i].thread, (void **)&ret); + wrote += instances[i].wrote; + } + gettimeofday(&curr, NULL); + sec = curr.tv_sec - start.tv_sec; wrote /= (1024 * 1024); printf("sec:%ld wrote:%d MB thoughput:%f MB/s\n", sec, wrote, (double)wrote / (double)sec); - close(fd); - return 0; + exit(0); } int main(int argc, char **argv) { struct ifreq ifr; - struct bpf_thread_instance *instances; - int i, j, rxqlen, txqlen, s; + int i, j, s, ret; + struct sigaction action = { + .sa_handler = timer_handler, + .sa_flags = 0 + }; + struct itimerval timer = { + .it_interval = { + .tv_sec = 0, + .tv_usec = 0 + }, + .it_value = { + .tv_sec = 60, + .tv_usec = 0 + } + }; if (argc < 2) { printf("usage: %s [ifname]\n", argv[0]); @@ -293,6 +309,18 @@ txqlen = ifr.ifr_txqueue_len; instances = (struct bpf_thread_instance *) malloc(sizeof(struct bpf_thread_instance) * (rxqlen + txqlen + 1)); + + sigemptyset(&action.sa_mask); + if (sigaction(SIGALRM, &action, NULL) < 0) { + perror("sigaction"); + return -1; + } + if (setitimer(ITIMER_REAL, &timer, NULL) < 0) { + perror("setitimer"); + return -1; + } + + gettimeofday(&start, NULL); for (i = 0; i < rxqlen; i++) { instances[i].type = QUEUE_TYPE_RX; instances[i].queue = ifr.ifr_queue_affinity_index = i; @@ -319,8 +347,10 @@ instances[j].queue = 1; pthread_create(&instances[j].thread, NULL, (void *(*)(void *))bpf_thread, &instances[j]); - for (i = 0; i < rxqlen; i++) { - pthread_join(instances[i].thread, NULL); + + for (i = 0; i < (rxqlen + txqlen + 1); i++) { + pthread_join(instances[i].thread, (void **)&ret); } + return 0; } ==== //depot/projects/soc2011/mq_bpf/tests/test_sqbpf.c#3 (text+ko) ==== @@ -61,9 +61,28 @@ #include #include #include +#include #define BPF_FORMAT "/dev/bpf%d" +static struct timeval start; +static int fd; +static int wrote = 0; + +static void timer_handler(int arg) +{ + struct timeval curr; + time_t sec; + + gettimeofday(&curr, NULL); + sec = curr.tv_sec - start.tv_sec; + wrote /= (1024 * 1024); + printf("sec:%ld wrote:%d MB thoughput:%f MB/s\n", + sec, wrote, (double)wrote / (double)sec); + close(fd); + exit(0); +} + int main(int argc, char **argv) { char filename[50]; @@ -73,17 +92,28 @@ int rbuf_offset = 0; int rbuf_len = 0; int length = 0; - int wrote = 0; struct bpf_hdr *hdr; struct ifreq ifr; - struct timeval start, curr; - time_t sec; + struct sigaction action = { + .sa_handler = timer_handler, + .sa_flags = 0 + }; + struct itimerval timer = { + .it_interval = { + .tv_sec = 0, + .tv_usec = 0 + }, + .it_value = { + .tv_sec = 60, + .tv_usec = 0 + } + }; if (argc < 2) { printf("usage: %s [ifname]\n", argv[0]); return -1; } - int fd = open("cap.dat", O_RDWR | O_CREAT); + fd = open("cap.dat", O_RDWR | O_CREAT); if (fd < 0) { perror("open"); return fd; @@ -132,19 +162,18 @@ return -1; } + sigemptyset(&action.sa_mask); + if (sigaction(SIGALRM, &action, NULL) < 0) { + perror("sigaction"); + return -1; + } + if (setitimer(ITIMER_REAL, &timer, NULL) < 0) { + perror("setitimer"); + return -1; + } gettimeofday(&start, NULL); - /* - * All this complexity is because BPF doesn't guarantee that - * only one packet will be returned at a time. We're getting - * what we deserve, though - this is a terrible abuse of the BPF - * interface. Sigh. - */ - - /* Process packets until we get one we can return or until we've - * done a read and gotten nothing we can return... - */ - do { + while(1) { /* If the buffer is empty, fill it. */ if (rbuf_offset >= rbuf_len) { length = read(bpf, rbuf, @@ -204,12 +233,6 @@ rbuf_offset = BPF_WORDALIGN(rbuf_offset + hdr->bh_caplen); - gettimeofday(&curr, NULL); - sec = curr.tv_sec - start.tv_sec; - } while (sec < 60); - wrote /= (1024 * 1024); - printf("sec:%ld wrote:%d MB thoughput:%f MB/s\n", - sec, wrote, (double)wrote / (double)sec); - close(fd); + } return 0; } From owner-p4-projects@FreeBSD.ORG Fri Jul 15 22:31:39 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0FAAC1065674; Fri, 15 Jul 2011 22:31:39 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6E4A1065672 for ; Fri, 15 Jul 2011 22:31:38 +0000 (UTC) (envelope-from syuu@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id B49318FC12 for ; Fri, 15 Jul 2011 22:31:38 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6FMVcqn047976 for ; Fri, 15 Jul 2011 22:31:38 GMT (envelope-from syuu@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6FMVcj8047973 for perforce@freebsd.org; Fri, 15 Jul 2011 22:31:38 GMT (envelope-from syuu@FreeBSD.org) Date: Fri, 15 Jul 2011 22:31:38 GMT Message-Id: <201107152231.p6FMVcj8047973@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to syuu@FreeBSD.org using -f From: Takuya ASADA To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196221 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 22:31:39 -0000 http://p4web.freebsd.org/@@196221?ac=10 Change 196221 by syuu@kikurage on 2011/07/15 22:30:44 test_mqbpf bug fix Affected files ... .. //depot/projects/soc2011/mq_bpf/tests/test_mqbpf.c#3 edit Differences ... ==== //depot/projects/soc2011/mq_bpf/tests/test_mqbpf.c#3 (text+ko) ==== @@ -66,7 +66,7 @@ #include #include -#define CAP_FORMAT "cap.dat.%d" +#define CAP_FORMAT "cap.dat.%d.%d" #define BPF_FORMAT "/dev/bpf%d" #define QUEUE_TYPE_RX 0 @@ -109,7 +109,7 @@ cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, sizeof(cpuset_t), &instance->cpuset); } - snprintf(filename, sizeof(filename), CAP_FORMAT, instance->queue); + snprintf(filename, sizeof(filename), CAP_FORMAT, instance->type, instance->queue); instance->fd = open(filename, O_RDWR | O_CREAT); if (instance->fd < 0) { perror("open");