From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 00:33:57 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 655B11065674; Sun, 6 Jun 2010 00:33:57 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 26A638FC08; Sun, 6 Jun 2010 00:33:56 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 2284873098; Sun, 6 Jun 2010 02:44:29 +0200 (CEST) Date: Sun, 6 Jun 2010 02:44:29 +0200 From: Luigi Rizzo To: Randall Stewart Message-ID: <20100606004429.GC56080@onelab2.iet.unipi.it> References: <201006052139.o55LdrBK045695@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201006052139.o55LdrBK045695@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208857 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 00:33:57 -0000 On Sat, Jun 05, 2010 at 09:39:53PM +0000, Randall Stewart wrote: > Author: rrs > Date: Sat Jun 5 21:39:52 2010 > New Revision: 208857 > URL: http://svn.freebsd.org/changeset/base/208857 > > Log: > Purge out a Windows def that somehow slipped > past the scrubber. i wonder if it makes sense to scrub away the code for other OS. While I understand the rationale, seeing the whole code might have several advantages: - understand the constraints that other OS impose; - learn what APIs are available in other OS; - teach people how to write portable code; cheers luigi From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 00:54:10 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C22D1065673; Sun, 6 Jun 2010 00:54:10 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:213:d4ff:fef3:2d8d]) by mx1.freebsd.org (Postfix) with ESMTP id BC3F78FC1D; Sun, 6 Jun 2010 00:54:09 +0000 (UTC) Received: from [192.168.2.108] (pool-96-238-218-232.snfcca.dsl-w.verizon.net [96.238.218.232]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id o560s1jY057412 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 5 Jun 2010 20:54:07 -0400 (EDT) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1275785648; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=a2OdwFsoIRHi5t1SMR1bTadBj8Ob3QjAvskCHYEKF90Ue9kDC3jwpNW sH95fvDMWKSmnpjx18ncs5zZDLzoSAg== Message-Id: <3A129572-D7A0-4211-AB71-21C808981C37@lakerest.net> From: Randall Stewart To: Luigi Rizzo In-Reply-To: <20100606004429.GC56080@onelab2.iet.unipi.it> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Sat, 5 Jun 2010 17:53:55 -0700 References: <201006052139.o55LdrBK045695@svn.freebsd.org> <20100606004429.GC56080@onelab2.iet.unipi.it> X-Mailer: Apple Mail (2.936) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208857 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 00:54:10 -0000 Luigi: We on the SCTP team ;-) have always worked under the constraint of "scrubbing out" with un-ifdef loads of stuff for - Windows - MacOS-X - User-Space Implementation - Panda (translated IOS-XR) Now there is a HUGE amount of cruft that has some ugly ifdef's in it which I was told way back was a no-no.... (I was also told unifdef is your friend ;-D) Anyway.. I would be more than glad to bring back the "full" code if folks would all agree.. it actually makes it a lot easier when you are debugging to have the precise line number instead of working between two worlds ;-) But of course we would have to get agreement from quite a few folks... but I am game ;-) R On Jun 5, 2010, at 5:44 PM, Luigi Rizzo wrote: > On Sat, Jun 05, 2010 at 09:39:53PM +0000, Randall Stewart wrote: >> Author: rrs >> Date: Sat Jun 5 21:39:52 2010 >> New Revision: 208857 >> URL: http://svn.freebsd.org/changeset/base/208857 >> >> Log: >> Purge out a Windows def that somehow slipped >> past the scrubber. > > i wonder if it makes sense to scrub away the code for other OS. > While I understand the rationale, seeing the whole code might have > several advantages: > - understand the constraints that other OS impose; > - learn what APIs are available in other OS; > - teach people how to write portable code; > > cheers > luigi > ------------------------------ Randall Stewart 803-317-4952 (cell) From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 01:10:02 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C94451065672; Sun, 6 Jun 2010 01:10:02 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 8BCC18FC13; Sun, 6 Jun 2010 01:10:02 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 94816730A1; Sun, 6 Jun 2010 03:20:34 +0200 (CEST) Date: Sun, 6 Jun 2010 03:20:34 +0200 From: Luigi Rizzo To: Randall Stewart Message-ID: <20100606012034.GA56426@onelab2.iet.unipi.it> References: <201006052139.o55LdrBK045695@svn.freebsd.org> <20100606004429.GC56080@onelab2.iet.unipi.it> <3A129572-D7A0-4211-AB71-21C808981C37@lakerest.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3A129572-D7A0-4211-AB71-21C808981C37@lakerest.net> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208857 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 01:10:02 -0000 On Sat, Jun 05, 2010 at 05:53:55PM -0700, Randall Stewart wrote: > Luigi: > > We on the SCTP team ;-) have always worked under the > constraint of "scrubbing out" with un-ifdef loads of stuff for > > - Windows > - MacOS-X > - User-Space Implementation > - Panda (translated IOS-XR) > > Now there is a HUGE amount of cruft that has some ugly ifdef's in it > which > I was told way back was a no-no.... (I was also told unifdef is your > friend ;-D) > > Anyway.. I would be more than glad to bring back the "full" code if > folks would all agree.. it actually makes it a lot easier when you > are debugging to have the precise line number instead of working between > two worlds ;-) > > But of course we would have to get agreement from quite a few folks... > but > I am game ;-) as a data point, i went through a similar problem when i ported ipfw+dummynet to linux and windows, and as you can see from the code in HEAD, the amount of OS-dependent code in the common files is minimal (much much less than in the first versions). Being ashamed of committing large #ifdef sections was a big motivator for trying to pack os-dependent parts in os-specific files and leave the core as clean as possible In the case of SCTP, i don't think anyone but the SCTP team would put hands or think of modifying the code, so if FreeBSD trusts your code (which obviously is the case), and as long as there no licensing issues (this is something you can tell us) I don't see why people should object on having the unscrubbed code. cheers luigi > R > On Jun 5, 2010, at 5:44 PM, Luigi Rizzo wrote: > > >On Sat, Jun 05, 2010 at 09:39:53PM +0000, Randall Stewart wrote: > >>Author: rrs > >>Date: Sat Jun 5 21:39:52 2010 > >>New Revision: 208857 > >>URL: http://svn.freebsd.org/changeset/base/208857 > >> > >>Log: > >> Purge out a Windows def that somehow slipped > >> past the scrubber. > > > >i wonder if it makes sense to scrub away the code for other OS. > >While I understand the rationale, seeing the whole code might have > >several advantages: > >- understand the constraints that other OS impose; > >- learn what APIs are available in other OS; > >- teach people how to write portable code; > > > >cheers > >luigi > > > > ------------------------------ > Randall Stewart > 803-317-4952 (cell) From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 02:32:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87AE21065672; Sun, 6 Jun 2010 02:32:20 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 765678FC0A; Sun, 6 Jun 2010 02:32:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o562WKvI009966; Sun, 6 Jun 2010 02:32:20 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o562WKHs009964; Sun, 6 Jun 2010 02:32:20 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006060232.o562WKHs009964@svn.freebsd.org> From: Randall Stewart Date: Sun, 6 Jun 2010 02:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208863 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 02:32:20 -0000 Author: rrs Date: Sun Jun 6 02:32:20 2010 New Revision: 208863 URL: http://svn.freebsd.org/changeset/base/208863 Log: Bruce's fix for some return's in error legs. MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Jun 5 23:29:24 2010 (r208862) +++ head/sys/netinet/sctp_usrreq.c Sun Jun 6 02:32:20 2010 (r208863) @@ -4678,6 +4678,8 @@ sctp_accept(struct socket *so, struct so struct sockaddr_in *sin; SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); sin->sin_port = ((struct sockaddr_in *)&store)->sin_port; @@ -4691,6 +4693,8 @@ sctp_accept(struct socket *so, struct so struct sockaddr_in6 *sin6; SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6); + if (sin6 == NULL) + return (ENOMEM); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sin6->sin6_port = ((struct sockaddr_in6 *)&store)->sin6_port; @@ -4756,6 +4760,8 @@ sctp_ingetaddr(struct socket *so, struct * Do the malloc first in case it blocks. */ SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); inp = (struct sctp_inpcb *)so->so_pcb; @@ -4858,6 +4864,8 @@ sctp_peeraddr(struct socket *so, struct return (ENOTCONN); } SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 02:33:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 514B21065677; Sun, 6 Jun 2010 02:33:47 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FC928FC14; Sun, 6 Jun 2010 02:33:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o562Xl2Y010337; Sun, 6 Jun 2010 02:33:47 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o562XlOs010335; Sun, 6 Jun 2010 02:33:47 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006060233.o562XlOs010335@svn.freebsd.org> From: Randall Stewart Date: Sun, 6 Jun 2010 02:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208864 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 02:33:47 -0000 Author: rrs Date: Sun Jun 6 02:33:46 2010 New Revision: 208864 URL: http://svn.freebsd.org/changeset/base/208864 Log: Hopefully this fixes a LOR by making so we only hold the iterator lock during updates to the iterators work. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jun 6 02:32:20 2010 (r208863) +++ head/sys/netinet/sctp_pcb.c Sun Jun 6 02:33:46 2010 (r208864) @@ -2296,7 +2296,7 @@ sctp_inpcb_alloc(struct socket *so, uint if (inp->sctp_asocidhash == NULL) { SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_INP_INFO_WUNLOCK(); - return error; + return (ENOBUFS); } #ifdef IPSEC { @@ -3107,29 +3107,13 @@ sctp_inpcb_free(struct sctp_inpcb *inp, #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 0); #endif - SCTP_ITERATOR_LOCK(); - - so = inp->sctp_socket; - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { - /* been here before.. eeks.. get out of here */ - SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); - SCTP_ITERATOR_UNLOCK(); -#ifdef SCTP_LOG_CLOSING - sctp_log_closing(inp, NULL, 1); -#endif - return; - } - SCTP_ASOC_CREATE_LOCK(inp); - SCTP_INP_INFO_WLOCK(); - - SCTP_INP_WLOCK(inp); - /* First time through we have the socket lock, after that no more. */ if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { /* * Once we are in we can remove the flag from = 1 is only * passed from the actual closing routines that are called * via the sockets layer. */ + SCTP_ITERATOR_LOCK(); inp->sctp_flags &= ~SCTP_PCB_FLAGS_CLOSE_IP; /* socket is gone, so no more wakeups allowed */ inp->sctp_flags |= SCTP_PCB_FLAGS_DONT_WAKE; @@ -3138,7 +3122,22 @@ sctp_inpcb_free(struct sctp_inpcb *inp, /* mark any iterators on the list or being processed */ sctp_iterator_inp_being_freed(inp); + SCTP_ITERATOR_UNLOCK(); + } + so = inp->sctp_socket; + if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { + /* been here before.. eeks.. get out of here */ + SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); +#ifdef SCTP_LOG_CLOSING + sctp_log_closing(inp, NULL, 1); +#endif + return; } + SCTP_ASOC_CREATE_LOCK(inp); + SCTP_INP_INFO_WLOCK(); + + SCTP_INP_WLOCK(inp); + /* First time through we have the socket lock, after that no more. */ sctp_timer_stop(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL, SCTP_FROM_SCTP_PCB + SCTP_LOC_1); @@ -3338,7 +3337,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 2); #endif @@ -3416,7 +3414,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 3); #endif @@ -3428,7 +3425,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 4); #endif @@ -3550,7 +3546,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_READ_DESTROY(inp); SCTP_ASOC_CREATE_LOCK_DESTROY(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_DECR_EP_COUNT(); } From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 06:07:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C6521065670; Sun, 6 Jun 2010 06:07:45 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52D928FC1C; Sun, 6 Jun 2010 06:07:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5667jrf057142; Sun, 6 Jun 2010 06:07:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5667iVD057140; Sun, 6 Jun 2010 06:07:44 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006060607.o5667iVD057140@svn.freebsd.org> From: Alan Cox Date: Sun, 6 Jun 2010 06:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208866 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 06:07:45 -0000 Author: alc Date: Sun Jun 6 06:07:44 2010 New Revision: 208866 URL: http://svn.freebsd.org/changeset/base/208866 Log: Don't set PG_WRITEABLE in init_pte_prot() (and thus pmap_enter()) unless the page is managed. Don't set the machine-independent layer's dirty field for the page being mapped in init_pte_prot(). (The dirty field is only supposed to set when a mapping is removed or write-protected and the page was managed and modified.) Determine whether or not to perform dirty bit emulation based on whether or not the page is managed, i.e., pageable, not based on whether the page is being mapped into the kernel address space. Nearly all of the kernel address space consists of unmanaged pages, so this has neglible impact on the overhead of dirty bit emulation for the kernel address space. However, there can also exist unmanaged pages in the user address space. Previously, dirty bit emulation was unnecessarily performed on these pages. Tested by: jchandra@ Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sun Jun 6 02:36:51 2010 (r208865) +++ head/sys/mips/mips/pmap.c Sun Jun 6 06:07:44 2010 (r208866) @@ -3072,26 +3072,20 @@ page_is_managed(vm_offset_t pa) static int init_pte_prot(vm_offset_t va, vm_page_t m, vm_prot_t prot) { - int rw = 0; + int rw; if (!(prot & VM_PROT_WRITE)) rw = PTE_ROPAGE; - else { - if (va >= VM_MIN_KERNEL_ADDRESS) { - /* - * Don't bother to trap on kernel writes, just - * record page as dirty. - */ - rw = PTE_RWPAGE; - vm_page_dirty(m); - } else if ((m->md.pv_flags & PV_TABLE_MOD) || - m->dirty == VM_PAGE_BITS_ALL) + else if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->md.pv_flags & PV_TABLE_MOD) != 0) rw = PTE_RWPAGE; else rw = PTE_CWPAGE; vm_page_flag_set(m, PG_WRITEABLE); - } - return rw; + } else + /* Needn't emulate a modified bit for unmanaged pages. */ + rw = PTE_RWPAGE; + return (rw); } /* From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 11:32:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D61C3106564A; Sun, 6 Jun 2010 11:32:38 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C595E8FC0A; Sun, 6 Jun 2010 11:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56BWcA3028921; Sun, 6 Jun 2010 11:32:38 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56BWcVK028919; Sun, 6 Jun 2010 11:32:38 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201006061132.o56BWcVK028919@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 6 Jun 2010 11:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208867 - head/usr.bin/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 11:32:38 -0000 Author: gabor Date: Sun Jun 6 11:32:38 2010 New Revision: 208867 URL: http://svn.freebsd.org/changeset/base/208867 Log: - Fig segmentation fault Submitted by: Hizel Ildar (via current@) Modified: head/usr.bin/dc/dc.c Modified: head/usr.bin/dc/dc.c ============================================================================== --- head/usr.bin/dc/dc.c Sun Jun 6 06:07:44 2010 (r208866) +++ head/usr.bin/dc/dc.c Sun Jun 6 11:32:38 2010 (r208867) @@ -87,12 +87,16 @@ main(int argc, char *argv[]) while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) { switch (ch) { case 'e': + if(!preproc_done) + init_bmachine(extended_regs); src_setstring(&src, optarg); reset_bmachine(&src); eval(); preproc_done = true; break; case 'f': + if(!preproc_done) + init_bmachine(extended_regs); procfile(optarg); preproc_done = true; break; @@ -114,7 +118,8 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - init_bmachine(extended_regs); + if (!preproc_done) + init_bmachine(extended_regs); setlinebuf(stdout); setlinebuf(stderr); From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 11:34:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB442106566B; Sun, 6 Jun 2010 11:34:09 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 8E3BA8FC08; Sun, 6 Jun 2010 11:34:09 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id BA6EA14DB8BC; Sun, 6 Jun 2010 13:34:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21oyQayuIhRa; Sun, 6 Jun 2010 13:34:06 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 9BD0514DB8B7; Sun, 6 Jun 2010 13:34:06 +0200 (CEST) Message-ID: <4C0B87D5.9040701@FreeBSD.org> Date: Sun, 06 Jun 2010 13:34:45 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; es-ES; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201006061132.o56BWcVK028919@svn.freebsd.org> In-Reply-To: <201006061132.o56BWcVK028919@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: svn commit: r208867 - head/usr.bin/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 11:34:10 -0000 El 2010. 06. 06. 13:32, Gabor Kovesdan escribió: > Author: gabor > Date: Sun Jun 6 11:32:38 2010 > New Revision: 208867 > URL: http://svn.freebsd.org/changeset/base/208867 > > Log: > - Fig segmentation fault > > Submitted by: Hizel Ildar (via current@) > Approved by: delphij (mentor) -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 11:36:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FDCC1065670; Sun, 6 Jun 2010 11:36:09 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 257678FC0C; Sun, 6 Jun 2010 11:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56Ba9pu029720; Sun, 6 Jun 2010 11:36:09 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56Ba9tr029717; Sun, 6 Jun 2010 11:36:09 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201006061136.o56Ba9tr029717@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 6 Jun 2010 11:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208868 - in head/usr.bin: bc dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 11:36:09 -0000 Author: gabor Date: Sun Jun 6 11:36:08 2010 New Revision: 208868 URL: http://svn.freebsd.org/changeset/base/208868 Log: - Fix signal handling in bc/dc. Now Ctrl-C terminates the execution. Requested by: gk (via private mail) Approved by: delphij (mentor) Modified: head/usr.bin/bc/scan.l head/usr.bin/dc/bcode.c Modified: head/usr.bin/bc/scan.l ============================================================================== --- head/usr.bin/bc/scan.l Sun Jun 6 11:32:38 2010 (r208867) +++ head/usr.bin/bc/scan.l Sun Jun 6 11:36:08 2010 (r208868) @@ -23,7 +23,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -235,22 +234,6 @@ add_str(const char *str) strlcat(strbuf, str, strbuf_sz); } -/* ARGSUSED */ -void -abort_line(int sig) -{ - static const char str[] = "[\n]P\n"; - int save_errno; - - switch (sig) { - default: - save_errno = errno; - YY_FLUSH_BUFFER; /* XXX signal race? */ - write(STDOUT_FILENO, str, sizeof(str) - 1); - errno = save_errno; - } -} - int yywrap(void) { @@ -288,8 +271,6 @@ yywrap(void) } else if (fileindex == sargc) { fileindex++; yyin = stdin; - if (interactive) - signal(SIGINT, abort_line); lineno = 1; filename = "stdin"; return (0); Modified: head/usr.bin/dc/bcode.c ============================================================================== --- head/usr.bin/dc/bcode.c Sun Jun 6 11:32:38 2010 (r208867) +++ head/usr.bin/dc/bcode.c Sun Jun 6 11:36:08 2010 (r208868) @@ -44,7 +44,6 @@ struct bmachine { struct source *readstack; struct stack *reg; struct stack stack; - volatile sig_atomic_t interrupted; u_int scale; u_int obase; u_int ibase; @@ -55,7 +54,7 @@ struct bmachine { }; static struct bmachine bmachine; -static void sighandler(int); +static void got_sigint(int); static __inline int readch(void); static __inline void unreadch(void); @@ -223,14 +222,11 @@ static const struct jump_entry jump_tabl (sizeof(jump_table_data)/sizeof(jump_table_data[0])) static void -sighandler(int ignored) +got_sigint(int ignored __unused) { - switch (ignored) - { - default: - bmachine.interrupted = true; - } + putchar('\n'); + exit(0); } void @@ -265,7 +261,7 @@ init_bmachine(bool extended_registers) bmachine.obase = bmachine.ibase = 10; BN_init(&zero); bn_check(BN_zero(&zero)); - signal(SIGINT, sighandler); + signal(SIGINT, got_sigint); } /* Reset the things needed before processing a (new) file */ @@ -1746,14 +1742,6 @@ eval(void) bmachine.readsp--; continue; } - if (bmachine.interrupted) { - if (bmachine.readsp > 0) { - src_free(); - bmachine.readsp--; - continue; - } else - bmachine.interrupted = false; - } #ifdef DEBUGGING fprintf(stderr, "# %c\n", ch); stack_print(stderr, &bmachine.stack, "* ", From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 12:00:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E961065670; Sun, 6 Jun 2010 12:00:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 9C4D48FC1D; Sun, 6 Jun 2010 12:00:08 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o56C0HER035704 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 6 Jun 2010 15:00:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o56C046V044084; Sun, 6 Jun 2010 15:00:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o56C04lA044083; Sun, 6 Jun 2010 15:00:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 6 Jun 2010 15:00:04 +0300 From: Kostik Belousov To: Gabor Kovesdan Message-ID: <20100606120004.GH83316@deviant.kiev.zoral.com.ua> References: <201006061136.o56Ba9tr029717@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WRFVI/CrBiF4s7LM" Content-Disposition: inline In-Reply-To: <201006061136.o56Ba9tr029717@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208868 - in head/usr.bin: bc dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 12:00:09 -0000 --WRFVI/CrBiF4s7LM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 06, 2010 at 11:36:09AM +0000, Gabor Kovesdan wrote: > @@ -223,14 +222,11 @@ static const struct jump_entry jump_tabl > (sizeof(jump_table_data)/sizeof(jump_table_data[0])) > =20 > static void > -sighandler(int ignored) > +got_sigint(int ignored __unused) > { > =20 > - switch (ignored) > - { > - default: > - bmachine.interrupted =3D true; > - } > + putchar('\n'); > + exit(0); > } In general, calling not async-signal safe functions from the signal handler is an invitation for undefined behaviour, that usually manifests itself as SIGSEGV and SIGBUS. --WRFVI/CrBiF4s7LM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwLjcMACgkQC3+MBN1Mb4ivNgCgpSTAlwDcw28lxBwdUIqoulUa vpoAoIs9tUG9zJnh3R9iEfcNBniM5JK2 =EjLK -----END PGP SIGNATURE----- --WRFVI/CrBiF4s7LM-- From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 12:14:49 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 906661065674; Sun, 6 Jun 2010 12:14:49 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id DDC7D8FC12; Sun, 6 Jun 2010 12:14:48 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.4/8.14.4) with ESMTP id o56CEkiW082930; Sun, 6 Jun 2010 16:14:46 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1275826486; bh=0blCCcpHfXpl3oUUSu0t/9p/qkX9MsdRcXyN/S8N0i8=; l=1236; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=bvhj+lW8vpbfSYBPhca7Teg6E/aramf2fMKZ7NlY8p6ksiwR/GePEqxzChQWs0bhl k1UYIn1ZOMFSyQWd68B7Fu+VUTf7clfYAO3Tx8pjy4XMshe10blWnamjp5GkspxbB1 qDu0BeKOwFvTtIp9sZQWNrOAKO5bHnQg6E5PXg5g= Received: (from ache@localhost) by nagual.pp.ru (8.14.4/8.14.4/Submit) id o56CEjDE082928; Sun, 6 Jun 2010 16:14:46 +0400 (MSD) (envelope-from ache) Date: Sun, 6 Jun 2010 16:14:45 +0400 From: Andrey Chernov To: Kostik Belousov Message-ID: <20100606121444.GA82819@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Kostik Belousov , Gabor Kovesdan , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201006061136.o56Ba9tr029717@svn.freebsd.org> <20100606120004.GH83316@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: <20100606120004.GH83316@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Gabor Kovesdan Subject: Re: svn commit: r208868 - in head/usr.bin: bc dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 12:14:49 -0000 --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 06, 2010 at 03:00:04PM +0300, Kostik Belousov wrote: > On Sun, Jun 06, 2010 at 11:36:09AM +0000, Gabor Kovesdan wrote: > > @@ -223,14 +222,11 @@ static const struct jump_entry jump_tabl > > (sizeof(jump_table_data)/sizeof(jump_table_data[0])) > > =20 > > static void > > -sighandler(int ignored) > > +got_sigint(int ignored __unused) > > { > > =20 > > - switch (ignored) > > - { > > - default: > > - bmachine.interrupted =3D true; > > - } > > + putchar('\n'); > > + exit(0); > > } > In general, calling not async-signal safe functions from the signal > handler is an invitation for undefined behaviour, that usually manifests > itself as SIGSEGV and SIGBUS. Yes, better use write(2) and _exit(2) here. --=20 http://ache.pp.ru/ --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwLkTQACgkQVg5YK5ZEdN1AdwCgmh3w4ttX7v+kqlLVOeKSBxSu A00AoKDR+1aqTKmR4FVoxt+pVwobUOvO =ZxvZ -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV-- From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 13:08:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36E56106564A; Sun, 6 Jun 2010 13:08:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2406C8FC1F; Sun, 6 Jun 2010 13:08:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56D8abx049840; Sun, 6 Jun 2010 13:08:36 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56D8aRd049837; Sun, 6 Jun 2010 13:08:36 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006061308.o56D8aRd049837@svn.freebsd.org> From: Martin Matuska Date: Sun, 6 Jun 2010 13:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208869 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 13:08:37 -0000 Author: mm Date: Sun Jun 6 13:08:36 2010 New Revision: 208869 URL: http://svn.freebsd.org/changeset/base/208869 Log: MFC r208775: Fix freeing space after deleting large files with holes. OpenSolaris onnv revision: 9950:78fc41aa9bc5 Reviewed by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID 6792701) Approved by: re (kib) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Jun 6 11:36:08 2010 (r208868) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Jun 6 13:08:36 2010 (r208869) @@ -371,56 +371,51 @@ dmu_prefetch(objset_t *os, uint64_t obje dnode_rele(dn, FTAG); } +/* + * Get the next "chunk" of file data to free. We traverse the file from + * the end so that the file gets shorter over time (if we crashes in the + * middle, this will leave us in a better state). We find allocated file + * data by simply searching the allocated level 1 indirects. + */ static int -get_next_chunk(dnode_t *dn, uint64_t *offset, uint64_t limit) +get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t limit) { - uint64_t len = *offset - limit; - uint64_t chunk_len = dn->dn_datablksz * DMU_MAX_DELETEBLKCNT; - uint64_t subchunk = + uint64_t len = *start - limit; + uint64_t blkcnt = 0; + uint64_t maxblks = DMU_MAX_ACCESS / (1ULL << (dn->dn_indblkshift + 1)); + uint64_t iblkrange = dn->dn_datablksz * EPB(dn->dn_indblkshift, SPA_BLKPTRSHIFT); - ASSERT(limit <= *offset); + ASSERT(limit <= *start); - if (len <= chunk_len) { - *offset = limit; + if (len <= iblkrange * maxblks) { + *start = limit; return (0); } + ASSERT(ISP2(iblkrange)); - ASSERT(ISP2(subchunk)); - - while (*offset > limit) { - uint64_t initial_offset = P2ROUNDUP(*offset, subchunk); - uint64_t delta; + while (*start > limit && blkcnt < maxblks) { int err; - /* skip over allocated data */ + /* find next allocated L1 indirect */ err = dnode_next_offset(dn, - DNODE_FIND_HOLE|DNODE_FIND_BACKWARDS, offset, 1, 1, 0); - if (err == ESRCH) - *offset = limit; - else if (err) - return (err); + DNODE_FIND_BACKWARDS, start, 2, 1, 0); - ASSERT3U(*offset, <=, initial_offset); - *offset = P2ALIGN(*offset, subchunk); - delta = initial_offset - *offset; - if (delta >= chunk_len) { - *offset += delta - chunk_len; + /* if there are no more, then we are done */ + if (err == ESRCH) { + *start = limit; return (0); - } - chunk_len -= delta; - - /* skip over unallocated data */ - err = dnode_next_offset(dn, - DNODE_FIND_BACKWARDS, offset, 1, 1, 0); - if (err == ESRCH) - *offset = limit; - else if (err) + } else if (err) { return (err); + } + blkcnt += 1; - if (*offset < limit) - *offset = limit; - ASSERT3U(*offset, <, initial_offset); + /* reset offset to end of "next" block back */ + *start = P2ALIGN(*start, iblkrange); + if (*start <= limit) + *start = limit; + else + *start -= 1; } return (0); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sun Jun 6 11:36:08 2010 (r208868) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sun Jun 6 13:08:36 2010 (r208869) @@ -1239,6 +1239,22 @@ dnode_willuse_space(dnode_t *dn, int64_t dmu_tx_willuse_space(tx, space); } +/* + * This function scans a block at the indicated "level" looking for + * a hole or data (depending on 'flags'). If level > 0, then we are + * scanning an indirect block looking at its pointers. If level == 0, + * then we are looking at a block of dnodes. If we don't find what we + * are looking for in the block, we return ESRCH. Otherwise, return + * with *offset pointing to the beginning (if searching forwards) or + * end (if searching backwards) of the range covered by the block + * pointer we matched on (or dnode). + * + * The basic search algorithm used below by dnode_next_offset() is to + * use this function to search up the block tree (widen the search) until + * we find something (i.e., we don't return ESRCH) and then search back + * down the tree (narrow the search) until we reach our original search + * level. + */ static int dnode_next_offset_level(dnode_t *dn, int flags, uint64_t *offset, int lvl, uint64_t blkfill, uint64_t txg) @@ -1318,6 +1334,7 @@ dnode_next_offset_level(dnode_t *dn, int error = ESRCH; } else { blkptr_t *bp = data; + uint64_t start = *offset; span = (lvl - 1) * epbs + dn->dn_datablkshift; minfill = 0; maxfill = blkfill << ((lvl - 1) * epbs); @@ -1327,18 +1344,25 @@ dnode_next_offset_level(dnode_t *dn, int else minfill++; - for (i = (*offset >> span) & ((1ULL << epbs) - 1); + *offset = *offset >> span; + for (i = BF64_GET(*offset, 0, epbs); i >= 0 && i < epb; i += inc) { if (bp[i].blk_fill >= minfill && bp[i].blk_fill <= maxfill && (hole || bp[i].blk_birth > txg)) break; - if (inc < 0 && *offset < (1ULL << span)) - *offset = 0; - else - *offset += (1ULL << span) * inc; + if (inc > 0 || *offset > 0) + *offset += inc; + } + *offset = *offset << span; + if (inc < 0) { + /* traversing backwards; position offset at the end */ + ASSERT3U(*offset, <=, start); + *offset = MIN(*offset + (1ULL << span) - 1, start); + } else if (*offset < start) { + *offset = start; } - if (i < 0 || i == epb) + if (i < 0 || i >= epb) error = ESRCH; } From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 13:18:42 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80C7D1065673; Sun, 6 Jun 2010 13:18:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 4347C8FC0C; Sun, 6 Jun 2010 13:18:42 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 6A5CD35A85E; Sun, 6 Jun 2010 15:18:41 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 55D15172B1; Sun, 6 Jun 2010 15:18:41 +0200 (CEST) Date: Sun, 6 Jun 2010 15:18:41 +0200 From: Jilles Tjoelker To: Andrey Chernov , Kostik Belousov , Gabor Kovesdan , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20100606131841.GA68034@stack.nl> References: <201006061136.o56Ba9tr029717@svn.freebsd.org> <20100606120004.GH83316@deviant.kiev.zoral.com.ua> <20100606121444.GA82819@nagual.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100606121444.GA82819@nagual.pp.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: svn commit: r208868 - in head/usr.bin: bc dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 13:18:42 -0000 On Sun, Jun 06, 2010 at 04:14:45PM +0400, Andrey Chernov wrote: > On Sun, Jun 06, 2010 at 03:00:04PM +0300, Kostik Belousov wrote: > > On Sun, Jun 06, 2010 at 11:36:09AM +0000, Gabor Kovesdan wrote: > > > @@ -223,14 +222,11 @@ static const struct jump_entry jump_tabl > > > (sizeof(jump_table_data)/sizeof(jump_table_data[0])) > > > static void > > > -sighandler(int ignored) > > > +got_sigint(int ignored __unused) > > > { > > > > > > - switch (ignored) > > > - { > > > - default: > > > - bmachine.interrupted = true; > > > - } > > > + putchar('\n'); > > > + exit(0); > > > } > > In general, calling not async-signal safe functions from the signal > > handler is an invitation for undefined behaviour, that usually manifests > > itself as SIGSEGV and SIGBUS. > Yes, better use write(2) and _exit(2) here. I wonder if a signal handler is necessary at all here. The shell should print a newline after an interruption. This does not appear to work in sh(1) in the (default) interactive job control mode, but works in tcsh, bash and zsh for example. Additionally, an exit status of 0 is wrong because a SIGINT abort is not successful termination. It is best to resend the signal (after setting it to SIG_DFL and unmasking it) so that it looks like if the signal handler hadn't been there. Shells may rely on this to distinguish SIGINTs that caused the command to return to its main loop only and SIGINTs that aborted the entire command: in the latter case any enclosing structure should be aborted too. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 14:09:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7D401065679; Sun, 6 Jun 2010 14:09:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBDF98FC13; Sun, 6 Jun 2010 14:09:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56E9mf8063170; Sun, 6 Jun 2010 14:09:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56E9mWI063166; Sun, 6 Jun 2010 14:09:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006061409.o56E9mWI063166@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 6 Jun 2010 14:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208870 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 14:09:49 -0000 Author: nwhitehorn Date: Sun Jun 6 14:09:48 2010 New Revision: 208870 URL: http://svn.freebsd.org/changeset/base/208870 Log: Some revisions of the Serverworks K2 SATA controller have a data corruption bug where if an ATA command is issued before DMA is started, data will become available to the controller before it knows what to do with it. This results in either data corruption or a controller crash. This patch remedies the problem by adopting the workaround employed by Linux and Darwin: starting the DMA engine prior to sending the ATA command. Observer on: Xserve G5 Reviewed by: mav MFC after: 1 week Modified: head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-lowlevel.c head/sys/dev/ata/chipsets/ata-serverworks.c Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Sun Jun 6 13:08:36 2010 (r208869) +++ head/sys/dev/ata/ata-all.h Sun Jun 6 14:09:48 2010 (r208870) @@ -564,6 +564,7 @@ struct ata_channel { #define ATA_CHECKS_CABLE 0x20 #define ATA_NO_ATAPI_DMA 0x40 #define ATA_SATA 0x80 +#define ATA_DMA_BEFORE_CMD 0x100 int pm_level; /* power management level */ int devices; /* what is present */ Modified: head/sys/dev/ata/ata-lowlevel.c ============================================================================== --- head/sys/dev/ata/ata-lowlevel.c Sun Jun 6 13:08:36 2010 (r208869) +++ head/sys/dev/ata/ata-lowlevel.c Sun Jun 6 14:09:48 2010 (r208870) @@ -141,6 +141,14 @@ ata_begin_transaction(struct ata_request goto begin_finished; } + /* start DMA engine if necessary */ + if ((ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { + device_printf(request->parent, "error starting DMA\n"); + request->result = EIO; + goto begin_finished; + } + /* issue command */ if (ch->hw.command(request)) { device_printf(request->parent, "error issuing %s command\n", @@ -150,7 +158,8 @@ ata_begin_transaction(struct ata_request } /* start DMA engine */ - if (ch->dma.start && ch->dma.start(request)) { + if (!(ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { device_printf(request->parent, "error starting DMA\n"); request->result = EIO; goto begin_finished; Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Sun Jun 6 13:08:36 2010 (r208869) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Sun Jun 6 14:09:48 2010 (r208870) @@ -241,6 +241,16 @@ ata_serverworks_ch_attach(device_t dev) ATA_OUTL(ctlr->r_res2, ch_offset + 0x88, 0); ATA_OUTL(ctlr->r_res2, ch_offset + 0x80, ATA_INL(ctlr->r_res2, ch_offset + 0x80) & ~0x00040000); + + /* + * Some controllers have a bug where they will send the command + * to the drive before seeing a DMA start, and then can begin + * receiving data before the DMA start arrives. The controller + * will then become confused and either corrupt the data or crash. + * Remedy this by starting DMA before sending the drive command. + */ + + ch->flags |= ATA_DMA_BEFORE_CMD; } /* chip does not reliably do 64K DMA transfers */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 14:29:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4407B1065677; Sun, 6 Jun 2010 14:29:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3291E8FC15; Sun, 6 Jun 2010 14:29:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56ET6NW067469; Sun, 6 Jun 2010 14:29:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56ET6P0067468; Sun, 6 Jun 2010 14:29:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006061429.o56ET6P0067468@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 6 Jun 2010 14:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208871 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 14:29:07 -0000 Author: nwhitehorn Date: Sun Jun 6 14:29:06 2010 New Revision: 208871 URL: http://svn.freebsd.org/changeset/base/208871 Log: Add Open Firmware PNP info strings to GPIOs and Uninorth cells. Submitted by: Andreas Tobler Modified: head/sys/powerpc/powermac/macgpio.c head/sys/powerpc/powermac/uninorth.c Modified: head/sys/powerpc/powermac/macgpio.c ============================================================================== --- head/sys/powerpc/powermac/macgpio.c Sun Jun 6 14:09:48 2010 (r208870) +++ head/sys/powerpc/powermac/macgpio.c Sun Jun 6 14:29:06 2010 (r208871) @@ -97,6 +97,8 @@ static device_method_t macgpio_methods[] DEVMETHOD(bus_deactivate_resource, macgpio_deactivate_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, macgpio_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Sun Jun 6 14:09:48 2010 (r208870) +++ head/sys/powerpc/powermac/uninorth.c Sun Jun 6 14:29:06 2010 (r208871) @@ -115,6 +115,8 @@ static device_method_t unin_chip_methods DEVMETHOD(bus_deactivate_resource, unin_chip_deactivate_resource), DEVMETHOD(bus_get_resource_list, unin_chip_get_resource_list), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, unin_chip_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 15:17:38 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5FFC106566C; Sun, 6 Jun 2010 15:17:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 6876B8FC1F; Sun, 6 Jun 2010 15:17:38 +0000 (UTC) Received: from c122-106-175-69.carlnfd1.nsw.optusnet.com.au (c122-106-175-69.carlnfd1.nsw.optusnet.com.au [122.106.175.69]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o56FHZ30004430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Jun 2010 01:17:36 +1000 Date: Mon, 7 Jun 2010 01:17:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Kostik Belousov In-Reply-To: <20100606120004.GH83316@deviant.kiev.zoral.com.ua> Message-ID: <20100607004046.C30264@delplex.bde.org> References: <201006061136.o56Ba9tr029717@svn.freebsd.org> <20100606120004.GH83316@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Gabor Kovesdan Subject: Re: svn commit: r208868 - in head/usr.bin: bc dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 15:17:38 -0000 On Sun, 6 Jun 2010, Kostik Belousov wrote: > On Sun, Jun 06, 2010 at 11:36:09AM +0000, Gabor Kovesdan wrote: >> @@ -223,14 +222,11 @@ static const struct jump_entry jump_tabl >> (sizeof(jump_table_data)/sizeof(jump_table_data[0])) >> >> static void >> -sighandler(int ignored) >> +got_sigint(int ignored __unused) >> { >> >> - switch (ignored) >> - { >> - default: >> - bmachine.interrupted = true; >> - } >> + putchar('\n'); >> + exit(0); >> } > In general, calling not async-signal safe functions from the signal > handler is an invitation for undefined behaviour, that usually manifests > itself as SIGSEGV and SIGBUS. It's always undefined, but usually has a null manifestation. Both the putchar() and the exit() are highly async-signal-unsafe. A correct signal handler would call _exit(nonzero) or kill itself to get get the signal status in the exit code, but then the putchar() would probably only write to the stdiio buffer. The old code attempted to deal with this by using the usual hack of only setting a variable of type sig_atomic_t (bmachine.interrupted) in the interrupt handler, but that usually doesn't work on any BSDish system since BSDish systems by default restart most syscalls after an interrupt, so if the syscall is waiting for user input, it will be restarted after a user SIGINT and resume waiting. top(1) is broken in FreeBSD in the same way that dc was, while in the vendor version it is broken in theory but rarely in practice by the undefined behaviour. Try this: start top and enter command mode, e.g. by "s. Now ^C at the prompt appears not to work. But a newline (possibly preceded by other input) makes the old ^C work unexpectedly. This mostly works in the vendor version because the signal handler is unsafe and just exits. Someone "fixed" this in FreeBSD using the flag hack, without adding the (possibly very large) complications needed to make the flag hack actually work. To make the hack work you must either: - turn off SA_RESTART for most signal actions. Then deal with most syscalls possibly failing with errno = EINTR. Code portable to old non-BSD systems need complications to deal with these EINTRS. Now POSIX with XSI extensions in 2001 (maybe standard now) has SA_RESTART, so a not-so-portable portable application can turn on SA_RESTART so as not to have to deal with the EINTRS, and have the BSD problems instead. - locate all syscalls for i/o on interactive devices and other syscalls of interest, and turn off SA_RESTART only while making these syscalls and deal with the resulting EINTRs only for these syscalls. This is probably easier than a global turnoff of SA_RESTART. This is probably practical in a small application like top or dc (there seems to be only 1 critical read() syscall in top), but probably impossible in a large application and difficult in one where the i/o is in libraries. >From the original commit mail: % Modified: head/usr.bin/bc/scan.l % ============================================================================== % --- head/usr.bin/bc/scan.l Sun Jun 6 11:32:38 2010 (r208867) % +++ head/usr.bin/bc/scan.l Sun Jun 6 11:36:08 2010 (r208868) % @@ -235,22 +234,6 @@ add_str(const char *str) % strlcat(strbuf, str, strbuf_sz); % } % % -/* ARGSUSED */ % -void % -abort_line(int sig) % -{ % - static const char str[] = "[\n]P\n"; % - int save_errno; % - % - switch (sig) { % - default: % - save_errno = errno; % - YY_FLUSH_BUFFER; /* XXX signal race? */ % - write(STDOUT_FILENO, str, sizeof(str) - 1); % - errno = save_errno; % - } % -} This apparently tried to be async-signal safe by using write() instead of stdio, but it isn't clear that this would mesh properly with i/o done before or after the signal. More seriously, it calls YY_FLUSH_BUFFER, which could do anything and is unlikeely to be async-signal safe. % Modified: head/usr.bin/dc/bcode.c % ============================================================================== % --- head/usr.bin/dc/bcode.c Sun Jun 6 11:32:38 2010 (r208867) % +++ head/usr.bin/dc/bcode.c Sun Jun 6 11:36:08 2010 (r208868) % ... % @@ -1746,14 +1742,6 @@ eval(void) % bmachine.readsp--; % continue; % } % - if (bmachine.interrupted) { % - if (bmachine.readsp > 0) { % - src_free(); % - bmachine.readsp--; % - continue; The old code seems to do further cleanup after a signal. This might be more important than printing a newline. % - } else % - bmachine.interrupted = false; % - } % #ifdef DEBUGGING % fprintf(stderr, "# %c\n", ch); % stack_print(stderr, &bmachine.stack, "* ", % Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 15:27:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85259106564A; Sun, 6 Jun 2010 15:27:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 734AC8FC1A; Sun, 6 Jun 2010 15:27:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56FR8GD080153; Sun, 6 Jun 2010 15:27:08 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56FR857080148; Sun, 6 Jun 2010 15:27:08 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006061527.o56FR857080148@svn.freebsd.org> From: Robert Watson Date: Sun, 6 Jun 2010 15:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208873 - head/tools/tools/netrate/tcpp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 15:27:08 -0000 Author: rwatson Date: Sun Jun 6 15:27:08 2010 New Revision: 208873 URL: http://svn.freebsd.org/changeset/base/208873 Log: Rework tcpp output so that it generates a comma-delimited list of values, optionally with a header if "-h" is passed. Toast CPU time measurement in the server for now. Remove -C and -T, since we now always report both connections/sec and Gb/sec. MFC after: 1 week Sponsored by: Juniper Networks Modified: head/tools/tools/netrate/tcpp/tcpp.c head/tools/tools/netrate/tcpp/tcpp.h head/tools/tools/netrate/tcpp/tcpp_client.c head/tools/tools/netrate/tcpp/tcpp_server.c Modified: head/tools/tools/netrate/tcpp/tcpp.c ============================================================================== --- head/tools/tools/netrate/tcpp/tcpp.c Sun Jun 6 14:31:41 2010 (r208872) +++ head/tools/tools/netrate/tcpp/tcpp.c Sun Jun 6 15:27:08 2010 (r208873) @@ -51,7 +51,7 @@ struct sockaddr_in remoteip; /* Base target address. */ struct sockaddr_in localipbase; /* Base local address, if -l. */ -int cflag, lflag, mflag, pflag, sflag, tflag, Cflag, Mflag, Pflag, Tflag; +int cflag, hflag, lflag, mflag, pflag, sflag, tflag, Mflag, Pflag; uint64_t bflag; u_short rflag; @@ -61,7 +61,8 @@ usage(void) fprintf(stderr, "client: tcpp" " -c remoteIP" - " [-CPT]" + " [-h]" + " [-P]" " [-M localIPcount]" " [-l localIPbase]" "\n\t" @@ -76,7 +77,7 @@ usage(void) fprintf(stderr, "server: tcpp" " -s" - " [-PT]" + " [-P]" " [-l localIPbase]" " [-m maxtcpsatonce]" " [-p procs]" @@ -112,7 +113,7 @@ main(int argc, char *argv[]) rflag = BASEPORT_DEFAULT; tflag = TCPS_DEFAULT; Mflag = 1; - while ((ch = getopt(argc, argv, "b:c:l:m:p:r:st:CM:PT")) != -1) { + while ((ch = getopt(argc, argv, "b:c:hl:m:p:r:st:CM:PT")) != -1) { switch (ch) { case 'b': ll = strtoll(optarg, &dummy, 10); @@ -127,6 +128,10 @@ main(int argc, char *argv[]) err(-1, "inet_aton: %s", optarg); break; + case 'h': + hflag++; + break; + case 'l': lflag++; if (inet_aton(optarg, &localipbase.sin_addr) != 1) @@ -165,10 +170,6 @@ main(int argc, char *argv[]) tflag = ll; break; - case 'C': - Cflag++; - break; - case 'M': ll = strtoll(optarg, &dummy, 10); if (*dummy != '\0' || ll <= 1) @@ -184,10 +185,6 @@ main(int argc, char *argv[]) errx(EX_USAGE, "-P current unsupported"); #endif - case 'T': - Tflag++; - break; - default: usage(); } @@ -204,7 +201,7 @@ main(int argc, char *argv[]) usage(); /* Several flags are valid only on the client, disallow if server. */ - if (sflag && (Cflag || Mflag > 1)) + if (sflag && (hflag || Mflag > 1)) usage(); if (cflag) Modified: head/tools/tools/netrate/tcpp/tcpp.h ============================================================================== --- head/tools/tools/netrate/tcpp/tcpp.h Sun Jun 6 14:31:41 2010 (r208872) +++ head/tools/tools/netrate/tcpp/tcpp.h Sun Jun 6 15:27:08 2010 (r208873) @@ -30,8 +30,8 @@ #define TCPP_H extern struct sockaddr_in localipbase, remoteip; -extern int cflag, lflag, mflag, pflag, sflag, tflag; -extern int Cflag, Iflag, Mflag, Pflag, Tflag; +extern int cflag, hflag, lflag, mflag, pflag, sflag, tflag; +extern int Iflag, Mflag, Pflag; extern uint64_t bflag; extern u_short rflag; Modified: head/tools/tools/netrate/tcpp/tcpp_client.c ============================================================================== --- head/tools/tools/netrate/tcpp/tcpp_client.c Sun Jun 6 14:31:41 2010 (r208872) +++ head/tools/tools/netrate/tcpp/tcpp_client.c Sun Jun 6 15:27:08 2010 (r208873) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2008-2009 Robert N. M. Watson + * Copyright (c) 2010 Juniper Networks, Inc. * All rights reserved. * + * This software was developed by Robert N. M. Watson under contract + * to Juniper Networks, Inc. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -337,33 +341,37 @@ tcpp_client(void) if (failed) errx(-1, "Too many errors"); - printf("%jd bytes transferred in %jd.%09jd seconds\n", - (bflag * tflag * pflag), (intmax_t)ts_finish.tv_sec, + if (hflag) + printf("bytes,seconds,conn/s,Gb/s,user%%,nice%%,sys%%," + "intr%%,idle%%\n"); + + /* + * Configuration parameters. + */ + printf("%jd,", bflag * tflag * pflag); + printf("%jd.%09jd,", (intmax_t)ts_finish.tv_sec, (intmax_t)(ts_finish.tv_nsec)); - if (Tflag) - printf("%d procs ", pflag); - if (Cflag) { - printf("%f cps%s", (double)(pflag * tflag)/ - (ts_finish.tv_sec + ts_finish.tv_nsec * 1e-9), - Tflag ? " " : "\n"); - } else { - printf("%f Gbps%s", (double)(bflag * tflag * pflag * 8) / - (ts_finish.tv_sec + ts_finish.tv_nsec * 1e-9) * 1e-9, - Tflag ? " " : "\n"); - } - if (Tflag) { - ticks = 0; - for (i = 0; i < CPUSTATES; i++) { - cp_time_finish[i] -= cp_time_start[i]; - ticks += cp_time_finish[i]; - } - printf("user%% %lu nice%% %lu sys%% %lu intr%% %lu " - "idle%% %lu\n", - (100 * cp_time_finish[CP_USER]) / ticks, - (100 * cp_time_finish[CP_NICE]) / ticks, - (100 * cp_time_finish[CP_SYS]) / ticks, - (100 * cp_time_finish[CP_INTR]) / ticks, - (100 * cp_time_finish[CP_IDLE]) / ticks); + /* + * Effective transmit rates. + */ + printf("%f,", (double)(pflag * tflag)/ + (ts_finish.tv_sec + ts_finish.tv_nsec * 1e-9)); + printf("%f,", (double)(bflag * tflag * pflag * 8) / + (ts_finish.tv_sec + ts_finish.tv_nsec * 1e-9) * 1e-9); + + /* + * CPU time (est). + */ + ticks = 0; + for (i = 0; i < CPUSTATES; i++) { + cp_time_finish[i] -= cp_time_start[i]; + ticks += cp_time_finish[i]; } + printf("%0.02f,", (float)(100 * cp_time_finish[CP_USER]) / ticks); + printf("%0.02f,", (float)(100 * cp_time_finish[CP_NICE]) / ticks); + printf("%0.02f,", (float)(100 * cp_time_finish[CP_SYS]) / ticks); + printf("%0.02f,", (float)(100 * cp_time_finish[CP_INTR]) / ticks); + printf("%0.02f", (float)(100 * cp_time_finish[CP_IDLE]) / ticks); + printf("\n"); } Modified: head/tools/tools/netrate/tcpp/tcpp_server.c ============================================================================== --- head/tools/tools/netrate/tcpp/tcpp_server.c Sun Jun 6 14:31:41 2010 (r208872) +++ head/tools/tools/netrate/tcpp/tcpp_server.c Sun Jun 6 15:27:08 2010 (r208873) @@ -277,8 +277,10 @@ tcpp_server_worker(int workernum) void tcpp_server(void) { +#if 0 long cp_time_last[CPUSTATES], cp_time_now[CPUSTATES], ticks; size_t size; +#endif pid_t pid; int i; @@ -307,7 +309,7 @@ tcpp_server(void) pid_list[i] = pid; } - if (Tflag) { +#if 0 size = sizeof(cp_time_last); if (sysctlbyname(SYSCTLNAME_CPTIME, &cp_time_last, &size, NULL, 0) < 0) @@ -334,7 +336,7 @@ tcpp_server(void) (100 * cp_time_last[CP_IDLE]) / ticks); bcopy(cp_time_now, cp_time_last, sizeof(cp_time_last)); } - } +#endif /* * GC workers. From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 16:07:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8694D1065675; Sun, 6 Jun 2010 16:07:40 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 764768FC0A; Sun, 6 Jun 2010 16:07:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56G7ece089015; Sun, 6 Jun 2010 16:07:40 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56G7eiC089013; Sun, 6 Jun 2010 16:07:40 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006061607.o56G7eiC089013@svn.freebsd.org> From: Randall Stewart Date: Sun, 6 Jun 2010 16:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208874 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 16:07:40 -0000 Author: rrs Date: Sun Jun 6 16:07:40 2010 New Revision: 208874 URL: http://svn.freebsd.org/changeset/base/208874 Log: Fix a bug in sctp_abort_assoc(). DON'T call the sctp_inpcb_free when the gone flag is set. You don't know what locks the caller has set and there is already a kill timer running. MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jun 6 15:27:08 2010 (r208873) +++ head/sys/netinet/sctputil.c Sun Jun 6 16:07:40 2010 (r208874) @@ -3823,13 +3823,6 @@ sctp_abort_association(struct sctp_inpcb #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif - } else { - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - if (LIST_FIRST(&inp->sctp_asoc_list) == NULL) { - sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, - SCTP_CALLED_DIRECTLY_NOCMPSET); - } - } } } From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 16:09:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFF1B1065674; Sun, 6 Jun 2010 16:09:12 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFC3D8FC0A; Sun, 6 Jun 2010 16:09:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56G9CA5089379; Sun, 6 Jun 2010 16:09:12 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56G9CdW089377; Sun, 6 Jun 2010 16:09:12 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006061609.o56G9CdW089377@svn.freebsd.org> From: Randall Stewart Date: Sun, 6 Jun 2010 16:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208875 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 16:09:13 -0000 Author: rrs Date: Sun Jun 6 16:09:12 2010 New Revision: 208875 URL: http://svn.freebsd.org/changeset/base/208875 Log: Fix a bug in the sctp_inpcb_free. Basically if the socket was setup to do an abortive close an association that was in the accept_queue could get stuck and never freed. Now we properly start the kill timer on the socket and turn off the flag (same thing we do for the graceful close method). MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jun 6 16:07:40 2010 (r208874) +++ head/sys/netinet/sctp_pcb.c Sun Jun 6 16:09:12 2010 (r208875) @@ -3363,6 +3363,10 @@ sctp_inpcb_free(struct sctp_inpcb *inp, asoc = nasoc) { nasoc = LIST_NEXT(asoc, sctp_tcblist); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { + asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); + } cnt++; continue; } From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 16:11:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ECE2106566B; Sun, 6 Jun 2010 16:11:17 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8E68FC1B; Sun, 6 Jun 2010 16:11:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56GBHca089885; Sun, 6 Jun 2010 16:11:17 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56GBHbE089883; Sun, 6 Jun 2010 16:11:17 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006061611.o56GBHbE089883@svn.freebsd.org> From: Randall Stewart Date: Sun, 6 Jun 2010 16:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208876 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 16:11:17 -0000 Author: rrs Date: Sun Jun 6 16:11:16 2010 New Revision: 208876 URL: http://svn.freebsd.org/changeset/base/208876 Log: 1) Further enhance the INVARIANT lock validation (no locks) are held by checking the create and inp locks as well. 2) Fix a bug in that when a socket is closed an INIT-ACK is returned, we do NOT unlock the locked_tcb unless its different (an unlikely scenario). If we blindly unlock as we were doing before we can end up unlocking the actual stcb thats about to be sent down to the free function which requires the lock be held. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jun 6 16:09:12 2010 (r208875) +++ head/sys/netinet/sctp_input.c Sun Jun 6 16:11:16 2010 (r208876) @@ -4534,7 +4534,8 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else { - if (locked_tcb) { + if (locked_tcb != stcb) { + /* Very unlikely */ SCTP_TCB_UNLOCK(locked_tcb); } *offset = length; @@ -5424,6 +5425,12 @@ __attribute__((noinline)) panic("Own lock on stcb at return from input"); } } + if (mtx_owned(&inp->inp_create_mtx)) { + panic("Own create lock on inp"); + } + if (mtx_owned(&inp->inp_mtx)) { + panic("Own inp lock on inp"); + } } #endif From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 16:13:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31D70106564A; Sun, 6 Jun 2010 16:13:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 211A78FC23; Sun, 6 Jun 2010 16:13:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56GDodZ090492; Sun, 6 Jun 2010 16:13:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56GDoYi090490; Sun, 6 Jun 2010 16:13:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006061613.o56GDoYi090490@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Jun 2010 16:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208877 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 16:13:51 -0000 Author: kib Date: Sun Jun 6 16:13:50 2010 New Revision: 208877 URL: http://svn.freebsd.org/changeset/base/208877 Log: Style-compilant order of declarations. Noted by: bde MFC after: 1 month Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sun Jun 6 16:11:16 2010 (r208876) +++ head/sys/amd64/amd64/fpu.c Sun Jun 6 16:13:50 2010 (r208877) @@ -453,8 +453,8 @@ fpudrop() int fpugetuserregs(struct thread *td, struct savefpu *addr) { - register_t s; struct pcb *pcb; + register_t s; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { @@ -477,8 +477,8 @@ fpugetuserregs(struct thread *td, struct int fpugetregs(struct thread *td, struct savefpu *addr) { - register_t s; struct pcb *pcb; + register_t s; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { @@ -504,8 +504,8 @@ fpugetregs(struct thread *td, struct sav void fpusetuserregs(struct thread *td, struct savefpu *addr) { - register_t s; struct pcb *pcb; + register_t s; pcb = td->td_pcb; s = intr_disable(); @@ -525,8 +525,8 @@ fpusetuserregs(struct thread *td, struct void fpusetregs(struct thread *td, struct savefpu *addr) { - register_t s; struct pcb *pcb; + register_t s; pcb = td->td_pcb; s = intr_disable(); From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 16:31:27 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D00B51065674; Sun, 6 Jun 2010 16:31:27 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 942F28FC1A; Sun, 6 Jun 2010 16:31:27 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id A078B1DD655; Sun, 6 Jun 2010 18:31:26 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 94880172B1; Sun, 6 Jun 2010 18:31:26 +0200 (CEST) Date: Sun, 6 Jun 2010 18:31:26 +0200 From: Jilles Tjoelker To: Bruce Evans Message-ID: <20100606163126.GA70256@stack.nl> References: <201006061136.o56Ba9tr029717@svn.freebsd.org> <20100606120004.GH83316@deviant.kiev.zoral.com.ua> <20100607004046.C30264@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100607004046.C30264@delplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Kostik Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Gabor Kovesdan Subject: Re: svn commit: r208868 - in head/usr.bin: bc dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 16:31:28 -0000 On Mon, Jun 07, 2010 at 01:17:34AM +1000, Bruce Evans wrote: > The old code attempted to deal with this by using the usual hack of > only setting a variable of type sig_atomic_t (bmachine.interrupted) > in the interrupt handler, but that usually doesn't work on any BSDish > system since BSDish systems by default restart most syscalls after an > interrupt, so if the syscall is waiting for user input, it will be > restarted after a user SIGINT and resume waiting. > top(1) is broken in FreeBSD in the same way that dc was, while in the > vendor version it is broken in theory but rarely in practice by the > undefined behaviour. Try this: start top and enter command mode, > e.g. by "s. Now ^C at the prompt appears not to work. But > a newline (possibly preceded by other input) makes the old ^C work > unexpectedly. This mostly works in the vendor version because the > signal handler is unsafe and just exits. Someone "fixed" this in > FreeBSD using the flag hack, without adding the (possibly very large) > complications needed to make the flag hack actually work. > To make the hack work you must either: > - turn off SA_RESTART for most signal actions. Then deal with most > syscalls possibly failing with errno = EINTR. Code portable to > old non-BSD systems need complications to deal with these EINTRS. > Now POSIX with XSI extensions in 2001 (maybe standard now) has > SA_RESTART, so a not-so-portable portable application can turn on > SA_RESTART so as not to have to deal with the EINTRS, and have > the BSD problems instead. In most cases, relying on EINTR like this introduces a race condition: it could be that the signal handler is called between the last check of the flag and blocking in a system call (checked for EINTR). In that case, the system call must complete before the program reacts to the signal, which could take very long. Exceptions include sigsuspend(2) and pselect(2) (note some FreeBSD versions have a pselect(3) purely in libc, which does not avoid this race condition). Another function of interest is sigtimedwait(2). A kludge for this race condition and problems where the flag is not checked often enough is an alarm(3) or similar call in the signal handler, forcing the program to be terminated bluntly if it does not react fast enough. Other methods include using signal masks or flags to make terminating the program or longjmp'ing from the signal handler safe. This works best if there are few places where the program can block for longer periods. (If you arrange that your signal handler never interrupts an async-signal-unsafe function, or if it is known that this particular invocation did not interrupt an async-signal-unsafe function, it may call async-signal-unsafe functions without problems.) > - locate all syscalls for i/o on interactive devices and other syscalls > of interest, and turn off SA_RESTART only while making these syscalls > and deal with the resulting EINTRs only for these syscalls. This is > probably easier than a global turnoff of SA_RESTART. This is probably > practical in a small application like top or dc (there seems to be only > 1 critical read() syscall in top), but probably impossible in a large > application and difficult in one where the i/o is in libraries. Many libraries retry potentially blocking system calls on EINTR. If you are wasting two system calls per "slow" system call anyway, it would likely be better if they were unmask/mask signals rather than toggling SA_RESTART. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 19:24:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB1C21065673; Sun, 6 Jun 2010 19:24:32 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA52E8FC14; Sun, 6 Jun 2010 19:24:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56JOW0F032235; Sun, 6 Jun 2010 19:24:32 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56JOWfo032230; Sun, 6 Jun 2010 19:24:32 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006061924.o56JOWfo032230@svn.freebsd.org> From: Randall Stewart Date: Sun, 6 Jun 2010 19:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208878 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 19:24:33 -0000 Author: rrs Date: Sun Jun 6 19:24:32 2010 New Revision: 208878 URL: http://svn.freebsd.org/changeset/base/208878 Log: Ok, yet another bug in killing off all the hundreds of apitesters.. Basically we end up with attempting to destroy a lock thats contended on. A cookie echo arrives at the same time that the close is happening. The close gets the lock but the cookie echo has already passed the check for the gone flag and is then locked waiting on the create lock.. when we go to destroy it bam. For now we do the timer destroy for all calls to close.. We can probably optimize this later so that we check whats being contended on and if there is contention then do the timer thing. but this is probably safest since the inp has been removed from all lists and references and only the timer can find it.. once the locks are released all other places will instantly see the GONE flag and bail (thats what the change in sctp_input is one place that was lacking the bail code). MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sun Jun 6 16:13:50 2010 (r208877) +++ head/sys/netinet/sctp_constants.h Sun Jun 6 19:24:32 2010 (r208878) @@ -894,7 +894,7 @@ __FBSDID("$FreeBSD$"); /* third argument */ #define SCTP_CALLED_DIRECTLY_NOCMPSET 0 #define SCTP_CALLED_AFTER_CMPSET_OFCLOSE 1 - +#define SCTP_CALLED_FROM_INPKILL_TIMER 2 /* second argument */ #define SCTP_FREE_SHOULD_USE_ABORT 1 #define SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE 0 Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jun 6 16:13:50 2010 (r208877) +++ head/sys/netinet/sctp_input.c Sun Jun 6 19:24:32 2010 (r208878) @@ -4862,6 +4862,7 @@ process_control_chunks: } else { if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ + abend: if (stcb) { SCTP_TCB_UNLOCK(stcb); } @@ -4912,6 +4913,11 @@ process_control_chunks: if (linp) { SCTP_ASOC_CREATE_LOCK(linp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { + SCTP_ASOC_CREATE_UNLOCK(linp); + goto abend; + } } if (netp) { ret_buf = Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jun 6 16:13:50 2010 (r208877) +++ head/sys/netinet/sctp_pcb.c Sun Jun 6 19:24:32 2010 (r208878) @@ -3423,7 +3423,9 @@ sctp_inpcb_free(struct sctp_inpcb *inp, #endif return; } - if ((inp->refcount) || (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP)) { + if ((inp->refcount) || + (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP) || + (from != SCTP_CALLED_FROM_INPKILL_TIMER)) { (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); sctp_timer_start(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL); SCTP_INP_WUNLOCK(inp); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jun 6 16:13:50 2010 (r208877) +++ head/sys/netinet/sctputil.c Sun Jun 6 19:24:32 2010 (r208878) @@ -1898,7 +1898,7 @@ sctp_timeout_handler(void *t) SCTP_INP_DECR_REF(inp); sctp_timer_stop(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_3); sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, - SCTP_CALLED_DIRECTLY_NOCMPSET); + SCTP_CALLED_FROM_INPKILL_TIMER); inp = NULL; goto out_no_decr; default: From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 20:34:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39028106566C; Sun, 6 Jun 2010 20:34:18 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 277698FC17; Sun, 6 Jun 2010 20:34:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56KYIAi047492; Sun, 6 Jun 2010 20:34:18 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56KYHoE047487; Sun, 6 Jun 2010 20:34:17 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006062034.o56KYHoE047487@svn.freebsd.org> From: Randall Stewart Date: Sun, 6 Jun 2010 20:34:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208879 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 20:34:18 -0000 Author: rrs Date: Sun Jun 6 20:34:17 2010 New Revision: 208879 URL: http://svn.freebsd.org/changeset/base/208879 Log: 1) Optimize the cleanup and don't always depend on the timer. This is done by considering the locks we will destroy and if they are contended we consider it the same as a reference count being up. Fixing this appears to cleanup another crash that was appearing with all the timers where the socket buf lock got corrupted. 2) Fix the sysctl code to take a lot more care when looking at INP's that are in the GONE or ALLGONE state. MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_lock_bsd.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_sysctl.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sun Jun 6 19:24:32 2010 (r208878) +++ head/sys/netinet/sctp_constants.h Sun Jun 6 20:34:17 2010 (r208879) @@ -894,7 +894,7 @@ __FBSDID("$FreeBSD$"); /* third argument */ #define SCTP_CALLED_DIRECTLY_NOCMPSET 0 #define SCTP_CALLED_AFTER_CMPSET_OFCLOSE 1 -#define SCTP_CALLED_FROM_INPKILL_TIMER 2 +#define SCTP_CALLED_FROM_INPKILL_TIMER 2 /* second argument */ #define SCTP_FREE_SHOULD_USE_ABORT 1 #define SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE 0 Modified: head/sys/netinet/sctp_lock_bsd.h ============================================================================== --- head/sys/netinet/sctp_lock_bsd.h Sun Jun 6 19:24:32 2010 (r208878) +++ head/sys/netinet/sctp_lock_bsd.h Sun Jun 6 20:34:17 2010 (r208879) @@ -185,6 +185,13 @@ extern int sctp_logoff_stuff; #define SCTP_INP_LOCK_DESTROY(_inp) \ mtx_destroy(&(_inp)->inp_mtx) +#define SCTP_INP_LOCK_CONTENDED(_inp) ((_inp)->inp_mtx.mtx_lock & MTX_CONTESTED) + +#define SCTP_INP_READ_CONTENDED(_inp) ((_inp)->inp_rdata_mtx.mtx_lock & MTX_CONTESTED) + +#define SCTP_ASOC_CREATE_LOCK_CONTENDED(_inp) ((_inp)->inp_create_mtx.mtx_lock & MTX_CONTESTED) + + #define SCTP_ASOC_CREATE_LOCK_DESTROY(_inp) \ mtx_destroy(&(_inp)->inp_create_mtx) Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jun 6 19:24:32 2010 (r208878) +++ head/sys/netinet/sctp_pcb.c Sun Jun 6 20:34:17 2010 (r208879) @@ -3096,7 +3096,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, struct sctp_laddr *laddr, *nladdr; struct inpcb *ip_pcb; struct socket *so; - + int being_refed = 0; struct sctp_queued_to_read *sq; @@ -3423,9 +3423,16 @@ sctp_inpcb_free(struct sctp_inpcb *inp, #endif return; } + if (SCTP_INP_LOCK_CONTENDED(inp)) + being_refed++; + if (SCTP_INP_READ_CONTENDED(inp)) + being_refed++; + if (SCTP_ASOC_CREATE_LOCK_CONTENDED(inp)) + being_refed++; + if ((inp->refcount) || - (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP) || - (from != SCTP_CALLED_FROM_INPKILL_TIMER)) { + (being_refed) || + (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP)) { (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); sctp_timer_start(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL); SCTP_INP_WUNLOCK(inp); Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sun Jun 6 19:24:32 2010 (r208878) +++ head/sys/netinet/sctp_sysctl.c Sun Jun 6 20:34:17 2010 (r208879) @@ -331,6 +331,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) struct xsctp_inpcb xinpcb; struct xsctp_tcb xstcb; struct xsctp_raddr xraddr; + struct socket *so; number_of_endpoints = 0; number_of_local_addresses = 0; @@ -369,6 +370,10 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) } LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { SCTP_INP_RLOCK(inp); + if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { + /* if its allgone it is being freed - skip it */ + goto skip; + } xinpcb.last = 0; xinpcb.local_port = ntohs(inp->sctp_lport); xinpcb.flags = inp->sctp_flags; @@ -377,13 +382,14 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xinpcb.total_recvs = inp->total_recvs; xinpcb.total_nospaces = inp->total_nospaces; xinpcb.fragmentation_point = inp->sctp_frag_point; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + so = inp->sctp_socket; + if ((so == NULL) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { xinpcb.qlen = 0; xinpcb.maxqlen = 0; } else { - xinpcb.qlen = inp->sctp_socket->so_qlen; - xinpcb.maxqlen = inp->sctp_socket->so_qlimit; + xinpcb.qlen = so->so_qlen; + xinpcb.maxqlen = so->so_qlimit; } SCTP_INP_INCR_REF(inp); SCTP_INP_RUNLOCK(inp); @@ -501,6 +507,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) if (error) { return error; } +skip: SCTP_INP_INFO_RLOCK(); } SCTP_INP_INFO_RUNLOCK(); From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 22:27:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 024571065672; Sun, 6 Jun 2010 22:27:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E446E8FC15; Sun, 6 Jun 2010 22:27:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56MRWdW072454; Sun, 6 Jun 2010 22:27:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56MRWZL072452; Sun, 6 Jun 2010 22:27:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006062227.o56MRWZL072452@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 6 Jun 2010 22:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208881 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 22:27:33 -0000 Author: jilles Date: Sun Jun 6 22:27:32 2010 New Revision: 208881 URL: http://svn.freebsd.org/changeset/base/208881 Log: sh: Pass through SIGINT from a child if interactive and job control is enabled. This already worked if without job control. In either case, this depends on it that a process that terminates due to SIGINT exits on it (so not with status 1, or worse, 0). Example: sleep 5; echo continued This does not print "continued" any more if sleep is aborted via ctrl+c. MFC after: 1 month Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Jun 6 21:19:04 2010 (r208880) +++ head/bin/sh/jobs.c Sun Jun 6 22:27:32 2010 (r208881) @@ -866,6 +866,7 @@ waitforjob(struct job *jp, int *origstat { #if JOBS pid_t mypgrp = getpgrp(); + int propagate_int = jp->jobctl && jp->foreground; #endif int status; int st; @@ -903,6 +904,11 @@ waitforjob(struct job *jp, int *origstat else CLEAR_PENDING_INT; } +#if JOBS + else if (rootshell && iflag && propagate_int && + WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) + kill(getpid(), SIGINT); +#endif INTON; return st; } From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 04:01:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44C5B1065675; Mon, 7 Jun 2010 04:01:39 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35E128FC0C; Mon, 7 Jun 2010 04:01:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5741dBq049015; Mon, 7 Jun 2010 04:01:39 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5741dfO049013; Mon, 7 Jun 2010 04:01:39 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006070401.o5741dfO049013@svn.freebsd.org> From: Randall Stewart Date: Mon, 7 Jun 2010 04:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208883 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 04:01:39 -0000 Author: rrs Date: Mon Jun 7 04:01:38 2010 New Revision: 208883 URL: http://svn.freebsd.org/changeset/base/208883 Log: Fix so we call socantrcvmore_locked so we don't see a race where we unlock to call the non-locked version and have the socket go away. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Jun 7 03:08:52 2010 (r208882) +++ head/sys/netinet/sctp_pcb.c Mon Jun 7 04:01:38 2010 (r208883) @@ -4675,8 +4675,8 @@ sctp_free_assoc(struct sctp_inpcb *inp, SS_ISCONFIRMING | SS_ISCONNECTED); } + socantrcvmore_locked(so); SOCK_UNLOCK(so); - socantrcvmore(so); sctp_sowwakeup(inp, so); sctp_sorwakeup(inp, so); SCTP_SOWAKEUP(so); From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 06:38:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F31181065673; Mon, 7 Jun 2010 06:38:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E24A78FC1D; Mon, 7 Jun 2010 06:38:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o576cC0q084810; Mon, 7 Jun 2010 06:38:12 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o576cC1v084809; Mon, 7 Jun 2010 06:38:12 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006070638.o576cC1v084809@svn.freebsd.org> From: Martin Matuska Date: Mon, 7 Jun 2010 06:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208885 - head/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 06:38:13 -0000 Author: mm Date: Mon Jun 7 06:38:12 2010 New Revision: 208885 URL: http://svn.freebsd.org/changeset/base/208885 Log: Document ZFS upgrade to version 14, support for NFSv4 ACLs, changes in L2ARC and zfs send. Approved by: delphij (mentor) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jun 7 04:45:40 2010 (r208884) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jun 7 06:38:12 2010 (r208885) @@ -313,6 +313,11 @@ &man.clear.locks.8; command has been added to clear locks held on behalf of an NFS client. + The ZFS file system + has been upgraded to version 14. Additional changes include + support for NFSv4 ACLs, a speedup of zfs send and an improved L2ARC. + New statistics for prefetch and L2ARC have been introduced. + From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 07:41:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99AFC106566B; Mon, 7 Jun 2010 07:41:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88DE28FC16; Mon, 7 Jun 2010 07:41:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o577fgAw099406; Mon, 7 Jun 2010 07:41:42 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o577fgIT099405; Mon, 7 Jun 2010 07:41:42 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006070741.o577fgIT099405@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Jun 2010 07:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208886 - head/sbin/geom/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 07:41:42 -0000 Author: ae Date: Mon Jun 7 07:41:41 2010 New Revision: 208886 URL: http://svn.freebsd.org/changeset/base/208886 Log: bgeom(3) does strdup of param name. Don't leak memory when deleting param from gctl_req. Reviewed by: marcel Approved by: mav (mentor) MFC after: 2 weeks Modified: head/sbin/geom/misc/subr.c Modified: head/sbin/geom/misc/subr.c ============================================================================== --- head/sbin/geom/misc/subr.c Mon Jun 7 06:38:12 2010 (r208885) +++ head/sbin/geom/misc/subr.c Mon Jun 7 07:41:41 2010 (r208886) @@ -436,6 +436,7 @@ gctl_delete_param(struct gctl_req *req, if (i == req->narg) return (ENOENT); + free(ap->name); req->narg--; while (i < req->narg) { req->arg[i] = req->arg[i + 1]; From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 08:23:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5C2D1065673; Mon, 7 Jun 2010 08:23:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B51578FC13; Mon, 7 Jun 2010 08:23:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o578NGIT008943; Mon, 7 Jun 2010 08:23:16 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o578NGvJ008941; Mon, 7 Jun 2010 08:23:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201006070823.o578NGvJ008941@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 7 Jun 2010 08:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208887 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 08:23:16 -0000 Author: np Date: Mon Jun 7 08:23:16 2010 New Revision: 208887 URL: http://svn.freebsd.org/changeset/base/208887 Log: cxgb(4): add an 'nfilters' tunable that lets the user place an upper limit on the number of hardware filters (and thus the amount of TCAM reserved for filtering). Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Mon Jun 7 07:41:41 2010 (r208886) +++ head/sys/dev/cxgb/cxgb_main.c Mon Jun 7 08:23:16 2010 (r208887) @@ -238,6 +238,10 @@ TUNABLE_INT("hw.cxgb.snd_queue_len", &cx SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN, &cxgb_snd_queue_len, 0, "send queue size "); +static int nfilters = -1; +TUNABLE_INT("hw.cxgb.nfilters", &nfilters); +SYSCTL_INT(_hw_cxgb, OID_AUTO, nfilters, CTLFLAG_RDTUN, + &nfilters, 0, "max number of entries in the filter table"); enum { MAX_TXQ_ENTRIES = 16384, @@ -1652,6 +1656,7 @@ static int cxgb_up(struct adapter *sc) { int err = 0; + unsigned int mxf = t3_mc5_size(&sc->mc5) - MC5_MIN_TIDS; KASSERT(sc->open_device_map == 0, ("%s: device(s) already open (%x)", __func__, sc->open_device_map)); @@ -1668,11 +1673,13 @@ cxgb_up(struct adapter *sc) if ((err = update_tpsram(sc))) goto out; - if (is_offload(sc)) { + if (is_offload(sc) && nfilters != 0) { sc->params.mc5.nservers = 0; - sc->params.mc5.nroutes = 0; - sc->params.mc5.nfilters = t3_mc5_size(&sc->mc5) - - MC5_MIN_TIDS; + + if (nfilters < 0) + sc->params.mc5.nfilters = mxf; + else + sc->params.mc5.nfilters = min(nfilters, mxf); } err = t3_init_hw(sc, 0); From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 10:09:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8406C106566B; Mon, 7 Jun 2010 10:09:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 739598FC0C; Mon, 7 Jun 2010 10:09:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57A9f86032308; Mon, 7 Jun 2010 10:09:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57A9fgU032307; Mon, 7 Jun 2010 10:09:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006071009.o57A9fgU032307@svn.freebsd.org> From: Xin LI Date: Mon, 7 Jun 2010 10:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208888 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 10:09:41 -0000 Author: delphij Date: Mon Jun 7 10:09:40 2010 New Revision: 208888 URL: http://svn.freebsd.org/changeset/base/208888 Log: Correct a bug in gzip(1): make sure that initialize isb with fstat() on input file before using it. PR: bin/147275 Submitted by: thomas MFC after: 1 week Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Mon Jun 7 08:23:16 2010 (r208887) +++ head/usr.bin/gzip/gzip.c Mon Jun 7 10:09:40 2010 (r208888) @@ -1224,17 +1224,23 @@ file_compress(char *file, char *outfile, return -1; } +#ifndef SMALL + if (fstat(in, &isb) != 0) { + maybe_warn("couldn't stat: %s", file); + close(in); + return -1; + } +#endif + if (cflag == 0) { #ifndef SMALL - if (fstat(in, &isb) == 0) { - if (isb.st_nlink > 1 && fflag == 0) { + if (isb.st_nlink != 1 && fflag == 0) { maybe_warnx("%s has %d other link%s -- " "skipping", file, isb.st_nlink - 1, isb.st_nlink == 1 ? "" : "s"); close(in); return -1; } - } if (fflag == 0 && (suff = check_suffix(file, 0)) && suff->zipped[0] != 0) { From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 10:10:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 409291065675; Mon, 7 Jun 2010 10:10:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 308338FC18; Mon, 7 Jun 2010 10:10:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57AAjs8032577; Mon, 7 Jun 2010 10:10:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57AAjUF032575; Mon, 7 Jun 2010 10:10:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006071010.o57AAjUF032575@svn.freebsd.org> From: Xin LI Date: Mon, 7 Jun 2010 10:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208889 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 10:10:45 -0000 Author: delphij Date: Mon Jun 7 10:10:44 2010 New Revision: 208889 URL: http://svn.freebsd.org/changeset/base/208889 Log: Follow up revision 208888 with purely ident changes. MFC after: 1 week Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Mon Jun 7 10:09:40 2010 (r208888) +++ head/usr.bin/gzip/gzip.c Mon Jun 7 10:10:44 2010 (r208889) @@ -1235,12 +1235,12 @@ file_compress(char *file, char *outfile, if (cflag == 0) { #ifndef SMALL if (isb.st_nlink != 1 && fflag == 0) { - maybe_warnx("%s has %d other link%s -- " - "skipping", file, isb.st_nlink - 1, - isb.st_nlink == 1 ? "" : "s"); - close(in); - return -1; - } + maybe_warnx("%s has %d other link%s -- " + "skipping", file, isb.st_nlink - 1, + isb.st_nlink == 1 ? "" : "s"); + close(in); + return -1; + } if (fflag == 0 && (suff = check_suffix(file, 0)) && suff->zipped[0] != 0) { From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 10:22:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A212A106566C; Mon, 7 Jun 2010 10:22:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 911CD8FC23; Mon, 7 Jun 2010 10:22:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57AMMfC050466; Mon, 7 Jun 2010 10:22:22 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57AMM0b050464; Mon, 7 Jun 2010 10:22:22 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006071022.o57AMM0b050464@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Jun 2010 10:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208890 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 10:22:22 -0000 Author: ae Date: Mon Jun 7 10:22:22 2010 New Revision: 208890 URL: http://svn.freebsd.org/changeset/base/208890 Log: MFC r207181: Re-calculate a geometry when reprobing as well. PR: kern/145452 Reviewed by: marcel Approved by: kib (mentor) Approved by: re (bz) Modified: stable/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Mon Jun 7 10:10:44 2010 (r208889) +++ stable/8/sys/geom/part/g_part.c Mon Jun 7 10:22:22 2010 (r208890) @@ -1067,6 +1067,15 @@ g_part_ctl_undo(struct gctl_req *req, st return (0); } table = gp->softc; + + /* + * Synthesize a disk geometry. Some partitioning schemes + * depend on it and since some file systems need it even + * when the partitition scheme doesn't, we do it here in + * scheme-independent code. + */ + pp = cp->provider; + g_part_geometry(table, cp, pp->mediasize / pp->sectorsize); } error = G_PART_READ(table, cp); From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 11:33:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9823D1065673; Mon, 7 Jun 2010 11:33:20 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8865F8FC12; Mon, 7 Jun 2010 11:33:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57BXKmM066018; Mon, 7 Jun 2010 11:33:20 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57BXKfB066016; Mon, 7 Jun 2010 11:33:20 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006071133.o57BXKfB066016@svn.freebsd.org> From: Randall Stewart Date: Mon, 7 Jun 2010 11:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208891 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 11:33:20 -0000 Author: rrs Date: Mon Jun 7 11:33:20 2010 New Revision: 208891 URL: http://svn.freebsd.org/changeset/base/208891 Log: Opps... my bad.. we don't need a SOCK_UNLOCK() after calling socantrcvmore_locked() since it will unlock the lock for you. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Jun 7 10:22:22 2010 (r208890) +++ head/sys/netinet/sctp_pcb.c Mon Jun 7 11:33:20 2010 (r208891) @@ -4676,7 +4676,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, SS_ISCONNECTED); } socantrcvmore_locked(so); - SOCK_UNLOCK(so); sctp_sowwakeup(inp, so); sctp_sorwakeup(inp, so); SCTP_SOWAKEUP(so); From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 13:37:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CEE0106567C; Mon, 7 Jun 2010 13:37:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6CF8FC26; Mon, 7 Jun 2010 13:37:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57DbDC2093422; Mon, 7 Jun 2010 13:37:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57DbDnJ093420; Mon, 7 Jun 2010 13:37:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006071337.o57DbDnJ093420@svn.freebsd.org> From: Andriy Gapon Date: Mon, 7 Jun 2010 13:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208892 - stable/8/sys/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 13:37:13 -0000 Author: avg Date: Mon Jun 7 13:37:13 2010 New Revision: 208892 URL: http://svn.freebsd.org/changeset/base/208892 Log: MFC r208610: boot/zfs: fix gang block reading code - use correct size (512) while reading a gang block - skip holes while reading child blocks - advance buffer pointer while reading child blocks PR: 144214 Approved by: re(kib) Modified: stable/8/sys/boot/zfs/zfsimpl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/8/sys/boot/zfs/zfsimpl.c Mon Jun 7 11:33:20 2010 (r208891) +++ stable/8/sys/boot/zfs/zfsimpl.c Mon Jun 7 13:37:13 2010 (r208892) @@ -958,12 +958,17 @@ zio_read_gang(spa_t *spa, const blkptr_t break; if (!vdev || !vdev->v_read) return (EIO); - if (vdev->v_read(vdev, bp, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) return (EIO); for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { - if (zio_read(spa, &zio_gb.zg_blkptr[i], buf)) + blkptr_t *gbp = &zio_gb.zg_blkptr[i]; + + if (BP_IS_HOLE(gbp)) + continue; + if (zio_read(spa, gbp, buf)) return (EIO); + buf = (char*)buf + BP_GET_PSIZE(gbp); } return (0); @@ -994,9 +999,8 @@ zio_read(spa_t *spa, const blkptr_t *bp, continue; if (DVA_GET_GANG(dva)) { - printf("ZFS: gang block detected!\n"); if (zio_read_gang(spa, bp, dva, buf)) - return (EIO); + continue; } else { vdevid = DVA_GET_VDEV(dva); offset = DVA_GET_OFFSET(dva); From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 13:44:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33776106564A; Mon, 7 Jun 2010 13:44:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22FBB8FC0C; Mon, 7 Jun 2010 13:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57Di5Ys094989; Mon, 7 Jun 2010 13:44:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57Di58f094987; Mon, 7 Jun 2010 13:44:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006071344.o57Di58f094987@svn.freebsd.org> From: Andriy Gapon Date: Mon, 7 Jun 2010 13:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208893 - stable/7/sys/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 13:44:05 -0000 Author: avg Date: Mon Jun 7 13:44:04 2010 New Revision: 208893 URL: http://svn.freebsd.org/changeset/base/208893 Log: MFC r208610: boot/zfs: fix gang block reading code - use correct size (512) while reading a gang block - skip holes while reading child blocks - advance buffer pointer while reading child blocks PR: 144214 Modified: stable/7/sys/boot/zfs/zfsimpl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/7/sys/boot/zfs/zfsimpl.c Mon Jun 7 13:37:13 2010 (r208892) +++ stable/7/sys/boot/zfs/zfsimpl.c Mon Jun 7 13:44:04 2010 (r208893) @@ -914,12 +914,17 @@ zio_read_gang(spa_t *spa, const blkptr_t break; if (!vdev || !vdev->v_read) return (EIO); - if (vdev->v_read(vdev, bp, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) return (EIO); for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { - if (zio_read(spa, &zio_gb.zg_blkptr[i], buf)) + blkptr_t *gbp = &zio_gb.zg_blkptr[i]; + + if (BP_IS_HOLE(gbp)) + continue; + if (zio_read(spa, gbp, buf)) return (EIO); + buf = (char*)buf + BP_GET_PSIZE(gbp); } return (0); @@ -950,9 +955,8 @@ zio_read(spa_t *spa, const blkptr_t *bp, continue; if (DVA_GET_GANG(dva)) { - printf("ZFS: gang block detected!\n"); if (zio_read_gang(spa, bp, dva, buf)) - return (EIO); + continue; } else { vdevid = DVA_GET_VDEV(dva); offset = DVA_GET_OFFSET(dva); From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 16:32:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3597910656D7; Mon, 7 Jun 2010 16:32:13 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22AD38FC16; Mon, 7 Jun 2010 16:32:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57GWDQm031939; Mon, 7 Jun 2010 16:32:13 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57GWCXZ031934; Mon, 7 Jun 2010 16:32:12 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006071632.o57GWCXZ031934@svn.freebsd.org> From: Matt Jacob Date: Mon, 7 Jun 2010 16:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208894 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 16:32:13 -0000 Author: mjacob Date: Mon Jun 7 16:32:12 2010 New Revision: 208894 URL: http://svn.freebsd.org/changeset/base/208894 Log: MFC of 198262 Use callout_init_mtx on FreeBSD versions recent enough. This closes the race where interrupt thread can complete the request for which timeout has fired and while mpt_timeout has blocked on mpt_lock. Approved by: re (kib) Modified: stable/8/sys/dev/mpt/mpt.c stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_raid.c Modified: stable/8/sys/dev/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Mon Jun 7 13:44:04 2010 (r208893) +++ stable/8/sys/dev/mpt/mpt.c Mon Jun 7 16:32:12 2010 (r208894) @@ -1238,7 +1238,6 @@ retry: req->state = REQ_STATE_ALLOCATED; req->chain = NULL; mpt_assign_serno(mpt, req); - mpt_callout_init(&req->callout); } else if (sleep_ok != 0) { mpt->getreqwaiter = 1; mpt_sleep(mpt, &mpt->request_free_list, PUSER, "mptgreq", 0); @@ -2251,6 +2250,7 @@ mpt_core_attach(struct mpt_softc *mpt) for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { request_t *req = &mpt->request_pool[val]; req->state = REQ_STATE_ALLOCATED; + mpt_callout_init(mpt, &req->callout); mpt_free_request(mpt, req); } MPT_UNLOCK(mpt); @@ -2334,10 +2334,18 @@ mpt_core_shutdown(struct mpt_softc *mpt) void mpt_core_detach(struct mpt_softc *mpt) { + int val; + /* * XXX: FREE MEMORY */ mpt_disable_ints(mpt); + + /* Make sure no request has pending timeouts. */ + for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { + request_t *req = &mpt->request_pool[val]; + mpt_callout_drain(mpt, &req->callout); + } } int Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Mon Jun 7 13:44:04 2010 (r208893) +++ stable/8/sys/dev/mpt/mpt.h Mon Jun 7 16:32:12 2010 (r208894) @@ -303,13 +303,6 @@ void mpt_map_rquest(void *, bus_dma_segm kthread_exit(status) #endif -/****************************** Timer Facilities ******************************/ -#if __FreeBSD_version > 500000 -#define mpt_callout_init(c) callout_init(c, /*mpsafe*/1); -#else -#define mpt_callout_init(c) callout_init(c); -#endif - /********************************** Endianess *********************************/ #define MPT_2_HOST64(ptr, tag) ptr->tag = le64toh(ptr->tag) #define MPT_2_HOST32(ptr, tag) ptr->tag = le32toh(ptr->tag) @@ -897,6 +890,10 @@ mpt_sleep(struct mpt_softc *mpt, void *i callout_reset(&(req)->callout, (ticks), (func), (arg)); #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c) +#define mpt_callout_drain(mpt, c) \ + callout_stop(c) #else #if 1 @@ -919,9 +916,13 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); + callout_reset(&(req)->callout, (ticks), (func), (arg)) #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init_mtx(c, &(mpt)->mpt_lock, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) #else @@ -934,18 +935,18 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define MPTLOCK_2_CAMLOCK(mpt) #define CAMLOCK_2_MPTLOCK(mpt) +#define mpt_req_timeout(req, ticks, func, arg) \ + callout_reset(&(req)->callout, (ticks), (func), (arg)) +#define mpt_req_untimeout(req, func, arg) \ + callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) + static __inline int mpt_sleep(struct mpt_softc *, void *, int, const char *, int); -#define mpt_ccb_timeout(ccb, ticks, func, arg) \ - do { \ - (ccb)->ccb_h.timeout_ch = timeout((func), (arg), (ticks)); \ - } while (0) -#define mpt_ccb_untimeout(ccb, func, arg) \ - untimeout((func), (arg), (ccb)->ccb_h.timeout_ch) -#define mpt_ccb_timeout_init(ccb) \ - callout_handle_init(&(ccb)->ccb_h.timeout_ch) - static __inline int mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) { Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Mon Jun 7 13:44:04 2010 (r208893) +++ stable/8/sys/dev/mpt/mpt_cam.c Mon Jun 7 16:32:12 2010 (r208894) @@ -1250,7 +1250,10 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, req->serno, ccb, req->ccb); @@ -1261,7 +1264,9 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } /* Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Mon Jun 7 13:44:04 2010 (r208893) +++ stable/8/sys/dev/mpt/mpt_raid.c Mon Jun 7 16:32:12 2010 (r208894) @@ -270,7 +270,7 @@ mpt_raid_attach(struct mpt_softc *mpt) mpt_handler_t handler; int error; - mpt_callout_init(&mpt->raid_timer); + mpt_callout_init(mpt, &mpt->raid_timer); error = mpt_spawn_raid_thread(mpt); if (error != 0) { @@ -319,10 +319,10 @@ mpt_raid_detach(struct mpt_softc *mpt) struct ccb_setasync csa; mpt_handler_t handler; - callout_stop(&mpt->raid_timer); + mpt_callout_drain(mpt, &mpt->raid_timer); + MPT_LOCK(mpt); mpt_terminate_raid_thread(mpt); - handler.reply_handler = mpt_raid_reply_handler; mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler, raid_handler_id); @@ -1555,9 +1555,14 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } void From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 17:39:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 189F31065672; Mon, 7 Jun 2010 17:39:37 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 068388FC12; Mon, 7 Jun 2010 17:39:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57Hda7v046668; Mon, 7 Jun 2010 17:39:36 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57HdaHd046667; Mon, 7 Jun 2010 17:39:36 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006071739.o57HdaHd046667@svn.freebsd.org> From: Matt Jacob Date: Mon, 7 Jun 2010 17:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208895 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 17:39:37 -0000 Author: mjacob Date: Mon Jun 7 17:39:36 2010 New Revision: 208895 URL: http://svn.freebsd.org/changeset/base/208895 Log: Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so that it will figure out the correct target to handle index and be able to find things like WWPN, etc. MFC after: 2 weeks Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Jun 7 16:32:12 2010 (r208894) +++ head/sys/dev/isp/isp_freebsd.c Mon Jun 7 17:39:36 2010 (r208895) @@ -4506,6 +4506,7 @@ isp_action(struct cam_sim *sim, union cc fcparam *fcp = FCPARAM(isp, bus); struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_fc *fc = &cts->xport_specific.fc; + unsigned int hdlidx; cts->protocol = PROTO_SCSI; cts->protocol_version = SCSI_REV_2; @@ -4517,8 +4518,9 @@ isp_action(struct cam_sim *sim, union cc fc->valid = CTS_FC_VALID_SPEED; fc->bitrate = 100000; fc->bitrate *= fcp->isp_gbspeed; - if (tgt > 0 && tgt < MAX_FC_TARG) { - fcportdb_t *lp = &fcp->portdb[tgt]; + hdlidx = fcp->isp_dev_map[tgt] - 1; + if (hdlidx < MAX_FC_TARG) { + fcportdb_t *lp = &fcp->portdb[hdlidx]; fc->wwnn = lp->node_wwn; fc->wwpn = lp->port_wwn; fc->port = lp->portid; From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 17:41:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48BFE1065670; Mon, 7 Jun 2010 17:41:35 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 370A38FC19; Mon, 7 Jun 2010 17:41:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57HfYQo047137; Mon, 7 Jun 2010 17:41:34 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57HfYCF047135; Mon, 7 Jun 2010 17:41:34 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006071741.o57HfYCF047135@svn.freebsd.org> From: Matt Jacob Date: Mon, 7 Jun 2010 17:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208896 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 17:41:35 -0000 Author: mjacob Date: Mon Jun 7 17:41:34 2010 New Revision: 208896 URL: http://svn.freebsd.org/changeset/base/208896 Log: Do a minor amount of stylifying. Also, get a Fibre Channel WWPN if one exists for a da unit and create a sysctl OID for it. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Jun 7 17:39:36 2010 (r208895) +++ head/sys/cam/scsi/scsi_da.c Mon Jun 7 17:41:34 2010 (r208896) @@ -130,6 +130,7 @@ struct da_softc { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; struct callout sendordered_c; + uint64_t wwpn; }; struct da_quirk_entry { @@ -1099,14 +1100,38 @@ dasysctlinit(void *context, int pending) } /* - * Now register the sysctl handler, so the user can the value on + * Now register the sysctl handler, so the user can change the value on * the fly. */ - SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree), + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); + /* + * Add some addressing info. + */ + memset(&cts, 0, sizeof (cts)); + xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + cam_periph_lock(periph); + xpt_action((union ccb *)&cts); + cam_periph_unlock(periph); + if (cts.ccb_h.status != CAM_REQ_CMP) { + cam_periph_release(periph); + return; + } + if (cts.protocol == PROTO_SCSI && cts.transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc = &cts.xport_specific.fc; + if (fc->valid & CTS_FC_VALID_WWPN) { + softc->wwpn = fc->wwpn; + SYSCTL_ADD_XLONG(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "wwpn", CTLTYPE_QUAD | CTLFLAG_RD, + &softc->wwpn, "World Wide Port Name"); + } + } cam_periph_release(periph); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 18:29:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CA131065678; Mon, 7 Jun 2010 18:29:10 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AC4F8FC1D; Mon, 7 Jun 2010 18:29:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57ITAoe057575; Mon, 7 Jun 2010 18:29:10 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57ITAG5057544; Mon, 7 Jun 2010 18:29:10 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006071829.o57ITAG5057544@svn.freebsd.org> From: Randall Stewart Date: Mon, 7 Jun 2010 18:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208897 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 18:29:10 -0000 Author: rrs Date: Mon Jun 7 18:29:10 2010 New Revision: 208897 URL: http://svn.freebsd.org/changeset/base/208897 Log: This fixes a BUG in the handling of the cum-ack calculation. We were only paying attention to the nr-mapping-array. Which seems to make sense on the surface, by definition things up to the cum-ack should be deliverable thus in the nr-mapping-array. However (there is always a gotcha) thats not true when it comes to large messages. The stack may hold the message while re-assembling it not not deliver it based on several thresholds. If that happens (which it would for smaller large messages) then the cum-ack is figured wrong. We now properly use both arrays in the cum-ack calculation. MFC after: 1 week. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Jun 7 17:41:34 2010 (r208896) +++ head/sys/netinet/sctp_indata.c Mon Jun 7 18:29:10 2010 (r208897) @@ -2245,15 +2245,19 @@ sctp_slide_mapping_arrays(struct sctp_tc /* * Now we also need to check the mapping array in a couple of ways. * 1) Did we move the cum-ack point? + * + * When you first glance at this you might think that all entries that + * make up the postion of the cum-ack would be in the nr-mapping + * array only.. i.e. things up to the cum-ack are always + * deliverable. Thats true with one exception, when its a fragmented + * message we may not deliver the data until some threshold (or all + * of it) is in place. So we must OR the nr_mapping_array and + * mapping_array to get a true picture of the cum-ack. */ struct sctp_association *asoc; int at; + uint8_t val; int slide_from, slide_end, lgap, distance; - - /* EY nr_mapping array variables */ - /* int nr_at; */ - /* int nr_last_all_ones = 0; */ - /* int nr_slide_from, nr_slide_end, nr_lgap, nr_distance; */ uint32_t old_cumack, old_base, old_highest, highest_tsn; asoc = &stcb->asoc; @@ -2268,11 +2272,12 @@ sctp_slide_mapping_arrays(struct sctp_tc */ at = 0; for (slide_from = 0; slide_from < stcb->asoc.mapping_array_size; slide_from++) { - if (asoc->nr_mapping_array[slide_from] == 0xff) { + val = asoc->nr_mapping_array[slide_from] | asoc->mapping_array[slide_from]; + if (val == 0xff) { at += 8; } else { /* there is a 0 bit */ - at += sctp_map_lookup_tab[asoc->nr_mapping_array[slide_from]]; + at += sctp_map_lookup_tab[val]; break; } } From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 18:47:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49F43106566B; Mon, 7 Jun 2010 18:47:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 386058FC19; Mon, 7 Jun 2010 18:47:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57Ilsn5061706; Mon, 7 Jun 2010 18:47:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57IlsVG061704; Mon, 7 Jun 2010 18:47:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006071847.o57IlsVG061704@svn.freebsd.org> From: Alexander Motin Date: Mon, 7 Jun 2010 18:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208898 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 18:47:54 -0000 Author: mav Date: Mon Jun 7 18:47:53 2010 New Revision: 208898 URL: http://svn.freebsd.org/changeset/base/208898 Log: Call BUS_PROBE_NOMATCH() when device detached due to driver unload. This allows bus to power-down device when driver unloaded on-flight. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Jun 7 18:29:10 2010 (r208897) +++ head/sys/kern/subr_bus.c Mon Jun 7 18:47:53 2010 (r208898) @@ -1166,6 +1166,9 @@ devclass_delete_driver(devclass_t buscla if ((error = device_detach(dev)) != 0) return (error); device_set_driver(dev, NULL); + BUS_PROBE_NOMATCH(dev->parent, dev); + devnomatch(dev); + dev->flags |= DF_DONENOMATCH; } } } @@ -2660,6 +2663,7 @@ device_attach(device_t dev) } device_sysctl_update(dev); dev->state = DS_ATTACHED; + dev->flags &= ~DF_DONENOMATCH; devadded(dev); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 19:20:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9A461065670; Mon, 7 Jun 2010 19:20:52 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 20C258FC17; Mon, 7 Jun 2010 19:20:51 +0000 (UTC) Received: by vws4 with SMTP id 4so2385760vws.13 for ; Mon, 07 Jun 2010 12:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=r5abVsJq5xPb6AuCc0+xm++hBEWmO1Bc5osZ80k0U7g=; b=tE/Wb8jQ97TPpv2VBZBbAWYsXq5v0iFO+9PMeb9TCiWBRjh/nOQPE+SwfI8fC/5VhW h90WSyZ6C5eCAjFI+m9tZt3VegLATZ6Hg4w8pdPJgOb29hJCZCqdZdHaeUCnRNuHGMLC 50l7gi/RRltmSyIOFgN/R4kLUe+t9StOdqXH8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=imLQlRIKOoHgb4oQMnhpJAfK2yqIHtH58pMMCwc6xqRfH8CreVdLy+q3oMiOXQvH/x TXfTSOYHKXvcRvAgvPkks2J0363QpaCMxryn48g0h3T8gMP3galKC7xQ5lYUBC3A55vC KRwnAKcrAIR7CdrG759yHDYu2gLJSgW6qANh0= Received: by 10.224.52.154 with SMTP id i26mr8927995qag.154.1275938451031; Mon, 07 Jun 2010 12:20:51 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id 2sm7467630qwi.29.2010.06.07.12.20.45 (version=SSLv3 cipher=RC4-MD5); Mon, 07 Jun 2010 12:20:46 -0700 (PDT) Date: Mon, 7 Jun 2010 15:20:40 -0400 From: Alexander Kabaev To: Matt Jacob Message-ID: <20100607152040.1cd12f32@kan.dnsalias.net> In-Reply-To: <201006071741.o57HfYCF047135@svn.freebsd.org> References: <201006071741.o57HfYCF047135@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/1AKy/mq787I598FmoZsoprq"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208896 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 19:20:52 -0000 --Sig_/1AKy/mq787I598FmoZsoprq Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 7 Jun 2010 17:41:34 +0000 (UTC) Matt Jacob wrote: > + /* > + * Add some addressing info. > + */ > + memset(&cts, 0, sizeof (cts)); Hi, you need to declare what cts is first. Kernel cannet be compiled right now due to this. --=20 Alexander Kabaev --Sig_/1AKy/mq787I598FmoZsoprq Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iD8DBQFMDUaMQ6z1jMm+XZYRAuaSAKDjlxEmpV9/11AXrpIfzl2o85J2HwCg5gHn Bb1lWEvK5r+rBx5y9W0JnYA= =oAVN -----END PGP SIGNATURE----- --Sig_/1AKy/mq787I598FmoZsoprq-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 20:07:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A25D31065670; Mon, 7 Jun 2010 20:07:59 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id D571C8FC14; Mon, 7 Jun 2010 20:07:58 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id AA4E445CD8; Mon, 7 Jun 2010 22:07:55 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6EF8445B36; Mon, 7 Jun 2010 22:07:49 +0200 (CEST) Date: Mon, 7 Jun 2010 22:07:43 +0200 From: Pawel Jakub Dawidek To: Randall Stewart Message-ID: <20100607200743.GB4468@garage.freebsd.pl> References: <201006061611.o56GBHbE089883@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+pHx0qQiF2pBVqBT" Content-Disposition: inline In-Reply-To: <201006061611.o56GBHbE089883@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208876 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 20:07:59 -0000 --+pHx0qQiF2pBVqBT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 06, 2010 at 04:11:17PM +0000, Randall Stewart wrote: > Author: rrs > Date: Sun Jun 6 16:11:16 2010 > New Revision: 208876 > URL: http://svn.freebsd.org/changeset/base/208876 >=20 > Log: > 1) Further enhance the INVARIANT lock validation (no locks) are > held by checking the create and inp locks as well. [...] > + if (mtx_owned(&inp->inp_create_mtx)) { > + panic("Own create lock on inp"); > + } > + if (mtx_owned(&inp->inp_mtx)) { > + panic("Own inp lock on inp"); > + } If you replace this with: mtx_assert(&inp->inp_create_mtx, MA_NOTOWNED); mtx_assert(&inp->inp_mtx, MA_NOTOWNED); But the kernel has to be compiled with INVARIANTS to make it work. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --+pHx0qQiF2pBVqBT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwNUY8ACgkQForvXbEpPzQLJQCgnChrTlQpi4UdAyy6MwIxuaJY qycAoMCM401xg8zGoSicT6vawOWvAvRo =whM3 -----END PGP SIGNATURE----- --+pHx0qQiF2pBVqBT-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 20:31:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10D04106566B; Mon, 7 Jun 2010 20:31:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA8958FC08; Mon, 7 Jun 2010 20:31:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57KVtaE084532; Mon, 7 Jun 2010 20:31:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57KVtD7084530; Mon, 7 Jun 2010 20:31:55 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006072031.o57KVtD7084530@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Jun 2010 20:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208899 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 20:31:56 -0000 Author: ae Date: Mon Jun 7 20:31:55 2010 New Revision: 208899 URL: http://svn.freebsd.org/changeset/base/208899 Log: MFC r197608: The first 96 bytes may not be zeroes. It can contain trivial boot code that merely emits an error and waits for a key press before rebooting. The error being that extended partitions are not bootable. The origin is presumed to be Windows 2000; Windows XP does not do this... For now, ignore the first 96 bytes when checking that the EBR is (for the most part) all zeroes. Tested by: Mario Lobo Dieter PR: kern/141235 Reviewed by: marcel Approved by: kib (mentor) Approved by: re (bz) Modified: stable/8/sys/geom/part/g_part_ebr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part_ebr.c ============================================================================== --- stable/8/sys/geom/part/g_part_ebr.c Mon Jun 7 18:47:53 2010 (r208898) +++ stable/8/sys/geom/part/g_part_ebr.c Mon Jun 7 20:31:55 2010 (r208899) @@ -410,13 +410,13 @@ g_part_ebr_probe(struct g_part_table *ta goto out; /* - * The sector is all zeroes, except for the partition entries - * and some signatures or disk serial number. Those can be - * found in the 9 bytes immediately in front of the partition - * table. + * The sector is all zeroes, except for the partition entries, + * pseudo boot code and some signatures or disk serial number. + * The latter can be found in the 9 bytes immediately in front + * of the partition table. */ sum = 0; - for (index = 0; index < DOSPARTOFF - 9; index++) + for (index = 96; index < DOSPARTOFF - 9; index++) sum += buf[index]; if (sum != 0) goto out; From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 22:39:23 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC143106566C; Mon, 7 Jun 2010 22:39:23 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id B26BB8FC0C; Mon, 7 Jun 2010 22:39:23 +0000 (UTC) Received: from [192.168.221.2] (remotevpn [192.168.221.2]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o57Md5qh033453 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 7 Jun 2010 15:39:23 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4C0D7505.5060704@feral.com> Date: Mon, 07 Jun 2010 15:39:01 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Alexander Kabaev References: <201006071741.o57HfYCF047135@svn.freebsd.org> <20100607152040.1cd12f32@kan.dnsalias.net> In-Reply-To: <20100607152040.1cd12f32@kan.dnsalias.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.3 (ns1.feral.com [192.168.221.1]); Mon, 07 Jun 2010 15:39:23 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Matt Jacob Subject: Re: svn commit: r208896 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 22:39:24 -0000 On 6/7/2010 12:20 PM, Alexander Kabaev wrote: > On Mon, 7 Jun 2010 17:41:34 +0000 (UTC) > Matt Jacob wrote: > > > >> + /* >> + * Add some addressing info. >> + */ >> + memset(&cts, 0, sizeof (cts)); >> > Hi, > > you need to declare what cts is first. Kernel cannet be compiled right > now due to this. > > ARGH! From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 22:43:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B86D106567F; Mon, 7 Jun 2010 22:43:37 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4C18FC19; Mon, 7 Jun 2010 22:43:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57Mhbpr013500; Mon, 7 Jun 2010 22:43:37 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57MhbnX013498; Mon, 7 Jun 2010 22:43:37 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006072243.o57MhbnX013498@svn.freebsd.org> From: Matt Jacob Date: Mon, 7 Jun 2010 22:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208900 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 22:43:37 -0000 Author: mjacob Date: Mon Jun 7 22:43:37 2010 New Revision: 208900 URL: http://svn.freebsd.org/changeset/base/208900 Log: redfacedly noting a missing part of a patch. Pointy Hat To: Me MFC after: 2 Week X-MFC: 208896 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Jun 7 20:31:55 2010 (r208899) +++ head/sys/cam/scsi/scsi_da.c Mon Jun 7 22:43:37 2010 (r208900) @@ -1079,6 +1079,7 @@ dasysctlinit(void *context, int pending) struct cam_periph *periph; struct da_softc *softc; char tmpstr[80], tmpstr2[80]; + struct ccb_trans_settings cts; periph = (struct cam_periph *)context; if (cam_periph_acquire(periph) != CAM_REQ_CMP) From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 23:34:13 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4DC9106564A; Mon, 7 Jun 2010 23:34:13 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:213:d4ff:fef3:2d8d]) by mx1.freebsd.org (Postfix) with ESMTP id 2D1238FC15; Mon, 7 Jun 2010 23:34:13 +0000 (UTC) Received: from mobile-166-187-104-083.mycingular.net (mobile-166-187-104-083.mycingular.net [166.187.104.83] (may be forged)) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id o57NXxti073095 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 7 Jun 2010 19:34:10 -0400 (EDT) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1275953652; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=AHFRJP2QT98d/7UKFgUT/dXN7do8Bd1/BOJvb4VGBtIYzbJZWReAEEC 7obNspNItWmHk5jtku1bfny0Pv549vg== Message-Id: <0823DFC0-2F58-4F79-A242-81F563B22C42@lakerest.net> From: Randall Stewart To: Pawel Jakub Dawidek In-Reply-To: <20100607200743.GB4468@garage.freebsd.pl> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Mon, 7 Jun 2010 13:55:08 -0700 References: <201006061611.o56GBHbE089883@svn.freebsd.org> <20100607200743.GB4468@garage.freebsd.pl> X-Mailer: Apple Mail (2.936) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208876 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 23:34:13 -0000 Cool... I will move these over to that assert... And the invariant is ok since this function only is there when you compile invariant in. R On Jun 7, 2010, at 1:07 PM, Pawel Jakub Dawidek wrote: > On Sun, Jun 06, 2010 at 04:11:17PM +0000, Randall Stewart wrote: >> Author: rrs >> Date: Sun Jun 6 16:11:16 2010 >> New Revision: 208876 >> URL: http://svn.freebsd.org/changeset/base/208876 >> >> Log: >> 1) Further enhance the INVARIANT lock validation (no locks) are >> held by checking the create and inp locks as well. > [...] >> + if (mtx_owned(&inp->inp_create_mtx)) { >> + panic("Own create lock on inp"); >> + } >> + if (mtx_owned(&inp->inp_mtx)) { >> + panic("Own inp lock on inp"); >> + } > > If you replace this with: > > mtx_assert(&inp->inp_create_mtx, MA_NOTOWNED); > mtx_assert(&inp->inp_mtx, MA_NOTOWNED); > > But the kernel has to be compiled with INVARIANTS to make it work. > > -- > Pawel Jakub Dawidek http://www.wheelsystems.com > pjd@FreeBSD.org http://www.FreeBSD.org > FreeBSD committer Am I Evil? Yes, I Am! ------------------------------ Randall Stewart 803-317-4952 (cell) From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 03:13:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267F4106567A; Tue, 8 Jun 2010 03:13:27 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 141E98FC16; Tue, 8 Jun 2010 03:13:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o583DQlo073582; Tue, 8 Jun 2010 03:13:26 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o583DQ6J073580; Tue, 8 Jun 2010 03:13:26 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201006080313.o583DQ6J073580@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 8 Jun 2010 03:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208901 - head/sys/dev/xen/netfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 03:13:27 -0000 Author: ken Date: Tue Jun 8 03:13:26 2010 New Revision: 208901 URL: http://svn.freebsd.org/changeset/base/208901 Log: A number of netfront fixes and stability improvements: - Re-enable TSO. This was broken previously due to CSUM_TSO clearing the CSUM_TCP flag, so our checksum flags were incorrectly set going to the netback driver. That was fixed in r206844 in tcp_output.c, so we can turn TSO back on here. - Fix the way transmit slots are calculated, so that we can't overfill the ring. - Avoid sending packets with more fragments/segments than netback can handle. The Linux netback code can only handle packets of MAX_SKB_FRAGS, which turns out to be 18 on machines with 4K pages. We can easily generate packets with 32 or so fragments with TSO turned on. Right now the solution is just to drop the packets (since netback doesn't seem to handle it gracefully), but we should come up with a way to allow a driver to tell the TCP stack the maximum number of fragments it can handle in a single packet. - Fix the way the consumer is tracked in the receive path. It could get out of sync fairly easily. - Use standard Xen ring macros to make it clearer how netfront is using the rings. - Get rid of Linux-ish negative errno return values. - Added more documentation to the driver. - Refactored code to make it easier to read. - Some other minor fixes. Reviewed by: gibbs Reviewed by: gibbs Sponsored by: Spectra Logic MFC after: 7 days Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Mon Jun 7 22:43:37 2010 (r208900) +++ head/sys/dev/xen/netfront/netfront.c Tue Jun 8 03:13:26 2010 (r208901) @@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$"); #include "xenbus_if.h" -#define XN_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) +#define XN_CSUM_FEATURES (CSUM_TCP | CSUM_UDP | CSUM_TSO) #define GRANT_INVALID_REF 0 @@ -124,7 +124,16 @@ static const int MODPARM_rx_copy = 1; static const int MODPARM_rx_flip = 0; #endif -#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2) +/** + * \brief The maximum allowed data fragments in a single transmit + * request. + * + * This limit is imposed by the backend driver. We assume here that + * we are dealing with a Linux driver domain and have set our limit + * to mirror the Linux MAX_SKB_FRAGS constant. + */ +#define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) + #define RX_COPY_THRESHOLD 256 #define net_ratelimit() 0 @@ -140,6 +149,9 @@ static void xn_tick_locked(struct netfro static void xn_tick(void *); static void xn_intr(void *); +static inline int xn_count_frags(struct mbuf *m); +static int xn_assemble_tx_request(struct netfront_info *sc, + struct mbuf *m_head); static void xn_start_locked(struct ifnet *); static void xn_start(struct ifnet *); static int xn_ioctl(struct ifnet *, u_long, caddr_t); @@ -174,8 +186,8 @@ static void xn_free_rx_ring(struct netfr static void xn_free_tx_ring(struct netfront_info *); static int xennet_get_responses(struct netfront_info *np, - struct netfront_rx_info *rinfo, RING_IDX rp, struct mbuf **list, - int *pages_flipped_p); + struct netfront_rx_info *rinfo, RING_IDX rp, RING_IDX *cons, + struct mbuf **list, int *pages_flipped_p); #define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) @@ -187,11 +199,12 @@ static int xennet_get_responses(struct n * not the other way around. The size must track the free index arrays. */ struct xn_chain_data { - struct mbuf *xn_tx_chain[NET_TX_RING_SIZE+1]; - int xn_tx_chain_cnt; - struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; + struct mbuf *xn_tx_chain[NET_TX_RING_SIZE+1]; + int xn_tx_chain_cnt; + struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; }; +#define NUM_ELEMENTS(x) (sizeof(x)/sizeof(*x)) struct net_device_stats { @@ -255,17 +268,11 @@ struct netfront_info { int rx_max_target; int rx_target; - /* - * {tx,rx}_skbs store outstanding skbuffs. The first entry in each - * array is an index into a chain of free entries. - */ - grant_ref_t gref_tx_head; grant_ref_t grant_tx_ref[NET_TX_RING_SIZE + 1]; grant_ref_t gref_rx_head; grant_ref_t grant_rx_ref[NET_TX_RING_SIZE + 1]; -#define TX_MAX_TARGET min(NET_RX_RING_SIZE, 256) device_t xbdev; int tx_ring_ref; int rx_ring_ref; @@ -288,7 +295,7 @@ struct netfront_info { #define XN_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->tx_lock, #_name"_tx", "network transmit lock", MTX_DEF); \ mtx_init(&(_sc)->rx_lock, #_name"_rx", "network receive lock", MTX_DEF); \ - mtx_init(&(_sc)->sc_lock, #_name"_sc", "netfront softc lock", MTX_DEF) + mtx_init(&(_sc)->sc_lock, #_name"_sc", "netfront softc lock", MTX_DEF) #define XN_RX_LOCK(_sc) mtx_lock(&(_sc)->rx_lock) #define XN_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->rx_lock) @@ -324,18 +331,22 @@ struct netfront_rx_info { */ static inline void -add_id_to_freelist(struct mbuf **list, unsigned short id) +add_id_to_freelist(struct mbuf **list, uintptr_t id) { - KASSERT(id != 0, ("add_id_to_freelist: the head item (0) must always be free.")); + KASSERT(id != 0, + ("%s: the head item (0) must always be free.", __func__)); list[id] = list[0]; - list[0] = (void *)(u_long)id; + list[0] = (struct mbuf *)id; } static inline unsigned short get_id_from_freelist(struct mbuf **list) { - u_int id = (u_int)(u_long)list[0]; - KASSERT(id != 0, ("get_id_from_freelist: the head item (0) must always remain free.")); + uintptr_t id; + + id = (uintptr_t)list[0]; + KASSERT(id != 0, + ("%s: the head item (0) must always remain free.", __func__)); list[0] = list[id]; return (id); } @@ -347,8 +358,7 @@ xennet_rxidx(RING_IDX idx) } static inline struct mbuf * -xennet_get_rx_mbuf(struct netfront_info *np, - RING_IDX ri) +xennet_get_rx_mbuf(struct netfront_info *np, RING_IDX ri) { int i = xennet_rxidx(ri); struct mbuf *m; @@ -495,25 +505,25 @@ talk_to_backend(device_t dev, struct net goto destroy_ring; } err = xenbus_printf(xbt, node, "tx-ring-ref","%u", - info->tx_ring_ref); + info->tx_ring_ref); if (err) { message = "writing tx ring-ref"; goto abort_transaction; } err = xenbus_printf(xbt, node, "rx-ring-ref","%u", - info->rx_ring_ref); + info->rx_ring_ref); if (err) { message = "writing rx ring-ref"; goto abort_transaction; } err = xenbus_printf(xbt, node, - "event-channel", "%u", irq_to_evtchn_port(info->irq)); + "event-channel", "%u", irq_to_evtchn_port(info->irq)); if (err) { message = "writing event-channel"; goto abort_transaction; } err = xenbus_printf(xbt, node, "request-rx-copy", "%u", - info->copying_receiver); + info->copying_receiver); if (err) { message = "writing request-rx-copy"; goto abort_transaction; @@ -674,9 +684,9 @@ xn_free_rx_ring(struct netfront_info *sc int i; for (i = 0; i < NET_RX_RING_SIZE; i++) { - if (sc->xn_cdata.xn_rx_chain[i] != NULL) { - m_freem(sc->xn_cdata.xn_rx_chain[i]); - sc->xn_cdata.xn_rx_chain[i] = NULL; + if (sc->xn_cdata.rx_mbufs[i] != NULL) { + m_freem(sc->rx_mbufs[i]); + sc->rx_mbufs[i] = NULL; } } @@ -693,8 +703,8 @@ xn_free_tx_ring(struct netfront_info *sc int i; for (i = 0; i < NET_TX_RING_SIZE; i++) { - if (sc->xn_cdata.xn_tx_chain[i] != NULL) { - m_freem(sc->xn_cdata.xn_tx_chain[i]); + if (sc->tx_mbufs[i] != NULL) { + m_freem(sc->tx_mbufs[i]); sc->xn_cdata.xn_tx_chain[i] = NULL; } } @@ -703,39 +713,36 @@ xn_free_tx_ring(struct netfront_info *sc #endif } -/* - * Do some brief math on the number of descriptors available to - * determine how many slots are available. - * - * Firstly - wouldn't something with RING_FREE_REQUESTS() be more applicable? - * Secondly - MAX_SKB_FRAGS is a Linux construct which may not apply here. - * Thirdly - it isn't used here anyway; the magic constant '24' is possibly - * wrong? - * The "2" is presumably to ensure there are also enough slots available for - * the ring entries used for "options" (eg, the TSO entry before a packet - * is queued); I'm not sure why its 2 and not 1. Perhaps to make sure there's - * a "free" node in the tx mbuf list (node 0) to represent the freelist? +/** + * \brief Verify that there is sufficient space in the Tx ring + * buffer for a maximally sized request to be enqueued. * - * This only figures out whether any xenbus ring descriptors are available; - * it doesn't at all reflect how many tx mbuf ring descriptors are also - * available. + * A transmit request requires a transmit descriptor for each packet + * fragment, plus up to 2 entries for "options" (e.g. TSO). */ static inline int -netfront_tx_slot_available(struct netfront_info *np) +xn_tx_slot_available(struct netfront_info *np) { - return ((np->tx.req_prod_pvt - np->tx.rsp_cons) < - (TX_MAX_TARGET - /* MAX_SKB_FRAGS */ 24 - 2)); + return (RING_FREE_REQUESTS(&np->tx) > (MAX_TX_REQ_FRAGS + 2)); } + static void netif_release_tx_bufs(struct netfront_info *np) { - struct mbuf *m; int i; for (i = 1; i <= NET_TX_RING_SIZE; i++) { - m = np->xn_cdata.xn_tx_chain[i]; + struct mbuf *m; + + m = np->tx_mbufs[i]; - if (((u_long)m) < KERNBASE) + /* + * We assume that no kernel addresses are + * less than NET_TX_RING_SIZE. Any entry + * in the table that is below this number + * must be an index from free-list tracking. + */ + if (((uintptr_t)m) <= NET_TX_RING_SIZE) continue; gnttab_grant_foreign_access_ref(np->grant_tx_ref[i], xenbus_get_otherend_id(np->xbdev), @@ -774,19 +781,25 @@ network_alloc_rx_buffers(struct netfront return; /* - * Allocate skbuffs greedily, even though we batch updates to the + * Allocate mbufs greedily, even though we batch updates to the * receive ring. This creates a less bursty demand on the memory - * allocator, so should reduce the chance of failed allocation + * allocator, and so should reduce the chance of failed allocation * requests both for ourself and for other kernel subsystems. + * + * Here we attempt to maintain rx_target buffers in flight, counting + * buffers that we have yet to process in the receive ring. */ batch_target = sc->rx_target - (req_prod - sc->rx.rsp_cons); for (i = mbufq_len(&sc->xn_rx_batch); i < batch_target; i++) { MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) + if (m_new == NULL) { + printf("%s: MGETHDR failed\n", __func__); goto no_mbuf; + } m_cljget(m_new, M_DONTWAIT, MJUMPAGESIZE); if ((m_new->m_flags & M_EXT) == 0) { + printf("%s: m_cljget failed\n", __func__); m_freem(m_new); no_mbuf: @@ -803,16 +816,29 @@ no_mbuf: mbufq_tail(&sc->xn_rx_batch, m_new); } - /* Is the batch large enough to be worthwhile? */ + /* + * If we've allocated at least half of our target number of entries, + * submit them to the backend - we have enough to make the overhead + * of submission worthwhile. Otherwise wait for more mbufs and + * request entries to become available. + */ if (i < (sc->rx_target/2)) { if (req_prod >sc->rx.sring->req_prod) goto push; return; } - /* Adjust floating fill target if we risked running out of buffers. */ - if ( ((req_prod - sc->rx.sring->rsp_prod) < (sc->rx_target / 4)) && - ((sc->rx_target *= 2) > sc->rx_max_target) ) - sc->rx_target = sc->rx_max_target; + + /* + * Double floating fill target if we risked having the backend + * run out of empty buffers for receive traffic. We define "running + * low" as having less than a fourth of our target buffers free + * at the time we refilled the queue. + */ + if ((req_prod - sc->rx.sring->rsp_prod) < (sc->rx_target / 4)) { + sc->rx_target *= 2; + if (sc->rx_target > sc->rx_max_target) + sc->rx_target = sc->rx_max_target; + } refill: for (nr_flips = i = 0; ; i++) { @@ -824,9 +850,8 @@ refill: id = xennet_rxidx(req_prod + i); - KASSERT(sc->xn_cdata.xn_rx_chain[id] == NULL, - ("non-NULL xm_rx_chain")); - sc->xn_cdata.xn_rx_chain[id] = m_new; + KASSERT(sc->rx_mbufs[id] == NULL, ("non-NULL xm_rx_chain")); + sc->rx_mbufs[id] = m_new; ref = gnttab_claim_grant_reference(&sc->gref_rx_head); KASSERT((short)ref >= 0, ("negative ref")); @@ -950,14 +975,13 @@ xn_rxeof(struct netfront_info *np) memset(extras, 0, sizeof(rinfo.extras)); m = NULL; - err = xennet_get_responses(np, &rinfo, rp, &m, + err = xennet_get_responses(np, &rinfo, rp, &i, &m, &pages_flipped); if (unlikely(err)) { if (m) mbufq_tail(&errq, m); np->stats.rx_errors++; - i = np->rx.rsp_cons; continue; } @@ -979,7 +1003,7 @@ xn_rxeof(struct netfront_info *np) np->stats.rx_bytes += m->m_pkthdr.len; mbufq_tail(&rxq, m); - np->rx.rsp_cons = ++i; + np->rx.rsp_cons = i; } if (pages_flipped) { @@ -1084,9 +1108,16 @@ xn_txeof(struct netfront_info *np) if (txr->status == NETIF_RSP_NULL) continue; + if (txr->status != NETIF_RSP_OKAY) { + printf("%s: WARNING: response is %d!\n", + __func__, txr->status); + } id = txr->id; - m = np->xn_cdata.xn_tx_chain[id]; + m = np->tx_mbufs[id]; KASSERT(m != NULL, ("mbuf not found in xn_tx_chain")); + KASSERT((uintptr_t)m > NET_TX_RING_SIZE, + ("mbuf already on the free list, but we're " + "trying to free it again!")); M_ASSERTVALID(m); /* @@ -1097,10 +1128,8 @@ xn_txeof(struct netfront_info *np) ifp->if_opackets++; if (unlikely(gnttab_query_foreign_access( np->grant_tx_ref[id]) != 0)) { - WPRINTK("network_tx_buf_gc: warning " - "-- grant still in use by backend " - "domain.\n"); - goto out; + panic("grant id %u still in use by the backend", + id); } gnttab_end_foreign_access_ref( np->grant_tx_ref[id]); @@ -1108,12 +1137,9 @@ xn_txeof(struct netfront_info *np) &np->gref_tx_head, np->grant_tx_ref[id]); np->grant_tx_ref[id] = GRANT_INVALID_REF; - np->xn_cdata.xn_tx_chain[id] = NULL; - add_id_to_freelist(np->xn_cdata.xn_tx_chain, id); + np->tx_mbufs[id] = NULL; + add_id_to_freelist(np->tx_mbufs, id); np->xn_cdata.xn_tx_chain_cnt--; - if (np->xn_cdata.xn_tx_chain_cnt < 0) { - panic("netif_release_tx_bufs: tx_chain_cnt must be >= 0"); - } m_free(m); /* Only mark the queue active if we've freed up at least one slot to try */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1135,7 +1161,6 @@ xn_txeof(struct netfront_info *np) mb(); } while (prod != np->tx.sring->rsp_prod); - out: if (np->tx_full && ((np->tx.sring->req_prod - prod) < NET_TX_RING_SIZE)) { np->tx_full = 0; @@ -1159,7 +1184,7 @@ xn_intr(void *xsc) ifp->if_drv_flags & IFF_DRV_RUNNING)) return; #endif - if (np->tx.rsp_cons != np->tx.sring->rsp_prod) { + if (RING_HAS_UNCONSUMED_RESPONSES(&np->tx)) { XN_TX_LOCK(np); xn_txeof(np); XN_TX_UNLOCK(np); @@ -1191,10 +1216,9 @@ xennet_move_rx_slot(struct netfront_info static int xennet_get_extras(struct netfront_info *np, - struct netif_extra_info *extras, RING_IDX rp) + struct netif_extra_info *extras, RING_IDX rp, RING_IDX *cons) { struct netif_extra_info *extra; - RING_IDX cons = np->rx.rsp_cons; int err = 0; @@ -1202,17 +1226,17 @@ xennet_get_extras(struct netfront_info * struct mbuf *m; grant_ref_t ref; - if (unlikely(cons + 1 == rp)) { + if (unlikely(*cons + 1 == rp)) { #if 0 if (net_ratelimit()) WPRINTK("Missing extra info\n"); #endif - err = -EINVAL; + err = EINVAL; break; } extra = (struct netif_extra_info *) - RING_GET_RESPONSE(&np->rx, ++cons); + RING_GET_RESPONSE(&np->rx, ++(*cons)); if (unlikely(!extra->type || extra->type >= XEN_NETIF_EXTRA_TYPE_MAX)) { @@ -1221,23 +1245,22 @@ xennet_get_extras(struct netfront_info * WPRINTK("Invalid extra type: %d\n", extra->type); #endif - err = -EINVAL; + err = EINVAL; } else { memcpy(&extras[extra->type - 1], extra, sizeof(*extra)); } - m = xennet_get_rx_mbuf(np, cons); - ref = xennet_get_rx_ref(np, cons); + m = xennet_get_rx_mbuf(np, *cons); + ref = xennet_get_rx_ref(np, *cons); xennet_move_rx_slot(np, m, ref); } while (extra->flags & XEN_NETIF_EXTRA_FLAG_MORE); - np->rx.rsp_cons = cons; return err; } static int xennet_get_responses(struct netfront_info *np, - struct netfront_rx_info *rinfo, RING_IDX rp, + struct netfront_rx_info *rinfo, RING_IDX rp, RING_IDX *cons, struct mbuf **list, int *pages_flipped_p) { @@ -1246,26 +1269,25 @@ xennet_get_responses(struct netfront_inf struct multicall_entry *mcl; struct netif_rx_response *rx = &rinfo->rx; struct netif_extra_info *extras = rinfo->extras; - RING_IDX cons = np->rx.rsp_cons; struct mbuf *m, *m0, *m_prev; - grant_ref_t ref = xennet_get_rx_ref(np, cons); - int max = 5 /* MAX_SKB_FRAGS + (rx->status <= RX_COPY_THRESHOLD) */; + grant_ref_t ref = xennet_get_rx_ref(np, *cons); + RING_IDX ref_cons = *cons; + int max = 5 /* MAX_TX_REQ_FRAGS + (rx->status <= RX_COPY_THRESHOLD) */; int frags = 1; int err = 0; u_long ret; - m0 = m = m_prev = xennet_get_rx_mbuf(np, cons); + m0 = m = m_prev = xennet_get_rx_mbuf(np, *cons); if (rx->flags & NETRXF_extra_info) { - err = xennet_get_extras(np, extras, rp); - cons = np->rx.rsp_cons; + err = xennet_get_extras(np, extras, rp, cons); } if (m0 != NULL) { - m0->m_pkthdr.len = 0; - m0->m_next = NULL; + m0->m_pkthdr.len = 0; + m0->m_next = NULL; } for (;;) { @@ -1277,14 +1299,18 @@ xennet_get_responses(struct netfront_inf #endif if (unlikely(rx->status < 0 || rx->offset + rx->status > PAGE_SIZE)) { + #if 0 if (net_ratelimit()) WPRINTK("rx->offset: %x, size: %u\n", rx->offset, rx->status); #endif xennet_move_rx_slot(np, m, ref); - err = -EINVAL; - goto next; + if (m0 == m) + m0 = NULL; + m = NULL; + err = EINVAL; + goto next_skip_queue; } /* @@ -1293,11 +1319,12 @@ xennet_get_responses(struct netfront_inf * situation to the system controller to reboot the backed. */ if (ref == GRANT_INVALID_REF) { + #if 0 if (net_ratelimit()) WPRINTK("Bad rx response id %d.\n", rx->id); #endif - err = -EINVAL; + err = EINVAL; goto next; } @@ -1306,12 +1333,10 @@ xennet_get_responses(struct netfront_inf * headroom, ... */ if (!(mfn = gnttab_end_foreign_transfer_ref(ref))) { - if (net_ratelimit()) - WPRINTK("Unfulfilled rx req " - "(id=%d, st=%d).\n", - rx->id, rx->status); + WPRINTK("Unfulfilled rx req (id=%d, st=%d).\n", + rx->id, rx->status); xennet_move_rx_slot(np, m, ref); - err = -ENOMEM; + err = ENOMEM; goto next; } @@ -1349,23 +1374,43 @@ next: m->m_data += rx->offset; m0->m_pkthdr.len += rx->status; +next_skip_queue: if (!(rx->flags & NETRXF_more_data)) break; - if (cons + frags == rp) { + if (*cons + frags == rp) { if (net_ratelimit()) WPRINTK("Need more frags\n"); - err = -ENOENT; + err = ENOENT; + printf("%s: cons %u frags %u rp %u, not enough frags\n", + __func__, *cons, frags, rp); break; } + /* + * Note that m can be NULL, if rx->status < 0 or if + * rx->offset + rx->status > PAGE_SIZE above. + */ m_prev = m; - rx = RING_GET_RESPONSE(&np->rx, cons + frags); - m = xennet_get_rx_mbuf(np, cons + frags); + rx = RING_GET_RESPONSE(&np->rx, *cons + frags); + m = xennet_get_rx_mbuf(np, *cons + frags); - m_prev->m_next = m; + /* + * m_prev == NULL can happen if rx->status < 0 or if + * rx->offset + * rx->status > PAGE_SIZE above. + */ + if (m_prev != NULL) + m_prev->m_next = m; + + /* + * m0 can be NULL if rx->status < 0 or if * rx->offset + + * rx->status > PAGE_SIZE above. + */ + if (m0 == NULL) + m0 = m; m->m_next = NULL; - ref = xennet_get_rx_ref(np, cons + frags); + ref = xennet_get_rx_ref(np, *cons + frags); + ref_cons = *cons + frags; frags++; } *list = m0; @@ -1373,11 +1418,12 @@ next: if (unlikely(frags > max)) { if (net_ratelimit()) WPRINTK("Too many frags\n"); - err = -E2BIG; + printf("%s: too many frags %d > max %d\n", __func__, frags, + max); + err = E2BIG; } - if (unlikely(err)) - np->rx.rsp_cons = cons + frags; + *cons += frags; *pages_flipped_p = pages_flipped; @@ -1406,209 +1452,228 @@ xn_tick(void *xsc) XN_RX_UNLOCK(sc); } -static void -xn_start_locked(struct ifnet *ifp) + +/** + * \brief Count the number of fragments in an mbuf chain. + * + * Surprisingly, there isn't an M* macro for this. + */ +static inline int +xn_count_frags(struct mbuf *m) { - int otherend_id; - unsigned short id; - struct mbuf *m_head, *m; - struct netfront_info *sc; - netif_tx_request_t *tx; + int nfrags; + + for (nfrags = 0; m != NULL; m = m->m_next) + nfrags++; + + return (nfrags); +} + +/** + * Given an mbuf chain, make sure we have enough room and then push + * it onto the transmit ring. + */ +static int +xn_assemble_tx_request(struct netfront_info *sc, struct mbuf *m_head) +{ + struct ifnet *ifp; + struct mbuf *m; + u_int nfrags; netif_extra_info_t *extra; - RING_IDX i; - grant_ref_t ref; - u_long mfn, tx_bytes; - int notify, nfrags; + int otherend_id; - sc = ifp->if_softc; - otherend_id = xenbus_get_otherend_id(sc->xbdev); - tx_bytes = 0; + ifp = sc->xn_ifp; - if (!netfront_carrier_ok(sc)) - return; - - for (i = sc->tx.req_prod_pvt; TRUE; i++) { - IF_DEQUEUE(&ifp->if_snd, m_head); - if (m_head == NULL) - break; - - /* - * netfront_tx_slot_available() tries to do some math to - * ensure that there'll be enough xenbus ring slots available - * for the maximum number of packet fragments (and a couple more - * for what I guess are TSO and other ring entry items.) - */ - if (!netfront_tx_slot_available(sc)) { - IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } + /** + * Defragment the mbuf if necessary. + */ + nfrags = xn_count_frags(m_head); - /* - * Defragment the mbuf if necessary. - */ - for (m = m_head, nfrags = 0; m; m = m->m_next) - nfrags++; - if (nfrags > MAX_SKB_FRAGS) { - m = m_defrag(m_head, M_DONTWAIT); - if (!m) { - m_freem(m_head); - break; - } - m_head = m; + /* + * Check to see whether this request is longer than netback + * can handle, and try to defrag it. + */ + /** + * It is a bit lame, but the netback driver in Linux can't + * deal with nfrags > MAX_TX_REQ_FRAGS, which is a quirk of + * the Linux network stack. + */ + if (nfrags > MAX_TX_REQ_FRAGS) { + m = m_defrag(m_head, M_DONTWAIT); + if (!m) { + /* + * Defrag failed, so free the mbuf and + * therefore drop the packet. + */ + m_freem(m_head); + return (EMSGSIZE); } + m_head = m; + } - /* Determine how many fragments now exist */ - for (m = m_head, nfrags = 0; m; m = m->m_next) - nfrags++; + /* Determine how many fragments now exist */ + nfrags = xn_count_frags(m_head); - /* - * Don't attempt to queue this packet if there aren't - * enough free entries in the chain. - * - * There isn't a 1:1 correspondance between the mbuf TX ring - * and the xenbus TX ring. - * xn_txeof() may need to be called to free up some slots. - * - * It is quite possible that this can be later eliminated if - * it turns out that partial * packets can be pushed into - * the ringbuffer, with fragments pushed in when further slots - * free up. - * - * It is also quite possible that the driver will lock up - * if the TX queue fills up with no RX traffic, and - * the mbuf ring is exhausted. The queue may need - * a swift kick to continue. - */ + /* + * Check to see whether the defragmented packet has too many + * segments for the Linux netback driver. + */ + /** + * The FreeBSD TCP stack, with TSO enabled, can produce a chain + * of mbufs longer than Linux can handle. Make sure we don't + * pass a too-long chain over to the other side by dropping the + * packet. It doesn't look like there is currently a way to + * tell the TCP stack to generate a shorter chain of packets. + */ + if (nfrags > MAX_TX_REQ_FRAGS) { + m_freem(m_head); + return (EMSGSIZE); + } - /* - * It is not +1 like the allocation because we need to keep - * slot [0] free for the freelist head - */ - if (sc->xn_cdata.xn_tx_chain_cnt + nfrags >= NET_TX_RING_SIZE) { - WPRINTK("xn_start_locked: xn_tx_chain_cnt (%d) + nfrags %d >= NET_TX_RING_SIZE (%d); must be full!\n", - (int) sc->xn_cdata.xn_tx_chain_cnt, - (int) nfrags, (int) NET_TX_RING_SIZE); - IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } + /* + * This check should be redundant. We've already verified that we + * have enough slots in the ring to handle a packet of maximum + * size, and that our packet is less than the maximum size. Keep + * it in here as an assert for now just to make certain that + * xn_tx_chain_cnt is accurate. + */ + KASSERT((sc->xn_cdata.xn_tx_chain_cnt + nfrags) <= NET_TX_RING_SIZE, + ("%s: xn_tx_chain_cnt (%d) + nfrags (%d) > NET_TX_RING_SIZE " + "(%d)!", __func__, (int) sc->xn_cdata.xn_tx_chain_cnt, + (int) nfrags, (int) NET_TX_RING_SIZE)); - /* - * Make sure there's actually space available in the - * Xen TX ring for this. Overcompensate for the possibility - * of having a TCP offload fragment just in case for now - * (the +1) rather than adding logic to accurately calculate - * the required size. - */ - if (RING_FREE_REQUESTS(&sc->tx) < (nfrags + 1)) { - WPRINTK("xn_start_locked: free ring slots (%d) < (nfrags + 1) (%d); must be full!\n", - (int) RING_FREE_REQUESTS(&sc->tx), - (int) (nfrags + 1)); - IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } + /* + * Start packing the mbufs in this chain into + * the fragment pointers. Stop when we run out + * of fragments or hit the end of the mbuf chain. + */ + m = m_head; + extra = NULL; + otherend_id = xenbus_get_otherend_id(sc->xbdev); + for (m = m_head; m; m = m->m_next) { + netif_tx_request_t *tx; + uintptr_t id; + grant_ref_t ref; + u_long mfn; /* XXX Wrong type? */ - /* - * Start packing the mbufs in this chain into - * the fragment pointers. Stop when we run out - * of fragments or hit the end of the mbuf chain. - */ - m = m_head; - extra = NULL; - for (m = m_head; m; m = m->m_next) { - tx = RING_GET_REQUEST(&sc->tx, i); - id = get_id_from_freelist(sc->xn_cdata.xn_tx_chain); - if (id == 0) - panic("xn_start_locked: was allocated the freelist head!\n"); - sc->xn_cdata.xn_tx_chain_cnt++; - if (sc->xn_cdata.xn_tx_chain_cnt >= NET_TX_RING_SIZE+1) - panic("xn_start_locked: tx_chain_cnt must be < NET_TX_RING_SIZE+1\n"); - sc->xn_cdata.xn_tx_chain[id] = m; - tx->id = id; - ref = gnttab_claim_grant_reference(&sc->gref_tx_head); - KASSERT((short)ref >= 0, ("Negative ref")); - mfn = virt_to_mfn(mtod(m, vm_offset_t)); - gnttab_grant_foreign_access_ref(ref, otherend_id, - mfn, GNTMAP_readonly); - tx->gref = sc->grant_tx_ref[id] = ref; - tx->offset = mtod(m, vm_offset_t) & (PAGE_SIZE - 1); - tx->flags = 0; - if (m == m_head) { - /* - * The first fragment has the entire packet - * size, subsequent fragments have just the - * fragment size. The backend works out the - * true size of the first fragment by - * subtracting the sizes of the other - * fragments. - */ - tx->size = m->m_pkthdr.len; + tx = RING_GET_REQUEST(&sc->tx, sc->tx.req_prod_pvt); + id = get_id_from_freelist(sc->tx_mbufs); + if (id == 0) + panic("xn_start_locked: was allocated the freelist head!\n"); + sc->xn_cdata.xn_tx_chain_cnt++; + if (sc->xn_cdata.xn_tx_chain_cnt > NET_TX_RING_SIZE) + panic("xn_start_locked: tx_chain_cnt must be <= NET_TX_RING_SIZE\n"); + sc->tx_mbufs[id] = m; + tx->id = id; + ref = gnttab_claim_grant_reference(&sc->gref_tx_head); + KASSERT((short)ref >= 0, ("Negative ref")); + mfn = virt_to_mfn(mtod(m, vm_offset_t)); + gnttab_grant_foreign_access_ref(ref, otherend_id, + mfn, GNTMAP_readonly); + tx->gref = sc->grant_tx_ref[id] = ref; + tx->offset = mtod(m, vm_offset_t) & (PAGE_SIZE - 1); + tx->flags = 0; + if (m == m_head) { + /* + * The first fragment has the entire packet + * size, subsequent fragments have just the + * fragment size. The backend works out the + * true size of the first fragment by + * subtracting the sizes of the other + * fragments. + */ + tx->size = m->m_pkthdr.len; - /* - * The first fragment contains the - * checksum flags and is optionally - * followed by extra data for TSO etc. - */ - if (m->m_pkthdr.csum_flags - & CSUM_DELAY_DATA) { - tx->flags |= (NETTXF_csum_blank - | NETTXF_data_validated); - } -#if __FreeBSD_version >= 700000 - if (m->m_pkthdr.csum_flags & CSUM_TSO) { - struct netif_extra_info *gso = - (struct netif_extra_info *) - RING_GET_REQUEST(&sc->tx, ++i); - - if (extra) - extra->flags |= XEN_NETIF_EXTRA_FLAG_MORE; - else - tx->flags |= NETTXF_extra_info; - - gso->u.gso.size = m->m_pkthdr.tso_segsz; - gso->u.gso.type = - XEN_NETIF_GSO_TYPE_TCPV4; - gso->u.gso.pad = 0; - gso->u.gso.features = 0; - - gso->type = XEN_NETIF_EXTRA_TYPE_GSO; - gso->flags = 0; - extra = gso; - } -#endif - } else { - tx->size = m->m_len; + /* + * The first fragment contains the checksum flags + * and is optionally followed by extra data for + * TSO etc. + */ + /** + * CSUM_TSO requires checksum offloading. + * Some versions of FreeBSD fail to + * set CSUM_TCP in the CSUM_TSO case, + * so we have to test for CSUM_TSO + * explicitly. + */ + if (m->m_pkthdr.csum_flags + & (CSUM_DELAY_DATA | CSUM_TSO)) { + tx->flags |= (NETTXF_csum_blank + | NETTXF_data_validated); } - if (m->m_next) { - tx->flags |= NETTXF_more_data; - i++; +#if __FreeBSD_version >= 700000 + if (m->m_pkthdr.csum_flags & CSUM_TSO) { + struct netif_extra_info *gso = + (struct netif_extra_info *) + RING_GET_REQUEST(&sc->tx, + ++sc->tx.req_prod_pvt); + + tx->flags |= NETTXF_extra_info; + + gso->u.gso.size = m->m_pkthdr.tso_segsz; + gso->u.gso.type = + XEN_NETIF_GSO_TYPE_TCPV4; + gso->u.gso.pad = 0; + gso->u.gso.features = 0; + + gso->type = XEN_NETIF_EXTRA_TYPE_GSO; + gso->flags = 0; } +#endif + } else { + tx->size = m->m_len; } + if (m->m_next) + tx->flags |= NETTXF_more_data; - BPF_MTAP(ifp, m_head); + sc->tx.req_prod_pvt++; + } + BPF_MTAP(ifp, m_head); + + sc->stats.tx_bytes += m_head->m_pkthdr.len; + sc->stats.tx_packets++; + + return (0); +} - sc->stats.tx_bytes += m_head->m_pkthdr.len; - sc->stats.tx_packets++; +static void +xn_start_locked(struct ifnet *ifp) +{ + struct netfront_info *sc; + struct mbuf *m_head; + int notify; + + sc = ifp->if_softc; + + if (!netfront_carrier_ok(sc)) + return; + + /* + * While we have enough transmit slots available for at least one + * maximum-sized packet, pull mbufs off the queue and put them on + * the transmit ring. + */ + while (xn_tx_slot_available(sc)) { + IF_DEQUEUE(&ifp->if_snd, m_head); + if (m_head == NULL) + break; + + if (xn_assemble_tx_request(sc, m_head) != 0) + break; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 03:39:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BF4F1065676; Tue, 8 Jun 2010 03:39:31 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51F978FC12; Tue, 8 Jun 2010 03:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o583dVTk079290; Tue, 8 Jun 2010 03:39:31 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o583dVnh079288; Tue, 8 Jun 2010 03:39:31 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006080339.o583dVnh079288@svn.freebsd.org> From: Randall Stewart Date: Tue, 8 Jun 2010 03:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208902 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 03:39:31 -0000 Author: rrs Date: Tue Jun 8 03:39:31 2010 New Revision: 208902 URL: http://svn.freebsd.org/changeset/base/208902 Log: 2 Bugs: 1) Only use both mapping arrays when NR sack is off. This way we can hold off moving the cumack (not the best but workable) when NR-sack is on. 2) We must make sure to just return on the move of the bit to the NR array if the cum-ack as already went past the TSN. This prevents marking a bit behind the array and hitting the invariant code that panic's us. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Jun 8 03:13:26 2010 (r208901) +++ head/sys/netinet/sctp_indata.c Tue Jun 8 03:39:31 2010 (r208902) @@ -289,12 +289,20 @@ sctp_build_ctl_cchunk(struct sctp_inpcb static void sctp_mark_non_revokable(struct sctp_association *asoc, uint32_t tsn) { - uint32_t gap, i; + uint32_t gap, i, cumackp1; int fnd = 0; if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { return; } + cumackp1 = asoc->cumulative_tsn + 1; + if (compare_with_wrap(cumackp1, tsn, MAX_TSN)) { + /* + * this tsn is behind the cum ack and thus we don't need to + * worry about it being moved from one to the other. + */ + return; + } SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn); if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { printf("gap:%x tsn:%x\n", gap, tsn); @@ -2259,6 +2267,7 @@ sctp_slide_mapping_arrays(struct sctp_tc uint8_t val; int slide_from, slide_end, lgap, distance; uint32_t old_cumack, old_base, old_highest, highest_tsn; + int type; asoc = &stcb->asoc; at = 0; @@ -2270,9 +2279,18 @@ sctp_slide_mapping_arrays(struct sctp_tc * We could probably improve this a small bit by calculating the * offset of the current cum-ack as the starting point. */ + if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && + stcb->asoc.peer_supports_nr_sack) { + type = SCTP_NR_SELECTIVE_ACK; + } else { + type = SCTP_SELECTIVE_ACK; + } at = 0; for (slide_from = 0; slide_from < stcb->asoc.mapping_array_size; slide_from++) { - val = asoc->nr_mapping_array[slide_from] | asoc->mapping_array[slide_from]; + if (type == SCTP_NR_SELECTIVE_ACK) + val = asoc->nr_mapping_array[slide_from]; + else + val = asoc->nr_mapping_array[slide_from] | asoc->mapping_array[slide_from]; if (val == 0xff) { at += 8; } else { From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 04:41:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C87D4106567B; Tue, 8 Jun 2010 04:41:31 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B73268FC14; Tue, 8 Jun 2010 04:41:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o584fVsU092807; Tue, 8 Jun 2010 04:41:31 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o584fVrG092805; Tue, 8 Jun 2010 04:41:31 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006080441.o584fVrG092805@svn.freebsd.org> From: Alan Cox Date: Tue, 8 Jun 2010 04:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208903 - stable/8/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 04:41:31 -0000 Author: alc Date: Tue Jun 8 04:41:31 2010 New Revision: 208903 URL: http://svn.freebsd.org/changeset/base/208903 Log: MFC r208765 In the unlikely event that pmap_ts_referenced() demoted five superpage mappings to the same underlying physical page, the calling thread would be left forever pinned to the same processor. Approved by: re (kib) Modified: stable/8/sys/i386/i386/pmap.c Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Tue Jun 8 03:39:31 2010 (r208902) +++ stable/8/sys/i386/i386/pmap.c Tue Jun 8 04:41:31 2010 (r208903) @@ -4461,7 +4461,7 @@ pmap_ts_referenced(vm_page_t m) rtval++; if (rtval > 4) { PMAP_UNLOCK(pmap); - return (rtval); + goto out; } } } @@ -4490,6 +4490,7 @@ pmap_ts_referenced(vm_page_t m) PMAP_UNLOCK(pmap); } while ((pv = pvn) != NULL && pv != pvf); } +out: sched_unpin(); return (rtval); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 04:48:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9734C1065670; Tue, 8 Jun 2010 04:48:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85BC08FC18; Tue, 8 Jun 2010 04:48:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o584maXv094400; Tue, 8 Jun 2010 04:48:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o584maU6094398; Tue, 8 Jun 2010 04:48:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006080448.o584maU6094398@svn.freebsd.org> From: Alan Cox Date: Tue, 8 Jun 2010 04:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208904 - stable/7/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 04:48:36 -0000 Author: alc Date: Tue Jun 8 04:48:36 2010 New Revision: 208904 URL: http://svn.freebsd.org/changeset/base/208904 Log: MFC r208765 In the unlikely event that pmap_ts_referenced() demoted five superpage mappings to the same underlying physical page, the calling thread would be left forever pinned to the same processor. Modified: stable/7/sys/i386/i386/pmap.c Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Tue Jun 8 04:41:31 2010 (r208903) +++ stable/7/sys/i386/i386/pmap.c Tue Jun 8 04:48:36 2010 (r208904) @@ -4408,7 +4408,7 @@ pmap_ts_referenced(vm_page_t m) rtval++; if (rtval > 4) { PMAP_UNLOCK(pmap); - return (rtval); + goto out; } } } @@ -4437,6 +4437,7 @@ pmap_ts_referenced(vm_page_t m) PMAP_UNLOCK(pmap); } while ((pv = pvn) != NULL && pv != pvf); } +out: sched_unpin(); return (rtval); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 05:14:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37698106567A; Tue, 8 Jun 2010 05:14:19 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25D2F8FC19; Tue, 8 Jun 2010 05:14:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o585EJQM000185; Tue, 8 Jun 2010 05:14:19 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o585EJfi000181; Tue, 8 Jun 2010 05:14:19 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006080514.o585EJfi000181@svn.freebsd.org> From: Matt Jacob Date: Tue, 8 Jun 2010 05:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208905 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 05:14:19 -0000 Author: mjacob Date: Tue Jun 8 05:14:18 2010 New Revision: 208905 URL: http://svn.freebsd.org/changeset/base/208905 Log: Make additional definitions up to and including SPC-4. Add in definitions for REPORT and SET TARGET PORT GROUP commands (foundations for future work). Regularize opcodes to be upper case hex. Pick *one* of tab or space after #define (tab) and stick with that. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_ch.h Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Tue Jun 8 04:48:36 2010 (r208904) +++ head/sys/cam/scsi/scsi_all.c Tue Jun 8 05:14:18 2010 (r208905) @@ -3954,6 +3954,57 @@ scsi_report_luns(struct ccb_scsiio *csio scsi_ulto4b(alloc_len, scsi_cmd->length); } +void +scsi_report_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t pdf, + void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_target_group *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_target_group *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_IN; + scsi_cmd->service_action = REPORT_TARGET_PORT_GROUPS | pdf; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + +void +scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_target_group *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_target_group *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_OUT; + scsi_cmd->service_action = SET_TARGET_PORT_GROUPS; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + /* * Syncronize the media to the contents of the cache for * the given lba/count pair. Specifying 0/0 means sync Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Tue Jun 8 04:48:36 2010 (r208904) +++ head/sys/cam/scsi/scsi_all.h Tue Jun 8 05:14:18 2010 (r208905) @@ -22,7 +22,7 @@ */ #ifndef _SCSI_SCSI_ALL_H -#define _SCSI_SCSI_ALL_H 1 +#define _SCSI_SCSI_ALL_H 1 #include @@ -41,13 +41,13 @@ extern int scsi_delay; /* * Define dome bits that are in ALL (or a lot of) scsi commands */ -#define SCSI_CTL_LINK 0x01 -#define SCSI_CTL_FLAG 0x02 -#define SCSI_CTL_VENDOR 0xC0 +#define SCSI_CTL_LINK 0x01 +#define SCSI_CTL_FLAG 0x02 +#define SCSI_CTL_VENDOR 0xC0 #define SCSI_CMD_LUN 0xA0 /* these two should not be needed */ #define SCSI_CMD_LUN_SHIFT 5 /* LUN in the cmd is no longer SCSI */ -#define SCSI_MAX_CDBLEN 16 /* +#define SCSI_MAX_CDBLEN 16 /* * 16 byte commands are in the * SCSI-3 spec */ @@ -56,7 +56,7 @@ extern int scsi_delay; #endif /* 6byte CDBs special case 0 length to be 256 */ -#define SCSI_CDB6_LEN(len) ((len) == 0 ? 256 : len) +#define SCSI_CDB6_LEN(len) ((len) == 0 ? 256 : len) /* * This type defines actions to be taken when a particular sense code is @@ -94,16 +94,16 @@ typedef enum { } scsi_sense_action_qualifier; /* Mask for error status values */ -#define SS_ERRMASK 0xff +#define SS_ERRMASK 0xff /* The default, retyable, error action */ -#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|EIO +#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|EIO /* The retyable, error action, with table specified error code */ -#define SS_RET SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE +#define SS_RET SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE /* Fatal error action, with table specified error code */ -#define SS_FATAL SS_FAIL|SSQ_PRINT_SENSE +#define SS_FATAL SS_FAIL|SSQ_PRINT_SENSE struct scsi_generic { @@ -168,16 +168,16 @@ struct scsi_mode_sense_6 #define SMS_DBD 0x08 u_int8_t page; #define SMS_PAGE_CODE 0x3F -#define SMS_VENDOR_SPECIFIC_PAGE 0x00 -#define SMS_DISCONNECT_RECONNECT_PAGE 0x02 -#define SMS_FORMAT_DEVICE_PAGE 0x03 -#define SMS_GEOMETRY_PAGE 0x04 -#define SMS_CACHE_PAGE 0x08 -#define SMS_PERIPHERAL_DEVICE_PAGE 0x09 -#define SMS_CONTROL_MODE_PAGE 0x0A -#define SMS_PROTO_SPECIFIC_PAGE 0x19 -#define SMS_INFO_EXCEPTIONS_PAGE 0x1C -#define SMS_ALL_PAGES_PAGE 0x3F +#define SMS_VENDOR_SPECIFIC_PAGE 0x00 +#define SMS_DISCONNECT_RECONNECT_PAGE 0x02 +#define SMS_FORMAT_DEVICE_PAGE 0x03 +#define SMS_GEOMETRY_PAGE 0x04 +#define SMS_CACHE_PAGE 0x08 +#define SMS_PERIPHERAL_DEVICE_PAGE 0x09 +#define SMS_CONTROL_MODE_PAGE 0x0A +#define SMS_PROTO_SPECIFIC_PAGE 0x19 +#define SMS_INFO_EXCEPTIONS_PAGE 0x1C +#define SMS_ALL_PAGES_PAGE 0x3F #define SMS_PAGE_CTRL_MASK 0xC0 #define SMS_PAGE_CTRL_CURRENT 0x00 #define SMS_PAGE_CTRL_CHANGEABLE 0x40 @@ -262,8 +262,8 @@ struct scsi_log_sense #define SLS_ERROR_VERIFY_PAGE 0x05 #define SLS_ERROR_NONMEDIUM_PAGE 0x06 #define SLS_ERROR_LASTN_PAGE 0x07 -#define SLS_SELF_TEST_PAGE 0x10 -#define SLS_IE_PAGE 0x2f +#define SLS_SELF_TEST_PAGE 0x10 +#define SLS_IE_PAGE 0x2f #define SLS_PAGE_CTRL_MASK 0xC0 #define SLS_PAGE_CTRL_THRESHOLD 0x00 #define SLS_PAGE_CTRL_CUMULATIVE 0x40 @@ -320,30 +320,30 @@ struct scsi_control_page { u_int8_t page_code; u_int8_t page_length; u_int8_t rlec; -#define SCB_RLEC 0x01 /*Report Log Exception Cond*/ +#define SCB_RLEC 0x01 /*Report Log Exception Cond*/ u_int8_t queue_flags; -#define SCP_QUEUE_ALG_MASK 0xF0 -#define SCP_QUEUE_ALG_RESTRICTED 0x00 -#define SCP_QUEUE_ALG_UNRESTRICTED 0x10 -#define SCP_QUEUE_ERR 0x02 /*Queued I/O aborted for CACs*/ -#define SCP_QUEUE_DQUE 0x01 /*Queued I/O disabled*/ +#define SCP_QUEUE_ALG_MASK 0xF0 +#define SCP_QUEUE_ALG_RESTRICTED 0x00 +#define SCP_QUEUE_ALG_UNRESTRICTED 0x10 +#define SCP_QUEUE_ERR 0x02 /*Queued I/O aborted for CACs*/ +#define SCP_QUEUE_DQUE 0x01 /*Queued I/O disabled*/ u_int8_t eca_and_aen; -#define SCP_EECA 0x80 /*Enable Extended CA*/ -#define SCP_RAENP 0x04 /*Ready AEN Permission*/ -#define SCP_UAAENP 0x02 /*UA AEN Permission*/ -#define SCP_EAENP 0x01 /*Error AEN Permission*/ +#define SCP_EECA 0x80 /*Enable Extended CA*/ +#define SCP_RAENP 0x04 /*Ready AEN Permission*/ +#define SCP_UAAENP 0x02 /*UA AEN Permission*/ +#define SCP_EAENP 0x01 /*Error AEN Permission*/ u_int8_t reserved; u_int8_t aen_holdoff_period[2]; }; struct scsi_cache_page { u_int8_t page_code; -#define SCHP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SCHP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t cache_flags; -#define SCHP_FLAGS_WCE 0x04 /* Write Cache Enable */ -#define SCHP_FLAGS_MF 0x02 /* Multiplication factor */ -#define SCHP_FLAGS_RCD 0x01 /* Read Cache Disable */ +#define SCHP_FLAGS_WCE 0x04 /* Write Cache Enable */ +#define SCHP_FLAGS_MF 0x02 /* Multiplication factor */ +#define SCHP_FLAGS_RCD 0x01 /* Read Cache Disable */ u_int8_t rw_cache_policy; u_int8_t dis_prefetch[2]; u_int8_t min_prefetch[2]; @@ -353,16 +353,16 @@ struct scsi_cache_page { struct scsi_info_exceptions_page { u_int8_t page_code; -#define SIEP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SIEP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t info_flags; -#define SIEP_FLAGS_PERF 0x80 -#define SIEP_FLAGS_EBF 0x20 -#define SIEP_FLAGS_EWASC 0x10 -#define SIEP_FLAGS_DEXCPT 0x08 -#define SIEP_FLAGS_TEST 0x04 -#define SIEP_FLAGS_EBACKERR 0x02 -#define SIEP_FLAGS_LOGERR 0x01 +#define SIEP_FLAGS_PERF 0x80 +#define SIEP_FLAGS_EBF 0x20 +#define SIEP_FLAGS_EWASC 0x10 +#define SIEP_FLAGS_DEXCPT 0x08 +#define SIEP_FLAGS_TEST 0x04 +#define SIEP_FLAGS_EBACKERR 0x02 +#define SIEP_FLAGS_LOGERR 0x01 u_int8_t mrie; u_int8_t interval_timer[4]; u_int8_t report_count[4]; @@ -370,19 +370,19 @@ struct scsi_info_exceptions_page { struct scsi_proto_specific_page { u_int8_t page_code; -#define SPSP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SPSP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t protocol; -#define SPSP_PROTO_FC 0x00 -#define SPSP_PROTO_SPI 0x01 -#define SPSP_PROTO_SSA 0x02 -#define SPSP_PROTO_1394 0x03 -#define SPSP_PROTO_RDMA 0x04 -#define SPSP_PROTO_ISCSI 0x05 -#define SPSP_PROTO_SAS 0x06 -#define SPSP_PROTO_ADT 0x07 -#define SPSP_PROTO_ATA 0x08 -#define SPSP_PROTO_NONE 0x0f +#define SPSP_PROTO_FC 0x00 +#define SPSP_PROTO_SPI 0x01 +#define SPSP_PROTO_SSA 0x02 +#define SPSP_PROTO_1394 0x03 +#define SPSP_PROTO_RDMA 0x04 +#define SPSP_PROTO_ISCSI 0x05 +#define SPSP_PROTO_SAS 0x06 +#define SPSP_PROTO_ADT 0x07 +#define SPSP_PROTO_ATA 0x08 +#define SPSP_PROTO_NONE 0x0f }; struct scsi_reserve @@ -412,7 +412,7 @@ struct scsi_prevent u_int8_t control; }; #define PR_PREVENT 0x01 -#define PR_ALLOW 0x00 +#define PR_ALLOW 0x00 struct scsi_sync_cache { @@ -490,7 +490,7 @@ struct scsi_rw_12 { u_int8_t opcode; #define SRW12_RELADDR 0x01 -#define SRW12_FUA 0x08 +#define SRW12_FUA 0x08 #define SRW12_DPO 0x10 u_int8_t byte2; u_int8_t addr[4]; @@ -527,13 +527,13 @@ struct scsi_start_stop_unit struct ata_pass_12 { u_int8_t opcode; u_int8_t protocol; -#define AP_MULTI 0xe0 +#define AP_MULTI 0xe0 u_int8_t flags; -#define AP_T_LEN 0x03 -#define AP_BB 0x04 -#define AP_T_DIR 0x08 -#define AP_CK_COND 0x20 -#define AP_OFFLINE 0x60 +#define AP_T_LEN 0x03 +#define AP_BB 0x04 +#define AP_T_DIR 0x08 +#define AP_CK_COND 0x20 +#define AP_OFFLINE 0x60 u_int8_t features; u_int8_t sector_count; u_int8_t lba_low; @@ -548,7 +548,7 @@ struct ata_pass_12 { struct ata_pass_16 { u_int8_t opcode; u_int8_t protocol; -#define AP_EXTEND 0x01 +#define AP_EXTEND 0x01 u_int8_t flags; u_int8_t features_ext; u_int8_t features; @@ -565,51 +565,69 @@ struct ata_pass_16 { u_int8_t control; }; -#define SC_SCSI_1 0x01 -#define SC_SCSI_2 0x03 +#define SC_SCSI_1 0x01 +#define SC_SCSI_2 0x03 /* * Opcodes */ #define TEST_UNIT_READY 0x00 -#define REQUEST_SENSE 0x03 +#define REQUEST_SENSE 0x03 #define READ_6 0x08 -#define WRITE_6 0x0a -#define INQUIRY 0x12 -#define MODE_SELECT_6 0x15 -#define MODE_SENSE_6 0x1a -#define START_STOP_UNIT 0x1b -#define START_STOP 0x1b -#define RESERVE 0x16 -#define RELEASE 0x17 -#define RECEIVE_DIAGNOSTIC 0x1c -#define SEND_DIAGNOSTIC 0x1d -#define PREVENT_ALLOW 0x1e +#define WRITE_6 0x0A +#define INQUIRY 0x12 +#define MODE_SELECT_6 0x15 +#define MODE_SENSE_6 0x1A +#define START_STOP_UNIT 0x1B +#define START_STOP 0x1B +#define RESERVE 0x16 +#define RELEASE 0x17 +#define RECEIVE_DIAGNOSTIC 0x1C +#define SEND_DIAGNOSTIC 0x1D +#define PREVENT_ALLOW 0x1E #define READ_CAPACITY 0x25 #define READ_10 0x28 -#define WRITE_10 0x2a -#define POSITION_TO_ELEMENT 0x2b +#define WRITE_10 0x2A +#define POSITION_TO_ELEMENT 0x2B #define SYNCHRONIZE_CACHE 0x35 #define READ_DEFECT_DATA_10 0x37 -#define WRITE_BUFFER 0x3b -#define READ_BUFFER 0x3c +#define WRITE_BUFFER 0x3B +#define READ_BUFFER 0x3C #define CHANGE_DEFINITION 0x40 -#define LOG_SELECT 0x4c -#define LOG_SENSE 0x4d +#define LOG_SELECT 0x4C +#define LOG_SENSE 0x4D #define MODE_SELECT_10 0x55 #define MODE_SENSE_10 0x5A #define ATA_PASS_16 0x85 #define READ_16 0x88 -#define WRITE_16 0x8a -#define SERVICE_ACTION_IN 0x9e +#define WRITE_16 0x8A +#define SERVICE_ACTION_IN 0x9E #define REPORT_LUNS 0xA0 -#define ATA_PASS_12 0xa1 -#define MOVE_MEDIUM 0xa5 -#define READ_12 0xa8 -#define WRITE_12 0xaa -#define READ_ELEMENT_STATUS 0xb8 - +#define ATA_PASS_12 0xA1 +#define MAINTENANCE_IN 0xA3 +#define MAINTENANCE_OUT 0xA4 +#define MOVE_MEDIUM 0xA5 +#define READ_12 0xA8 +#define WRITE_12 0xAA +#define READ_ELEMENT_STATUS 0xB8 + +/* Maintenance In Service Action Codes */ +#define REPORT_IDENTIFYING_INFRMATION 0x05 +#define REPORT_TARGET_PORT_GROUPS 0x0A +#define REPORT_ALIASES 0x0B +#define REPORT_SUPPORTED_OPERATION_CODES 0x0C +#define REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0D +#define REPORT_PRIORITY 0x0E +#define REPORT_TIMESTAMP 0x0F +#define MANAGEMENT_PROTOCOL_IN 0x10 +/* Maintenance Out Service Action Codes */ +#define SET_IDENTIFY_INFORMATION 0x06 +#define SET_TARGET_PORT_GROUPS 0x0A +#define CHANGE_ALIASES 0x0B +#define SET_PRIORITY 0x0E +#define SET_TIMESTAMP 0x0F +#define MANGAEMENT_PROTOCOL_OUT 0x10 /* * Device Types @@ -635,7 +653,7 @@ struct ata_pass_16 { #define T_NODEVICE 0x1f #define T_ANY 0xff /* Used in Quirk table matches */ -#define T_REMOV 1 +#define T_REMOV 1 #define T_FIXED 0 /* @@ -670,7 +688,7 @@ struct scsi_inquiry_data * physical device is not currently * connected to this logical unit. */ -#define SID_QUAL_RSVD 0x02 +#define SID_QUAL_RSVD 0x02 #define SID_QUAL_BAD_LU 0x03 /* * The target is not capable of * supporting a physical device on @@ -688,30 +706,39 @@ struct scsi_inquiry_data #define SID_QUAL2 0x7F #define SID_IS_REMOVABLE(inq_data) (((inq_data)->dev_qual2 & 0x80) != 0) u_int8_t version; -#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07) +#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07) #define SCSI_REV_0 0 #define SCSI_REV_CCS 1 #define SCSI_REV_2 2 #define SCSI_REV_SPC 3 #define SCSI_REV_SPC2 4 +#define SCSI_REV_SPC3 5 +#define SCSI_REV_SPC4 6 -#define SID_ECMA 0x38 -#define SID_ISO 0xC0 +#define SID_ECMA 0x38 +#define SID_ISO 0xC0 u_int8_t response_format; -#define SID_AENC 0x80 -#define SID_TrmIOP 0x40 +#define SID_AENC 0x80 +#define SID_TrmIOP 0x40 u_int8_t additional_length; #define SID_ADDITIONAL_LENGTH(iqd) \ ((iqd)->additional_length + \ offsetof(struct scsi_inquiry_data, additional_length) + 1) - u_int8_t reserved; + u_int8_t spc3_flags; +#define SPC3_SID_PROTECT 0x01 +#define SPC3_SID_3PC 0x08 +#define SPC3_SID_TPGS_MASK 0x30 +#define SPC3_SID_TPGS_IMPLICIT 0x10 +#define SPC3_SID_TPGS_EXPLICIT 0x20 +#define SPC3_SID_ACC 0x40 +#define SPC3_SID_SCCS 0x80 u_int8_t spc2_flags; -#define SPC2_SID_MChngr 0x08 -#define SPC2_SID_MultiP 0x10 -#define SPC2_SID_EncServ 0x40 -#define SPC2_SID_BQueue 0x80 +#define SPC2_SID_MChngr 0x08 +#define SPC2_SID_MultiP 0x10 +#define SPC2_SID_EncServ 0x40 +#define SPC2_SID_BQueue 0x80 -#define INQ_DATA_TQ_ENABLED(iqd) \ +#define INQ_DATA_TQ_ENABLED(iqd) \ ((SID_ANSI_REV(iqd) < SCSI_REV_SPC2)? ((iqd)->flags & SID_CmdQue) : \ (((iqd)->flags & SID_CmdQue) && !((iqd)->spc2_flags & SPC2_SID_BQueue)) || \ (!((iqd)->flags & SID_CmdQue) && ((iqd)->spc2_flags & SPC2_SID_BQueue))) @@ -724,11 +751,11 @@ struct scsi_inquiry_data #define SID_WBus16 0x20 #define SID_WBus32 0x40 #define SID_RelAdr 0x80 -#define SID_VENDOR_SIZE 8 +#define SID_VENDOR_SIZE 8 char vendor[SID_VENDOR_SIZE]; -#define SID_PRODUCT_SIZE 16 +#define SID_PRODUCT_SIZE 16 char product[SID_PRODUCT_SIZE]; -#define SID_REVISION_SIZE 4 +#define SID_REVISION_SIZE 4 char revision[SID_REVISION_SIZE]; /* * The following fields were taken from SCSI Primary Commands - 2 @@ -769,10 +796,10 @@ struct scsi_vpd_supported_page_list { u_int8_t device; u_int8_t page_code; -#define SVPD_SUPPORTED_PAGE_LIST 0x00 +#define SVPD_SUPPORTED_PAGE_LIST 0x00 u_int8_t reserved; u_int8_t length; /* number of VPD entries */ -#define SVPD_SUPPORTED_PAGES_SIZE 251 +#define SVPD_SUPPORTED_PAGES_SIZE 251 u_int8_t list[SVPD_SUPPORTED_PAGES_SIZE]; }; @@ -780,10 +807,10 @@ struct scsi_vpd_unit_serial_number { u_int8_t device; u_int8_t page_code; -#define SVPD_UNIT_SERIAL_NUMBER 0x80 +#define SVPD_UNIT_SERIAL_NUMBER 0x80 u_int8_t reserved; u_int8_t length; /* serial number length */ -#define SVPD_SERIAL_NUM_SIZE 251 +#define SVPD_SERIAL_NUM_SIZE 251 u_int8_t serial_num[SVPD_SERIAL_NUM_SIZE]; }; @@ -860,6 +887,63 @@ struct scsi_report_luns_data { #define RPL_LUNDATA_ATYP_LUN 0x80 #define RPL_LUNDATA_ATYP_EXTLUN 0xc0 +struct scsi_target_group +{ + uint8_t opcode; + uint8_t service_action; +#define STG_PDF_LENGTH 0x00 +#define RPL_PDF_EXTENDED 0x20 + uint8_t reserved1[3]; + uint8_t length[4]; + uint8_t reserved2; + uint8_t control; +}; + +struct scsi_target_port_descriptor { + uint8_t reserved[2]; + uint8_t relative_target_port_identifier[2]; +}; + +struct scsi_target_port_group_descriptor { + uint8_t pref_state; +#define TPG_PRIMARY 0x80 +#define TPG_ASYMMETRIC_ACCESS_STATE_MASK 0xf +#define TPG_ASYMMETRIC_ACCESS_OPTIMIZED 0x0 +#define TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED 0x1 +#define TPG_ASYMMETRIC_ACCESS_STANDBY 0x2 +#define TPG_ASYMMETRIC_ACCESS_UNAVAILABLE 0x3 +#define TPG_ASYMMETRIC_ACCESS_LBA_DEPENDENT 0x4 +#define TPG_ASYMMETRIC_ACCESS_OFFLINE 0xE +#define TPG_ASYMMETRIC_ACCESS_TRANSITIONING 0xF + uint8_t support; +#define TPG_AO_SUP 0x01 +#define TPG_AN_SUP 0x02 +#define TPG_S_SUP 0x04 +#define TPG_U_SUP 0x08 +#define TPG_LBD_SUP 0x10 +#define TPG_O_SUP 0x40 +#define TPG_T_SUP 0x80 + uint8_t target_port_group[2]; + uint8_t reserved; + uint8_t status; + uint8_t vendor_specific; + uint8_t target_port_count; + struct scsi_target_port_descriptor descriptors[1]; +}; + +struct scsi_target_group_data { + uint8_t length[4]; /* length of returned data, in bytes */ + struct scsi_target_port_group_descriptor groups[1]; +}; + +struct scsi_target_group_data_extended { + uint8_t length[4]; /* length of returned data, in bytes */ + uint8_t format_type; /* STG_PDF_LENGTH or RPL_PDF_EXTENDED */ + uint8_t implicit_transition_time; + uint8_t reserved[2]; + struct scsi_target_port_group_descriptor groups[1]; +}; + struct scsi_sense_data { @@ -898,12 +982,12 @@ struct scsi_sense_data u_int8_t fru; u_int8_t sense_key_spec[3]; #define SSD_SCS_VALID 0x80 -#define SSD_FIELDPTR_CMD 0x40 -#define SSD_BITPTR_VALID 0x08 -#define SSD_BITPTR_VALUE 0x07 -#define SSD_MIN_SIZE 18 +#define SSD_FIELDPTR_CMD 0x40 +#define SSD_BITPTR_VALID 0x08 +#define SSD_BITPTR_VALUE 0x07 +#define SSD_MIN_SIZE 18 u_int8_t extra_bytes[14]; -#define SSD_FULL_SIZE sizeof(struct scsi_sense_data) +#define SSD_FULL_SIZE sizeof(struct scsi_sense_data) }; struct scsi_mode_header_6 @@ -948,13 +1032,13 @@ struct scsi_mode_blk_desc #define SCSI_STATUS_CHECK_COND 0x02 #define SCSI_STATUS_COND_MET 0x04 #define SCSI_STATUS_BUSY 0x08 -#define SCSI_STATUS_INTERMED 0x10 -#define SCSI_STATUS_INTERMED_COND_MET 0x14 -#define SCSI_STATUS_RESERV_CONFLICT 0x18 -#define SCSI_STATUS_CMD_TERMINATED 0x22 /* Obsolete in SAM-2 */ -#define SCSI_STATUS_QUEUE_FULL 0x28 -#define SCSI_STATUS_ACA_ACTIVE 0x30 -#define SCSI_STATUS_TASK_ABORTED 0x40 +#define SCSI_STATUS_INTERMED 0x10 +#define SCSI_STATUS_INTERMED_COND_MET 0x14 +#define SCSI_STATUS_RESERV_CONFLICT 0x18 +#define SCSI_STATUS_CMD_TERMINATED 0x22 /* Obsolete in SAM-2 */ +#define SCSI_STATUS_QUEUE_FULL 0x28 +#define SCSI_STATUS_ACA_ACTIVE 0x30 +#define SCSI_STATUS_TASK_ABORTED 0x40 struct scsi_inquiry_pattern { u_int8_t type; @@ -1065,9 +1149,9 @@ int scsi_interpret_sense(struct cam_dev #endif /* _KERNEL */ #define SF_RETRY_UA 0x01 -#define SF_NO_PRINT 0x02 -#define SF_QUIET_IR 0x04 /* Be quiet about Illegal Request reponses */ -#define SF_PRINT_ALWAYS 0x08 +#define SF_NO_PRINT 0x02 +#define SF_QUIET_IR 0x04 /* Be quiet about Illegal Request reponses */ +#define SF_PRINT_ALWAYS 0x08 const char * scsi_op_desc(u_int16_t opcode, @@ -1174,6 +1258,20 @@ void scsi_report_luns(struct ccb_scsiio u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_report_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, + u_int8_t pdf, + void *buf, + u_int32_t alloc_len, u_int8_t sense_len, + u_int32_t timeout); + +void scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, void *buf, + u_int32_t alloc_len, u_int8_t sense_len, + u_int32_t timeout); + void scsi_synchronize_cache(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, Modified: head/sys/cam/scsi/scsi_ch.h ============================================================================== --- head/sys/cam/scsi/scsi_ch.h Tue Jun 8 04:48:36 2010 (r208904) +++ head/sys/cam/scsi/scsi_ch.h Tue Jun 8 05:14:18 2010 (r208905) @@ -105,7 +105,6 @@ struct scsi_initialize_element_status { */ struct scsi_move_medium { u_int8_t opcode; -#define MOVE_MEDIUM 0xa5 u_int8_t byte2; u_int8_t tea[2]; /* transport element address */ u_int8_t src[2]; /* source element address */ @@ -122,7 +121,6 @@ struct scsi_move_medium { */ struct scsi_position_to_element { u_int8_t opcode; -#define POSITION_TO_ELEMENT 0x2b u_int8_t byte2; u_int8_t tea[2]; /* transport element address */ u_int8_t dst[2]; /* destination element address */ @@ -137,7 +135,6 @@ struct scsi_position_to_element { */ struct scsi_read_element_status { u_int8_t opcode; -#define READ_ELEMENT_STATUS 0xb8 u_int8_t byte2; #define READ_ELEMENT_STATUS_VOLTAG 0x10 /* report volume tag info */ /* ...next 4 bits are an element type code... */ @@ -151,7 +148,6 @@ struct scsi_read_element_status { struct scsi_request_volume_element_address { u_int8_t opcode; -#define REQUEST_VOLUME_ELEMENT_ADDRESS 0xb5 u_int8_t byte2; #define REQUEST_VOLUME_ELEMENT_ADDRESS_VOLTAG 0x10 /* ...next 4 bits are an element type code... */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 10:03:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1824106566B; Tue, 8 Jun 2010 10:03:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C16D28FC1B; Tue, 8 Jun 2010 10:03:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58A38DU063254; Tue, 8 Jun 2010 10:03:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58A38Ge063252; Tue, 8 Jun 2010 10:03:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006081003.o58A38Ge063252@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Jun 2010 10:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208907 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 10:03:08 -0000 Author: mav Date: Tue Jun 8 10:03:08 2010 New Revision: 208907 URL: http://svn.freebsd.org/changeset/base/208907 Log: Disable NCQ and PMP support for VIA VT8251 AHCI. It was reported to be unreliable under load. Linux does the same. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Tue Jun 8 07:49:02 2010 (r208906) +++ head/sys/dev/ahci/ahci.c Tue Jun 8 10:03:08 2010 (r208907) @@ -239,8 +239,8 @@ static struct { {0x0d8d10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8e10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8f10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x33491106, 0x00, "VIA VT8251", 0}, - {0x62871106, 0x00, "VIA VT8251", 0}, + {0x33491106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, + {0x62871106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, {0x11841039, 0x00, "SiS 966", 0}, {0x11851039, 0x00, "SiS 968", 0}, {0x01861039, 0x00, "SiS 968", 0}, From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 10:52:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E0A41065677; Tue, 8 Jun 2010 10:52:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6261B8FC0C; Tue, 8 Jun 2010 10:52:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Aqb5Z078602; Tue, 8 Jun 2010 10:52:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58AqbUv078600; Tue, 8 Jun 2010 10:52:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006081052.o58AqbUv078600@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Jun 2010 10:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208908 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 10:52:37 -0000 Author: mav Date: Tue Jun 8 10:52:37 2010 New Revision: 208908 URL: http://svn.freebsd.org/changeset/base/208908 Log: MFC r208796: Fix PCH chipset IDs. They are 0x3bxx, not 0x3axx. Approved by: re (kib) Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Tue Jun 8 10:03:08 2010 (r208907) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Tue Jun 8 10:52:37 2010 (r208908) @@ -140,22 +140,22 @@ ata_intel_probe(device_t dev) { ATA_I82801JI_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_S2, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, - { 0x3a208086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a218086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a228086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a238086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a248086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a258086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a268086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a278086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a288086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a298086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2a8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2b8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2c8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2d8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2e8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2f8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b208086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b218086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b228086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b238086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b248086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b258086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b268086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b278086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b288086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b298086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2a8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2b8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2c8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2d8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2e8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2f8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { 0, 0, 0, 0, 0, 0}}; From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 16:05:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 416D3106567A; Tue, 8 Jun 2010 16:05:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 19FE98FC0C; Tue, 8 Jun 2010 16:05:04 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 8987546BC2; Tue, 8 Jun 2010 12:05:03 -0400 (EDT) Date: Tue, 8 Jun 2010 17:05:03 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Pawel Jakub Dawidek In-Reply-To: <20100607200743.GB4468@garage.freebsd.pl> Message-ID: References: <201006061611.o56GBHbE089883@svn.freebsd.org> <20100607200743.GB4468@garage.freebsd.pl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208876 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 16:05:04 -0000 On Mon, 7 Jun 2010, Pawel Jakub Dawidek wrote: >> 1) Further enhance the INVARIANT lock validation (no locks) are >> held by checking the create and inp locks as well. > [...] >> + if (mtx_owned(&inp->inp_create_mtx)) { >> + panic("Own create lock on inp"); >> + } >> + if (mtx_owned(&inp->inp_mtx)) { >> + panic("Own inp lock on inp"); >> + } > > If you replace this with: > > mtx_assert(&inp->inp_create_mtx, MA_NOTOWNED); > mtx_assert(&inp->inp_mtx, MA_NOTOWNED); > > But the kernel has to be compiled with INVARIANTS to make it work. It might be worth mimicking the locking assertions from in_pcb.h, even though these data structures are different. Robert From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 16:17:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 336AE1065698; Tue, 8 Jun 2010 16:17:26 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 219E78FC16; Tue, 8 Jun 2010 16:17:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58GHQt3050031; Tue, 8 Jun 2010 16:17:26 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58GHQIE050026; Tue, 8 Jun 2010 16:17:26 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006081617.o58GHQIE050026@svn.freebsd.org> From: Matt Jacob Date: Tue, 8 Jun 2010 16:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208911 - in head/sys/cam: . scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 16:17:26 -0000 Author: mjacob Date: Tue Jun 8 16:17:25 2010 New Revision: 208911 URL: http://svn.freebsd.org/changeset/base/208911 Log: Implement the usage of Report Luns as part of SCSI probing for SCP3 or better devices. This can be disabled on a per-device basis using quirks as well. This also handles the case where there is actually no connected LUN 0 (which can definitely be the case for storage arrays). Reviewed by: scsi@ MFC after: 1 month Modified: head/sys/cam/cam_debug.h head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/cam_debug.h ============================================================================== --- head/sys/cam/cam_debug.h Tue Jun 8 15:45:38 2010 (r208910) +++ head/sys/cam/cam_debug.h Tue Jun 8 16:17:25 2010 (r208911) @@ -40,7 +40,8 @@ typedef enum { CAM_DEBUG_SUBTRACE = 0x04, /* internal to routine flows */ CAM_DEBUG_CDB = 0x08, /* print out SCSI CDBs only */ CAM_DEBUG_XPT = 0x10, /* print out xpt scheduling */ - CAM_DEBUG_PERIPH = 0x20 /* print out peripheral calls */ + CAM_DEBUG_PERIPH = 0x20, /* print out peripheral calls */ + CAM_DEBUG_PROBE = 0x40 /* print out probe actions */ } cam_debug_flags; #if defined(CAMDEBUG) && defined(_KERNEL) @@ -58,6 +59,7 @@ extern u_int32_t cam_debug_delay; && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) + #define CAM_DEBUG(path, flag, printfargs) \ if ((cam_dflags & (flag)) \ && (cam_dpath != NULL) \ @@ -68,6 +70,7 @@ extern u_int32_t cam_debug_delay; if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } + #define CAM_DEBUG_PRINT(flag, printfargs) \ if (cam_dflags & (flag)) { \ printf("cam_debug: "); \ @@ -76,11 +79,20 @@ extern u_int32_t cam_debug_delay; DELAY(cam_debug_delay); \ } +#define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \ + if (cam_dflags & (flag)) { \ + xpt_print(path, "cam_debug: "); \ + printf printfargs; \ + if (cam_debug_delay != 0) \ + DELAY(cam_debug_delay); \ + } + #else /* !CAMDEBUG || !_KERNEL */ #define CAM_DEBUGGED(A, B) 0 #define CAM_DEBUG(A, B, C) #define CAM_DEBUG_PRINT(A, B) +#define CAM_DEBUG_PATH_PRINT(A, B, C) #endif /* CAMDEBUG && _KERNEL */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Jun 8 15:45:38 2010 (r208910) +++ head/sys/cam/cam_xpt.c Tue Jun 8 16:17:25 2010 (r208911) @@ -196,8 +196,18 @@ static struct cdevsw xpt_cdevsw = { /* Storage for debugging datastructures */ #ifdef CAMDEBUG struct cam_path *cam_dpath; -u_int32_t cam_dflags; +#ifdef CAM_DEBUG_FLAGS +u_int32_t cam_dflags = CAM_DEBUG_FLAGS; +#else +u_int32_t cam_dflags = CAM_DEBUG_NONE; +#endif +TUNABLE_INT("kern.cam.dflags", &cam_dflags); +SYSCTL_INT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW, + &cam_dflags, 0, "Cam Debug Flags"); u_int32_t cam_debug_delay; +TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay); +SYSCTL_INT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW, + &cam_debug_delay, 0, "Cam Debug Flags"); #endif /* Our boot-time initialization hook */ @@ -4212,6 +4222,7 @@ xpt_alloc_target(struct cam_eb *bus, tar target->target_id = target_id; target->refcount = 1; target->generation = 0; + target->luns = NULL; timevalclear(&target->last_reset); /* * Hold a reference to our parent bus so it @@ -4243,6 +4254,8 @@ xpt_release_target(struct cam_et *target TAILQ_REMOVE(&target->bus->et_entries, target, links); target->bus->generation++; xpt_release_bus(target->bus); + if (target->luns) + free(target->luns, M_CAMXPT); free(target, M_CAMXPT); } } @@ -4505,11 +4518,6 @@ xpt_config(void *arg) #ifdef CAMDEBUG /* Setup debugging flags and path */ -#ifdef CAM_DEBUG_FLAGS - cam_dflags = CAM_DEBUG_FLAGS; -#else /* !CAM_DEBUG_FLAGS */ - cam_dflags = CAM_DEBUG_NONE; -#endif /* CAM_DEBUG_FLAGS */ #ifdef CAM_DEBUG_BUS if (cam_dflags != CAM_DEBUG_NONE) { /* Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Tue Jun 8 15:45:38 2010 (r208910) +++ head/sys/cam/cam_xpt_internal.h Tue Jun 8 16:17:25 2010 (r208911) @@ -135,6 +135,8 @@ struct cam_et { u_int32_t refcount; u_int generation; struct timeval last_reset; + u_int rpl_size; + struct scsi_report_luns_data *luns; }; /* Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Tue Jun 8 15:45:38 2010 (r208910) +++ head/sys/cam/scsi/scsi_xpt.c Tue Jun 8 16:17:25 2010 (r208911) @@ -71,6 +71,7 @@ struct scsi_quirk_entry { #define CAM_QUIRK_NOSERIAL 0x02 #define CAM_QUIRK_HILUNS 0x04 #define CAM_QUIRK_NOHILUNS 0x08 +#define CAM_QUIRK_NORPTLUNS 0x10 u_int mintags; u_int maxtags; }; @@ -84,6 +85,21 @@ SYSCTL_PROC(_kern_cam, OID_AUTO, cam_src "allow search above LUN 7 for SCSI3 and greater devices"); #define CAM_SCSI2_MAXLUN 8 +#define CAM_CAN_GET_SIMPLE_LUN(x, i) \ + ((((x)->luns[i].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \ + RPL_LUNDATA_ATYP_PERIPH) || \ + (((x)->luns[i].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \ + RPL_LUNDATA_ATYP_FLAT)) +#define CAM_GET_SIMPLE_LUN(lp, i, lval) \ + if (((lp)->luns[(i)].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \ + RPL_LUNDATA_ATYP_PERIPH) { \ + (lval) = (lp)->luns[(i)].lundata[1]; \ + } else { \ + (lval) = (lp)->luns[(i)].lundata[0]; \ + (lval) &= RPL_LUNDATA_FLAT_LUN_MASK; \ + (lval) <<= 8; \ + (lval) |= (lp)->luns[(i)].lundata[1]; \ + } /* * If we're not quirked to search <= the first 8 luns * and we are either quirked to search above lun 8, @@ -116,6 +132,7 @@ typedef enum { PROBE_TUR, PROBE_INQUIRY, /* this counts as DV0 for Basic Domain Validation */ PROBE_FULL_INQUIRY, + PROBE_REPORT_LUNS, PROBE_MODE_SENSE, PROBE_SERIAL_NUM_0, PROBE_SERIAL_NUM_1, @@ -130,6 +147,7 @@ static char *probe_action_text[] = { "PROBE_TUR", "PROBE_INQUIRY", "PROBE_FULL_INQUIRY", + "PROBE_REPORT_LUNS", "PROBE_MODE_SENSE", "PROBE_SERIAL_NUM_0", "PROBE_SERIAL_NUM_1", @@ -527,6 +545,10 @@ static void proberequestdefaultnegotiat static int proberequestbackoff(struct cam_periph *periph, struct cam_ed *device); static void probedone(struct cam_periph *periph, union ccb *done_ccb); +static int probe_strange_rpl_data(struct scsi_report_luns_data *rp, + uint32_t maxlun); +static void probe_purge_old(struct cam_path *path, + struct scsi_report_luns_data *new); static void probecleanup(struct cam_periph *periph); static void scsi_find_quirk(struct cam_ed *device); static void scsi_scan_bus(struct cam_periph *periph, union ccb *ccb); @@ -685,6 +707,7 @@ probestart(struct cam_periph *periph, un softc = (probe_softc *)periph->softc; csio = &start_ccb->csio; +again: switch (softc->action) { case PROBE_TUR: @@ -773,6 +796,28 @@ probestart(struct cam_periph *periph, un /*timeout*/60 * 1000); break; } + case PROBE_REPORT_LUNS: + { + void *rp; + + rp = malloc(periph->path->target->rpl_size, + M_CAMXPT, M_NOWAIT | M_ZERO); + if (rp == NULL) { + struct scsi_inquiry_data *inq_buf; + inq_buf = &periph->path->device->inq_data; + xpt_print(periph->path, + "Unable to alloc report luns storage\n"); + if (INQ_DATA_TQ_ENABLED(inq_buf)) + PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); + else + PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + goto again; + } + scsi_report_luns(csio, 5, probedone, MSG_SIMPLE_Q_TAG, + RPL_REPORT_DEFAULT, rp, periph->path->target->rpl_size, + SSD_FULL_SIZE, 60000); break; + break; + } case PROBE_MODE_SENSE: { void *mode_buf; @@ -1045,9 +1090,7 @@ probedone(struct cam_periph *periph, uni periph_qual = SID_QUAL(inq_buf); - switch(periph_qual) { - case SID_QUAL_LU_CONNECTED: - { + if (periph_qual == SID_QUAL_LU_CONNECTED) { u_int8_t len; /* @@ -1074,10 +1117,23 @@ probedone(struct cam_periph *periph, uni scsi_find_quirk(path->device); scsi_devise_transport(path); - if (INQ_DATA_TQ_ENABLED(inq_buf)) - PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); + + if (path->device->lun_id == 0 && + SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && + (SCSI_QUIRK(path->device)->quirks & + CAM_QUIRK_NORPTLUNS) == 0) { + PROBE_SET_ACTION(softc, + PROBE_REPORT_LUNS); + /* + * Start with room for *one* lun. + */ + periph->path->target->rpl_size = 16; + } else if (INQ_DATA_TQ_ENABLED(inq_buf)) + PROBE_SET_ACTION(softc, + PROBE_MODE_SENSE); else - PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + PROBE_SET_ACTION(softc, + PROBE_SERIAL_NUM_0); if (path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -1086,9 +1142,21 @@ probedone(struct cam_periph *periph, uni xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - } - default: - break; + } else if (path->device->lun_id == 0 && + SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && + (SCSI_QUIRK(path->device)->quirks & + CAM_QUIRK_NORPTLUNS) == 0) { + if (path->device->flags & + CAM_DEV_UNCONFIGURED) { + path->device->flags &= + ~CAM_DEV_UNCONFIGURED; + xpt_acquire_device(path->device); + } + PROBE_SET_ACTION(softc, PROBE_REPORT_LUNS); + periph->path->target->rpl_size = 16; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; } } else if (cam_periph_error(done_ccb, 0, done_ccb->ccb_h.target_lun > 0 @@ -1118,6 +1186,120 @@ probedone(struct cam_periph *periph, uni xpt_release_ccb(done_ccb); break; } + case PROBE_REPORT_LUNS: + { + struct ccb_scsiio *csio; + struct scsi_report_luns_data *lp; + u_int nlun, maxlun; + + csio = &done_ccb->csio; + + lp = (struct scsi_report_luns_data *)csio->data_ptr; + nlun = scsi_4btoul(lp->length) / 8; + maxlun = (csio->dxfer_len / 8) - 1; + + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (cam_periph_error(done_ccb, 0, + done_ccb->ccb_h.target_lun > 0 ? + SF_RETRY_UA|SF_QUIET_IR : SF_RETRY_UA, + &softc->saved_ccb) == ERESTART) { + return; + } + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + xpt_release_devq(done_ccb->ccb_h.path, 1, + TRUE); + } + free(lp, M_CAMXPT); + lp = NULL; + } else if (nlun > maxlun) { + /* + * Reallocate and retry to cover all luns + */ + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, + ("reallocating REPORT_LUNS for %u luns\n", nlun)); + free(lp, M_CAMXPT); + path->target->rpl_size = (nlun << 3) + 8; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } else if (nlun == 0) { + /* + * If there don't appear to be any luns, bail. + */ + free(lp, M_CAMXPT); + lp = NULL; + } else if (probe_strange_rpl_data(lp, maxlun)) { + /* + * If we can't understand the lun format + * of any entry, bail. + */ + free(lp, M_CAMXPT); + lp = NULL; + } else { + lun_id_t lun; + int idx; + + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, + ("%u luns reported\n", nlun)); + + CAM_GET_SIMPLE_LUN(lp, 0, lun); + /* + * If the first lun is not lun 0, then either there + * is no lun 0 in the list, or the list is unsorted. + */ + if (lun != 0) { + for (idx = 0; idx < nlun; idx++) { + CAM_GET_SIMPLE_LUN(lp, idx, lun); + if (lun == 0) { + break; + } + } + if (idx != nlun) { + uint8_t tlun[8]; + memcpy(tlun, + lp->luns[0].lundata, 8); + memcpy(lp->luns[0].lundata, + lp->luns[idx].lundata, 8); + memcpy(lp->luns[idx].lundata, + tlun, 8); + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, + path, ("lun 0 in position %u\n", idx)); + } else { + /* + * There is no lun 0 in our list. Destroy + * the validity of the inquiry data so we + * bail here and now. + */ + path->device->flags &= + ~CAM_DEV_INQUIRY_DATA_VALID; + } + } + /* + * If we have an old lun list, We can either + * retest luns that appear to have been dropped, + * or just nuke them. We'll opt for the latter. + * This function will also install the new list + * in the target structure. + */ + probe_purge_old(path, lp); + lp = NULL; + } + if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) { + struct scsi_inquiry_data *inq_buf; + inq_buf = &path->device->inq_data; + if (INQ_DATA_TQ_ENABLED(inq_buf)) + PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); + else + PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } + if (lp) { + free(lp, M_CAMXPT); + } + break; + } case PROBE_MODE_SENSE: { struct ccb_scsiio *csio; @@ -1432,6 +1614,80 @@ probedone(struct cam_periph *periph, uni } } +static int +probe_strange_rpl_data(struct scsi_report_luns_data *rp, uint32_t maxlun) +{ + uint32_t idx; + uint32_t nlun = MIN(maxlun, (scsi_4btoul(rp->length) / 8)); + + for (idx = 0; idx < nlun; idx++) { + if (!CAM_CAN_GET_SIMPLE_LUN(rp, idx)) { + return (-1); + } + } + return (0); +} + +static void +probe_purge_old(struct cam_path *path, struct scsi_report_luns_data *new) +{ + struct cam_path *tp; + struct scsi_report_luns_data *old; + u_int idx1, idx2, nlun_old, nlun_new, this_lun; + u_int8_t *ol, *nl; + + if (path->target == NULL) { + return; + } + if (path->target->luns == NULL) { + path->target->luns = new; + return; + } + old = path->target->luns; + nlun_old = scsi_4btoul(old->length) / 8; + nlun_new = scsi_4btoul(new->length) / 8; + + /* + * We are not going to assume sorted lists. Deal. + */ + for (idx1 = 0; idx1 < nlun_old; idx1++) { + ol = old->luns[idx1].lundata; + for (idx2 = 0; idx2 < nlun_new; idx2++) { + nl = new->luns[idx2].lundata; + if (memcmp(nl, ol, 8) == 0) { + break; + } + } + if (idx2 < nlun_new) { + continue; + } + /* + * An 'old' item not in the 'new' list. + * Nuke it. Except that if it is lun 0, + * that would be what the probe state + * machine is currently working on, + * so we won't do that. + * + * We also cannot nuke it if it is + * not in a lun format we understand. + */ + if (!CAM_CAN_GET_SIMPLE_LUN(old, idx1)) { + continue; + } + CAM_GET_SIMPLE_LUN(old, idx1, this_lun); + if (this_lun == 0) { + continue; + } + if (xpt_create_path(&tp, NULL, xpt_path_path_id(path), + xpt_path_target_id(path), this_lun) == CAM_REQ_CMP) { + xpt_async(AC_LOST_DEVICE, tp, NULL); + xpt_free_path(tp); + } + } + free(old, M_CAMXPT); + path->target->luns = new; +} + static void probecleanup(struct cam_periph *periph) { @@ -1480,6 +1736,7 @@ typedef struct { union ccb *request_ccb; struct ccb_pathinq *cpi; int counter; + int lunindex[0]; } scsi_scan_bus_info; /* @@ -1553,13 +1810,15 @@ scsi_scan_bus(struct cam_periph *periph, } /* Save some state for use while we probe for devices */ - scan_info = (scsi_scan_bus_info *) - malloc(sizeof(scsi_scan_bus_info), M_CAMXPT, M_NOWAIT); + scan_info = (scsi_scan_bus_info *) malloc(sizeof(scsi_scan_bus_info) + + (work_ccb->cpi.max_target * sizeof (u_int)), M_CAMXPT, M_ZERO|M_NOWAIT); if (scan_info == NULL) { request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(request_ccb); return; } + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, request_ccb->ccb_h.path, + ("SCAN start for %p\n", scan_info)); scan_info->request_ccb = request_ccb; scan_info->cpi = &work_ccb->cpi; @@ -1626,26 +1885,76 @@ scsi_scan_bus(struct cam_periph *periph, case XPT_SCAN_LUN: { cam_status status; - struct cam_path *path; + struct cam_path *path, *oldpath; scsi_scan_bus_info *scan_info; + struct cam_et *target; + struct cam_ed *device; + int next_target; path_id_t path_id; target_id_t target_id; lun_id_t lun_id; + oldpath = request_ccb->ccb_h.path; + + status = request_ccb->ccb_h.status & CAM_STATUS_MASK; /* Reuse the same CCB to query if a device was really found */ scan_info = (scsi_scan_bus_info *)request_ccb->ccb_h.ppriv_ptr0; xpt_setup_ccb(&request_ccb->ccb_h, request_ccb->ccb_h.path, request_ccb->ccb_h.pinfo.priority); request_ccb->ccb_h.func_code = XPT_GDEV_TYPE; + path_id = request_ccb->ccb_h.path_id; target_id = request_ccb->ccb_h.target_id; lun_id = request_ccb->ccb_h.target_lun; xpt_action(request_ccb); - if (request_ccb->ccb_h.status != CAM_REQ_CMP) { - struct cam_ed *device; - struct cam_et *target; + target = request_ccb->ccb_h.path->target; + next_target = 1; + + if (target->luns) { + uint32_t first; + u_int nluns = scsi_4btoul(target->luns->length) / 8; + + /* + * Make sure we skip over lun 0 if it's the first member + * of the list as we've actually just finished probing + * it. + */ + CAM_GET_SIMPLE_LUN(target->luns, 0, first); + if (first == 0 && scan_info->lunindex[target_id] == 0) { + scan_info->lunindex[target_id]++; + } + + if (scan_info->lunindex[target_id] < nluns) { + CAM_GET_SIMPLE_LUN(target->luns, + scan_info->lunindex[target_id], lun_id); + next_target = 0; + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, + request_ccb->ccb_h.path, + ("next lun to try at index %u is %u\n", + scan_info->lunindex[target_id], lun_id)); + scan_info->lunindex[target_id]++; + } else { + /* + * We're done with scanning all luns. + * + * Nuke the bogus device for lun 0 if lun 0 + * wasn't on the list. + */ + if (first != 0) { + TAILQ_FOREACH(device, + &target->ed_entries, links) { + if (device->lun_id == 0) { + break; + } + } + if (device) { + xpt_release_device(device); + } + } + } + } else if (request_ccb->ccb_h.status != CAM_REQ_CMP) { int phl; /* @@ -1654,7 +1963,6 @@ scsi_scan_bus(struct cam_periph *periph, * target that might have "gone away", go onto * the next lun. */ - target = request_ccb->ccb_h.path->target; /* * We may touch devices that we don't * hold references too, so ensure they @@ -1670,11 +1978,15 @@ scsi_scan_bus(struct cam_periph *periph, device = TAILQ_NEXT(device, links); } if ((lun_id != 0) || (device != NULL)) { - if (lun_id < (CAM_SCSI2_MAXLUN-1) || phl) + if (lun_id < (CAM_SCSI2_MAXLUN-1) || phl) { lun_id++; + next_target = 0; + } } + if (lun_id == request_ccb->ccb_h.target_lun + || lun_id > scan_info->cpi->max_lun) + next_target = 1; } else { - struct cam_ed *device; device = request_ccb->ccb_h.path->device; @@ -1682,23 +1994,26 @@ scsi_scan_bus(struct cam_periph *periph, CAM_QUIRK_NOLUNS) == 0) { /* Try the next lun */ if (lun_id < (CAM_SCSI2_MAXLUN-1) - || CAN_SRCH_HI_DENSE(device)) + || CAN_SRCH_HI_DENSE(device)) { lun_id++; + next_target = 0; + } } + if (lun_id == request_ccb->ccb_h.target_lun + || lun_id > scan_info->cpi->max_lun) + next_target = 1; } /* - * Free the current request path- we're done with it. - */ - xpt_free_path(request_ccb->ccb_h.path); - - /* * Check to see if we scan any further luns. */ - if (lun_id == request_ccb->ccb_h.target_lun - || lun_id > scan_info->cpi->max_lun) { + if (next_target) { int done; + /* + * Free the current request path- we're done with it. + */ + xpt_free_path(oldpath); hop_again: done = 0; if (scan_info->request_ccb->ccb_h.func_code == XPT_SCAN_TGT) { @@ -1723,6 +2038,9 @@ scsi_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, + request_ccb->ccb_h.path, + ("SCAN done for %p\n", scan_info)); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(request_ccb); @@ -1758,6 +2076,13 @@ scsi_scan_bus(struct cam_periph *periph, } else { status = xpt_create_path(&path, xpt_periph, path_id, target_id, lun_id); + /* + * Free the old request path- we're done with it. We + * do this *after* creating the new path so that + * we don't remove a target that has our lun list + * in the case that lun 0 is not present. + */ + xpt_free_path(oldpath); if (status != CAM_REQ_CMP) { printf("scsi_scan_bus: xpt_create_path failed " "with status %#x, halting LUN scan\n", From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 16:17:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5736F10656C1; Tue, 8 Jun 2010 16:17:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46F938FC26; Tue, 8 Jun 2010 16:17:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58GHlWM050134; Tue, 8 Jun 2010 16:17:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58GHlKu050132; Tue, 8 Jun 2010 16:17:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006081617.o58GHlKu050132@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Jun 2010 16:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208912 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 16:17:47 -0000 Author: jhb Date: Tue Jun 8 16:17:47 2010 New Revision: 208912 URL: http://svn.freebsd.org/changeset/base/208912 Log: Fix a sign bug that caused adaptive spinning in sx_xlock() to not work properly. Among other things it did not drop Giant while spinning leading to livelocks. Reviewed by: rookie, kib, jmallett MFC after: 3 days Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue Jun 8 16:17:25 2010 (r208911) +++ head/sys/kern/kern_sx.c Tue Jun 8 16:17:47 2010 (r208912) @@ -511,7 +511,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t * running or the state of the lock changes. */ x = sx->sx_lock; - if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) != 0) { + if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0) { if ((x & SX_LOCK_SHARED) == 0) { x = SX_OWNER(x); owner = (struct thread *)x; From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 16:48:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 466D11065678; Tue, 8 Jun 2010 16:48:50 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BF538FC14; Tue, 8 Jun 2010 16:48:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Gmono057010; Tue, 8 Jun 2010 16:48:50 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58Gmnxw057007; Tue, 8 Jun 2010 16:48:49 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006081648.o58Gmnxw057007@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 8 Jun 2010 16:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208913 - in head/usr.sbin: nfsdumpstate timed/timed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 16:48:50 -0000 Author: uqs Date: Tue Jun 8 16:48:49 2010 New Revision: 208913 URL: http://svn.freebsd.org/changeset/base/208913 Log: mdoc: replace troff macros with -mdoc equivalents Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.8 head/usr.sbin/timed/timed/timed.8 Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.8 ============================================================================== --- head/usr.sbin/nfsdumpstate/nfsdumpstate.8 Tue Jun 8 16:17:47 2010 (r208912) +++ head/usr.sbin/nfsdumpstate/nfsdumpstate.8 Tue Jun 8 16:48:49 2010 (r208913) @@ -47,15 +47,18 @@ The options are as follows: .It Fl o Displays a summary of Clients for NFSv4. Each line lists a Client with the ClientID being the last field of the line. -.sp -.nf +.Pp The following are the client flag values displayed: -NC - Needs Confirmation -CB - Callbacks are enabled -GSS - Using RPCSEC_GSS -REV - Administratively Revoked, via nfsrevoke(8) -.fi -.sp +.Bl -tag -compact -offset 2n -width MMMM +.It NC +Needs Confirmation +.It CB +Callbacks are enabled +.It GSS +Using RPCSEC_GSS +.It REV +Administratively Revoked, via nfsrevoke(8) +.El .It Fl l Ar filename Displays a list of all NFSv4 Opens and Locks on the file specified by the Modified: head/usr.sbin/timed/timed/timed.8 ============================================================================== --- head/usr.sbin/timed/timed/timed.8 Tue Jun 8 16:17:47 2010 (r208912) +++ head/usr.sbin/timed/timed/timed.8 Tue Jun 8 16:48:49 2010 (r208913) @@ -77,44 +77,37 @@ are used by This option may be specified multiple times to add more than one network to the list. .It Fl F Ar host ... -.in +2 -.ti -2 -- +.Bl -dash -compact +.It Create a list of trusted hosts. -.ti -2 -- +.It Can take one or more parameters. -.ti -2 -- +.It .Nm will only accept trusted hosts as masters. If it finds an untrusted host claiming to be master, .Nm will suppress incoming messages from that host and call for a new election. -.ti -2 -- +.It Use real host names (resolvable by RDNS) not aliases (eg in .Xr named 8 parlance: use A names, not C names). -.ti -2 -- +.It Use full names eg time1.domain.com not time1. -.ti -2 -- +.It .Fl F automatically includes the functionality of .Fl M -( so +(so .Fl M does not need to asserted). -.ti -2 -- +.It If .Fl F is not specified, all hosts on connected networks are treated as trustworthy. -.in -2 +.El .It Fl M Allow this host to become a .Nm From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 16:49:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E7131065787; Tue, 8 Jun 2010 16:49:00 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC4A8FC12; Tue, 8 Jun 2010 16:49:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Gn0xO057091; Tue, 8 Jun 2010 16:49:00 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58Gn0on057076; Tue, 8 Jun 2010 16:49:00 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006081649.o58Gn0on057076@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 8 Jun 2010 16:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208914 - in head/lib: libc/sys libpmc librpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 16:49:00 -0000 Author: uqs Date: Tue Jun 8 16:48:59 2010 New Revision: 208914 URL: http://svn.freebsd.org/changeset/base/208914 Log: mdoc: remove literal tabs where they don't belong Modified: head/lib/libc/sys/flock.2 head/lib/libc/sys/getitimer.2 head/lib/libc/sys/getrusage.2 head/lib/libc/sys/mq_close.2 head/lib/libc/sys/mq_getattr.2 head/lib/libc/sys/mq_notify.2 head/lib/libc/sys/mq_open.2 head/lib/libc/sys/mq_receive.2 head/lib/libc/sys/mq_send.2 head/lib/libc/sys/mq_setattr.2 head/lib/libpmc/pmc.corei7.3 head/lib/libpmc/pmc.corei7uc.3 head/lib/libpmc/pmc.westmereuc.3 head/lib/librpcsec_gss/rpc_gss_seccreate.3 Modified: head/lib/libc/sys/flock.2 ============================================================================== --- head/lib/libc/sys/flock.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/flock.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -38,10 +38,10 @@ .Lb libc .Sh SYNOPSIS .In sys/file.h -.Fd "#define LOCK_SH 0x01 /* shared file lock */" -.Fd "#define LOCK_EX 0x02 /* exclusive file lock */" -.Fd "#define LOCK_NB 0x04 /* do not block when locking */" -.Fd "#define LOCK_UN 0x08 /* unlock file */" +.Fd "#define LOCK_SH 0x01 /* shared file lock */" +.Fd "#define LOCK_EX 0x02 /* exclusive file lock */" +.Fd "#define LOCK_NB 0x04 /* do not block when locking */" +.Fd "#define LOCK_UN 0x08 /* unlock file */" .Ft int .Fn flock "int fd" "int operation" .Sh DESCRIPTION Modified: head/lib/libc/sys/getitimer.2 ============================================================================== --- head/lib/libc/sys/getitimer.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/getitimer.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -39,9 +39,9 @@ .Lb libc .Sh SYNOPSIS .In sys/time.h -.Fd "#define ITIMER_REAL 0" -.Fd "#define ITIMER_VIRTUAL 1" -.Fd "#define ITIMER_PROF 2" +.Fd "#define ITIMER_REAL 0" +.Fd "#define ITIMER_VIRTUAL 1" +.Fd "#define ITIMER_PROF 2" .Ft int .Fn getitimer "int which" "struct itimerval *value" .Ft int Modified: head/lib/libc/sys/getrusage.2 ============================================================================== --- head/lib/libc/sys/getrusage.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/getrusage.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -40,9 +40,9 @@ .In sys/types.h .In sys/time.h .In sys/resource.h -.Fd "#define RUSAGE_SELF 0" -.Fd "#define RUSAGE_CHILDREN -1" -.Fd "#define RUSAGE_THREAD 1" +.Fd "#define RUSAGE_SELF 0" +.Fd "#define RUSAGE_CHILDREN -1" +.Fd "#define RUSAGE_THREAD 1" .Ft int .Fn getrusage "int who" "struct rusage *rusage" .Sh DESCRIPTION Modified: head/lib/libc/sys/mq_close.2 ============================================================================== --- head/lib/libc/sys/mq_close.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/mq_close.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -102,4 +102,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: head/lib/libc/sys/mq_getattr.2 ============================================================================== --- head/lib/libc/sys/mq_getattr.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/mq_getattr.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -124,4 +124,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: head/lib/libc/sys/mq_notify.2 ============================================================================== --- head/lib/libc/sys/mq_notify.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/mq_notify.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -148,4 +148,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: head/lib/libc/sys/mq_open.2 ============================================================================== --- head/lib/libc/sys/mq_open.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/mq_open.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -320,4 +320,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: head/lib/libc/sys/mq_receive.2 ============================================================================== --- head/lib/libc/sys/mq_receive.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/mq_receive.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -214,4 +214,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: head/lib/libc/sys/mq_send.2 ============================================================================== --- head/lib/libc/sys/mq_send.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/mq_send.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -233,4 +233,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: head/lib/libc/sys/mq_setattr.2 ============================================================================== --- head/lib/libc/sys/mq_setattr.2 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libc/sys/mq_setattr.2 Tue Jun 8 16:48:59 2010 (r208914) @@ -120,4 +120,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: head/lib/libpmc/pmc.corei7.3 ============================================================================== --- head/lib/libpmc/pmc.corei7.3 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libpmc/pmc.corei7.3 Tue Jun 8 16:48:59 2010 (r208914) @@ -613,7 +613,7 @@ Counter 0, 1 only .It Li L1D_CACHE_LOCK.HIT .Pq Event 42H , Umask 01H Counts retired load locks that hit in the L1 data cache or hit in an already -allocated fill buffer. The lock portion of the load lock transaction must +allocated fill buffer. The lock portion of the load lock transaction must hit in the L1D. The initial load will pull the lock into the L1 data cache. Counter 0, 1 only Modified: head/lib/libpmc/pmc.corei7uc.3 ============================================================================== --- head/lib/libpmc/pmc.corei7uc.3 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libpmc/pmc.corei7uc.3 Tue Jun 8 16:48:59 2010 (r208914) @@ -151,14 +151,14 @@ count is divided by this count to obtain .Pq Event 03H , Umask 08H Counts the number of GQ read tracker entries that are allocated in the read tracker, have missed in the L3 and have not acquired a Request Transaction -ID. The GQ read tracker L3 miss to RTID acquired occupancy count is +ID. The GQ read tracker L3 miss to RTID acquired occupancy count is divided by this count to obtain the average latency for a read L3 miss to acquire an RTID. .It Li GQ_ALLOC.WT_TO_RTID_ACQUIRED .Pq Event 03H , Umask 10H Counts the number of GQ write tracker entries that are allocated in the write tracker, have missed in the L3 and have not acquired a Request -Transaction ID. The GQ write tracker L3 miss to RTID occupancy count is +Transaction ID. The GQ write tracker L3 miss to RTID occupancy count is divided by this count to obtain the average latency for a write L3 miss to acquire an RTID. .It Li GQ_ALLOC.WRITE_TRACKER Modified: head/lib/libpmc/pmc.westmereuc.3 ============================================================================== --- head/lib/libpmc/pmc.westmereuc.3 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/libpmc/pmc.westmereuc.3 Tue Jun 8 16:48:59 2010 (r208914) @@ -157,14 +157,14 @@ count is divided by this count to obtain .Pq Event 03H , Umask 08H Counts the number of GQ read tracker entries that are allocated in the read tracker, have missed in the L3 and have not acquired a Request Transaction -ID. The GQ read tracker L3 miss to RTID acquired occupancy count is +ID. The GQ read tracker L3 miss to RTID acquired occupancy count is divided by this count to obtain the average latency for a read L3 miss to acquire an RTID. .It Li GQ_ALLOC.WT_TO_RTID_ACQUIRED .Pq Event 03H , Umask 10H Counts the number of GQ write tracker entries that are allocated in the write tracker, have missed in the L3 and have not acquired a Request -Transaction ID. The GQ write tracker L3 miss to RTID occupancy count is +Transaction ID. The GQ write tracker L3 miss to RTID occupancy count is divided by this count to obtain the average latency for a write L3 miss to acquire an RTID. .It Li GQ_ALLOC.WRITE_TRACKER Modified: head/lib/librpcsec_gss/rpc_gss_seccreate.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_seccreate.3 Tue Jun 8 16:48:49 2010 (r208913) +++ head/lib/librpcsec_gss/rpc_gss_seccreate.3 Tue Jun 8 16:48:59 2010 (r208914) @@ -74,7 +74,7 @@ RPC headers and data are integrity prote RPC headers are integrity protected by a checksum and data is encrypted. .El .It qop -Desired quality of protection or NULL for the default. +Desired quality of protection or NULL for the default. Available values are listed in /etc/gss/qop .It options_req Extra security context options to be passed to the underlying GSS-API From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 17:08:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1459106567B; Tue, 8 Jun 2010 17:08:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFB9F8FC16; Tue, 8 Jun 2010 17:08:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58H8DeS061377; Tue, 8 Jun 2010 17:08:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58H8DLn061374; Tue, 8 Jun 2010 17:08:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006081708.o58H8DLn061374@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Jun 2010 17:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208915 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 17:08:14 -0000 Author: jhb Date: Tue Jun 8 17:08:13 2010 New Revision: 208915 URL: http://svn.freebsd.org/changeset/base/208915 Log: - Use a bit more care when moving I/O APIC interrupts between CPUs. Mask the interrupt followed by a brief delay if it is not currently masked before moving the interrupt. - Move the icu_lock out of ioapic_program_intpin() and into callers. This closes a race where ioapic_program_intpin() could use a stale value of the masked state to compute the masked bit in the register. Reviewed by: mav MFC after: 2 weeks Modified: head/sys/amd64/amd64/io_apic.c head/sys/i386/i386/io_apic.c Modified: head/sys/amd64/amd64/io_apic.c ============================================================================== --- head/sys/amd64/amd64/io_apic.c Tue Jun 8 16:48:59 2010 (r208914) +++ head/sys/amd64/amd64/io_apic.c Tue Jun 8 17:08:13 2010 (r208915) @@ -261,16 +261,15 @@ ioapic_program_intpin(struct ioapic_ints * If a pin is completely invalid or if it is valid but hasn't * been enabled yet, just ensure that the pin is masked. */ + mtx_assert(&icu_lock, MA_OWNED); if (intpin->io_irq == IRQ_DISABLED || (intpin->io_irq < NUM_IO_INTS && intpin->io_vector == 0)) { - mtx_lock_spin(&icu_lock); low = ioapic_read(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin)); if ((low & IOART_INTMASK) == IOART_INTMCLR) ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low | IOART_INTMSET); - mtx_unlock_spin(&icu_lock); return; } @@ -312,14 +311,12 @@ ioapic_program_intpin(struct ioapic_ints } /* Write the values to the APIC. */ - mtx_lock_spin(&icu_lock); intpin->io_lowreg = low; ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin)); value &= ~IOART_DEST; value |= high; ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value); - mtx_unlock_spin(&icu_lock); } static int @@ -352,6 +349,19 @@ ioapic_assign_cpu(struct intsrc *isrc, u if (new_vector == 0) return (ENOSPC); + /* + * Mask the old intpin if it is enabled while it is migrated. + * + * At least some level-triggered interrupts seem to need the + * extra DELAY() to avoid being stuck in a non-EOI'd state. + */ + mtx_lock_spin(&icu_lock); + if (!intpin->io_masked) { + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), + intpin->io_lowreg | IOART_INTMSET); + DELAY(100); + } + intpin->io_cpu = apic_id; intpin->io_vector = new_vector; if (isrc->is_handlers > 0) @@ -364,6 +374,8 @@ ioapic_assign_cpu(struct intsrc *isrc, u intpin->io_vector); } ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); + /* * Free the old vector after the new one is established. This is done * to prevent races where we could miss an interrupt. @@ -399,9 +411,11 @@ ioapic_disable_intr(struct intsrc *isrc) /* Mask this interrupt pin and free its APIC vector. */ vector = intpin->io_vector; apic_disable_vector(intpin->io_cpu, vector); + mtx_lock_spin(&icu_lock); intpin->io_masked = 1; intpin->io_vector = 0; ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); apic_free_vector(intpin->io_cpu, vector, intpin->io_irq); } } @@ -443,6 +457,7 @@ ioapic_config_intr(struct intsrc *isrc, * XXX: Should we write to the ELCR if the trigger mode changes for * an EISA IRQ or an ISA IRQ with the ELCR present? */ + mtx_lock_spin(&icu_lock); if (intpin->io_bus == APIC_BUS_EISA) pol = INTR_POLARITY_HIGH; changed = 0; @@ -464,6 +479,7 @@ ioapic_config_intr(struct intsrc *isrc, } if (changed) ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); return (0); } @@ -473,8 +489,10 @@ ioapic_resume(struct pic *pic) struct ioapic *io = (struct ioapic *)pic; int i; + mtx_lock_spin(&icu_lock); for (i = 0; i < io->io_numintr; i++) ioapic_program_intpin(&io->io_pins[i]); + mtx_unlock_spin(&icu_lock); } /* Modified: head/sys/i386/i386/io_apic.c ============================================================================== --- head/sys/i386/i386/io_apic.c Tue Jun 8 16:48:59 2010 (r208914) +++ head/sys/i386/i386/io_apic.c Tue Jun 8 17:08:13 2010 (r208915) @@ -261,16 +261,15 @@ ioapic_program_intpin(struct ioapic_ints * If a pin is completely invalid or if it is valid but hasn't * been enabled yet, just ensure that the pin is masked. */ + mtx_assert(&icu_lock, MA_OWNED); if (intpin->io_irq == IRQ_DISABLED || (intpin->io_irq < NUM_IO_INTS && intpin->io_vector == 0)) { - mtx_lock_spin(&icu_lock); low = ioapic_read(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin)); if ((low & IOART_INTMASK) == IOART_INTMCLR) ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low | IOART_INTMSET); - mtx_unlock_spin(&icu_lock); return; } @@ -312,14 +311,12 @@ ioapic_program_intpin(struct ioapic_ints } /* Write the values to the APIC. */ - mtx_lock_spin(&icu_lock); intpin->io_lowreg = low; ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin)); value &= ~IOART_DEST; value |= high; ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value); - mtx_unlock_spin(&icu_lock); } static int @@ -352,6 +349,19 @@ ioapic_assign_cpu(struct intsrc *isrc, u if (new_vector == 0) return (ENOSPC); + /* + * Mask the old intpin if it is enabled while it is migrated. + * + * At least some level-triggered interrupts seem to need the + * extra DELAY() to avoid being stuck in a non-EOI'd state. + */ + mtx_lock_spin(&icu_lock); + if (!intpin->io_masked) { + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), + intpin->io_lowreg | IOART_INTMSET); + DELAY(100); + } + intpin->io_cpu = apic_id; intpin->io_vector = new_vector; if (isrc->is_handlers > 0) @@ -364,6 +374,8 @@ ioapic_assign_cpu(struct intsrc *isrc, u intpin->io_vector); } ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); + /* * Free the old vector after the new one is established. This is done * to prevent races where we could miss an interrupt. @@ -399,9 +411,11 @@ ioapic_disable_intr(struct intsrc *isrc) /* Mask this interrupt pin and free its APIC vector. */ vector = intpin->io_vector; apic_disable_vector(intpin->io_cpu, vector); + mtx_lock_spin(&icu_lock); intpin->io_masked = 1; intpin->io_vector = 0; ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); apic_free_vector(intpin->io_cpu, vector, intpin->io_irq); } } @@ -443,6 +457,7 @@ ioapic_config_intr(struct intsrc *isrc, * XXX: Should we write to the ELCR if the trigger mode changes for * an EISA IRQ or an ISA IRQ with the ELCR present? */ + mtx_lock_spin(&icu_lock); if (intpin->io_bus == APIC_BUS_EISA) pol = INTR_POLARITY_HIGH; changed = 0; @@ -464,6 +479,7 @@ ioapic_config_intr(struct intsrc *isrc, } if (changed) ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); return (0); } @@ -473,8 +489,10 @@ ioapic_resume(struct pic *pic) struct ioapic *io = (struct ioapic *)pic; int i; + mtx_lock_spin(&icu_lock); for (i = 0; i < io->io_numintr; i++) ioapic_program_intpin(&io->io_pins[i]); + mtx_unlock_spin(&icu_lock); } /* From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 17:26:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA85E106567C; Tue, 8 Jun 2010 17:26:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8BC88FC1D; Tue, 8 Jun 2010 17:26:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58HQITo065402; Tue, 8 Jun 2010 17:26:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58HQItr065400; Tue, 8 Jun 2010 17:26:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006081726.o58HQItr065400@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 8 Jun 2010 17:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208916 - stable/8/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 17:26:19 -0000 Author: nwhitehorn Date: Tue Jun 8 17:26:18 2010 New Revision: 208916 URL: http://svn.freebsd.org/changeset/base/208916 Log: MFC r208168: It is not necessary (and in some cases harmful) to hardcode ata_kauai's IRQ to 39 on K2 devices, as well as Shasta ones. Reported by: Andreas Tobler Approved by: re (kib) Modified: stable/8/sys/powerpc/powermac/ata_kauai.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/powerpc/powermac/ata_kauai.c ============================================================================== --- stable/8/sys/powerpc/powermac/ata_kauai.c Tue Jun 8 17:08:13 2010 (r208915) +++ stable/8/sys/powerpc/powermac/ata_kauai.c Tue Jun 8 17:26:18 2010 (r208916) @@ -220,8 +220,9 @@ ata_kauai_probe(device_t dev) if (compatstring != NULL && strcmp(compatstring,"shasta-ata") == 0) sc->shasta = 1; - /* Regular Kauai controllers apparently need this hack */ - if (!sc->shasta) + /* Pre-K2 controllers apparently need this hack */ + if (!sc->shasta && + (compatstring == NULL || strcmp(compatstring, "K2-UATA") != 0)) bus_set_resource(dev, SYS_RES_IRQ, 0, 39, 1); rid = PCIR_BARS; From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 17:28:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E66BE106566C; Tue, 8 Jun 2010 17:28:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D59B98FC1E; Tue, 8 Jun 2010 17:28:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58HSSqB065903; Tue, 8 Jun 2010 17:28:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58HSSqr065901; Tue, 8 Jun 2010 17:28:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201006081728.o58HSSqr065901@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Jun 2010 17:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208917 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 17:28:29 -0000 Author: yongari Date: Tue Jun 8 17:28:28 2010 New Revision: 208917 URL: http://svn.freebsd.org/changeset/base/208917 Log: Remove unused macros. Reviewed by: bde Modified: head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Tue Jun 8 17:26:18 2010 (r208916) +++ head/sys/dev/bge/if_bgereg.h Tue Jun 8 17:28:28 2010 (r208917) @@ -2086,9 +2086,6 @@ struct bge_status_block { struct bge_sts_idx bge_idx[16]; }; -#define BGE_TX_CONSIDX(x, i) x->bge_idx[i].bge_tx_considx -#define BGE_RX_PRODIDX(x, i) x->bge_idx[i].bge_rx_prodidx - #define BGE_STATFLAG_UPDATED 0x00000001 #define BGE_STATFLAG_LINKSTATE_CHANGED 0x00000002 #define BGE_STATFLAG_ERROR 0x00000004 @@ -2475,15 +2472,9 @@ struct bge_gib { pci_write_config(dev, reg, (pci_read_config(dev, reg, s) & ~(x)), s) /* - * Memory management stuff. Note: the SSLOTS, MSLOTS and JSLOTS - * values are tuneable. They control the actual amount of buffers - * allocated for the standard, mini and jumbo receive rings. + * Memory management stuff. */ -#define BGE_SSLOTS 256 -#define BGE_MSLOTS 256 -#define BGE_JSLOTS 384 - #define BGE_NSEG_JUMBO 4 #define BGE_NSEG_NEW 32 #define BGE_TSOSEG_SZ 4096 From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 17:44:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88E151065674; Tue, 8 Jun 2010 17:44:50 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7826F8FC19; Tue, 8 Jun 2010 17:44:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Hio7X069506; Tue, 8 Jun 2010 17:44:50 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58HioF1069504; Tue, 8 Jun 2010 17:44:50 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006081744.o58HioF1069504@svn.freebsd.org> From: Matt Jacob Date: Tue, 8 Jun 2010 17:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208918 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 17:44:50 -0000 Author: mjacob Date: Tue Jun 8 17:44:49 2010 New Revision: 208918 URL: http://svn.freebsd.org/changeset/base/208918 Log: One byte off for scsi_target_group cdb. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Tue Jun 8 17:28:28 2010 (r208917) +++ head/sys/cam/scsi/scsi_all.h Tue Jun 8 17:44:49 2010 (r208918) @@ -893,7 +893,7 @@ struct scsi_target_group uint8_t service_action; #define STG_PDF_LENGTH 0x00 #define RPL_PDF_EXTENDED 0x20 - uint8_t reserved1[3]; + uint8_t reserved1[4]; uint8_t length[4]; uint8_t reserved2; uint8_t control; From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 17:51:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83BF11065675; Tue, 8 Jun 2010 17:51:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 711F68FC1F; Tue, 8 Jun 2010 17:51:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58HpL44070961; Tue, 8 Jun 2010 17:51:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58HpLbW070956; Tue, 8 Jun 2010 17:51:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006081751.o58HpLbW070956@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Jun 2010 17:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208919 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 17:51:21 -0000 Author: jhb Date: Tue Jun 8 17:51:21 2010 New Revision: 208919 URL: http://svn.freebsd.org/changeset/base/208919 Log: Move the I/O APIC code to the x86 tree since it is identical on i386 and amd64. Added: head/sys/x86/x86/io_apic.c - copied unchanged from r208915, head/sys/i386/i386/io_apic.c Deleted: head/sys/amd64/amd64/io_apic.c head/sys/i386/i386/io_apic.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Jun 8 17:44:49 2010 (r208918) +++ head/sys/conf/files.amd64 Tue Jun 8 17:51:21 2010 (r208919) @@ -105,9 +105,7 @@ amd64/amd64/in_cksum.c optional inet amd64/amd64/initcpu.c standard amd64/amd64/intr_machdep.c standard amd64/amd64/io.c optional io -amd64/amd64/io_apic.c standard amd64/amd64/legacy.c standard -x86/x86/local_apic.c standard amd64/amd64/locore.S standard no-obj amd64/amd64/machdep.c standard amd64/amd64/mca.c standard @@ -306,3 +304,5 @@ x86/isa/isa.c standard x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/isa/orm.c optional isa +x86/x86/io_apic.c standard +x86/x86/local_apic.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Jun 8 17:44:49 2010 (r208918) +++ head/sys/conf/files.i386 Tue Jun 8 17:51:21 2010 (r208919) @@ -269,10 +269,8 @@ i386/i386/in_cksum.c optional inet i386/i386/initcpu.c standard i386/i386/intr_machdep.c standard i386/i386/io.c optional io -i386/i386/io_apic.c optional apic i386/i386/k6_mem.c optional mem i386/i386/legacy.c optional native -x86/x86/local_apic.c optional apic i386/i386/locore.s optional native no-obj i386/xen/locore.s optional xen no-obj i386/i386/longrun.c optional cpu_enable_longrun @@ -390,3 +388,5 @@ x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/isa/orm.c optional isa +x86/x86/io_apic.c optional apic +x86/x86/local_apic.c optional apic Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Tue Jun 8 17:44:49 2010 (r208918) +++ head/sys/conf/files.pc98 Tue Jun 8 17:51:21 2010 (r208919) @@ -148,10 +148,8 @@ i386/i386/in_cksum.c optional inet i386/i386/initcpu.c standard i386/i386/intr_machdep.c standard i386/i386/io.c optional io -i386/i386/io_apic.c optional apic i386/i386/k6_mem.c optional mem i386/i386/legacy.c standard -x86/x86/local_apic.c optional apic i386/i386/locore.s standard no-obj i386/i386/mca.c standard i386/i386/mem.c optional mem @@ -258,3 +256,5 @@ pc98/pc98/pc98_machdep.c standard # x86/isa/atpic.c optional atpic x86/isa/isa.c optional isa +x86/x86/io_apic.c optional apic +x86/x86/local_apic.c optional apic Copied: head/sys/x86/x86/io_apic.c (from r208915, head/sys/i386/i386/io_apic.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/x86/io_apic.c Tue Jun 8 17:51:21 2010 (r208919, copy of r208915, head/sys/i386/i386/io_apic.c) @@ -0,0 +1,922 @@ +/*- + * Copyright (c) 2003 John Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_isa.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#define IOAPIC_ISA_INTS 16 +#define IOAPIC_MEM_REGION 32 +#define IOAPIC_REDTBL_LO(i) (IOAPIC_REDTBL + (i) * 2) +#define IOAPIC_REDTBL_HI(i) (IOAPIC_REDTBL_LO(i) + 1) + +#define IRQ_EXTINT (NUM_IO_INTS + 1) +#define IRQ_NMI (NUM_IO_INTS + 2) +#define IRQ_SMI (NUM_IO_INTS + 3) +#define IRQ_DISABLED (NUM_IO_INTS + 4) + +static MALLOC_DEFINE(M_IOAPIC, "io_apic", "I/O APIC structures"); + +/* + * I/O APIC interrupt source driver. Each pin is assigned an IRQ cookie + * as laid out in the ACPI System Interrupt number model where each I/O + * APIC has a contiguous chunk of the System Interrupt address space. + * We assume that IRQs 1 - 15 behave like ISA IRQs and that all other + * IRQs behave as PCI IRQs by default. We also assume that the pin for + * IRQ 0 is actually an ExtINT pin. The apic enumerators override the + * configuration of individual pins as indicated by their tables. + * + * Documentation for the I/O APIC: "82093AA I/O Advanced Programmable + * Interrupt Controller (IOAPIC)", May 1996, Intel Corp. + * ftp://download.intel.com/design/chipsets/datashts/29056601.pdf + */ + +struct ioapic_intsrc { + struct intsrc io_intsrc; + u_int io_irq; + u_int io_intpin:8; + u_int io_vector:8; + u_int io_cpu:8; + u_int io_activehi:1; + u_int io_edgetrigger:1; + u_int io_masked:1; + int io_bus:4; + uint32_t io_lowreg; +}; + +struct ioapic { + struct pic io_pic; + u_int io_id:8; /* logical ID */ + u_int io_apic_id:4; + u_int io_intbase:8; /* System Interrupt base */ + u_int io_numintr:8; + volatile ioapic_t *io_addr; /* XXX: should use bus_space */ + vm_paddr_t io_paddr; + STAILQ_ENTRY(ioapic) io_next; + struct ioapic_intsrc io_pins[0]; +}; + +static u_int ioapic_read(volatile ioapic_t *apic, int reg); +static void ioapic_write(volatile ioapic_t *apic, int reg, u_int val); +static const char *ioapic_bus_string(int bus_type); +static void ioapic_print_irq(struct ioapic_intsrc *intpin); +static void ioapic_enable_source(struct intsrc *isrc); +static void ioapic_disable_source(struct intsrc *isrc, int eoi); +static void ioapic_eoi_source(struct intsrc *isrc); +static void ioapic_enable_intr(struct intsrc *isrc); +static void ioapic_disable_intr(struct intsrc *isrc); +static int ioapic_vector(struct intsrc *isrc); +static int ioapic_source_pending(struct intsrc *isrc); +static int ioapic_config_intr(struct intsrc *isrc, enum intr_trigger trig, + enum intr_polarity pol); +static void ioapic_resume(struct pic *pic); +static int ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id); +static void ioapic_program_intpin(struct ioapic_intsrc *intpin); + +static STAILQ_HEAD(,ioapic) ioapic_list = STAILQ_HEAD_INITIALIZER(ioapic_list); +struct pic ioapic_template = { ioapic_enable_source, ioapic_disable_source, + ioapic_eoi_source, ioapic_enable_intr, + ioapic_disable_intr, ioapic_vector, + ioapic_source_pending, NULL, ioapic_resume, + ioapic_config_intr, ioapic_assign_cpu }; + +static int next_ioapic_base; +static u_int next_id; + +SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); +static int enable_extint; +SYSCTL_INT(_hw_apic, OID_AUTO, enable_extint, CTLFLAG_RDTUN, &enable_extint, 0, + "Enable the ExtINT pin in the first I/O APIC"); +TUNABLE_INT("hw.apic.enable_extint", &enable_extint); + +static __inline void +_ioapic_eoi_source(struct intsrc *isrc) +{ + lapic_eoi(); +} + +static u_int +ioapic_read(volatile ioapic_t *apic, int reg) +{ + + mtx_assert(&icu_lock, MA_OWNED); + apic->ioregsel = reg; + return (apic->iowin); +} + +static void +ioapic_write(volatile ioapic_t *apic, int reg, u_int val) +{ + + mtx_assert(&icu_lock, MA_OWNED); + apic->ioregsel = reg; + apic->iowin = val; +} + +static const char * +ioapic_bus_string(int bus_type) +{ + + switch (bus_type) { + case APIC_BUS_ISA: + return ("ISA"); + case APIC_BUS_EISA: + return ("EISA"); + case APIC_BUS_PCI: + return ("PCI"); + default: + return ("unknown"); + } +} + +static void +ioapic_print_irq(struct ioapic_intsrc *intpin) +{ + + switch (intpin->io_irq) { + case IRQ_DISABLED: + printf("disabled"); + break; + case IRQ_EXTINT: + printf("ExtINT"); + break; + case IRQ_NMI: + printf("NMI"); + break; + case IRQ_SMI: + printf("SMI"); + break; + default: + printf("%s IRQ %u", ioapic_bus_string(intpin->io_bus), + intpin->io_irq); + } +} + +static void +ioapic_enable_source(struct intsrc *isrc) +{ + struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; + struct ioapic *io = (struct ioapic *)isrc->is_pic; + uint32_t flags; + + mtx_lock_spin(&icu_lock); + if (intpin->io_masked) { + flags = intpin->io_lowreg & ~IOART_INTMASK; + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), + flags); + intpin->io_masked = 0; + } + mtx_unlock_spin(&icu_lock); +} + +static void +ioapic_disable_source(struct intsrc *isrc, int eoi) +{ + struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; + struct ioapic *io = (struct ioapic *)isrc->is_pic; + uint32_t flags; + + mtx_lock_spin(&icu_lock); + if (!intpin->io_masked && !intpin->io_edgetrigger) { + flags = intpin->io_lowreg | IOART_INTMSET; + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), + flags); + intpin->io_masked = 1; + } + + if (eoi == PIC_EOI) + _ioapic_eoi_source(isrc); + + mtx_unlock_spin(&icu_lock); +} + +static void +ioapic_eoi_source(struct intsrc *isrc) +{ + + _ioapic_eoi_source(isrc); +} + +/* + * Completely program an intpin based on the data in its interrupt source + * structure. + */ +static void +ioapic_program_intpin(struct ioapic_intsrc *intpin) +{ + struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic; + uint32_t low, high, value; + + /* + * If a pin is completely invalid or if it is valid but hasn't + * been enabled yet, just ensure that the pin is masked. + */ + mtx_assert(&icu_lock, MA_OWNED); + if (intpin->io_irq == IRQ_DISABLED || (intpin->io_irq < NUM_IO_INTS && + intpin->io_vector == 0)) { + low = ioapic_read(io->io_addr, + IOAPIC_REDTBL_LO(intpin->io_intpin)); + if ((low & IOART_INTMASK) == IOART_INTMCLR) + ioapic_write(io->io_addr, + IOAPIC_REDTBL_LO(intpin->io_intpin), + low | IOART_INTMSET); + return; + } + + /* Set the destination. */ + low = IOART_DESTPHY; + high = intpin->io_cpu << APIC_ID_SHIFT; + + /* Program the rest of the low word. */ + if (intpin->io_edgetrigger) + low |= IOART_TRGREDG; + else + low |= IOART_TRGRLVL; + if (intpin->io_activehi) + low |= IOART_INTAHI; + else + low |= IOART_INTALO; + if (intpin->io_masked) + low |= IOART_INTMSET; + switch (intpin->io_irq) { + case IRQ_EXTINT: + KASSERT(intpin->io_edgetrigger, + ("ExtINT not edge triggered")); + low |= IOART_DELEXINT; + break; + case IRQ_NMI: + KASSERT(intpin->io_edgetrigger, + ("NMI not edge triggered")); + low |= IOART_DELNMI; + break; + case IRQ_SMI: + KASSERT(intpin->io_edgetrigger, + ("SMI not edge triggered")); + low |= IOART_DELSMI; + break; + default: + KASSERT(intpin->io_vector != 0, ("No vector for IRQ %u", + intpin->io_irq)); + low |= IOART_DELFIXED | intpin->io_vector; + } + + /* Write the values to the APIC. */ + intpin->io_lowreg = low; + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); + value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin)); + value &= ~IOART_DEST; + value |= high; + ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value); +} + +static int +ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id) +{ + struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; + struct ioapic *io = (struct ioapic *)isrc->is_pic; + u_int old_vector, new_vector; + u_int old_id; + + /* + * keep 1st core as the destination for NMI + */ + if (intpin->io_irq == IRQ_NMI) + apic_id = 0; + + /* + * Set us up to free the old irq. + */ + old_vector = intpin->io_vector; + old_id = intpin->io_cpu; + if (old_vector && apic_id == old_id) + return (0); + + /* + * Allocate an APIC vector for this interrupt pin. Once + * we have a vector we program the interrupt pin. + */ + new_vector = apic_alloc_vector(apic_id, intpin->io_irq); + if (new_vector == 0) + return (ENOSPC); + + /* + * Mask the old intpin if it is enabled while it is migrated. + * + * At least some level-triggered interrupts seem to need the + * extra DELAY() to avoid being stuck in a non-EOI'd state. + */ + mtx_lock_spin(&icu_lock); + if (!intpin->io_masked) { + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), + intpin->io_lowreg | IOART_INTMSET); + DELAY(100); + } + + intpin->io_cpu = apic_id; + intpin->io_vector = new_vector; + if (isrc->is_handlers > 0) + apic_enable_vector(intpin->io_cpu, intpin->io_vector); + if (bootverbose) { + printf("ioapic%u: routing intpin %u (", io->io_id, + intpin->io_intpin); + ioapic_print_irq(intpin); + printf(") to lapic %u vector %u\n", intpin->io_cpu, + intpin->io_vector); + } + ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); + + /* + * Free the old vector after the new one is established. This is done + * to prevent races where we could miss an interrupt. + */ + if (old_vector) { + if (isrc->is_handlers > 0) + apic_disable_vector(old_id, old_vector); + apic_free_vector(old_id, old_vector, intpin->io_irq); + } + return (0); +} + +static void +ioapic_enable_intr(struct intsrc *isrc) +{ + struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; + + if (intpin->io_vector == 0) + if (ioapic_assign_cpu(isrc, intr_next_cpu()) != 0) + panic("Couldn't find an APIC vector for IRQ %d", + intpin->io_irq); + apic_enable_vector(intpin->io_cpu, intpin->io_vector); +} + + +static void +ioapic_disable_intr(struct intsrc *isrc) +{ + struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; + u_int vector; + + if (intpin->io_vector != 0) { + /* Mask this interrupt pin and free its APIC vector. */ + vector = intpin->io_vector; + apic_disable_vector(intpin->io_cpu, vector); + mtx_lock_spin(&icu_lock); + intpin->io_masked = 1; + intpin->io_vector = 0; + ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); + apic_free_vector(intpin->io_cpu, vector, intpin->io_irq); + } +} + +static int +ioapic_vector(struct intsrc *isrc) +{ + struct ioapic_intsrc *pin; + + pin = (struct ioapic_intsrc *)isrc; + return (pin->io_irq); +} + +static int +ioapic_source_pending(struct intsrc *isrc) +{ + struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; + + if (intpin->io_vector == 0) + return 0; + return (lapic_intr_pending(intpin->io_vector)); +} + +static int +ioapic_config_intr(struct intsrc *isrc, enum intr_trigger trig, + enum intr_polarity pol) +{ + struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; + struct ioapic *io = (struct ioapic *)isrc->is_pic; + int changed; + + KASSERT(!(trig == INTR_TRIGGER_CONFORM || pol == INTR_POLARITY_CONFORM), + ("%s: Conforming trigger or polarity\n", __func__)); + + /* + * EISA interrupts always use active high polarity, so don't allow + * them to be set to active low. + * + * XXX: Should we write to the ELCR if the trigger mode changes for + * an EISA IRQ or an ISA IRQ with the ELCR present? + */ + mtx_lock_spin(&icu_lock); + if (intpin->io_bus == APIC_BUS_EISA) + pol = INTR_POLARITY_HIGH; + changed = 0; + if (intpin->io_edgetrigger != (trig == INTR_TRIGGER_EDGE)) { + if (bootverbose) + printf("ioapic%u: Changing trigger for pin %u to %s\n", + io->io_id, intpin->io_intpin, + trig == INTR_TRIGGER_EDGE ? "edge" : "level"); + intpin->io_edgetrigger = (trig == INTR_TRIGGER_EDGE); + changed++; + } + if (intpin->io_activehi != (pol == INTR_POLARITY_HIGH)) { + if (bootverbose) + printf("ioapic%u: Changing polarity for pin %u to %s\n", + io->io_id, intpin->io_intpin, + pol == INTR_POLARITY_HIGH ? "high" : "low"); + intpin->io_activehi = (pol == INTR_POLARITY_HIGH); + changed++; + } + if (changed) + ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); + return (0); +} + +static void +ioapic_resume(struct pic *pic) +{ + struct ioapic *io = (struct ioapic *)pic; + int i; + + mtx_lock_spin(&icu_lock); + for (i = 0; i < io->io_numintr; i++) + ioapic_program_intpin(&io->io_pins[i]); + mtx_unlock_spin(&icu_lock); +} + +/* + * Create a plain I/O APIC object. + */ +void * +ioapic_create(vm_paddr_t addr, int32_t apic_id, int intbase) +{ + struct ioapic *io; + struct ioapic_intsrc *intpin; + volatile ioapic_t *apic; + u_int numintr, i; + uint32_t value; + + /* Map the register window so we can access the device. */ + apic = pmap_mapdev(addr, IOAPIC_MEM_REGION); + mtx_lock_spin(&icu_lock); + value = ioapic_read(apic, IOAPIC_VER); + mtx_unlock_spin(&icu_lock); + + /* If it's version register doesn't seem to work, punt. */ + if (value == 0xffffffff) { + pmap_unmapdev((vm_offset_t)apic, IOAPIC_MEM_REGION); + return (NULL); + } + + /* Determine the number of vectors and set the APIC ID. */ + numintr = ((value & IOART_VER_MAXREDIR) >> MAXREDIRSHIFT) + 1; + io = malloc(sizeof(struct ioapic) + + numintr * sizeof(struct ioapic_intsrc), M_IOAPIC, M_WAITOK); + io->io_pic = ioapic_template; + mtx_lock_spin(&icu_lock); + io->io_id = next_id++; + io->io_apic_id = ioapic_read(apic, IOAPIC_ID) >> APIC_ID_SHIFT; + if (apic_id != -1 && io->io_apic_id != apic_id) { + ioapic_write(apic, IOAPIC_ID, apic_id << APIC_ID_SHIFT); + mtx_unlock_spin(&icu_lock); + io->io_apic_id = apic_id; + printf("ioapic%u: Changing APIC ID to %d\n", io->io_id, + apic_id); + } else + mtx_unlock_spin(&icu_lock); + if (intbase == -1) { + intbase = next_ioapic_base; + printf("ioapic%u: Assuming intbase of %d\n", io->io_id, + intbase); + } else if (intbase != next_ioapic_base && bootverbose) + printf("ioapic%u: WARNING: intbase %d != expected base %d\n", + io->io_id, intbase, next_ioapic_base); + io->io_intbase = intbase; + next_ioapic_base = intbase + numintr; + io->io_numintr = numintr; + io->io_addr = apic; + io->io_paddr = addr; + + /* + * Initialize pins. Start off with interrupts disabled. Default + * to active-hi and edge-triggered for ISA interrupts and active-lo + * and level-triggered for all others. + */ + bzero(io->io_pins, sizeof(struct ioapic_intsrc) * numintr); + mtx_lock_spin(&icu_lock); + for (i = 0, intpin = io->io_pins; i < numintr; i++, intpin++) { + intpin->io_intsrc.is_pic = (struct pic *)io; + intpin->io_intpin = i; + intpin->io_irq = intbase + i; + + /* + * Assume that pin 0 on the first I/O APIC is an ExtINT pin. + * Assume that pins 1-15 are ISA interrupts and that all + * other pins are PCI interrupts. + */ + if (intpin->io_irq == 0) + ioapic_set_extint(io, i); + else if (intpin->io_irq < IOAPIC_ISA_INTS) { + intpin->io_bus = APIC_BUS_ISA; + intpin->io_activehi = 1; + intpin->io_edgetrigger = 1; + intpin->io_masked = 1; + } else { + intpin->io_bus = APIC_BUS_PCI; + intpin->io_activehi = 0; + intpin->io_edgetrigger = 0; + intpin->io_masked = 1; + } + + /* + * Route interrupts to the BSP by default. Interrupts may + * be routed to other CPUs later after they are enabled. + */ + intpin->io_cpu = PCPU_GET(apic_id); + value = ioapic_read(apic, IOAPIC_REDTBL_LO(i)); + ioapic_write(apic, IOAPIC_REDTBL_LO(i), value | IOART_INTMSET); + } + mtx_unlock_spin(&icu_lock); + + return (io); +} + +int +ioapic_get_vector(void *cookie, u_int pin) +{ + struct ioapic *io; + + io = (struct ioapic *)cookie; + if (pin >= io->io_numintr) + return (-1); + return (io->io_pins[pin].io_irq); +} + +int +ioapic_disable_pin(void *cookie, u_int pin) +{ + struct ioapic *io; + + io = (struct ioapic *)cookie; + if (pin >= io->io_numintr) + return (EINVAL); + if (io->io_pins[pin].io_irq == IRQ_DISABLED) + return (EINVAL); + io->io_pins[pin].io_irq = IRQ_DISABLED; + if (bootverbose) + printf("ioapic%u: intpin %d disabled\n", io->io_id, pin); + return (0); +} + +int +ioapic_remap_vector(void *cookie, u_int pin, int vector) +{ + struct ioapic *io; + + io = (struct ioapic *)cookie; + if (pin >= io->io_numintr || vector < 0) + return (EINVAL); + if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + return (EINVAL); + io->io_pins[pin].io_irq = vector; + if (bootverbose) + printf("ioapic%u: Routing IRQ %d -> intpin %d\n", io->io_id, + vector, pin); + return (0); +} + +int +ioapic_set_bus(void *cookie, u_int pin, int bus_type) +{ + struct ioapic *io; + + if (bus_type < 0 || bus_type > APIC_BUS_MAX) + return (EINVAL); + io = (struct ioapic *)cookie; + if (pin >= io->io_numintr) + return (EINVAL); + if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + return (EINVAL); + if (io->io_pins[pin].io_bus == bus_type) + return (0); + io->io_pins[pin].io_bus = bus_type; + if (bootverbose) + printf("ioapic%u: intpin %d bus %s\n", io->io_id, pin, + ioapic_bus_string(bus_type)); + return (0); +} + +int +ioapic_set_nmi(void *cookie, u_int pin) +{ + struct ioapic *io; + + io = (struct ioapic *)cookie; + if (pin >= io->io_numintr) + return (EINVAL); + if (io->io_pins[pin].io_irq == IRQ_NMI) + return (0); + if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + return (EINVAL); + io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN; + io->io_pins[pin].io_irq = IRQ_NMI; + io->io_pins[pin].io_masked = 0; + io->io_pins[pin].io_edgetrigger = 1; + io->io_pins[pin].io_activehi = 1; + if (bootverbose) + printf("ioapic%u: Routing NMI -> intpin %d\n", + io->io_id, pin); + return (0); +} + +int +ioapic_set_smi(void *cookie, u_int pin) +{ + struct ioapic *io; + + io = (struct ioapic *)cookie; + if (pin >= io->io_numintr) + return (EINVAL); + if (io->io_pins[pin].io_irq == IRQ_SMI) + return (0); + if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + return (EINVAL); + io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN; + io->io_pins[pin].io_irq = IRQ_SMI; + io->io_pins[pin].io_masked = 0; + io->io_pins[pin].io_edgetrigger = 1; + io->io_pins[pin].io_activehi = 1; + if (bootverbose) + printf("ioapic%u: Routing SMI -> intpin %d\n", + io->io_id, pin); + return (0); +} + +int +ioapic_set_extint(void *cookie, u_int pin) +{ + struct ioapic *io; + + io = (struct ioapic *)cookie; + if (pin >= io->io_numintr) + return (EINVAL); + if (io->io_pins[pin].io_irq == IRQ_EXTINT) + return (0); + if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + return (EINVAL); + io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN; + io->io_pins[pin].io_irq = IRQ_EXTINT; + if (enable_extint) + io->io_pins[pin].io_masked = 0; + else + io->io_pins[pin].io_masked = 1; + io->io_pins[pin].io_edgetrigger = 1; + io->io_pins[pin].io_activehi = 1; + if (bootverbose) + printf("ioapic%u: Routing external 8259A's -> intpin %d\n", + io->io_id, pin); + return (0); +} + +int +ioapic_set_polarity(void *cookie, u_int pin, enum intr_polarity pol) +{ + struct ioapic *io; + int activehi; + + io = (struct ioapic *)cookie; + if (pin >= io->io_numintr || pol == INTR_POLARITY_CONFORM) + return (EINVAL); + if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + return (EINVAL); + activehi = (pol == INTR_POLARITY_HIGH); + if (io->io_pins[pin].io_activehi == activehi) + return (0); + io->io_pins[pin].io_activehi = activehi; + if (bootverbose) + printf("ioapic%u: intpin %d polarity: %s\n", io->io_id, pin, + pol == INTR_POLARITY_HIGH ? "high" : "low"); + return (0); +} + +int +ioapic_set_triggermode(void *cookie, u_int pin, enum intr_trigger trigger) +{ + struct ioapic *io; + int edgetrigger; + + io = (struct ioapic *)cookie; + if (pin >= io->io_numintr || trigger == INTR_TRIGGER_CONFORM) + return (EINVAL); + if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + return (EINVAL); + edgetrigger = (trigger == INTR_TRIGGER_EDGE); + if (io->io_pins[pin].io_edgetrigger == edgetrigger) + return (0); + io->io_pins[pin].io_edgetrigger = edgetrigger; + if (bootverbose) + printf("ioapic%u: intpin %d trigger: %s\n", io->io_id, pin, + trigger == INTR_TRIGGER_EDGE ? "edge" : "level"); + return (0); +} + +/* + * Register a complete I/O APIC object with the interrupt subsystem. + */ +void +ioapic_register(void *cookie) +{ + struct ioapic_intsrc *pin; + struct ioapic *io; + volatile ioapic_t *apic; + uint32_t flags; + int i; + + io = (struct ioapic *)cookie; + apic = io->io_addr; + mtx_lock_spin(&icu_lock); + flags = ioapic_read(apic, IOAPIC_VER) & IOART_VER_VERSION; + STAILQ_INSERT_TAIL(&ioapic_list, io, io_next); + mtx_unlock_spin(&icu_lock); + printf("ioapic%u irqs %u-%u on motherboard\n", + io->io_id, flags >> 4, flags & 0xf, io->io_intbase, + io->io_intbase + io->io_numintr - 1); + + /* Register valid pins as interrupt sources. */ + intr_register_pic(&io->io_pic); + for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) + if (pin->io_irq < NUM_IO_INTS) + intr_register_source(&pin->io_intsrc); +} + +/* A simple new-bus driver to consume PCI I/O APIC devices. */ +static int +ioapic_pci_probe(device_t dev) +{ + + if (pci_get_class(dev) == PCIC_BASEPERIPH && + pci_get_subclass(dev) == PCIS_BASEPERIPH_PIC) { + switch (pci_get_progif(dev)) { + case PCIP_BASEPERIPH_PIC_IO_APIC: + device_set_desc(dev, "IO APIC"); + break; + case PCIP_BASEPERIPH_PIC_IOX_APIC: + device_set_desc(dev, "IO(x) APIC"); + break; + default: + return (ENXIO); + } + device_quiet(dev); + return (-10000); + } + return (ENXIO); +} + +static int +ioapic_pci_attach(device_t dev) +{ + + return (0); +} + +static device_method_t ioapic_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ioapic_pci_probe), + DEVMETHOD(device_attach, ioapic_pci_attach), + + { 0, 0 } +}; + +DEFINE_CLASS_0(ioapic, ioapic_pci_driver, ioapic_pci_methods, 0); + +static devclass_t ioapic_devclass; +DRIVER_MODULE(ioapic, pci, ioapic_pci_driver, ioapic_devclass, 0, 0); + +/* + * A new-bus driver to consume the memory resources associated with + * the APICs in the system. On some systems ACPI or PnPBIOS system + * resource devices may already claim these resources. To keep from + * breaking those devices, we attach ourself to the nexus device after + * legacy0 and acpi0 and ignore any allocation failures. + */ +static void +apic_identify(driver_t *driver, device_t parent) +{ + + /* + * Add at order 12. acpi0 is probed at order 10 and legacy0 + * is probed at order 11. + */ + if (lapic_paddr != 0) + BUS_ADD_CHILD(parent, 12, "apic", 0); +} + +static int +apic_probe(device_t dev) +{ + + device_set_desc(dev, "APIC resources"); + device_quiet(dev); + return (0); +} + +static void +apic_add_resource(device_t dev, int rid, vm_paddr_t base, size_t length) +{ + int error; + +#ifdef PAE + /* + * Resources use long's to track resources, so we can't + * include memory regions above 4GB. + */ + if (base >= ~0ul) + return; +#endif + error = bus_set_resource(dev, SYS_RES_MEMORY, rid, base, length); + if (error) + panic("apic_add_resource: resource %d failed set with %d", rid, + error); + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0); +} + +static int +apic_attach(device_t dev) +{ + struct ioapic *io; + int i; + + /* Reserve the local APIC. */ + apic_add_resource(dev, 0, lapic_paddr, sizeof(lapic_t)); + i = 1; + STAILQ_FOREACH(io, &ioapic_list, io_next) { + apic_add_resource(dev, i, io->io_paddr, IOAPIC_MEM_REGION); + i++; + } + return (0); +} + +static device_method_t apic_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, apic_identify), + DEVMETHOD(device_probe, apic_probe), + DEVMETHOD(device_attach, apic_attach), + + { 0, 0 } +}; + +DEFINE_CLASS_0(apic, apic_driver, apic_methods, 0); + +static devclass_t apic_devclass; +DRIVER_MODULE(apic, nexus, apic_driver, apic_devclass, 0, 0); From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 17:54:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F3101065673; Tue, 8 Jun 2010 17:54:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E0918FC0C; Tue, 8 Jun 2010 17:54:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58HsS4D071691; Tue, 8 Jun 2010 17:54:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58HsSkK071689; Tue, 8 Jun 2010 17:54:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006081754.o58HsSkK071689@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 8 Jun 2010 17:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208920 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 17:54:28 -0000 Author: kib Date: Tue Jun 8 17:54:28 2010 New Revision: 208920 URL: http://svn.freebsd.org/changeset/base/208920 Log: Reorganize the code in bdwrite() which handles move of dirtiness from the buffer pages to buffer. Combine the code to set buffer dirty range (previously in vfs_setdirty()) and to clean the pages (vfs_clean_pages()) into new function vfs_clean_pages_dirty_buf(). Now the vm object lock is acquired only once. Drain the VPO_BUSY bit of the buffer pages before setting valid and clean bits in vfs_clean_pages_dirty_buf() with new helper vfs_drain_busy_pages(). pmap_clear_modify() asserts that page is not busy. In vfs_busy_pages(), move the wait for draining of VPO_BUSY before the dirtyness handling, to follow the structure of vfs_clean_pages_dirty_buf(). Reported and tested by: pho Suggested and reviewed by: alc MFC after: 2 weeks Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Jun 8 17:51:21 2010 (r208919) +++ head/sys/kern/vfs_bio.c Tue Jun 8 17:54:28 2010 (r208920) @@ -102,8 +102,8 @@ static void vm_hold_load_pages(struct bu static void vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, vm_page_t m); static void vfs_page_set_validclean(struct buf *bp, vm_ooffset_t off, vm_page_t m); -static void vfs_clean_pages(struct buf *bp); -static void vfs_setdirty(struct buf *bp); +static void vfs_drain_busy_pages(struct buf *bp); +static void vfs_clean_pages_dirty_buf(struct buf *bp); static void vfs_setdirty_locked_object(struct buf *bp); static void vfs_vmio_release(struct buf *bp); static int vfs_bio_clcheck(struct vnode *vp, int size, @@ -1025,18 +1025,17 @@ bdwrite(struct buf *bp) } /* - * Set the *dirty* buffer range based upon the VM system dirty pages. - */ - vfs_setdirty(bp); - - /* - * We need to do this here to satisfy the vnode_pager and the - * pageout daemon, so that it thinks that the pages have been - * "cleaned". Note that since the pages are in a delayed write - * buffer -- the VFS layer "will" see that the pages get written - * out on the next sync, or perhaps the cluster will be completed. + * Set the *dirty* buffer range based upon the VM system dirty + * pages. + * + * Mark the buffer pages as clean. We need to do this here to + * satisfy the vnode_pager and the pageout daemon, so that it + * thinks that the pages have been "cleaned". Note that since + * the pages are in a delayed write buffer -- the VFS layer + * "will" see that the pages get written out on the next sync, + * or perhaps the cluster will be completed. */ - vfs_clean_pages(bp); + vfs_clean_pages_dirty_buf(bp); bqrelse(bp); /* @@ -2398,31 +2397,44 @@ notinmem: } /* - * vfs_setdirty: - * - * Sets the dirty range for a buffer based on the status of the dirty - * bits in the pages comprising the buffer. + * Set the dirty range for a buffer based on the status of the dirty + * bits in the pages comprising the buffer. The range is limited + * to the size of the buffer. * - * The range is limited to the size of the buffer. + * Tell the VM system that the pages associated with this buffer + * are clean. This is used for delayed writes where the data is + * going to go to disk eventually without additional VM intevention. * - * This routine is primarily used by NFS, but is generalized for the - * B_VMIO case. + * Note that while we only really need to clean through to b_bcount, we + * just go ahead and clean through to b_bufsize. */ static void -vfs_setdirty(struct buf *bp) +vfs_clean_pages_dirty_buf(struct buf *bp) { + vm_ooffset_t foff, noff, eoff; + vm_page_t m; + int i; - /* - * Degenerate case - empty buffer - */ - if (bp->b_bufsize == 0) + if ((bp->b_flags & B_VMIO) == 0 || bp->b_bufsize == 0) return; - if ((bp->b_flags & B_VMIO) == 0) - return; + foff = bp->b_offset; + KASSERT(bp->b_offset != NOOFFSET, + ("vfs_clean_pages_dirty_buf: no buffer offset")); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); + vfs_drain_busy_pages(bp); vfs_setdirty_locked_object(bp); + for (i = 0; i < bp->b_npages; i++) { + noff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; + eoff = noff; + if (eoff > bp->b_offset + bp->b_bufsize) + eoff = bp->b_offset + bp->b_bufsize; + m = bp->b_pages[i]; + vfs_page_set_validclean(bp, foff, m); + /* vm_page_clear_dirty(m, foff & PAGE_MASK, eoff - foff); */ + foff = noff; + } VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); } @@ -3533,6 +3545,31 @@ vfs_page_set_validclean(struct buf *bp, } /* + * Ensure that all buffer pages are not busied by VPO_BUSY flag. If + * any page is busy, drain the flag. + */ +static void +vfs_drain_busy_pages(struct buf *bp) +{ + vm_page_t m; + int i, last_busied; + + VM_OBJECT_LOCK_ASSERT(bp->b_bufobj->bo_object, MA_OWNED); + last_busied = 0; + for (i = 0; i < bp->b_npages; i++) { + m = bp->b_pages[i]; + if ((m->oflags & VPO_BUSY) != 0) { + for (; last_busied < i; last_busied++) + vm_page_busy(bp->b_pages[last_busied]); + while ((m->oflags & VPO_BUSY) != 0) + vm_page_sleep(m, "vbpage"); + } + } + for (i = 0; i < last_busied; i++) + vm_page_wakeup(bp->b_pages[i]); +} + +/* * This routine is called before a device strategy routine. * It is used to tell the VM system that paging I/O is in * progress, and treat the pages associated with the buffer @@ -3560,15 +3597,9 @@ vfs_busy_pages(struct buf *bp, int clear KASSERT(bp->b_offset != NOOFFSET, ("vfs_busy_pages: no buffer offset")); VM_OBJECT_LOCK(obj); + vfs_drain_busy_pages(bp); if (bp->b_bufsize != 0) vfs_setdirty_locked_object(bp); -retry: - for (i = 0; i < bp->b_npages; i++) { - m = bp->b_pages[i]; - - if (vm_page_sleep_if_busy(m, FALSE, "vbpage")) - goto retry; - } bogus = 0; for (i = 0; i < bp->b_npages; i++) { m = bp->b_pages[i]; @@ -3609,42 +3640,6 @@ retry: } /* - * Tell the VM system that the pages associated with this buffer - * are clean. This is used for delayed writes where the data is - * going to go to disk eventually without additional VM intevention. - * - * Note that while we only really need to clean through to b_bcount, we - * just go ahead and clean through to b_bufsize. - */ -static void -vfs_clean_pages(struct buf *bp) -{ - int i; - vm_ooffset_t foff, noff, eoff; - vm_page_t m; - - if (!(bp->b_flags & B_VMIO)) - return; - - foff = bp->b_offset; - KASSERT(bp->b_offset != NOOFFSET, - ("vfs_clean_pages: no buffer offset")); - VM_OBJECT_LOCK(bp->b_bufobj->bo_object); - for (i = 0; i < bp->b_npages; i++) { - m = bp->b_pages[i]; - noff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; - eoff = noff; - - if (eoff > bp->b_offset + bp->b_bufsize) - eoff = bp->b_offset + bp->b_bufsize; - vfs_page_set_validclean(bp, foff, m); - /* vm_page_clear_dirty(m, foff & PAGE_MASK, eoff - foff); */ - foff = noff; - } - VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); -} - -/* * vfs_bio_set_valid: * * Set the range within the buffer to valid. The range is From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 18:04:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E7531065674; Tue, 8 Jun 2010 18:04:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CE418FC1C; Tue, 8 Jun 2010 18:04:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58I48gR073880; Tue, 8 Jun 2010 18:04:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58I473g073875; Tue, 8 Jun 2010 18:04:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006081804.o58I473g073875@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Jun 2010 18:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208921 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 18:04:08 -0000 Author: jhb Date: Tue Jun 8 18:04:07 2010 New Revision: 208921 URL: http://svn.freebsd.org/changeset/base/208921 Log: Move the machine check support code to the x86 tree since it is identical on i386 and amd64. Requested by: alc Added: head/sys/x86/x86/mca.c - copied, changed from r208893, head/sys/i386/i386/mca.c Deleted: head/sys/amd64/amd64/mca.c head/sys/i386/i386/mca.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Jun 8 17:54:28 2010 (r208920) +++ head/sys/conf/files.amd64 Tue Jun 8 18:04:07 2010 (r208921) @@ -108,7 +108,6 @@ amd64/amd64/io.c optional io amd64/amd64/legacy.c standard amd64/amd64/locore.S standard no-obj amd64/amd64/machdep.c standard -amd64/amd64/mca.c standard amd64/amd64/mem.c optional mem amd64/amd64/minidump_machdep.c standard amd64/amd64/mp_machdep.c optional smp @@ -306,3 +305,4 @@ x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/x86/io_apic.c standard x86/x86/local_apic.c standard +x86/x86/mca.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Jun 8 17:54:28 2010 (r208920) +++ head/sys/conf/files.i386 Tue Jun 8 18:04:07 2010 (r208921) @@ -276,7 +276,6 @@ i386/xen/locore.s optional xen no-obj i386/i386/longrun.c optional cpu_enable_longrun i386/i386/machdep.c standard i386/xen/xen_machdep.c optional xen -i386/i386/mca.c standard i386/i386/mem.c optional mem i386/i386/minidump_machdep.c standard i386/i386/mp_clock.c optional smp @@ -390,3 +389,4 @@ x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic +x86/x86/mca.c standard Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Tue Jun 8 17:54:28 2010 (r208920) +++ head/sys/conf/files.pc98 Tue Jun 8 18:04:07 2010 (r208921) @@ -151,7 +151,6 @@ i386/i386/io.c optional io i386/i386/k6_mem.c optional mem i386/i386/legacy.c standard i386/i386/locore.s standard no-obj -i386/i386/mca.c standard i386/i386/mem.c optional mem i386/i386/minidump_machdep.c standard i386/i386/mp_clock.c optional smp @@ -258,3 +257,4 @@ x86/isa/atpic.c optional atpic x86/isa/isa.c optional isa x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic +x86/x86/mca.c standard Copied and modified: head/sys/x86/x86/mca.c (from r208893, head/sys/i386/i386/mca.c) ============================================================================== --- head/sys/i386/i386/mca.c Mon Jun 7 13:44:04 2010 (r208893, copy source) +++ head/sys/x86/x86/mca.c Tue Jun 8 18:04:07 2010 (r208921) @@ -32,7 +32,11 @@ #include __FBSDID("$FreeBSD$"); +#ifdef __amd64__ +#define DEV_APIC +#else #include "opt_apic.h" +#endif #include #include @@ -837,8 +841,9 @@ mca_intr(void) * Just print the values of the old Pentium registers * and panic. */ - printf("MC Type: 0x%llx Address: 0x%llx\n", - rdmsr(MSR_P5_MC_TYPE), rdmsr(MSR_P5_MC_ADDR)); + printf("MC Type: 0x%jx Address: 0x%jx\n", + (uintmax_t)rdmsr(MSR_P5_MC_TYPE), + (uintmax_t)rdmsr(MSR_P5_MC_ADDR)); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 18:36:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D9F61065679; Tue, 8 Jun 2010 18:36:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AF488FC16; Tue, 8 Jun 2010 18:36:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Ia3Ur080913; Tue, 8 Jun 2010 18:36:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58Ia3r7080908; Tue, 8 Jun 2010 18:36:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006081836.o58Ia3r7080908@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Jun 2010 18:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208922 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 18:36:04 -0000 Author: jhb Date: Tue Jun 8 18:36:03 2010 New Revision: 208922 URL: http://svn.freebsd.org/changeset/base/208922 Log: Move the MD support for PCI message signalled interrupts to the x86 tree as it is identical for i386 and amd64. Added: head/sys/x86/x86/msi.c - copied unchanged from r208893, head/sys/i386/i386/msi.c Deleted: head/sys/amd64/amd64/msi.c head/sys/i386/i386/msi.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Jun 8 18:04:07 2010 (r208921) +++ head/sys/conf/files.amd64 Tue Jun 8 18:36:03 2010 (r208922) @@ -115,7 +115,6 @@ amd64/amd64/mp_watchdog.c optional mp_wa amd64/amd64/mpboot.S optional smp amd64/amd64/mptable.c optional mptable amd64/amd64/mptable_pci.c optional mptable pci -amd64/amd64/msi.c optional pci amd64/amd64/nexus.c standard amd64/amd64/pmap.c standard amd64/amd64/prof_machdep.c optional profiling-routine @@ -306,3 +305,4 @@ x86/isa/orm.c optional isa x86/x86/io_apic.c standard x86/x86/local_apic.c standard x86/x86/mca.c standard +x86/x86/msi.c optional pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Jun 8 18:04:07 2010 (r208921) +++ head/sys/conf/files.i386 Tue Jun 8 18:36:03 2010 (r208922) @@ -286,7 +286,6 @@ i386/i386/mpboot.s optional smp native i386/i386/mptable.c optional apic native i386/xen/mptable.c optional apic xen i386/i386/mptable_pci.c optional apic pci -i386/i386/msi.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon i386/i386/pmap.c optional native @@ -390,3 +389,4 @@ x86/isa/orm.c optional isa x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mca.c standard +x86/x86/msi.c optional apic pci Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Tue Jun 8 18:04:07 2010 (r208921) +++ head/sys/conf/files.pc98 Tue Jun 8 18:36:03 2010 (r208922) @@ -159,7 +159,6 @@ i386/i386/mp_watchdog.c optional mp_wat i386/i386/mpboot.s optional smp i386/i386/mptable.c optional apic i386/i386/mptable_pci.c optional apic pci -i386/i386/msi.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon i386/i386/pmap.c standard @@ -258,3 +257,4 @@ x86/isa/isa.c optional isa x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mca.c standard +x86/x86/msi.c optional apic pci Copied: head/sys/x86/x86/msi.c (from r208893, head/sys/i386/i386/msi.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/x86/msi.c Tue Jun 8 18:36:03 2010 (r208922, copy of r208893, head/sys/i386/i386/msi.c) @@ -0,0 +1,602 @@ +/*- + * Copyright (c) 2006 Yahoo!, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Support for PCI Message Signalled Interrupts (MSI). MSI interrupts on + * x86 are basically APIC messages that the northbridge delivers directly + * to the local APICs as if they had come from an I/O APIC. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Fields in address for Intel MSI messages. */ +#define MSI_INTEL_ADDR_DEST 0x000ff000 +#define MSI_INTEL_ADDR_RH 0x00000008 +# define MSI_INTEL_ADDR_RH_ON 0x00000008 +# define MSI_INTEL_ADDR_RH_OFF 0x00000000 +#define MSI_INTEL_ADDR_DM 0x00000004 +# define MSI_INTEL_ADDR_DM_PHYSICAL 0x00000000 +# define MSI_INTEL_ADDR_DM_LOGICAL 0x00000004 + +/* Fields in data for Intel MSI messages. */ +#define MSI_INTEL_DATA_TRGRMOD IOART_TRGRMOD /* Trigger mode. */ +# define MSI_INTEL_DATA_TRGREDG IOART_TRGREDG +# define MSI_INTEL_DATA_TRGRLVL IOART_TRGRLVL +#define MSI_INTEL_DATA_LEVEL 0x00004000 /* Polarity. */ +# define MSI_INTEL_DATA_DEASSERT 0x00000000 +# define MSI_INTEL_DATA_ASSERT 0x00004000 +#define MSI_INTEL_DATA_DELMOD IOART_DELMOD /* Delivery mode. */ +# define MSI_INTEL_DATA_DELFIXED IOART_DELFIXED +# define MSI_INTEL_DATA_DELLOPRI IOART_DELLOPRI +# define MSI_INTEL_DATA_DELSMI IOART_DELSMI +# define MSI_INTEL_DATA_DELNMI IOART_DELNMI +# define MSI_INTEL_DATA_DELINIT IOART_DELINIT +# define MSI_INTEL_DATA_DELEXINT IOART_DELEXINT +#define MSI_INTEL_DATA_INTVEC IOART_INTVEC /* Interrupt vector. */ + +/* + * Build Intel MSI message and data values from a source. AMD64 systems + * seem to be compatible, so we use the same function for both. + */ +#define INTEL_ADDR(msi) \ + (MSI_INTEL_ADDR_BASE | (msi)->msi_cpu << 12 | \ + MSI_INTEL_ADDR_RH_OFF | MSI_INTEL_ADDR_DM_PHYSICAL) +#define INTEL_DATA(msi) \ + (MSI_INTEL_DATA_TRGREDG | MSI_INTEL_DATA_DELFIXED | (msi)->msi_vector) + +static MALLOC_DEFINE(M_MSI, "msi", "PCI MSI"); + +/* + * MSI sources are bunched into groups. This is because MSI forces + * all of the messages to share the address and data registers and + * thus certain properties (such as the local APIC ID target on x86). + * Each group has a 'first' source that contains information global to + * the group. These fields are marked with (g) below. + * + * Note that local APIC ID is kind of special. Each message will be + * assigned an ID by the system; however, a group will use the ID from + * the first message. + * + * For MSI-X, each message is isolated. + */ +struct msi_intsrc { + struct intsrc msi_intsrc; + device_t msi_dev; /* Owning device. (g) */ + struct msi_intsrc *msi_first; /* First source in group. */ + u_int msi_irq; /* IRQ cookie. */ + u_int msi_msix; /* MSI-X message. */ + u_int msi_vector:8; /* IDT vector. */ + u_int msi_cpu:8; /* Local APIC ID. (g) */ + u_int msi_count:8; /* Messages in this group. (g) */ + u_int msi_maxcount:8; /* Alignment for this group. (g) */ + int *msi_irqs; /* Group's IRQ list. (g) */ +}; + +static void msi_create_source(void); +static void msi_enable_source(struct intsrc *isrc); +static void msi_disable_source(struct intsrc *isrc, int eoi); +static void msi_eoi_source(struct intsrc *isrc); +static void msi_enable_intr(struct intsrc *isrc); +static void msi_disable_intr(struct intsrc *isrc); +static int msi_vector(struct intsrc *isrc); +static int msi_source_pending(struct intsrc *isrc); +static int msi_config_intr(struct intsrc *isrc, enum intr_trigger trig, + enum intr_polarity pol); +static int msi_assign_cpu(struct intsrc *isrc, u_int apic_id); + +struct pic msi_pic = { msi_enable_source, msi_disable_source, msi_eoi_source, + msi_enable_intr, msi_disable_intr, msi_vector, + msi_source_pending, NULL, NULL, msi_config_intr, + msi_assign_cpu }; + +static int msi_enabled; +static int msi_last_irq; +static struct mtx msi_lock; + +static void +msi_enable_source(struct intsrc *isrc) +{ +} + +static void +msi_disable_source(struct intsrc *isrc, int eoi) +{ + + if (eoi == PIC_EOI) + lapic_eoi(); +} + +static void +msi_eoi_source(struct intsrc *isrc) +{ + + lapic_eoi(); +} + +static void +msi_enable_intr(struct intsrc *isrc) +{ + struct msi_intsrc *msi = (struct msi_intsrc *)isrc; + + apic_enable_vector(msi->msi_cpu, msi->msi_vector); +} + +static void +msi_disable_intr(struct intsrc *isrc) +{ + struct msi_intsrc *msi = (struct msi_intsrc *)isrc; + + apic_disable_vector(msi->msi_cpu, msi->msi_vector); +} + +static int +msi_vector(struct intsrc *isrc) +{ + struct msi_intsrc *msi = (struct msi_intsrc *)isrc; + + return (msi->msi_irq); +} + +static int +msi_source_pending(struct intsrc *isrc) +{ + + return (0); +} + +static int +msi_config_intr(struct intsrc *isrc, enum intr_trigger trig, + enum intr_polarity pol) +{ + + return (ENODEV); +} + +static int +msi_assign_cpu(struct intsrc *isrc, u_int apic_id) +{ + struct msi_intsrc *sib, *msi = (struct msi_intsrc *)isrc; + int old_vector; + u_int old_id; + int i, vector; + + /* + * Only allow CPUs to be assigned to the first message for an + * MSI group. + */ + if (msi->msi_first != msi) + return (EINVAL); + + /* Store information to free existing irq. */ + old_vector = msi->msi_vector; + old_id = msi->msi_cpu; + if (old_id == apic_id) + return (0); + + /* Allocate IDT vectors on this cpu. */ + if (msi->msi_count > 1) { + KASSERT(msi->msi_msix == 0, ("MSI-X message group")); + vector = apic_alloc_vectors(apic_id, msi->msi_irqs, + msi->msi_count, msi->msi_maxcount); + } else + vector = apic_alloc_vector(apic_id, msi->msi_irq); + if (vector == 0) + return (ENOSPC); + + msi->msi_cpu = apic_id; + msi->msi_vector = vector; + if (msi->msi_intsrc.is_handlers > 0) + apic_enable_vector(msi->msi_cpu, msi->msi_vector); + if (bootverbose) + printf("msi: Assigning %s IRQ %d to local APIC %u vector %u\n", + msi->msi_msix ? "MSI-X" : "MSI", msi->msi_irq, + msi->msi_cpu, msi->msi_vector); + for (i = 1; i < msi->msi_count; i++) { + sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]); + sib->msi_cpu = apic_id; + sib->msi_vector = vector + i; + if (sib->msi_intsrc.is_handlers > 0) + apic_enable_vector(sib->msi_cpu, sib->msi_vector); + if (bootverbose) + printf( + "msi: Assigning MSI IRQ %d to local APIC %u vector %u\n", + sib->msi_irq, sib->msi_cpu, sib->msi_vector); + } + pci_remap_msi_irq(msi->msi_dev, msi->msi_irq); + + /* + * Free the old vector after the new one is established. This is done + * to prevent races where we could miss an interrupt. + */ + if (msi->msi_intsrc.is_handlers > 0) + apic_disable_vector(old_id, old_vector); + apic_free_vector(old_id, old_vector, msi->msi_irq); + for (i = 1; i < msi->msi_count; i++) { + sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]); + if (sib->msi_intsrc.is_handlers > 0) + apic_disable_vector(old_id, old_vector + i); + apic_free_vector(old_id, old_vector + i, msi->msi_irqs[i]); + } + return (0); +} + +void +msi_init(void) +{ + + /* Check if we have a supported CPU. */ + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf) + break; + /* FALLTHROUGH */ + default: + return; + } + + msi_enabled = 1; + intr_register_pic(&msi_pic); + mtx_init(&msi_lock, "msi", NULL, MTX_DEF); +} + +static void +msi_create_source(void) +{ + struct msi_intsrc *msi; + u_int irq; + + mtx_lock(&msi_lock); + if (msi_last_irq >= NUM_MSI_INTS) { + mtx_unlock(&msi_lock); + return; + } + irq = msi_last_irq + FIRST_MSI_INT; + msi_last_irq++; + mtx_unlock(&msi_lock); + + msi = malloc(sizeof(struct msi_intsrc), M_MSI, M_WAITOK | M_ZERO); + msi->msi_intsrc.is_pic = &msi_pic; + msi->msi_irq = irq; + intr_register_source(&msi->msi_intsrc); + nexus_add_irq(irq); +} + +/* + * Try to allocate 'count' interrupt sources with contiguous IDT values. + */ +int +msi_alloc(device_t dev, int count, int maxcount, int *irqs) +{ + struct msi_intsrc *msi, *fsrc; + u_int cpu; + int cnt, i, *mirqs, vector; + + if (!msi_enabled) + return (ENXIO); + + if (count > 1) + mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK); + else + mirqs = NULL; +again: + mtx_lock(&msi_lock); + + /* Try to find 'count' free IRQs. */ + cnt = 0; + for (i = FIRST_MSI_INT; i < FIRST_MSI_INT + NUM_MSI_INTS; i++) { + msi = (struct msi_intsrc *)intr_lookup_source(i); + + /* End of allocated sources, so break. */ + if (msi == NULL) + break; + + /* If this is a free one, save its IRQ in the array. */ + if (msi->msi_dev == NULL) { + irqs[cnt] = i; + cnt++; + if (cnt == count) + break; + } + } + + /* Do we need to create some new sources? */ + if (cnt < count) { + /* If we would exceed the max, give up. */ + if (i + (count - cnt) > FIRST_MSI_INT + NUM_MSI_INTS) { + mtx_unlock(&msi_lock); + free(mirqs, M_MSI); + return (ENXIO); + } + mtx_unlock(&msi_lock); + + /* We need count - cnt more sources. */ + while (cnt < count) { + msi_create_source(); + cnt++; + } + goto again; + } + + /* Ok, we now have the IRQs allocated. */ + KASSERT(cnt == count, ("count mismatch")); + + /* Allocate 'count' IDT vectors. */ + cpu = intr_next_cpu(); + vector = apic_alloc_vectors(cpu, irqs, count, maxcount); + if (vector == 0) { + mtx_unlock(&msi_lock); + free(mirqs, M_MSI); + return (ENOSPC); + } + + /* Assign IDT vectors and make these messages owned by 'dev'. */ + fsrc = (struct msi_intsrc *)intr_lookup_source(irqs[0]); + for (i = 0; i < count; i++) { + msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]); + msi->msi_cpu = cpu; + msi->msi_dev = dev; + msi->msi_vector = vector + i; + if (bootverbose) + printf( + "msi: routing MSI IRQ %d to local APIC %u vector %u\n", + msi->msi_irq, msi->msi_cpu, msi->msi_vector); + msi->msi_first = fsrc; + KASSERT(msi->msi_intsrc.is_handlers == 0, + ("dead MSI has handlers")); + } + fsrc->msi_count = count; + fsrc->msi_maxcount = maxcount; + if (count > 1) + bcopy(irqs, mirqs, count * sizeof(*mirqs)); + fsrc->msi_irqs = mirqs; + mtx_unlock(&msi_lock); + + return (0); +} + +int +msi_release(int *irqs, int count) +{ + struct msi_intsrc *msi, *first; + int i; + + mtx_lock(&msi_lock); + first = (struct msi_intsrc *)intr_lookup_source(irqs[0]); + if (first == NULL) { + mtx_unlock(&msi_lock); + return (ENOENT); + } + + /* Make sure this isn't an MSI-X message. */ + if (first->msi_msix) { + mtx_unlock(&msi_lock); + return (EINVAL); + } + + /* Make sure this message is allocated to a group. */ + if (first->msi_first == NULL) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + + /* + * Make sure this is the start of a group and that we are releasing + * the entire group. + */ + if (first->msi_first != first || first->msi_count != count) { + mtx_unlock(&msi_lock); + return (EINVAL); + } + KASSERT(first->msi_dev != NULL, ("unowned group")); + + /* Clear all the extra messages in the group. */ + for (i = 1; i < count; i++) { + msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]); + KASSERT(msi->msi_first == first, ("message not in group")); + KASSERT(msi->msi_dev == first->msi_dev, ("owner mismatch")); + msi->msi_first = NULL; + msi->msi_dev = NULL; + apic_free_vector(msi->msi_cpu, msi->msi_vector, msi->msi_irq); + msi->msi_vector = 0; + } + + /* Clear out the first message. */ + first->msi_first = NULL; + first->msi_dev = NULL; + apic_free_vector(first->msi_cpu, first->msi_vector, first->msi_irq); + first->msi_vector = 0; + first->msi_count = 0; + first->msi_maxcount = 0; + free(first->msi_irqs, M_MSI); + first->msi_irqs = NULL; + + mtx_unlock(&msi_lock); + return (0); +} + +int +msi_map(int irq, uint64_t *addr, uint32_t *data) +{ + struct msi_intsrc *msi; + + mtx_lock(&msi_lock); + msi = (struct msi_intsrc *)intr_lookup_source(irq); + if (msi == NULL) { + mtx_unlock(&msi_lock); + return (ENOENT); + } + + /* Make sure this message is allocated to a device. */ + if (msi->msi_dev == NULL) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + + /* + * If this message isn't an MSI-X message, make sure it's part + * of a group, and switch to the first message in the + * group. + */ + if (!msi->msi_msix) { + if (msi->msi_first == NULL) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + msi = msi->msi_first; + } + + *addr = INTEL_ADDR(msi); + *data = INTEL_DATA(msi); + mtx_unlock(&msi_lock); + return (0); +} + +int +msix_alloc(device_t dev, int *irq) +{ + struct msi_intsrc *msi; + u_int cpu; + int i, vector; + + if (!msi_enabled) + return (ENXIO); + +again: + mtx_lock(&msi_lock); + + /* Find a free IRQ. */ + for (i = FIRST_MSI_INT; i < FIRST_MSI_INT + NUM_MSI_INTS; i++) { + msi = (struct msi_intsrc *)intr_lookup_source(i); + + /* End of allocated sources, so break. */ + if (msi == NULL) + break; + + /* Stop at the first free source. */ + if (msi->msi_dev == NULL) + break; + } + + /* Do we need to create a new source? */ + if (msi == NULL) { + /* If we would exceed the max, give up. */ + if (i + 1 > FIRST_MSI_INT + NUM_MSI_INTS) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + mtx_unlock(&msi_lock); + + /* Create a new source. */ + msi_create_source(); + goto again; + } + + /* Allocate an IDT vector. */ + cpu = intr_next_cpu(); + vector = apic_alloc_vector(cpu, i); + if (vector == 0) { + mtx_unlock(&msi_lock); + return (ENOSPC); + } + if (bootverbose) + printf("msi: routing MSI-X IRQ %d to local APIC %u vector %u\n", + msi->msi_irq, cpu, vector); + + /* Setup source. */ + msi->msi_cpu = cpu; + msi->msi_dev = dev; + msi->msi_first = msi; + msi->msi_vector = vector; + msi->msi_msix = 1; + msi->msi_count = 1; + msi->msi_maxcount = 1; + msi->msi_irqs = NULL; + + KASSERT(msi->msi_intsrc.is_handlers == 0, ("dead MSI-X has handlers")); + mtx_unlock(&msi_lock); + + *irq = i; + return (0); +} + +int +msix_release(int irq) +{ + struct msi_intsrc *msi; + + mtx_lock(&msi_lock); + msi = (struct msi_intsrc *)intr_lookup_source(irq); + if (msi == NULL) { + mtx_unlock(&msi_lock); + return (ENOENT); + } + + /* Make sure this is an MSI-X message. */ + if (!msi->msi_msix) { + mtx_unlock(&msi_lock); + return (EINVAL); + } + + KASSERT(msi->msi_dev != NULL, ("unowned message")); + + /* Clear out the message. */ + msi->msi_first = NULL; + msi->msi_dev = NULL; + apic_free_vector(msi->msi_cpu, msi->msi_vector, msi->msi_irq); + msi->msi_vector = 0; + msi->msi_msix = 0; + msi->msi_count = 0; + msi->msi_maxcount = 0; + + mtx_unlock(&msi_lock); + return (0); +} From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 18:46:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBC051065673; Tue, 8 Jun 2010 18:46:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id ACED48FC1A; Tue, 8 Jun 2010 18:46:32 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5AEE046C04; Tue, 8 Jun 2010 14:46:32 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 819598A021; Tue, 8 Jun 2010 14:46:31 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Tue, 8 Jun 2010 14:46:09 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006081804.o58I473g073875@svn.freebsd.org> In-Reply-To: <201006081804.o58I473g073875@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201006081446.09423.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 08 Jun 2010 14:46:31 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208921 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 18:46:33 -0000 On Tuesday 08 June 2010 2:04:07 pm John Baldwin wrote: > Author: jhb > Date: Tue Jun 8 18:04:07 2010 > New Revision: 208921 > URL: http://svn.freebsd.org/changeset/base/208921 > > Log: > Move the machine check support code to the x86 tree since it is identical > on i386 and amd64. > > Requested by: alc It would be nice to consolidate as that is identical on both platforms, but that moving to x86/include is trickier as the header needs to be available in userland, probably as still. would work ok (i.e. in /usr/include/x86/mca.h), but that makes things trickier in the kernel as the file should really live in sys/x86/include, not sys/x86 directly. I'm open to suggestions on if this is feasible and if so how to do it. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 19:26:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F12621065674; Tue, 8 Jun 2010 19:26:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF9D78FC16; Tue, 8 Jun 2010 19:26:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58JQMw2092029; Tue, 8 Jun 2010 19:26:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58JQM71092027; Tue, 8 Jun 2010 19:26:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201006081926.o58JQM71092027@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Jun 2010 19:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208923 - stable/8/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 19:26:23 -0000 Author: yongari Date: Tue Jun 8 19:26:22 2010 New Revision: 208923 URL: http://svn.freebsd.org/changeset/base/208923 Log: MFC r208806: Don't blindly set IFF_DRV_OACTIVE when sge_encap() fails. If there is no queued frame, IFF_DRV_OACTIVE would never be cleared. Submitted by: Nikolay Denev < ndenev <> gmail at com > Approved by: re (bz) Modified: stable/8/sys/dev/sge/if_sge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Tue Jun 8 18:36:03 2010 (r208922) +++ stable/8/sys/dev/sge/if_sge.c Tue Jun 8 19:26:22 2010 (r208923) @@ -1588,8 +1588,9 @@ sge_start_locked(struct ifnet *ifp) if (m_head == NULL) break; if (sge_encap(sc, &m_head)) { - if (m_head != NULL) - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 19:27:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDBA11065676; Tue, 8 Jun 2010 19:27:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC5D8FC19; Tue, 8 Jun 2010 19:27:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o58JMAjH011770; Tue, 8 Jun 2010 13:22:10 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 08 Jun 2010 13:22:10 -0600 (MDT) Message-Id: <20100608.132210.10150326092157406.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <201006081446.09423.jhb@freebsd.org> References: <201006081804.o58I473g073875@svn.freebsd.org> <201006081446.09423.jhb@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208921 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 19:27:58 -0000 In message: <201006081446.09423.jhb@freebsd.org> John Baldwin writes: : On Tuesday 08 June 2010 2:04:07 pm John Baldwin wrote: : > Author: jhb : > Date: Tue Jun 8 18:04:07 2010 : > New Revision: 208921 : > URL: http://svn.freebsd.org/changeset/base/208921 : > : > Log: : > Move the machine check support code to the x86 tree since it is identical : > on i386 and amd64. : > : > Requested by: alc : : It would be nice to consolidate as that is identical on both : platforms, but that moving to x86/include is trickier as the header needs to : be available in userland, probably as still. : would work ok (i.e. in /usr/include/x86/mca.h), but that makes things trickier : in the kernel as the file should really live in sys/x86/include, not sys/x86 : directly. : : I'm open to suggestions on if this is feasible and if so how to do it. I believe we had a long talk about this before. copy the current {i386,amd64}/mca.h to x86/mca.h new {i386,amd64}/mca.h == #include (no copyright notice, etc) just like we do for the pc98 stuff. The mca.h file would live in sys/x86/include. That was the consensus of the conversation at the time. There's some support for this already in the tree for pc98 vs i386 stuff. There's work in flight for mips and powerpc that do similar things for the 64-bit versions (the mips stuff is on the drawing board, the powerpc stuff is in nathanw's branch). Plus this dove-tails into the MACHINE_CPUARCH stuff I've worked on with the tbemd branch that's headed into head as soon as the mips merge is sorted out. In src/include/Makefile we have: .if defined(_MARCH) ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ cd ${.CURDIR}/../sys/${_MARCH}/include; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/${_MARCH} .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc .endif .endif we could add .if defined(_MCARCH) ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ ${DESTDIR}${INCLUDEDIR}/${_MCARCH}; \ cd ${.CURDIR}/../sys/${_MARCH}/include; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/${_MCARCH} .endif just after it, plus a few touch-ups elsewhere in the file (like defining _MCARCH if MACHINE_CPUARCH != MACHINE_ARCH). And just to recap, MACHINE_ARCH is the binary architecture that's being built. MACHINE_CPUARCH is where the source for a group of related MACHINE_ARCH live. MACHINE_CPUARCH is mips for all mips platforms, but MACHINE_ARCH is mipsel or mipseb (and maybe mips64el and mips64eb) for those platforms. To apply this pattern to intel, MACHINE_ARCH={i386,amd64} and MACHINE_CPUARCH=x86. Warner From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 19:36:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFEB91065675; Tue, 8 Jun 2010 19:36:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE1F98FC15; Tue, 8 Jun 2010 19:36:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Jaft9094342; Tue, 8 Jun 2010 19:36:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58Jafdi094340; Tue, 8 Jun 2010 19:36:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201006081936.o58Jafdi094340@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Jun 2010 19:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208924 - stable/7/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 19:36:41 -0000 Author: yongari Date: Tue Jun 8 19:36:41 2010 New Revision: 208924 URL: http://svn.freebsd.org/changeset/base/208924 Log: MFC r208806: Don't blindly set IFF_DRV_OACTIVE when sge_encap() fails. If there is no queued frame, IFF_DRV_OACTIVE would never be cleared. Submitted by: Nikolay Denev < ndenev <> gmail at com > Modified: stable/7/sys/dev/sge/if_sge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Tue Jun 8 19:26:22 2010 (r208923) +++ stable/7/sys/dev/sge/if_sge.c Tue Jun 8 19:36:41 2010 (r208924) @@ -1588,8 +1588,9 @@ sge_start_locked(struct ifnet *ifp) if (m_head == NULL) break; if (sge_encap(sc, &m_head)) { - if (m_head != NULL) - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 21:27:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8A8F1065672; Tue, 8 Jun 2010 21:27:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7E048FC12; Tue, 8 Jun 2010 21:27:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58LR57P018922; Tue, 8 Jun 2010 21:27:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58LR5Vq018920; Tue, 8 Jun 2010 21:27:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006082127.o58LR5Vq018920@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Jun 2010 21:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208925 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 21:27:05 -0000 Author: jhb Date: Tue Jun 8 21:27:05 2010 New Revision: 208925 URL: http://svn.freebsd.org/changeset/base/208925 Log: The lock associated with the /dev/apm knote is already held, so use KNOTE_LOCKED() instead of KNOTE_UNLOCKED(). Reported by: mav MFC after: 3 days Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Jun 8 19:36:41 2010 (r208924) +++ head/sys/dev/acpica/acpi.c Tue Jun 8 21:27:05 2010 (r208925) @@ -2346,7 +2346,7 @@ acpi_ReqSleepState(struct acpi_softc *sc clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) { selwakeuppri(&clone->sel_read, PZERO); - KNOTE_UNLOCKED(&clone->sel_read.si_note, 0); + KNOTE_LOCKED(&clone->sel_read.si_note, 0); } } From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 21:28:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3416D106564A; Tue, 8 Jun 2010 21:28:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 02FD28FC18; Tue, 8 Jun 2010 21:28:09 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 944C346C04; Tue, 8 Jun 2010 17:28:08 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id B5B0B8A01F; Tue, 8 Jun 2010 17:28:07 -0400 (EDT) From: John Baldwin To: "M. Warner Losh" Date: Tue, 8 Jun 2010 17:25:24 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006081804.o58I473g073875@svn.freebsd.org> <201006081446.09423.jhb@freebsd.org> <20100608.132210.10150326092157406.imp@bsdimp.com> In-Reply-To: <20100608.132210.10150326092157406.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006081725.24684.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 08 Jun 2010 17:28:07 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208921 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 21:28:09 -0000 On Tuesday 08 June 2010 3:22:10 pm M. Warner Losh wrote: > In message: <201006081446.09423.jhb@freebsd.org> > John Baldwin writes: > : On Tuesday 08 June 2010 2:04:07 pm John Baldwin wrote: > : > Author: jhb > : > Date: Tue Jun 8 18:04:07 2010 > : > New Revision: 208921 > : > URL: http://svn.freebsd.org/changeset/base/208921 > : > > : > Log: > : > Move the machine check support code to the x86 tree since it is identical > : > on i386 and amd64. > : > > : > Requested by: alc > : > : It would be nice to consolidate as that is identical on both > : platforms, but that moving to x86/include is trickier as the header needs to > : be available in userland, probably as still. > : would work ok (i.e. in /usr/include/x86/mca.h), but that makes things trickier > : in the kernel as the file should really live in sys/x86/include, not sys/x86 > : directly. > : > : I'm open to suggestions on if this is feasible and if so how to do it. > > I believe we had a long talk about this before. > > copy the current {i386,amd64}/mca.h to x86/mca.h > new {i386,amd64}/mca.h == #include (no copyright notice, etc) > > just like we do for the pc98 stuff. The mca.h file would live in > sys/x86/include. How does this work for the kernel? doesn't map to sys/x86/include/mca.h. For machine we make a symlink that points to sys//include. Are you proposing an x86 symlink in the kernel build directory that for i386, pc98, and amd64 that points to sys/x86/include? Ah, looks like you are. This is handled by _ILINKS in kern.post.mk currently. If you will fix all the glue magic so #include works in kernel and userland I have several headers I can move (apicreg.h, mca.h, etc.). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 22:26:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7946010656C4; Tue, 8 Jun 2010 22:26:48 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 665038FC1B; Tue, 8 Jun 2010 22:26:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58MQmWx032022; Tue, 8 Jun 2010 22:26:48 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58MQmbk032012; Tue, 8 Jun 2010 22:26:48 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006082226.o58MQmbk032012@svn.freebsd.org> From: Matt Jacob Date: Tue, 8 Jun 2010 22:26:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208926 - in head/tools/tools/vhba: . faulty lots medium rptluns simple X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 22:26:48 -0000 Author: mjacob Date: Tue Jun 8 22:26:47 2010 New Revision: 208926 URL: http://svn.freebsd.org/changeset/base/208926 Log: Add the VHBA package. It is here in tools because it's really a testbed. Sponsored by: Panasas MFC after: 1 month Added: head/tools/tools/vhba/ head/tools/tools/vhba/Makefile (contents, props changed) head/tools/tools/vhba/README (contents, props changed) head/tools/tools/vhba/faulty/ head/tools/tools/vhba/faulty/Makefile (contents, props changed) head/tools/tools/vhba/faulty/vhba_faulty.c (contents, props changed) head/tools/tools/vhba/lots/ head/tools/tools/vhba/lots/Makefile (contents, props changed) head/tools/tools/vhba/lots/vhba_lots.c (contents, props changed) head/tools/tools/vhba/medium/ head/tools/tools/vhba/medium/Makefile (contents, props changed) head/tools/tools/vhba/medium/vhba_medium.c (contents, props changed) head/tools/tools/vhba/opt_cam.h (contents, props changed) head/tools/tools/vhba/rptluns/ head/tools/tools/vhba/rptluns/Makefile (contents, props changed) head/tools/tools/vhba/rptluns/vhba_rptluns.c (contents, props changed) head/tools/tools/vhba/simple/ head/tools/tools/vhba/simple/Makefile (contents, props changed) head/tools/tools/vhba/simple/vhba_simple.c (contents, props changed) head/tools/tools/vhba/vhba.c (contents, props changed) head/tools/tools/vhba/vhba.h (contents, props changed) Added: head/tools/tools/vhba/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vhba/Makefile Tue Jun 8 22:26:47 2010 (r208926) @@ -0,0 +1,29 @@ +# $FreeBSD$ +# +# Copyright (c) 2010 by Panasas Inc +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice immediately at the beginning of the file, without modification, +# this list of conditions, and the following disclaimer. +# 2. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +SUBDIR= simple medium lots faulty rptluns + +.include Added: head/tools/tools/vhba/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vhba/README Tue Jun 8 22:26:47 2010 (r208926) @@ -0,0 +1,16 @@ +$FreeBSD$ +Tue Jun 8 15:02:02 PDT 2010 + +This packages is a testbed for a number of purposes and consists +of two pieces. + +The first piece is a simple SIM driver for FreeBSD. It provides +*just enough* framework to be useful, plus some nominally common +code responses for code sharing purposes. + +The second piece(s) are underlying implementations which make various +virtual devices implemented under the VHBA itself. The current ones +are pretty much used to stress and test the FreeBSD CAM framework +itself- this is why this is in the tool directory. + +Clearly other connections and possibilities exist as well. Added: head/tools/tools/vhba/faulty/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vhba/faulty/Makefile Tue Jun 8 22:26:47 2010 (r208926) @@ -0,0 +1,7 @@ +# $FreeBSD$ +KMOD= vfaulty +SRCS= vhba_faulty.c vhba.c +CFLAGS += -I${.CURDIR}/.. -DVHBA_MOD=\"vfaulty\" +VPATH= ${.CURDIR}/.. + +.include Added: head/tools/tools/vhba/faulty/vhba_faulty.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vhba/faulty/vhba_faulty.c Tue Jun 8 22:26:47 2010 (r208926) @@ -0,0 +1,349 @@ +/*- + * Copyright (c) 2010 by Panasas, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice immediately at the beginning of the file, without modification, + * this list of conditions, and the following disclaimer. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* $FreeBSD$ */ +/* + * "Faulty" Device. Victimize random commands with a Selection Timeout. + */ +#include "vhba.h" + +#define MAX_TGT VHBA_MAXTGT +#define MAX_LUN 4 + +#define DISK_SIZE 32 +#define DISK_SHIFT 9 +#define DISK_NBLKS ((DISK_SIZE << 20) >> DISK_SHIFT) +#define PSEUDO_SPT 64 +#define PSEUDO_HDS 64 +#define PSEUDO_SPC (PSEUDO_SPT * PSEUDO_HDS) + +typedef struct { + vhba_softc_t * vhba; + uint8_t * disk; + size_t disk_size; + uint32_t ctr; + uint32_t dead; + struct task qt; +} faulty_t; + +static void vhba_task(void *, int); +static void faulty_act(faulty_t *, struct ccb_scsiio *); + +void +vhba_init(vhba_softc_t *vhba) +{ + static faulty_t vhbastatic; + vhbastatic.vhba = vhba; + vhbastatic.disk_size = DISK_SIZE << 20; + vhbastatic.disk = malloc(vhbastatic.disk_size, M_DEVBUF, M_WAITOK|M_ZERO); + vhba->private = &vhbastatic; + vhbastatic.ctr = (arc4random() & 0xffff) + 1; + TASK_INIT(&vhbastatic.qt, 0, vhba_task, &vhbastatic); +} + + +void +vhba_fini(vhba_softc_t *vhba) +{ + faulty_t *vhbas = vhba->private; + vhba->private = NULL; + free(vhbas->disk, M_DEVBUF); +} + +void +vhba_kick(vhba_softc_t *vhba) +{ + faulty_t *vhbas = vhba->private; + taskqueue_enqueue(taskqueue_swi, &vhbas->qt); +} + +static void +vhba_task(void *arg, int pending) +{ + faulty_t *vhbas = arg; + struct ccb_hdr *ccbh; + + mtx_lock(&vhbas->vhba->lock); + while ((ccbh = TAILQ_FIRST(&vhbas->vhba->actv)) != NULL) { + TAILQ_REMOVE(&vhbas->vhba->actv, ccbh, sim_links.tqe); + faulty_act(vhbas, (struct ccb_scsiio *)ccbh); + if (--vhbas->ctr == 0) { + vhbas->dead = 1; + vhbas->ctr = (arc4random() & 0xff) + 1; + } + } + while ((ccbh = TAILQ_FIRST(&vhbas->vhba->done)) != NULL) { + TAILQ_REMOVE(&vhbas->vhba->done, ccbh, sim_links.tqe); + xpt_done((union ccb *)ccbh); + } + mtx_unlock(&vhbas->vhba->lock); +} + +static void +faulty_act(faulty_t *vhbas, struct ccb_scsiio *csio) +{ + char junk[128]; + cam_status camstatus; + uint8_t *cdb, *ptr, status; + uint32_t data_len; + uint64_t off; + + data_len = 0; + status = SCSI_STATUS_OK; + + memset(&csio->sense_data, 0, sizeof (csio->sense_data)); + cdb = csio->cdb_io.cdb_bytes; + + if (csio->ccb_h.target_id >= MAX_TGT) { + vhba_set_status(&csio->ccb_h, CAM_SEL_TIMEOUT); + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + if (vhbas->dead) { + vhbas->dead = 0; + vhba_set_status(&csio->ccb_h, CAM_SEL_TIMEOUT); + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + if (csio->ccb_h.target_lun >= MAX_LUN && cdb[0] != INQUIRY && cdb[0] != REPORT_LUNS && cdb[0] != REQUEST_SENSE) { + vhba_fill_sense(csio, SSD_KEY_ILLEGAL_REQUEST, 0x25, 0x0); + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + + switch (cdb[0]) { + case MODE_SENSE: + case MODE_SENSE_10: + { + unsigned int nbyte; + uint8_t page = cdb[2] & SMS_PAGE_CODE; + uint8_t pgctl = cdb[2] & SMS_PAGE_CTRL_MASK; + + switch (page) { + case SMS_FORMAT_DEVICE_PAGE: + case SMS_GEOMETRY_PAGE: + case SMS_CACHE_PAGE: + case SMS_CONTROL_MODE_PAGE: + case SMS_ALL_PAGES_PAGE: + break; + default: + vhba_fill_sense(csio, SSD_KEY_ILLEGAL_REQUEST, 0x24, 0x0); + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + memset(junk, 0, sizeof (junk)); + if (cdb[1] & SMS_DBD) { + ptr = &junk[4]; + } else { + ptr = junk; + ptr[3] = 8; + ptr[4] = ((1 << DISK_SHIFT) >> 24) & 0xff; + ptr[5] = ((1 << DISK_SHIFT) >> 16) & 0xff; + ptr[6] = ((1 << DISK_SHIFT) >> 8) & 0xff; + ptr[7] = ((1 << DISK_SHIFT)) & 0xff; + + ptr[8] = (DISK_NBLKS >> 24) & 0xff; + ptr[9] = (DISK_NBLKS >> 16) & 0xff; + ptr[10] = (DISK_NBLKS >> 8) & 0xff; + ptr[11] = DISK_NBLKS & 0xff; + ptr += 12; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_FORMAT_DEVICE_PAGE) { + ptr[0] = SMS_FORMAT_DEVICE_PAGE; + ptr[1] = 24; + if (pgctl != SMS_PAGE_CTRL_CHANGEABLE) { + /* tracks per zone */ + /* ptr[2] = 0; */ + /* ptr[3] = 0; */ + /* alternate sectors per zone */ + /* ptr[4] = 0; */ + /* ptr[5] = 0; */ + /* alternate tracks per zone */ + /* ptr[6] = 0; */ + /* ptr[7] = 0; */ + /* alternate tracks per logical unit */ + /* ptr[8] = 0; */ + /* ptr[9] = 0; */ + /* sectors per track */ + ptr[10] = (PSEUDO_SPT >> 8) & 0xff; + ptr[11] = PSEUDO_SPT & 0xff; + /* data bytes per physical sector */ + ptr[12] = ((1 << DISK_SHIFT) >> 8) & 0xff; + ptr[13] = (1 << DISK_SHIFT) & 0xff; + /* interleave */ + /* ptr[14] = 0; */ + /* ptr[15] = 1; */ + /* track skew factor */ + /* ptr[16] = 0; */ + /* ptr[17] = 0; */ + /* cylinder skew factor */ + /* ptr[18] = 0; */ + /* ptr[19] = 0; */ + /* SSRC, HSEC, RMB, SURF */ + } + ptr += 26; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_GEOMETRY_PAGE) { + ptr[0] = SMS_GEOMETRY_PAGE; + ptr[1] = 24; + if (pgctl != SMS_PAGE_CTRL_CHANGEABLE) { + uint32_t cyl = (DISK_NBLKS + ((PSEUDO_SPC - 1))) / PSEUDO_SPC; + /* number of cylinders */ + ptr[2] = (cyl >> 24) & 0xff; + ptr[3] = (cyl >> 16) & 0xff; + ptr[4] = cyl & 0xff; + /* number of heads */ + ptr[5] = PSEUDO_HDS; + /* starting cylinder- write precompensation */ + /* ptr[6] = 0; */ + /* ptr[7] = 0; */ + /* ptr[8] = 0; */ + /* starting cylinder- reduced write current */ + /* ptr[9] = 0; */ + /* ptr[10] = 0; */ + /* ptr[11] = 0; */ + /* drive step rate */ + /* ptr[12] = 0; */ + /* ptr[13] = 0; */ + /* landing zone cylinder */ + /* ptr[14] = 0; */ + /* ptr[15] = 0; */ + /* ptr[16] = 0; */ + /* RPL */ + /* ptr[17] = 0; */ + /* rotational offset */ + /* ptr[18] = 0; */ + /* medium rotation rate - 7200 RPM */ + ptr[20] = 0x1c; + ptr[21] = 0x20; + } + ptr += 26; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_CACHE_PAGE) { + ptr[0] = SMS_CACHE_PAGE; + ptr[1] = 18; + ptr[2] = 1 << 2; + ptr += 20; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_CONTROL_MODE_PAGE) { + ptr[0] = SMS_CONTROL_MODE_PAGE; + ptr[1] = 10; + if (pgctl != SMS_PAGE_CTRL_CHANGEABLE) { + ptr[3] = 1 << 4; /* unrestricted reordering allowed */ + ptr[8] = 0x75; /* 30000 ms */ + ptr[9] = 0x30; + } + ptr += 12; + } + nbyte = (char *)ptr - &junk[0]; + ptr[0] = nbyte - 4; + + if (cdb[0] == MODE_SENSE) { + data_len = min(cdb[4], csio->dxfer_len); + } else { + uint16_t tw = (cdb[7] << 8) | cdb[8]; + data_len = min(tw, csio->dxfer_len); + } + data_len = min(data_len, nbyte); + if (data_len) { + memcpy(csio->data_ptr, junk, data_len); + } + csio->resid = csio->dxfer_len - data_len; + break; + } + case READ_6: + case READ_10: + case READ_12: + case READ_16: + case WRITE_6: + case WRITE_10: + case WRITE_12: + case WRITE_16: + if (vhba_rwparm(cdb, &off, &data_len, DISK_NBLKS, DISK_SHIFT)) { + vhba_fill_sense(csio, SSD_KEY_ILLEGAL_REQUEST, 0x24, 0x0); + break; + } + if (data_len) { + if ((cdb[0] & 0xf) == 8) { + memcpy(csio->data_ptr, &vhbas->disk[off], data_len); + } else { + memcpy(&vhbas->disk[off], csio->data_ptr, data_len); + } + csio->resid = csio->dxfer_len - data_len; + } else { + csio->resid = csio->dxfer_len; + } + break; + + case READ_CAPACITY: + if (cdb[2] || cdb[3] || cdb[4] || cdb[5]) { + vhba_fill_sense(csio, SSD_KEY_UNIT_ATTENTION, 0x24, 0x0); + break; + } + if (cdb[8] & 0x1) { /* PMI */ + csio->data_ptr[0] = 0xff; + csio->data_ptr[1] = 0xff; + csio->data_ptr[2] = 0xff; + csio->data_ptr[3] = 0xff; + } else { + uint64_t last_blk = DISK_NBLKS - 1; + if (last_blk < 0xffffffffULL) { + csio->data_ptr[0] = (last_blk >> 24) & 0xff; + csio->data_ptr[1] = (last_blk >> 16) & 0xff; + csio->data_ptr[2] = (last_blk >> 8) & 0xff; + csio->data_ptr[3] = (last_blk) & 0xff; + } else { + csio->data_ptr[0] = 0xff; + csio->data_ptr[1] = 0xff; + csio->data_ptr[2] = 0xff; + csio->data_ptr[3] = 0xff; + } + } + csio->data_ptr[4] = ((1 << DISK_SHIFT) >> 24) & 0xff; + csio->data_ptr[5] = ((1 << DISK_SHIFT) >> 16) & 0xff; + csio->data_ptr[6] = ((1 << DISK_SHIFT) >> 8) & 0xff; + csio->data_ptr[7] = ((1 << DISK_SHIFT)) & 0xff; + break; + default: + vhba_default_cmd(csio, MAX_LUN, NULL); + break; + } + if (csio->scsi_status != SCSI_STATUS_OK) { + camstatus = CAM_SCSI_STATUS_ERROR; + if (csio->scsi_status == SCSI_STATUS_CHECK_COND) { + camstatus |= CAM_AUTOSNS_VALID; + } + } else { + csio->scsi_status = SCSI_STATUS_OK; + camstatus = CAM_REQ_CMP; + } + vhba_set_status(&csio->ccb_h, camstatus); + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); +} +DEV_MODULE(vhba_faulty, vhba_modprobe, NULL); Added: head/tools/tools/vhba/lots/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vhba/lots/Makefile Tue Jun 8 22:26:47 2010 (r208926) @@ -0,0 +1,7 @@ +# $FreeBSD$ +KMOD= vlots +SRCS= vhba_lots.c vhba.c +CFLAGS += -I${.CURDIR}/.. -DVHBA_MOD=\"vlots\" +VPATH= ${.CURDIR}/.. + +.include Added: head/tools/tools/vhba/lots/vhba_lots.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vhba/lots/vhba_lots.c Tue Jun 8 22:26:47 2010 (r208926) @@ -0,0 +1,335 @@ +/*- + * Copyright (c) 2010 by Panasas, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice immediately at the beginning of the file, without modification, + * this list of conditions, and the following disclaimer. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* $FreeBSD$ */ +/* + * VHBA device that just reate boatloads of devices. + */ +#include "vhba.h" + +#define MAX_TGT VHBA_MAXTGT +#define MAX_LUN 32 + +#define DISK_SIZE 32 +#define DISK_SHIFT 9 +#define DISK_NBLKS ((DISK_SIZE << 20) >> DISK_SHIFT) +#define PSEUDO_SPT 64 +#define PSEUDO_HDS 64 +#define PSEUDO_SPC (PSEUDO_SPT * PSEUDO_HDS) + +typedef struct { + vhba_softc_t * vhba; + uint8_t * disk; + size_t disk_size; + struct task qt; +} vhbalots_t; + +static void vhba_task(void *, int); +static void vhbalots_act(vhbalots_t *, struct ccb_scsiio *); + +void +vhba_init(vhba_softc_t *vhba) +{ + static vhbalots_t vhbas; + vhbas.vhba = vhba; + vhbas.disk_size = DISK_SIZE << 20; + vhbas.disk = malloc(vhbas.disk_size, M_DEVBUF, M_WAITOK|M_ZERO); + vhba->private = &vhbas; + TASK_INIT(&vhbas.qt, 0, vhba_task, &vhbas); +} + + +void +vhba_fini(vhba_softc_t *vhba) +{ + vhbalots_t *vhbas = vhba->private; + vhba->private = NULL; + free(vhbas->disk, M_DEVBUF); +} + +void +vhba_kick(vhba_softc_t *vhba) +{ + vhbalots_t *vhbas = vhba->private; + taskqueue_enqueue(taskqueue_swi, &vhbas->qt); +} + +static void +vhba_task(void *arg, int pending) +{ + vhbalots_t *vhbas = arg; + struct ccb_hdr *ccbh; + + mtx_lock(&vhbas->vhba->lock); + while ((ccbh = TAILQ_FIRST(&vhbas->vhba->actv)) != NULL) { + TAILQ_REMOVE(&vhbas->vhba->actv, ccbh, sim_links.tqe); + vhbalots_act(vhbas, (struct ccb_scsiio *)ccbh); + } + while ((ccbh = TAILQ_FIRST(&vhbas->vhba->done)) != NULL) { + TAILQ_REMOVE(&vhbas->vhba->done, ccbh, sim_links.tqe); + xpt_done((union ccb *)ccbh); + } + mtx_unlock(&vhbas->vhba->lock); +} + +static void +vhbalots_act(vhbalots_t *vhbas, struct ccb_scsiio *csio) +{ + char junk[128]; + uint8_t *cdb, *ptr, status; + uint32_t data_len; + uint64_t off; + + data_len = 0; + status = SCSI_STATUS_OK; + + memset(&csio->sense_data, 0, sizeof (csio->sense_data)); + cdb = csio->cdb_io.cdb_bytes; + + if (csio->ccb_h.target_id >= MAX_TGT) { + csio->ccb_h.status = CAM_SEL_TIMEOUT; + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + if (csio->ccb_h.target_lun >= MAX_LUN && cdb[0] != INQUIRY && cdb[0] != REPORT_LUNS && cdb[0] != REQUEST_SENSE) { + vhba_fill_sense(csio, SSD_KEY_ILLEGAL_REQUEST, 0x25, 0x0); + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + + switch (cdb[0]) { + case MODE_SENSE: + case MODE_SENSE_10: + { + unsigned int nbyte; + uint8_t page = cdb[2] & SMS_PAGE_CODE; + uint8_t pgctl = cdb[2] & SMS_PAGE_CTRL_MASK; + + switch (page) { + case SMS_FORMAT_DEVICE_PAGE: + case SMS_GEOMETRY_PAGE: + case SMS_CACHE_PAGE: + case SMS_CONTROL_MODE_PAGE: + case SMS_ALL_PAGES_PAGE: + break; + default: + vhba_fill_sense(csio, SSD_KEY_ILLEGAL_REQUEST, 0x24, 0x0); + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + memset(junk, 0, sizeof (junk)); + if (cdb[1] & SMS_DBD) { + ptr = &junk[4]; + } else { + ptr = junk; + ptr[3] = 8; + ptr[4] = ((1 << DISK_SHIFT) >> 24) & 0xff; + ptr[5] = ((1 << DISK_SHIFT) >> 16) & 0xff; + ptr[6] = ((1 << DISK_SHIFT) >> 8) & 0xff; + ptr[7] = ((1 << DISK_SHIFT)) & 0xff; + + ptr[8] = (DISK_NBLKS >> 24) & 0xff; + ptr[9] = (DISK_NBLKS >> 16) & 0xff; + ptr[10] = (DISK_NBLKS >> 8) & 0xff; + ptr[11] = DISK_NBLKS & 0xff; + ptr += 12; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_FORMAT_DEVICE_PAGE) { + ptr[0] = SMS_FORMAT_DEVICE_PAGE; + ptr[1] = 24; + if (pgctl != SMS_PAGE_CTRL_CHANGEABLE) { + /* tracks per zone */ + /* ptr[2] = 0; */ + /* ptr[3] = 0; */ + /* alternate sectors per zone */ + /* ptr[4] = 0; */ + /* ptr[5] = 0; */ + /* alternate tracks per zone */ + /* ptr[6] = 0; */ + /* ptr[7] = 0; */ + /* alternate tracks per logical unit */ + /* ptr[8] = 0; */ + /* ptr[9] = 0; */ + /* sectors per track */ + ptr[10] = (PSEUDO_SPT >> 8) & 0xff; + ptr[11] = PSEUDO_SPT & 0xff; + /* data bytes per physical sector */ + ptr[12] = ((1 << DISK_SHIFT) >> 8) & 0xff; + ptr[13] = (1 << DISK_SHIFT) & 0xff; + /* interleave */ + /* ptr[14] = 0; */ + /* ptr[15] = 1; */ + /* track skew factor */ + /* ptr[16] = 0; */ + /* ptr[17] = 0; */ + /* cylinder skew factor */ + /* ptr[18] = 0; */ + /* ptr[19] = 0; */ + /* SSRC, HSEC, RMB, SURF */ + } + ptr += 26; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_GEOMETRY_PAGE) { + ptr[0] = SMS_GEOMETRY_PAGE; + ptr[1] = 24; + if (pgctl != SMS_PAGE_CTRL_CHANGEABLE) { + uint32_t cyl = (DISK_NBLKS + ((PSEUDO_SPC - 1))) / PSEUDO_SPC; + /* number of cylinders */ + ptr[2] = (cyl >> 24) & 0xff; + ptr[3] = (cyl >> 16) & 0xff; + ptr[4] = cyl & 0xff; + /* number of heads */ + ptr[5] = PSEUDO_HDS; + /* starting cylinder- write precompensation */ + /* ptr[6] = 0; */ + /* ptr[7] = 0; */ + /* ptr[8] = 0; */ + /* starting cylinder- reduced write current */ + /* ptr[9] = 0; */ + /* ptr[10] = 0; */ + /* ptr[11] = 0; */ + /* drive step rate */ + /* ptr[12] = 0; */ + /* ptr[13] = 0; */ + /* landing zone cylinder */ + /* ptr[14] = 0; */ + /* ptr[15] = 0; */ + /* ptr[16] = 0; */ + /* RPL */ + /* ptr[17] = 0; */ + /* rotational offset */ + /* ptr[18] = 0; */ + /* medium rotation rate - 7200 RPM */ + ptr[20] = 0x1c; + ptr[21] = 0x20; + } + ptr += 26; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_CACHE_PAGE) { + ptr[0] = SMS_CACHE_PAGE; + ptr[1] = 18; + ptr[2] = 1 << 2; + ptr += 20; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_CONTROL_MODE_PAGE) { + ptr[0] = SMS_CONTROL_MODE_PAGE; + ptr[1] = 10; + if (pgctl != SMS_PAGE_CTRL_CHANGEABLE) { + ptr[3] = 1 << 4; /* unrestricted reordering allowed */ + ptr[8] = 0x75; /* 30000 ms */ + ptr[9] = 0x30; + } + ptr += 12; + } + nbyte = (char *)ptr - &junk[0]; + ptr[0] = nbyte - 4; + + if (cdb[0] == MODE_SENSE) { + data_len = min(cdb[4], csio->dxfer_len); + } else { + uint16_t tw = (cdb[7] << 8) | cdb[8]; + data_len = min(tw, csio->dxfer_len); + } + data_len = min(data_len, nbyte); + if (data_len) { + memcpy(csio->data_ptr, junk, data_len); + } + csio->resid = csio->dxfer_len - data_len; + break; + } + case READ_6: + case READ_10: + case READ_12: + case READ_16: + case WRITE_6: + case WRITE_10: + case WRITE_12: + case WRITE_16: + if (vhba_rwparm(cdb, &off, &data_len, DISK_NBLKS, DISK_SHIFT)) { + vhba_fill_sense(csio, SSD_KEY_ILLEGAL_REQUEST, 0x24, 0x0); + break; + } + if (data_len) { + if ((cdb[0] & 0xf) == 8) { + memcpy(csio->data_ptr, &vhbas->disk[off], data_len); + } else { + memcpy(&vhbas->disk[off], csio->data_ptr, data_len); + } + csio->resid = csio->dxfer_len - data_len; + } else { + csio->resid = csio->dxfer_len; + } + break; + + case READ_CAPACITY: + if (cdb[2] || cdb[3] || cdb[4] || cdb[5]) { + vhba_fill_sense(csio, SSD_KEY_UNIT_ATTENTION, 0x24, 0x0); + break; + } + if (cdb[8] & 0x1) { /* PMI */ + csio->data_ptr[0] = 0xff; + csio->data_ptr[1] = 0xff; + csio->data_ptr[2] = 0xff; + csio->data_ptr[3] = 0xff; + } else { + uint64_t last_blk = DISK_NBLKS - 1; + if (last_blk < 0xffffffffULL) { + csio->data_ptr[0] = (last_blk >> 24) & 0xff; + csio->data_ptr[1] = (last_blk >> 16) & 0xff; + csio->data_ptr[2] = (last_blk >> 8) & 0xff; + csio->data_ptr[3] = (last_blk) & 0xff; + } else { + csio->data_ptr[0] = 0xff; + csio->data_ptr[1] = 0xff; + csio->data_ptr[2] = 0xff; + csio->data_ptr[3] = 0xff; + } + } + csio->data_ptr[4] = ((1 << DISK_SHIFT) >> 24) & 0xff; + csio->data_ptr[5] = ((1 << DISK_SHIFT) >> 16) & 0xff; + csio->data_ptr[6] = ((1 << DISK_SHIFT) >> 8) & 0xff; + csio->data_ptr[7] = ((1 << DISK_SHIFT)) & 0xff; + break; + default: + vhba_default_cmd(csio, MAX_LUN, NULL); + break; + } + csio->ccb_h.status &= ~CAM_STATUS_MASK; + if (csio->scsi_status != SCSI_STATUS_OK) { + csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR; + if (csio->scsi_status == SCSI_STATUS_CHECK_COND) { + csio->ccb_h.status |= CAM_AUTOSNS_VALID; + } + } else { + csio->scsi_status = SCSI_STATUS_OK; + csio->ccb_h.status |= CAM_REQ_CMP; + } + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); +} +DEV_MODULE(vhba_lots, vhba_modprobe, NULL); Added: head/tools/tools/vhba/medium/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vhba/medium/Makefile Tue Jun 8 22:26:47 2010 (r208926) @@ -0,0 +1,7 @@ +# $FreeBSD$ +KMOD= vmedium +SRCS= vhba_medium.c vhba.c +CFLAGS += -I${.CURDIR}/.. -DVHBA_MOD=\"vmedium\" +VPATH= ${.CURDIR}/.. + +.include Added: head/tools/tools/vhba/medium/vhba_medium.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vhba/medium/vhba_medium.c Tue Jun 8 22:26:47 2010 (r208926) @@ -0,0 +1,337 @@ +/*- + * Copyright (c) 2010 by Panasas, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice immediately at the beginning of the file, without modification, + * this list of conditions, and the following disclaimer. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* $FreeBSD$ */ +/* + * A VHBA device that has a medium number of device. + */ +#include "vhba.h" + +#define MAX_TGT 4 +#define MAX_LUN 10 + +#define DISK_SIZE 32 +#define DISK_SHIFT 9 +#define DISK_NBLKS ((DISK_SIZE << 20) >> DISK_SHIFT) +#define PSEUDO_SPT 64 +#define PSEUDO_HDS 64 +#define PSEUDO_SPC (PSEUDO_SPT * PSEUDO_HDS) + +typedef struct { + vhba_softc_t * vhba; + uint8_t * disk; + size_t disk_size; + struct task qt; +} vhbamedium_t; + +static void vhba_task(void *, int); +static void vhbamedium_act(vhbamedium_t *, struct ccb_scsiio *); + +void +vhba_init(vhba_softc_t *vhba) +{ + static vhbamedium_t vhbas; + vhbas.vhba = vhba; + vhbas.disk_size = DISK_SIZE << 20; + vhbas.disk = malloc(vhbas.disk_size, M_DEVBUF, M_WAITOK|M_ZERO); + vhba->private = &vhbas; + TASK_INIT(&vhbas.qt, 0, vhba_task, &vhbas); +} + + +void +vhba_fini(vhba_softc_t *vhba) +{ + vhbamedium_t *vhbas = vhba->private; + vhba->private = NULL; + free(vhbas->disk, M_DEVBUF); +} + +void +vhba_kick(vhba_softc_t *vhba) +{ + vhbamedium_t *vhbas = vhba->private; + taskqueue_enqueue(taskqueue_swi, &vhbas->qt); +} + +static void +vhba_task(void *arg, int pending) +{ + vhbamedium_t *vhbas = arg; + struct ccb_hdr *ccbh; + + mtx_lock(&vhbas->vhba->lock); + while ((ccbh = TAILQ_FIRST(&vhbas->vhba->actv)) != NULL) { + TAILQ_REMOVE(&vhbas->vhba->actv, ccbh, sim_links.tqe); + vhbamedium_act(vhbas, (struct ccb_scsiio *)ccbh); + } + while ((ccbh = TAILQ_FIRST(&vhbas->vhba->done)) != NULL) { + TAILQ_REMOVE(&vhbas->vhba->done, ccbh, sim_links.tqe); + xpt_done((union ccb *)ccbh); + } + mtx_unlock(&vhbas->vhba->lock); +} + +static void +vhbamedium_act(vhbamedium_t *vhbas, struct ccb_scsiio *csio) +{ + char junk[128]; + uint8_t *cdb, *ptr, status; + uint32_t data_len; + uint64_t off; + + data_len = 0; + status = SCSI_STATUS_OK; + + memset(&csio->sense_data, 0, sizeof (csio->sense_data)); + cdb = csio->cdb_io.cdb_bytes; + + if (csio->ccb_h.target_id >= MAX_TGT) { + csio->ccb_h.status = CAM_SEL_TIMEOUT; + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + if (csio->ccb_h.target_lun >= MAX_LUN && cdb[0] != INQUIRY && cdb[0] != REPORT_LUNS && cdb[0] != REQUEST_SENSE) { + vhba_fill_sense(csio, SSD_KEY_ILLEGAL_REQUEST, 0x25, 0x0); + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + + switch (cdb[0]) { + case MODE_SENSE: + case MODE_SENSE_10: + { + unsigned int nbyte; + uint8_t page = cdb[2] & SMS_PAGE_CODE; + uint8_t pgctl = cdb[2] & SMS_PAGE_CTRL_MASK; + + switch (page) { + case SMS_FORMAT_DEVICE_PAGE: + case SMS_GEOMETRY_PAGE: + case SMS_CACHE_PAGE: + case SMS_CONTROL_MODE_PAGE: + case SMS_ALL_PAGES_PAGE: + break; + default: + vhba_fill_sense(csio, SSD_KEY_ILLEGAL_REQUEST, 0x24, 0x0); + TAILQ_INSERT_TAIL(&vhbas->vhba->done, &csio->ccb_h, sim_links.tqe); + return; + } + memset(junk, 0, sizeof (junk)); + if (cdb[1] & SMS_DBD) { + ptr = &junk[4]; + } else { + ptr = junk; + ptr[3] = 8; + ptr[4] = ((1 << DISK_SHIFT) >> 24) & 0xff; + ptr[5] = ((1 << DISK_SHIFT) >> 16) & 0xff; + ptr[6] = ((1 << DISK_SHIFT) >> 8) & 0xff; + ptr[7] = ((1 << DISK_SHIFT)) & 0xff; + + ptr[8] = (DISK_NBLKS >> 24) & 0xff; + ptr[9] = (DISK_NBLKS >> 16) & 0xff; + ptr[10] = (DISK_NBLKS >> 8) & 0xff; + ptr[11] = DISK_NBLKS & 0xff; + ptr += 12; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_FORMAT_DEVICE_PAGE) { + ptr[0] = SMS_FORMAT_DEVICE_PAGE; + ptr[1] = 24; + if (pgctl != SMS_PAGE_CTRL_CHANGEABLE) { + /* tracks per zone */ + /* ptr[2] = 0; */ + /* ptr[3] = 0; */ + /* alternate sectors per zone */ + /* ptr[4] = 0; */ + /* ptr[5] = 0; */ + /* alternate tracks per zone */ + /* ptr[6] = 0; */ + /* ptr[7] = 0; */ + /* alternate tracks per logical unit */ + /* ptr[8] = 0; */ + /* ptr[9] = 0; */ + /* sectors per track */ + ptr[10] = (PSEUDO_SPT >> 8) & 0xff; + ptr[11] = PSEUDO_SPT & 0xff; + /* data bytes per physical sector */ + ptr[12] = ((1 << DISK_SHIFT) >> 8) & 0xff; + ptr[13] = (1 << DISK_SHIFT) & 0xff; + /* interleave */ + /* ptr[14] = 0; */ + /* ptr[15] = 1; */ + /* track skew factor */ + /* ptr[16] = 0; */ + /* ptr[17] = 0; */ + /* cylinder skew factor */ + /* ptr[18] = 0; */ + /* ptr[19] = 0; */ + /* SSRC, HSEC, RMB, SURF */ + } + ptr += 26; + } + + if (page == SMS_ALL_PAGES_PAGE || page == SMS_GEOMETRY_PAGE) { + ptr[0] = SMS_GEOMETRY_PAGE; + ptr[1] = 24; + if (pgctl != SMS_PAGE_CTRL_CHANGEABLE) { + uint32_t cyl = (DISK_NBLKS + ((PSEUDO_SPC - 1))) / PSEUDO_SPC; + /* number of cylinders */ + ptr[2] = (cyl >> 24) & 0xff; + ptr[3] = (cyl >> 16) & 0xff; + ptr[4] = cyl & 0xff; + /* number of heads */ + ptr[5] = PSEUDO_HDS; + /* starting cylinder- write precompensation */ + /* ptr[6] = 0; */ + /* ptr[7] = 0; */ + /* ptr[8] = 0; */ + /* starting cylinder- reduced write current */ + /* ptr[9] = 0; */ + /* ptr[10] = 0; */ + /* ptr[11] = 0; */ + /* drive step rate */ + /* ptr[12] = 0; */ + /* ptr[13] = 0; */ + /* landing zone cylinder */ + /* ptr[14] = 0; */ + /* ptr[15] = 0; */ + /* ptr[16] = 0; */ + /* RPL */ + /* ptr[17] = 0; */ + /* rotational offset */ + /* ptr[18] = 0; */ + /* medium rotation rate - 7200 RPM */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 22:40:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 798EC1065675; Tue, 8 Jun 2010 22:40:03 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C71A8FC15; Tue, 8 Jun 2010 22:40:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Me3VO034933; Tue, 8 Jun 2010 22:40:03 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58Me3Xv034931; Tue, 8 Jun 2010 22:40:03 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006082240.o58Me3Xv034931@svn.freebsd.org> From: Matt Jacob Date: Tue, 8 Jun 2010 22:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208927 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 22:40:03 -0000 Author: mjacob Date: Tue Jun 8 22:40:02 2010 New Revision: 208927 URL: http://svn.freebsd.org/changeset/base/208927 Log: Try and narrow the gap in which you act on an event that has been canceled. Obtained from: Jaako Heinonen MFC after: 1 month Modified: head/sys/geom/geom_event.c Modified: head/sys/geom/geom_event.c ============================================================================== --- head/sys/geom/geom_event.c Tue Jun 8 22:26:47 2010 (r208926) +++ head/sys/geom/geom_event.c Tue Jun 8 22:40:02 2010 (r208927) @@ -76,6 +76,7 @@ struct g_event { #define EV_DONE 0x80000 #define EV_WAKEUP 0x40000 #define EV_CANCELED 0x20000 +#define EV_INPROGRESS 0x10000 void g_waitidle(void) @@ -206,12 +207,19 @@ one_event(void) g_topology_unlock(); return (0); } + if (ep->flag & EV_INPROGRESS) { + mtx_unlock(&g_eventlock); + g_topology_unlock(); + return (1); + } + ep->flag |= EV_INPROGRESS; mtx_unlock(&g_eventlock); g_topology_assert(); ep->func(ep->arg, 0); g_topology_assert(); mtx_lock(&g_eventlock); TAILQ_REMOVE(&g_events, ep, events); + ep->flag &= ~EV_INPROGRESS; mtx_unlock(&g_eventlock); if (ep->flag & EV_WAKEUP) { ep->flag |= EV_DONE; @@ -255,6 +263,8 @@ g_cancel_event(void *ref) break; } TAILQ_FOREACH_SAFE(ep, &g_events, events, epn) { + if (ep->flag & EV_INPROGRESS) + continue; for (n = 0; n < G_N_EVENTREFS; n++) { if (ep->ref[n] == NULL) break; From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 22:41:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86EE2106566B; Tue, 8 Jun 2010 22:41:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABCF8FC1D; Tue, 8 Jun 2010 22:41:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o58MdUD4013621; Tue, 8 Jun 2010 16:39:30 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 08 Jun 2010 16:39:30 -0600 (MDT) Message-Id: <20100608.163930.769051484062774012.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <201006081725.24684.jhb@freebsd.org> References: <201006081446.09423.jhb@freebsd.org> <20100608.132210.10150326092157406.imp@bsdimp.com> <201006081725.24684.jhb@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208921 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 22:41:44 -0000 In message: <201006081725.24684.jhb@freebsd.org> John Baldwin writes: : On Tuesday 08 June 2010 3:22:10 pm M. Warner Losh wrote: : > In message: <201006081446.09423.jhb@freebsd.org> : > John Baldwin writes: : > : On Tuesday 08 June 2010 2:04:07 pm John Baldwin wrote: : > : > Author: jhb : > : > Date: Tue Jun 8 18:04:07 2010 : > : > New Revision: 208921 : > : > URL: http://svn.freebsd.org/changeset/base/208921 : > : > : > : > Log: : > : > Move the machine check support code to the x86 tree since it is : identical : > : > on i386 and amd64. : > : > : > : > Requested by: alc : > : : > : It would be nice to consolidate as that is identical on : both : > : platforms, but that moving to x86/include is trickier as the header needs : to : > : be available in userland, probably as still. : > : would work ok (i.e. in /usr/include/x86/mca.h), but that makes things : trickier : > : in the kernel as the file should really live in sys/x86/include, not : sys/x86 : > : directly. : > : : > : I'm open to suggestions on if this is feasible and if so how to do it. : > : > I believe we had a long talk about this before. : > : > copy the current {i386,amd64}/mca.h to x86/mca.h : > new {i386,amd64}/mca.h == #include (no copyright notice, etc) : > : > just like we do for the pc98 stuff. The mca.h file would live in : > sys/x86/include. : : How does this work for the kernel? doesn't map to : sys/x86/include/mca.h. You still include macine/mca.h inside the kernel, except for mca.c itself. You shouldn't short-circuit things because you know an implementation detail. : For machine we make a symlink that points to : sys//include. Are you proposing an x86 symlink in the kernel build : directory that for i386, pc98, and amd64 that points to sys/x86/include? Yes. : Ah, looks like you are. This is handled by _ILINKS in kern.post.mk currently. : If you will fix all the glue magic so #include works in kernel and : userland I have several headers I can move (apicreg.h, mca.h, etc.). I believe this is correct... But a lot of it is dependent on the merge of tbemd branch, which is still at least a week away. Can you wait that long? Warner From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 22:46:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5870106564A; Tue, 8 Jun 2010 22:46:44 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A49F58FC13; Tue, 8 Jun 2010 22:46:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58MkijA036474; Tue, 8 Jun 2010 22:46:44 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58MkiSf036472; Tue, 8 Jun 2010 22:46:44 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006082246.o58MkiSf036472@svn.freebsd.org> From: Matt Jacob Date: Tue, 8 Jun 2010 22:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208928 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 22:46:44 -0000 Author: mjacob Date: Tue Jun 8 22:46:44 2010 New Revision: 208928 URL: http://svn.freebsd.org/changeset/base/208928 Log: Rearrange how things are done to avoid dereferencing stale pointers in the case of immediate unconfigure after configure. Hold the periph an extra count while we have the task to create sysctl context outstanding so that the periph doesn't go away unexpectedly. Sponsored by: Panasas Reviewed by: scsi@ MFC after: 1 month Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 8 22:40:02 2010 (r208927) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 8 22:46:44 2010 (r208928) @@ -998,11 +998,6 @@ dacleanup(struct cam_periph *periph) xpt_print(periph->path, "can't remove sysctl context\n"); } - /* - * Nullify our periph pointer here to try and catch - * race conditions in callbacks/downcalls. - */ - softc->disk->d_drv1 = NULL; disk_destroy(softc->disk); callout_drain(&softc->sendordered_c); free(softc, M_DEVBUF); @@ -1082,8 +1077,13 @@ dasysctlinit(void *context, int pending) struct ccb_trans_settings cts; periph = (struct cam_periph *)context; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + /* + * periph was held for us when this task was enqueued + */ + if (periph->flags & CAM_PERIPH_INVALID) { + cam_periph_release(periph); return; + } softc = (struct da_softc *)periph->softc; snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number); @@ -1263,29 +1263,6 @@ daregister(struct cam_periph *periph, vo * Register this media as a disk */ - mtx_unlock(periph->sim->mtx); - softc->disk = disk_alloc(); - softc->disk->d_open = daopen; - softc->disk->d_close = daclose; - softc->disk->d_strategy = dastrategy; - softc->disk->d_dump = dadump; - softc->disk->d_name = "da"; - softc->disk->d_drv1 = periph; - if (cpi.maxio == 0) - softc->disk->d_maxsize = DFLTPHYS; /* traditional default */ - else if (cpi.maxio > MAXPHYS) - softc->disk->d_maxsize = MAXPHYS; /* for safety */ - else - softc->disk->d_maxsize = cpi.maxio; - softc->disk->d_unit = periph->unit_number; - softc->disk->d_flags = 0; - if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) - softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - strlcpy(softc->disk->d_ident, cgd->serial_num, - MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1)); - disk_create(softc->disk, DISK_VERSION); - mtx_lock(periph->sim->mtx); - /* * Add async callbacks for bus reset and * bus device reset calls. I don't bother @@ -1303,7 +1280,6 @@ daregister(struct cam_periph *periph, vo * the end of probe. */ (void)cam_periph_hold(periph, PRIBIO); - xpt_schedule(periph, CAM_PRIORITY_DEV); /* * Schedule a periodic event to occasionally send an @@ -1314,6 +1290,31 @@ daregister(struct cam_periph *periph, vo (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); + mtx_unlock(periph->sim->mtx); + softc->disk = disk_alloc(); + softc->disk->d_open = daopen; + softc->disk->d_close = daclose; + softc->disk->d_strategy = dastrategy; + softc->disk->d_dump = dadump; + softc->disk->d_name = "da"; + softc->disk->d_drv1 = periph; + if (cpi.maxio == 0) + softc->disk->d_maxsize = DFLTPHYS; /* traditional default */ + else if (cpi.maxio > MAXPHYS) + softc->disk->d_maxsize = MAXPHYS; /* for safety */ + else + softc->disk->d_maxsize = cpi.maxio; + softc->disk->d_unit = periph->unit_number; + softc->disk->d_flags = 0; + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) + softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; + strlcpy(softc->disk->d_ident, cgd->serial_num, + MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1)); + disk_create(softc->disk, DISK_VERSION); + mtx_lock(periph->sim->mtx); + + xpt_schedule(periph, CAM_PRIORITY_DEV); + return(CAM_REQ_CMP); } @@ -1773,6 +1774,7 @@ dadone(struct cam_periph *periph, union * Create our sysctl variables, now that we know * we have successfully attached. */ + (void) cam_periph_acquire(periph); /* increase the refcount */ taskqueue_enqueue(taskqueue_thread,&softc->sysctl_task); } softc->state = DA_STATE_NORMAL; From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 05:49:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C4FD1065670; Wed, 9 Jun 2010 05:49:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E566B8FC08; Wed, 9 Jun 2010 05:49:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o595n20U029225; Wed, 9 Jun 2010 05:49:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o595n21i029223; Wed, 9 Jun 2010 05:49:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006090549.o595n21i029223@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Jun 2010 05:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208934 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 05:49:03 -0000 Author: mav Date: Wed Jun 9 05:49:02 2010 New Revision: 208934 URL: http://svn.freebsd.org/changeset/base/208934 Log: Add set of codec IDs. PR: kern/147466 Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Jun 9 05:06:42 2010 (r208933) +++ head/sys/dev/sound/pci/hda/hdac.c Wed Jun 9 05:49:02 2010 (r208934) @@ -741,6 +741,7 @@ static const struct { #define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051) #define HDA_CODEC_CX20582 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066) #define HDA_CODEC_CX20583 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5067) +#define HDA_CODEC_CX20585 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5069) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) /* VIA */ @@ -803,6 +804,10 @@ static const struct { #define HDA_CODEC_NVIDIAMCP78 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0002) #define HDA_CODEC_NVIDIAMCP78_2 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0006) #define HDA_CODEC_NVIDIAMCP7A HDA_CODEC_CONSTRUCT(NVIDIA, 0x0007) +#define HDA_CODEC_NVIDIAGT220 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000a) +#define HDA_CODEC_NVIDIAGT21X HDA_CODEC_CONSTRUCT(NVIDIA, 0x000b) +#define HDA_CODEC_NVIDIAMCP89 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000c) +#define HDA_CODEC_NVIDIAGT240 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000d) #define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067) #define HDA_CODEC_NVIDIAMCP73 HDA_CODEC_CONSTRUCT(NVIDIA, 0x8001) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) @@ -920,6 +925,7 @@ static const struct { { HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" }, { HDA_CODEC_CX20582, "Conexant CX20582 (Pebble)" }, { HDA_CODEC_CX20583, "Conexant CX20583 (Pebble HSF)" }, + { HDA_CODEC_CX20585, "Conexant CX20585" }, { HDA_CODEC_VT1708_8, "VIA VT1708_8" }, { HDA_CODEC_VT1708_9, "VIA VT1708_9" }, { HDA_CODEC_VT1708_A, "VIA VT1708_A" }, @@ -975,6 +981,10 @@ static const struct { { HDA_CODEC_NVIDIAMCP78, "NVidia MCP78 HDMI" }, { HDA_CODEC_NVIDIAMCP78_2, "NVidia MCP78 HDMI" }, { HDA_CODEC_NVIDIAMCP7A, "NVidia MCP7A HDMI" }, + { HDA_CODEC_NVIDIAGT220, "NVidia GT220 HDMI" }, + { HDA_CODEC_NVIDIAGT21X, "NVidia GT21x HDMI" }, + { HDA_CODEC_NVIDIAMCP89, "NVidia MCP89 HDMI" }, + { HDA_CODEC_NVIDIAGT240, "NVidia GT240 HDMI" }, { HDA_CODEC_INTELG45_1, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_3, "Intel G45 HDMI" }, From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 07:31:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DC091065672; Wed, 9 Jun 2010 07:31:32 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D1548FC1A; Wed, 9 Jun 2010 07:31:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o597VW6K051682; Wed, 9 Jun 2010 07:31:32 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o597VWD6051680; Wed, 9 Jun 2010 07:31:32 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006090731.o597VWD6051680@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 9 Jun 2010 07:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208935 - head/lib/msun/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 07:31:32 -0000 Author: uqs Date: Wed Jun 9 07:31:32 2010 New Revision: 208935 URL: http://svn.freebsd.org/changeset/base/208935 Log: mdoc: spell out theta, the Unicode glyph is hard to read for terminal fonts It is referred to as "theta" later in the document anyway, so stop being fancy. Modified: head/lib/msun/man/atan2.3 Modified: head/lib/msun/man/atan2.3 ============================================================================== --- head/lib/msun/man/atan2.3 Wed Jun 9 05:49:02 2010 (r208934) +++ head/lib/msun/man/atan2.3 Wed Jun 9 07:31:32 2010 (r208935) @@ -66,12 +66,6 @@ functions compute the principal value of .Fa y/ Ns Ar x , using the signs of both arguments to determine the quadrant of the return value. -.ie '\*[.T]'utf8' \{\ -. ds Th \[*h] -.\} -.el \{\ -. ds Th theta -.\} .Pp The .Fn carg , @@ -80,8 +74,8 @@ and .Fn cargl functions compute the complex argument (or phase angle) of .Fa z . -The complex argument is the number \*(Th such that -.Li z = r * e^(I * \*(Th) , +The complex argument is the number theta such that +.Li z = r * e^(I * theta) , where .Li r = cabs(z) . The call From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 07:31:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B19910656C5; Wed, 9 Jun 2010 07:31:41 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 896BA8FC19; Wed, 9 Jun 2010 07:31:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o597VfXA051753; Wed, 9 Jun 2010 07:31:41 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o597Vf4k051751; Wed, 9 Jun 2010 07:31:41 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006090731.o597Vf4k051751@svn.freebsd.org> From: Brian Somers Date: Wed, 9 Jun 2010 07:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208936 - stable/8/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 07:31:41 -0000 Author: brian Date: Wed Jun 9 07:31:41 2010 New Revision: 208936 URL: http://svn.freebsd.org/changeset/base/208936 Log: MFC r197477 - clean up keys deleted via pthread_key_delete() PR: 135462 Approved by: re (kib) Nod timeout: davidxu Modified: stable/8/lib/libthr/thread/thr_spec.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/8/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:32 2010 (r208935) +++ stable/8/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:41 2010 (r208936) @@ -131,9 +131,19 @@ _thread_cleanupspecific(void) curthread->specific[key].data = NULL; curthread->specific_data_count--; } + else if (curthread->specific[key].data != NULL) { + /* + * This can happen if the key is deleted via + * pthread_key_delete without first setting the value + * to NULL in all threads. POSIX says that the + * destructor is not invoked in this case. + */ + curthread->specific[key].data = NULL; + curthread->specific_data_count--; + } /* - * If there is a destructore, call it + * If there is a destructor, call it * with the key table entry unlocked: */ if (destructor != NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 07:36:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7D5A106566B; Wed, 9 Jun 2010 07:36:35 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A58BB8FC0C; Wed, 9 Jun 2010 07:36:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o597aZpw052901; Wed, 9 Jun 2010 07:36:35 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o597aZUk052899; Wed, 9 Jun 2010 07:36:35 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006090736.o597aZUk052899@svn.freebsd.org> From: Brian Somers Date: Wed, 9 Jun 2010 07:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208937 - stable/7/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 07:36:35 -0000 Author: brian Date: Wed Jun 9 07:36:35 2010 New Revision: 208937 URL: http://svn.freebsd.org/changeset/base/208937 Log: MFC r197477 - clean up keys deleted via pthread_key_delete() PR: 135462 Modified: stable/7/lib/libthr/thread/thr_spec.c Directory Properties: stable/7/lib/libthr/ (props changed) Modified: stable/7/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/7/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:41 2010 (r208936) +++ stable/7/lib/libthr/thread/thr_spec.c Wed Jun 9 07:36:35 2010 (r208937) @@ -131,9 +131,19 @@ _thread_cleanupspecific(void) curthread->specific[key].data = NULL; curthread->specific_data_count--; } + else if (curthread->specific[key].data != NULL) { + /* + * This can happen if the key is deleted via + * pthread_key_delete without first setting the value + * to NULL in all threads. POSIX says that the + * destructor is not invoked in this case. + */ + curthread->specific[key].data = NULL; + curthread->specific_data_count--; + } /* - * If there is a destructore, call it + * If there is a destructor, call it * with the key table entry unlocked: */ if (destructor != NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 08:53:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 587D310656DC; Wed, 9 Jun 2010 08:53:51 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47D1B8FC17; Wed, 9 Jun 2010 08:53:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o598rppw070688; Wed, 9 Jun 2010 08:53:51 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o598rp3F070687; Wed, 9 Jun 2010 08:53:51 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006090853.o598rp3F070687@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 9 Jun 2010 08:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208938 - head/contrib/sendmail/mail.local X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 08:53:51 -0000 Author: uqs Date: Wed Jun 9 08:53:50 2010 New Revision: 208938 URL: http://svn.freebsd.org/changeset/base/208938 Log: Remove -mdoc macros from -man page Neither groff nor mandoc render these when in -man mode. This was introduced in r38083 as a local change, therefore no commit to the vendor branch. Modified: head/contrib/sendmail/mail.local/mail.local.8 Modified: head/contrib/sendmail/mail.local/mail.local.8 ============================================================================== --- head/contrib/sendmail/mail.local/mail.local.8 Wed Jun 9 07:36:35 2010 (r208937) +++ head/contrib/sendmail/mail.local/mail.local.8 Wed Jun 9 08:53:50 2010 (r208938) @@ -39,9 +39,7 @@ The options are as follows: Do not advertise 8BITMIME support in LMTP mode. .TP .B \-B -Turn off the attempts to notify the -.Dq biff -service. +Turn off the attempts to notify the ``biff'' service. .TP .B \-b Return a permanent error instead of a temporary error @@ -63,11 +61,8 @@ Specify the sender's name. Turn on LMTP mode. .TP .B \-s -Turn off the -.Xr fsync 2 -call that forces the mailbox to be committed to disk before returning a -.Dq success -status. +Turn off the fsync(2) call that forces the mailbox to be committed +to disk before returning a "success" status. .TP .BI \-r " from" Specify the sender's name (for backward compatibility). From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 09:44:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F33051065678; Wed, 9 Jun 2010 09:44:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E271C8FC15; Wed, 9 Jun 2010 09:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o599i5vs081700; Wed, 9 Jun 2010 09:44:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o599i5OX081698; Wed, 9 Jun 2010 09:44:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006090944.o599i5OX081698@svn.freebsd.org> From: Andriy Gapon Date: Wed, 9 Jun 2010 09:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208939 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 09:44:06 -0000 Author: avg Date: Wed Jun 9 09:44:05 2010 New Revision: 208939 URL: http://svn.freebsd.org/changeset/base/208939 Log: MFC r208800: scsi_cd: pass correct pointer to free() Found with: Coverity Prevent(tm) CID: 2986 Approved by: re(kib) Modified: stable/8/sys/cam/scsi/scsi_cd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Wed Jun 9 08:53:50 2010 (r208938) +++ stable/8/sys/cam/scsi/scsi_cd.c Wed Jun 9 09:44:05 2010 (r208939) @@ -2528,7 +2528,7 @@ cdioctl(struct disk *dp, u_long cmd, voi error = cdgetmode(periph, ¶ms, AUDIO_PAGE); if (error) { - free(¶ms.mode_buf, M_SCSICD); + free(params.mode_buf, M_SCSICD); cam_periph_unlock(periph); break; } From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 09:51:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9635E106564A; Wed, 9 Jun 2010 09:51:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 857808FC0C; Wed, 9 Jun 2010 09:51:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o599pGWr083311; Wed, 9 Jun 2010 09:51:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o599pGmn083309; Wed, 9 Jun 2010 09:51:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006090951.o599pGmn083309@svn.freebsd.org> From: Andriy Gapon Date: Wed, 9 Jun 2010 09:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208940 - stable/7/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 09:51:16 -0000 Author: avg Date: Wed Jun 9 09:51:16 2010 New Revision: 208940 URL: http://svn.freebsd.org/changeset/base/208940 Log: MFC r208800: scsi_cd: pass correct pointer to free() Modified: stable/7/sys/cam/scsi/scsi_cd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_cd.c Wed Jun 9 09:44:05 2010 (r208939) +++ stable/7/sys/cam/scsi/scsi_cd.c Wed Jun 9 09:51:16 2010 (r208940) @@ -2523,7 +2523,7 @@ cdioctl(struct disk *dp, u_long cmd, voi error = cdgetmode(periph, ¶ms, AUDIO_PAGE); if (error) { - free(¶ms, M_SCSICD); + free(params.mode_buf, M_SCSICD); cam_periph_unlock(periph); break; } From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 10:14:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B69E1065676; Wed, 9 Jun 2010 10:14:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABBB8FC13; Wed, 9 Jun 2010 10:14:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59AE0Xa091209; Wed, 9 Jun 2010 10:14:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59AE0lI091207; Wed, 9 Jun 2010 10:14:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006091014.o59AE0lI091207@svn.freebsd.org> From: Andriy Gapon Date: Wed, 9 Jun 2010 10:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208941 - stable/8/sys/fs/udf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 10:14:00 -0000 Author: avg Date: Wed Jun 9 10:13:59 2010 New Revision: 208941 URL: http://svn.freebsd.org/changeset/base/208941 Log: MFC r208671: udf_readlink: fix malloc call with uninitialized size parameter Found by: clang static analyzer Approved by: re(kib) Modified: stable/8/sys/fs/udf/udf_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/8/sys/fs/udf/udf_vnops.c Wed Jun 9 09:51:16 2010 (r208940) +++ stable/8/sys/fs/udf/udf_vnops.c Wed Jun 9 10:13:59 2010 (r208941) @@ -904,9 +904,9 @@ udf_readlink(struct vop_readlink_args *a vp = ap->a_vp; node = VTON(vp); len = le64toh(node->fentry->inf_len); + iov[0].iov_len = len; buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK); iov[0].iov_base = buf; - iov[0].iov_len = len; uio.uio_iov = iov; uio.uio_iovcnt = 1; uio.uio_offset = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 10:14:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03DDA106568B; Wed, 9 Jun 2010 10:14:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E75E88FC0C; Wed, 9 Jun 2010 10:14:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59AEhI9091418; Wed, 9 Jun 2010 10:14:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59AEhuV091416; Wed, 9 Jun 2010 10:14:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006091014.o59AEhuV091416@svn.freebsd.org> From: Andriy Gapon Date: Wed, 9 Jun 2010 10:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208942 - stable/7/sys/fs/udf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 10:14:44 -0000 Author: avg Date: Wed Jun 9 10:14:43 2010 New Revision: 208942 URL: http://svn.freebsd.org/changeset/base/208942 Log: MFC r208671: udf_readlink: fix malloc call with uninitialized size parameter Found by: clang static analyzer Modified: stable/7/sys/fs/udf/udf_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Wed Jun 9 10:13:59 2010 (r208941) +++ stable/7/sys/fs/udf/udf_vnops.c Wed Jun 9 10:14:43 2010 (r208942) @@ -903,9 +903,9 @@ udf_readlink(struct vop_readlink_args *a vp = ap->a_vp; node = VTON(vp); len = le64toh(node->fentry->inf_len); + iov[0].iov_len = len; buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK); iov[0].iov_base = buf; - iov[0].iov_len = len; uio.uio_iov = iov; uio.uio_iovcnt = 1; uio.uio_offset = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 10:36:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F12B106566C; Wed, 9 Jun 2010 10:36:26 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2EFE8FC12; Wed, 9 Jun 2010 10:36:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59AaPof096202; Wed, 9 Jun 2010 10:36:25 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59AaPMR096200; Wed, 9 Jun 2010 10:36:25 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201006091036.o59AaPMR096200@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 9 Jun 2010 10:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208943 - head/usr.bin/calendar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 10:36:26 -0000 Author: edwin Date: Wed Jun 9 10:36:25 2010 New Revision: 208943 URL: http://svn.freebsd.org/changeset/base/208943 Log: fix memset() calls. Found with: Coverity Prevent(tm) CID: 8531 Modified: head/usr.bin/calendar/locale.c Modified: head/usr.bin/calendar/locale.c ============================================================================== --- head/usr.bin/calendar/locale.c Wed Jun 9 10:14:43 2010 (r208942) +++ head/usr.bin/calendar/locale.c Wed Jun 9 10:36:25 2010 (r208943) @@ -76,7 +76,7 @@ setnnames(void) int i, l; struct tm tm; - memset(&tm, sizeof(struct tm), 0); + memset(&tm, '\0', sizeof(struct tm)); for (i = 0; i < 7; i++) { tm.tm_wday = i; strftime(buf, sizeof(buf), "%a", &tm); @@ -104,7 +104,7 @@ setnnames(void) fndays[i].len = strlen(buf); } - memset(&tm, sizeof(struct tm), 0); + memset(&tm, '\0', sizeof(struct tm)); for (i = 0; i < 12; i++) { tm.tm_mon = i; strftime(buf, sizeof(buf), "%b", &tm); From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 12:25:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4ED01065676; Wed, 9 Jun 2010 12:25:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1E208FC12; Wed, 9 Jun 2010 12:25:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59CPvi6020829; Wed, 9 Jun 2010 12:25:57 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59CPv85020819; Wed, 9 Jun 2010 12:25:57 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006091225.o59CPv85020819@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 9 Jun 2010 12:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208946 - in head: share/man/man4 sys/conf sys/modules/netgraph sys/modules/netgraph/patch sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 12:25:58 -0000 Author: ae Date: Wed Jun 9 12:25:57 2010 New Revision: 208946 URL: http://svn.freebsd.org/changeset/base/208946 Log: New netgraph node ng_patch(4). It performs data modification of packets passing through. Modifications are restricted to a subset of C language operations on unsigned integers of 8, 16, 32 or 64 bit size. These are: set to new value (=), addition (+=), subtraction (-=), multiplication (*=), division (/=), negation (= -), bitwise AND (&=), bitwise OR (|=), bitwise eXclusive OR (^=), shift left (<<=), shift right (>>=). Several operations are all applied to a packet sequentially in order they were specified by user. Submitted by: Maxim Ignatenko Vadim Goncharov Discussed with: net@ Approved by: mav (mentor) MFC after: 1 month Added: head/share/man/man4/ng_patch.4 (contents, props changed) head/sys/modules/netgraph/patch/ head/sys/modules/netgraph/patch/Makefile (contents, props changed) head/sys/netgraph/ng_patch.c (contents, props changed) head/sys/netgraph/ng_patch.h (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/modules/netgraph/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Jun 9 12:06:08 2010 (r208945) +++ head/share/man/man4/Makefile Wed Jun 9 12:25:57 2010 (r208946) @@ -274,6 +274,7 @@ MAN= aac.4 \ ng_nat.4 \ ng_netflow.4 \ ng_one2many.4 \ + ng_patch.4 \ ng_ppp.4 \ ng_pppoe.4 \ ng_pptpgre.4 \ Added: head/share/man/man4/ng_patch.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ng_patch.4 Wed Jun 9 12:25:57 2010 (r208946) @@ -0,0 +1,235 @@ +.\" Copyright (c) 2010 Maxim Ignatenko +.\" Copyright (c) 2010 Vadim Goncharov +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 9, 2010 +.Dt NG_PATCH 4 +.Os +.Sh NAME +.Nm ng_patch +.Nd "trivial mbuf data modifying netgraph node type" +.Sh SYNOPSIS +.In netgraph/ng_patch.h +.Sh DESCRIPTION +The +.Nm patch +node performs data modification of packets passing through it. +Modifications are restricted to a subset of C language operations +on unsigned integers of 8, 16, 32 or 64 bit size. +These are: set to new value (=), addition (+=), subtraction (-=), +multiplication (*=), division (/=), negation (= -), +bitwise AND (&=), bitwise OR (|=), bitwise eXclusive OR (^=), +shift left (<<=), shift right (>>=). +A negation operation is the one exception: integer is treated as signed +and second operand (the +.Va value ) +is not used. +There may be several modification operations, they are all applied +to a packet sequentially in order they were specified by user. +Data payload of packet is viewed as array of bytes, with zero offset +corresponding to the very first byte of packet headers, and +.Va length +bytes beginning from +.Va offset +are taken as a single integer in network byte order. +.Sh HOOKS +This node type has two hooks: +.Bl -tag -width indent +.It Va in +Packets received on this hook are modified according to rules specified +in config and then forwarded to +.Ar out +hook, if it exists and connected. +Otherwise they are reflected back to the +.Ar in +hook. +.It Va out +Packets received on this hook are forwarded to +.Ar in +hook without any changes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width indent +.It Dv NGM_PATCH_SETCONFIG Pq Li setconfig +This command sets the sequence of modify operations +that will be applied to incoming data on a hook. +The following +.Vt "struct ng_patch_config" +must be supplied as an argument: +.Bd -literal -offset 4n +struct ng_patch_op { + uint64_t value; + uint32_t offset; + uint16_t length; /* 1,2,4 or 8 bytes */ + uint16_t mode; +}; +/* Patching modes */ +#define NG_PATCH_MODE_SET 1 +#define NG_PATCH_MODE_ADD 2 +#define NG_PATCH_MODE_SUB 3 +#define NG_PATCH_MODE_MUL 4 +#define NG_PATCH_MODE_DIV 5 +#define NG_PATCH_MODE_NEG 6 +#define NG_PATCH_MODE_AND 7 +#define NG_PATCH_MODE_OR 8 +#define NG_PATCH_MODE_XOR 9 +#define NG_PATCH_MODE_SHL 10 +#define NG_PATCH_MODE_SHR 11 + +struct ng_patch_config { + uint32_t count; + uint32_t csum_flags; + struct ng_patch_op ops[]; +}; +.Ed +.Pp +The +.Va csum_flags +can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_SCTP and CSUM_UDP +(other values are ignored) for instructing the IP stack to recalculate the +corresponding checksum before transmitting packet on output interface. +The +.Nm +node does not do any checksum correction by itself. +.It Dv NGM_PATCH_GETCONFIG Pq Li getconfig +This control message obtains current set of modify operations, +returned as +.Vt "struct ng_patch_config" . +.It Dv NGM_PATCH_GET_STATS Pq Li getstats +Returns node statistics as a +.Vt "struct ng_patch_stats" . +.It Dv NGM_PATCH_CLR_STATS Pq Li clrstats +Clear node statistics. +.It Dv NGM_PATCH_GETCLR_STATS Pq Li getclrstats +This command is identical to +.Dv NGM_PATCH_GET_STATS , +except that the statistics are also atomically cleared. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh EXAMPLES +The +.Nm +node allows to modify TTL and TOS/DSCP fields in IP packets. +Suppose you have two adjacent simplex links to remote network +(e.g.\& satellite), so that the packets expiring in between +will generate unwanted ICMP-replies which have to go forth, not back. +Thus you need to raise TTL of every packet entering link link by 2 +to ensure the TTL will not reach zero there. +So you setup +.Xr ipfw 8 +rule with +.Cm netgraph +action to inject packets going to other end of simplex link by the +following +.Xr ngctl 8 +script: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + mkpeer ipfw: patch 200 in + name ipfw:200 ttl_add + msg ttl_add: setconfig { count=1 csum_flags=1 ops=[ \e + { mode=2 value=3 length=1 offset=8 } ] } +SEQ +/sbin/ipfw add 150 netgraph 200 ip from any to simplex.remote.net +.Ed +.Pp +Here +.Dq Li ttl_add +node of type +.Nm +configured to add (mode +.Dv NG_PATCH_MODE_ADD ) +a +.Va value +of 3 to a one-byte TTL field, which is 9th byte of IP packet header. +.Pp +Another example would be two consecutive modifications of packet TOS +field: say, you need to clear the +.Dv IPTOS_THROUGHPUT +bit and set the +.Dv IPTOS_MINCOST +bit. +So you do: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + mkpeer ipfw: patch 300 in + name ipfw:300 tos_chg + msg tos_chg: setconfig { count=2 csum_flags=1 ops=[ \e + { mode=7 value=0xf7 length=1 offset=1 } \e + { mode=8 value=0x02 length=1 offset=1 } ] } +SEQ +/sbin/ipfw add 160 netgraph 600 ip from any to any not dst-port 80 +.Ed +.Pp +This first does +.Dv NG_PATCH_MODE_AND +clearing the fourth bit and then +.Dv NG_PATCH_MODE_OR +setting the third bit. +.Pp +In both examples the +.Va csum_flags +field indicates that IP checksum (but not TCP or UDP checksum) should be +recalculated before transmit. +.Pp +Note: one should ensure that packets are returned to ipfw after processing +inside +.Xr netgraph 4 , +by setting appropriate +.Xr sysctl 8 +variable: +.Bd -literal -offset 4n +sysctl net.inet.ip.fw.one_pass=0 +.Ed +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_ipfw 4 , +.Xr ngctl 8 +.Sh HISTORY +The +.Nm +node type was implemented in +.Fx 8.1 . +.Sh AUTHORS +.An "Maxim Ignatenko" Aq gelraen.ua@gmail.com . +This manual page was written by +.An "Vadim Goncharov" Aq vadimnuclight@tpu.ru . +.Sh BUGS +Node blindly tries to apply every patching operation to each packet +(except those which offset if greater than length of the packet), +so be sure that you supply only the right packets to it (e.g. changing +bytes in the ARP packets meant to be in IP header could corrupt +them and make your machine unreachable from the network). +.Pp +.Em !!! WARNING !!! +.Pp +Output path of the IP stack assumes correct fields and lengths in the +packets - changing them by mistake to incorrect values can cause +unpredictable results including kernel panics. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Jun 9 12:06:08 2010 (r208945) +++ head/sys/conf/NOTES Wed Jun 9 12:25:57 2010 (r208946) @@ -706,6 +706,7 @@ options NETGRAPH_MPPC_ENCRYPTION options NETGRAPH_NETFLOW options NETGRAPH_NAT options NETGRAPH_ONE2MANY +options NETGRAPG_PATCH options NETGRAPH_PIPE options NETGRAPH_PPP options NETGRAPH_PPPOE Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jun 9 12:06:08 2010 (r208945) +++ head/sys/conf/files Wed Jun 9 12:25:57 2010 (r208946) @@ -2470,6 +2470,7 @@ netgraph/ng_mppc.c optional netgraph_mp netgraph/ng_nat.c optional netgraph_nat inet libalias netgraph/ng_one2many.c optional netgraph_one2many netgraph/ng_parse.c optional netgraph +netgraph/ng_patch.c optional netgraph_patch netgraph/ng_pipe.c optional netgraph_pipe netgraph/ng_ppp.c optional netgraph_ppp netgraph/ng_pppoe.c optional netgraph_pppoe Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jun 9 12:06:08 2010 (r208945) +++ head/sys/conf/options Wed Jun 9 12:25:57 2010 (r208946) @@ -486,6 +486,7 @@ NETGRAPH_MPPC_ENCRYPTION opt_netgraph.h NETGRAPH_NAT opt_netgraph.h NETGRAPH_NETFLOW opt_netgraph.h NETGRAPH_ONE2MANY opt_netgraph.h +NETGRAPH_PATCH opt_netgraph.h NETGRAPH_PIPE opt_netgraph.h NETGRAPH_PPP opt_netgraph.h NETGRAPH_PPPOE opt_netgraph.h Modified: head/sys/modules/netgraph/Makefile ============================================================================== --- head/sys/modules/netgraph/Makefile Wed Jun 9 12:06:08 2010 (r208945) +++ head/sys/modules/netgraph/Makefile Wed Jun 9 12:25:57 2010 (r208946) @@ -35,6 +35,7 @@ SUBDIR= async \ netflow \ netgraph \ one2many \ + patch \ pipe \ ppp \ pppoe \ Added: head/sys/modules/netgraph/patch/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/netgraph/patch/Makefile Wed Jun 9 12:25:57 2010 (r208946) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +KMOD= ng_patch +SRCS= ng_patch.c + +.include Added: head/sys/netgraph/ng_patch.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netgraph/ng_patch.c Wed Jun 9 12:25:57 2010 (r208946) @@ -0,0 +1,566 @@ +/*- + * Copyright (C) 2010 by Maxim Ignatenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include /* be64toh(), htobe64() */ +#include +#include +#include +#include + +static ng_constructor_t ng_patch_constructor; +static ng_rcvmsg_t ng_patch_rcvmsg; +static ng_shutdown_t ng_patch_shutdown; +static ng_newhook_t ng_patch_newhook; +static ng_rcvdata_t ng_patch_rcvdata; +static ng_disconnect_t ng_patch_disconnect; + +#define OFFSETOF(s, e) ((char *)&((s *)0)->e - (char *)((s *)0)) + +static int +ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, + const u_char *buf) +{ + const struct ng_patch_config *p; + + p = (const struct ng_patch_config *)(buf - + OFFSETOF(struct ng_patch_config, ops)); + return (p->count); +} + +static const struct ng_parse_struct_field ng_patch_op_type_fields[] + = NG_PATCH_OP_TYPE_INFO; +static const struct ng_parse_type ng_patch_op_type = { + &ng_parse_struct_type, + &ng_patch_op_type_fields +}; + +static const struct ng_parse_array_info ng_patch_confarr_info = { + &ng_patch_op_type, + &ng_patch_config_getlen +}; +static const struct ng_parse_type ng_patch_confarr_type = { + &ng_parse_array_type, + &ng_patch_confarr_info +}; + +static const struct ng_parse_struct_field ng_patch_config_type_fields[] + = NG_PATCH_CONFIG_TYPE_INFO; +static const struct ng_parse_type ng_patch_config_type = { + &ng_parse_struct_type, + &ng_patch_config_type_fields +}; + +static const struct ng_parse_struct_field ng_patch_stats_fields[] + = NG_PATCH_STATS_TYPE_INFO; +static const struct ng_parse_type ng_patch_stats_type = { + &ng_parse_struct_type, + &ng_patch_stats_fields +}; + +static const struct ng_cmdlist ng_patch_cmdlist[] = { + { + NGM_PATCH_COOKIE, + NGM_PATCH_GETCONFIG, + "getconfig", + NULL, + &ng_patch_config_type + }, + { + NGM_PATCH_COOKIE, + NGM_PATCH_SETCONFIG, + "setconfig", + &ng_patch_config_type, + NULL + }, + { + NGM_PATCH_COOKIE, + NGM_PATCH_GET_STATS, + "getstats", + NULL, + &ng_patch_stats_type + }, + { + NGM_PATCH_COOKIE, + NGM_PATCH_CLR_STATS, + "clrstats", + NULL, + NULL + }, + { + NGM_PATCH_COOKIE, + NGM_PATCH_GETCLR_STATS, + "getclrstats", + NULL, + &ng_patch_stats_type + }, + { 0 } +}; + +static struct ng_type typestruct = { + .version = NG_ABI_VERSION, + .name = NG_PATCH_NODE_TYPE, + .constructor = ng_patch_constructor, + .rcvmsg = ng_patch_rcvmsg, + .shutdown = ng_patch_shutdown, + .newhook = ng_patch_newhook, + .rcvdata = ng_patch_rcvdata, + .disconnect = ng_patch_disconnect, + .cmdlist = ng_patch_cmdlist, +}; +NETGRAPH_INIT(patch, &typestruct); + +union patch_val { + uint8_t v1; + uint16_t v2; + uint32_t v4; + uint64_t v8; +}; + +struct ng_patch_priv { + hook_p in; + hook_p out; + struct ng_patch_config *config; + union patch_val *val; + struct ng_patch_stats stats; +}; +typedef struct ng_patch_priv *priv_p; + +#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ + (count) * sizeof(struct ng_patch_op)) + +static void do_patch(priv_p conf, struct mbuf *m); + +static int +ng_patch_constructor(node_p node) +{ + priv_p privdata; + + privdata = malloc(sizeof(*privdata), M_NETGRAPH, M_WAIT | M_ZERO); + NG_NODE_SET_PRIVATE(node, privdata); + privdata->in = NULL; + privdata->out = NULL; + privdata->config = NULL; + return (0); +} + +static int +ng_patch_newhook(node_p node, hook_p hook, const char *name) +{ + const priv_p privp = NG_NODE_PRIVATE(node); + + if (strncmp(name, NG_PATCH_HOOK_IN, strlen(NG_PATCH_HOOK_IN)) == 0) { + privp->in = hook; + } else if (strncmp(name, NG_PATCH_HOOK_OUT, + strlen(NG_PATCH_HOOK_OUT)) == 0) { + privp->out = hook; + } else + return (EINVAL); + return(0); +} + +static int +ng_patch_rcvmsg(node_p node, item_p item, hook_p lasthook) +{ + const priv_p privp = NG_NODE_PRIVATE(node); + struct ng_patch_config *conf; + struct ng_mesg *msg; + struct ng_mesg *resp = NULL; + int i, clear = 0; + int error = 0; + + NGI_GET_MSG(item, msg); + switch (msg->header.typecookie) { + case NGM_PATCH_COOKIE: + switch (msg->header.cmd) { + case NGM_PATCH_GETCONFIG: + if (privp->config == NULL) + break; + NG_MKRESPONSE(resp, msg, + NG_PATCH_CONF_SIZE(privp->config->count), M_WAIT); + bcopy(privp->config, resp->data, + NG_PATCH_CONF_SIZE(privp->config->count)); + break; + case NGM_PATCH_SETCONFIG: + { + struct ng_patch_config *newconf; + union patch_val *newval; + + if (msg->header.arglen < sizeof(struct ng_patch_config)) { + error = EINVAL; + break; + } + + conf = (struct ng_patch_config *)msg->data; + if (msg->header.arglen < NG_PATCH_CONF_SIZE(conf->count)) { + error = EINVAL; + break; + } + + for(i = 0; i < conf->count; i++) { + switch(conf->ops[i].length) { + case 1: + case 2: + case 4: + case 8: + break; + default: + error = EINVAL; + break; + } + if (error != 0) + break; + } + + conf->csum_flags &= CSUM_IP | CSUM_TCP | CSUM_UDP | + CSUM_SCTP; + + if (error == 0) { + newconf = malloc(NG_PATCH_CONF_SIZE(conf->count), + M_NETGRAPH, M_WAIT); + newval = malloc(conf->count * sizeof(union patch_val), + M_NETGRAPH, M_WAIT); + for(i = 0; i < conf->count; i++) { + switch (conf->ops[i].length) { + case 1: + newval[i].v1 = conf->ops[i].value; + break; + case 2: + newval[i].v2 = conf->ops[i].value; + break; + case 4: + newval[i].v4 = conf->ops[i].value; + break; + case 8: + newval[i].v8 = conf->ops[i].value; + break; + } + } + bcopy(conf, newconf, NG_PATCH_CONF_SIZE(conf->count)); + if (privp->val != NULL) + free(privp->val, M_NETGRAPH); + privp->val = newval; + if (privp->config != NULL) + free(privp->config, M_NETGRAPH); + privp->config = newconf; + } + break; + } + case NGM_PATCH_GETCLR_STATS: + clear = 1; + /* FALLTHROUGH */ + case NGM_PATCH_GET_STATS: + NG_MKRESPONSE(resp, msg, sizeof(struct ng_patch_stats), + M_WAIT); + bcopy(&(privp->stats), resp->data, + sizeof(struct ng_patch_stats)); + if (clear == 0) + break; + /* else FALLTHROUGH */ + case NGM_PATCH_CLR_STATS: + bzero(&(privp->stats), sizeof(struct ng_patch_stats)); + break; + default: + error = EINVAL; + break; + } + break; + default: + error = EINVAL; + break; + } + + NG_RESPOND_MSG(error, node, item, resp); + NG_FREE_MSG(msg); + return(error); +} + +static void +do_patch(priv_p privp, struct mbuf *m) +{ + struct ng_patch_config *conf = privp->config; + uint64_t buf; + int i, patched = 0; + + for(i = 0; i < conf->count; i++) { + if (conf->ops[i].offset + conf->ops[i].length > m->m_pkthdr.len) + continue; + + /* for "=" operation we don't need to copy data from mbuf */ + if (conf->ops[i].mode != NG_PATCH_MODE_SET) { + m_copydata(m, conf->ops[i].offset, + conf->ops[i].length, (caddr_t)&buf); + } + + switch (conf->ops[i].length) { + case 1: + switch (conf->ops[i].mode) { + case NG_PATCH_MODE_SET: + *((uint8_t *)&buf) = privp->val[i].v1; + break; + case NG_PATCH_MODE_ADD: + *((uint8_t *)&buf) += privp->val[i].v1; + break; + case NG_PATCH_MODE_SUB: + *((uint8_t *)&buf) -= privp->val[i].v1; + break; + case NG_PATCH_MODE_MUL: + *((uint8_t *)&buf) *= privp->val[i].v1; + break; + case NG_PATCH_MODE_DIV: + *((uint8_t *)&buf) /= privp->val[i].v1; + break; + case NG_PATCH_MODE_NEG: + *((int8_t *)&buf) = - *((int8_t *)&buf); + break; + case NG_PATCH_MODE_AND: + *((uint8_t *)&buf) &= privp->val[i].v1; + break; + case NG_PATCH_MODE_OR: + *((uint8_t *)&buf) |= privp->val[i].v1; + break; + case NG_PATCH_MODE_XOR: + *((uint8_t *)&buf) ^= privp->val[i].v1; + break; + case NG_PATCH_MODE_SHL: + *((uint8_t *)&buf) <<= privp->val[i].v1; + break; + case NG_PATCH_MODE_SHR: + *((uint8_t *)&buf) >>= privp->val[i].v1; + break; + } + break; + case 2: + *((int16_t *)&buf) = ntohs(*((int16_t *)&buf)); + switch (conf->ops[i].mode) { + case NG_PATCH_MODE_SET: + *((uint16_t *)&buf) = privp->val[i].v2; + break; + case NG_PATCH_MODE_ADD: + *((uint16_t *)&buf) += privp->val[i].v2; + break; + case NG_PATCH_MODE_SUB: + *((uint16_t *)&buf) -= privp->val[i].v2; + break; + case NG_PATCH_MODE_MUL: + *((uint16_t *)&buf) *= privp->val[i].v2; + break; + case NG_PATCH_MODE_DIV: + *((uint16_t *)&buf) /= privp->val[i].v2; + break; + case NG_PATCH_MODE_NEG: + *((int16_t *)&buf) = - *((int16_t *)&buf); + break; + case NG_PATCH_MODE_AND: + *((uint16_t *)&buf) &= privp->val[i].v2; + break; + case NG_PATCH_MODE_OR: + *((uint16_t *)&buf) |= privp->val[i].v2; + break; + case NG_PATCH_MODE_XOR: + *((uint16_t *)&buf) ^= privp->val[i].v2; + break; + case NG_PATCH_MODE_SHL: + *((uint16_t *)&buf) <<= privp->val[i].v2; + break; + case NG_PATCH_MODE_SHR: + *((uint16_t *)&buf) >>= privp->val[i].v2; + break; + } + *((int16_t *)&buf) = htons(*((int16_t *)&buf)); + break; + case 4: + *((int32_t *)&buf) = ntohl(*((int32_t *)&buf)); + switch (conf->ops[i].mode) { + case NG_PATCH_MODE_SET: + *((uint32_t *)&buf) = privp->val[i].v4; + break; + case NG_PATCH_MODE_ADD: + *((uint32_t *)&buf) += privp->val[i].v4; + break; + case NG_PATCH_MODE_SUB: + *((uint32_t *)&buf) -= privp->val[i].v4; + break; + case NG_PATCH_MODE_MUL: + *((uint32_t *)&buf) *= privp->val[i].v4; + break; + case NG_PATCH_MODE_DIV: + *((uint32_t *)&buf) /= privp->val[i].v4; + break; + case NG_PATCH_MODE_NEG: + *((int32_t *)&buf) = - *((int32_t *)&buf); + break; + case NG_PATCH_MODE_AND: + *((uint32_t *)&buf) &= privp->val[i].v4; + break; + case NG_PATCH_MODE_OR: + *((uint32_t *)&buf) |= privp->val[i].v4; + break; + case NG_PATCH_MODE_XOR: + *((uint32_t *)&buf) ^= privp->val[i].v4; + break; + case NG_PATCH_MODE_SHL: + *((uint32_t *)&buf) <<= privp->val[i].v4; + break; + case NG_PATCH_MODE_SHR: + *((uint32_t *)&buf) >>= privp->val[i].v4; + break; + } + *((int32_t *)&buf) = htonl(*((int32_t *)&buf)); + break; + case 8: + *((int64_t *)&buf) = be64toh(*((int64_t *)&buf)); + switch (conf->ops[i].mode) { + case NG_PATCH_MODE_SET: + *((uint64_t *)&buf) = privp->val[i].v8; + break; + case NG_PATCH_MODE_ADD: + *((uint64_t *)&buf) += privp->val[i].v8; + break; + case NG_PATCH_MODE_SUB: + *((uint64_t *)&buf) -= privp->val[i].v8; + break; + case NG_PATCH_MODE_MUL: + *((uint64_t *)&buf) *= privp->val[i].v8; + break; + case NG_PATCH_MODE_DIV: + *((uint64_t *)&buf) /= privp->val[i].v8; + break; + case NG_PATCH_MODE_NEG: + *((int64_t *)&buf) = - *((int64_t *)&buf); + break; + case NG_PATCH_MODE_AND: + *((uint64_t *)&buf) &= privp->val[i].v8; + break; + case NG_PATCH_MODE_OR: + *((uint64_t *)&buf) |= privp->val[i].v8; + break; + case NG_PATCH_MODE_XOR: + *((uint64_t *)&buf) ^= privp->val[i].v8; + break; + case NG_PATCH_MODE_SHL: + *((uint64_t *)&buf) <<= privp->val[i].v8; + break; + case NG_PATCH_MODE_SHR: + *((uint64_t *)&buf) >>= privp->val[i].v8; + break; + } + *((int64_t *)&buf) = htobe64(*((int64_t *)&buf)); + break; + } + + m_copyback(m, conf->ops[i].offset, conf->ops[i].length, + (caddr_t)&buf); + patched = 1; + } + if (patched > 0) + privp->stats.patched++; +} + +static int +ng_patch_rcvdata(hook_p hook, item_p item) +{ + const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + struct mbuf *m; + hook_p target; + int error; + + priv->stats.received++; + NGI_GET_M(item, m); + if (priv->config != NULL && hook == priv->in && + (m->m_flags & M_PKTHDR) != 0) { + m = m_unshare(m,M_NOWAIT); + if (m == NULL) { + priv->stats.dropped++; + NG_FREE_ITEM(item); + return (ENOMEM); + } + do_patch(priv, m); + m->m_flags |= priv->config->csum_flags; + } + + target = NULL; + if (hook == priv->in) { + /* return frames on 'in' hook if 'out' not connected */ + if (priv->out != NULL) + target = priv->out; + else + target = priv->in; + } + if (hook == priv->out && priv->in != NULL) + target = priv->in; + + if (target == NULL) { + priv->stats.dropped++; + NG_FREE_ITEM(item); + NG_FREE_M(m); + return (0); + } + NG_FWD_NEW_DATA(error, item, target, m); + return (error); +} + +static int +ng_patch_shutdown(node_p node) +{ + const priv_p privdata = NG_NODE_PRIVATE(node); + + if (privdata->val != NULL) + free(privdata->val, M_NETGRAPH); + if (privdata->config != NULL) + free(privdata->config, M_NETGRAPH); + NG_NODE_SET_PRIVATE(node, NULL); + NG_NODE_UNREF(node); + free(privdata, M_NETGRAPH); + return (0); +} + +static int +ng_patch_disconnect(hook_p hook) +{ + priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + + if (hook == priv->in) { + priv->in = NULL; + } + if (hook == priv->out) { + priv->out = NULL; + } + if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) + && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) /* already shutting down? */ + ng_rmnode_self(NG_HOOK_NODE(hook)); + return (0); +} + Added: head/sys/netgraph/ng_patch.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netgraph/ng_patch.h Wed Jun 9 12:25:57 2010 (r208946) @@ -0,0 +1,107 @@ +/*- + * Copyright (C) 2010 by Maxim Ignatenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_NG_PATCH_H_ +#define _NETGRAPH_NG_PATCH_H_ + +/* Node type name. */ +#define NG_PATCH_NODE_TYPE "patch" + +/* Node type cookie. */ +#define NGM_PATCH_COOKIE 1262445509 + +/* Hook names */ +#define NG_PATCH_HOOK_IN "in" +#define NG_PATCH_HOOK_OUT "out" + +/* Netgraph commands understood by this node type */ +enum { + NGM_PATCH_SETCONFIG = 1, + NGM_PATCH_GETCONFIG, + NGM_PATCH_GET_STATS, + NGM_PATCH_CLR_STATS, + NGM_PATCH_GETCLR_STATS +}; + +/* Patching modes */ +enum { + NG_PATCH_MODE_SET = 1, + NG_PATCH_MODE_ADD = 2, + NG_PATCH_MODE_SUB = 3, + NG_PATCH_MODE_MUL = 4, + NG_PATCH_MODE_DIV = 5, + NG_PATCH_MODE_NEG = 6, + NG_PATCH_MODE_AND = 7, + NG_PATCH_MODE_OR = 8, + NG_PATCH_MODE_XOR = 9, + NG_PATCH_MODE_SHL = 10, + NG_PATCH_MODE_SHR = 11 +}; + +struct ng_patch_op { + uint64_t value; + uint32_t offset; + uint16_t length; /* 1,2,4 or 8 (bytes) */ + uint16_t mode; +}; + +#define NG_PATCH_OP_TYPE_INFO { \ + { "value", &ng_parse_uint64_type }, \ + { "offset", &ng_parse_uint32_type }, \ + { "length", &ng_parse_uint16_type }, \ + { "mode", &ng_parse_uint16_type }, \ + { NULL } \ +} + +struct ng_patch_config { + uint32_t count; + uint32_t csum_flags; + struct ng_patch_op ops[]; +}; + +#define NG_PATCH_CONFIG_TYPE_INFO { \ + { "count", &ng_parse_uint32_type }, \ + { "csum_flags", &ng_parse_uint32_type }, \ + { "ops", &ng_patch_confarr_type }, \ + { NULL } \ +} + +struct ng_patch_stats { + uint64_t received; + uint64_t patched; + uint64_t dropped; +}; + +#define NG_PATCH_STATS_TYPE_INFO { \ + { "received", &ng_parse_uint64_type }, \ + { "patched", &ng_parse_uint64_type }, \ + { "dropped", &ng_parse_uint64_type }, \ + { NULL } \ +} + +#endif /* _NETGRAPH_NG_PATCH_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 12:30:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86A68106567F; Wed, 9 Jun 2010 12:30:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76EBD8FC14; Wed, 9 Jun 2010 12:30:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59CUe7V021960; Wed, 9 Jun 2010 12:30:40 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59CUels021958; Wed, 9 Jun 2010 12:30:40 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006091230.o59CUels021958@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 9 Jun 2010 12:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208947 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 12:30:40 -0000 Author: ae Date: Wed Jun 9 12:30:40 2010 New Revision: 208947 URL: http://svn.freebsd.org/changeset/base/208947 Log: Fix typo. Approved by: mav (mentor) MFC after: 1 month Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Jun 9 12:25:57 2010 (r208946) +++ head/sys/conf/NOTES Wed Jun 9 12:30:40 2010 (r208947) @@ -706,7 +706,7 @@ options NETGRAPH_MPPC_ENCRYPTION options NETGRAPH_NETFLOW options NETGRAPH_NAT options NETGRAPH_ONE2MANY -options NETGRAPG_PATCH +options NETGRAPH_PATCH options NETGRAPH_PIPE options NETGRAPH_PPP options NETGRAPH_PPPOE From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 12:44:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0329D106564A; Wed, 9 Jun 2010 12:44:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B248F8FC13; Wed, 9 Jun 2010 12:44:44 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6493946B98; Wed, 9 Jun 2010 08:44:44 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 67B138A025; Wed, 9 Jun 2010 08:44:43 -0400 (EDT) From: John Baldwin To: "M. Warner Losh" Date: Wed, 9 Jun 2010 08:03:21 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006081446.09423.jhb@freebsd.org> <201006081725.24684.jhb@freebsd.org> <20100608.163930.769051484062774012.imp@bsdimp.com> In-Reply-To: <20100608.163930.769051484062774012.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006090803.21947.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 09 Jun 2010 08:44:43 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208921 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 12:44:45 -0000 On Tuesday 08 June 2010 6:39:30 pm M. Warner Losh wrote: > In message: <201006081725.24684.jhb@freebsd.org> > John Baldwin writes: > : On Tuesday 08 June 2010 3:22:10 pm M. Warner Losh wrote: > : > In message: <201006081446.09423.jhb@freebsd.org> > : > John Baldwin writes: > : > : On Tuesday 08 June 2010 2:04:07 pm John Baldwin wrote: > : > : > Author: jhb > : > : > Date: Tue Jun 8 18:04:07 2010 > : > : > New Revision: 208921 > : > : > URL: http://svn.freebsd.org/changeset/base/208921 > : > : > > : > : > Log: > : > : > Move the machine check support code to the x86 tree since it is > : identical > : > : > on i386 and amd64. > : > : > > : > : > Requested by: alc > : > : > : > : It would be nice to consolidate as that is identical on > : both > : > : platforms, but that moving to x86/include is trickier as the header needs > : to > : > : be available in userland, probably as still. > : > : would work ok (i.e. in /usr/include/x86/mca.h), but that makes things > : trickier > : > : in the kernel as the file should really live in sys/x86/include, not > : sys/x86 > : > : directly. > : > : > : > : I'm open to suggestions on if this is feasible and if so how to do it. > : > > : > I believe we had a long talk about this before. > : > > : > copy the current {i386,amd64}/mca.h to x86/mca.h > : > new {i386,amd64}/mca.h == #include (no copyright notice, etc) > : > > : > just like we do for the pc98 stuff. The mca.h file would live in > : > sys/x86/include. > : > : How does this work for the kernel? doesn't map to > : sys/x86/include/mca.h. > > You still include macine/mca.h inside the kernel, except for mca.c > itself. You shouldn't short-circuit things because you know an > implementation detail. I was asking how the actual contents would work since it would #include which only works if you have some sort of x86 symlink. :) > : For machine we make a symlink that points to > : sys//include. Are you proposing an x86 symlink in the kernel build > : directory that for i386, pc98, and amd64 that points to sys/x86/include? > > Yes. > > : Ah, looks like you are. This is handled by _ILINKS in kern.post.mk currently. > : If you will fix all the glue magic so #include works in kernel and > : userland I have several headers I can move (apicreg.h, mca.h, etc.). > > I believe this is correct... > > But a lot of it is dependent on the merge of tbemd branch, which is > still at least a week away. Can you wait that long? Yes, I can wait for quite a while. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 14:21:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E5F41065670; Wed, 9 Jun 2010 14:21:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 325E68FC1F; Wed, 9 Jun 2010 14:21:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o59EFNAr022514; Wed, 9 Jun 2010 08:15:23 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 09 Jun 2010 08:15:24 -0600 (MDT) Message-Id: <20100609.081524.287595822797354295.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <201006090803.21947.jhb@freebsd.org> References: <201006081725.24684.jhb@freebsd.org> <20100608.163930.769051484062774012.imp@bsdimp.com> <201006090803.21947.jhb@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208921 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 14:21:43 -0000 In message: <201006090803.21947.jhb@freebsd.org> John Baldwin writes: : On Tuesday 08 June 2010 6:39:30 pm M. Warner Losh wrote: : > In message: <201006081725.24684.jhb@freebsd.org> : > John Baldwin writes: : > : On Tuesday 08 June 2010 3:22:10 pm M. Warner Losh wrote: : > : > In message: <201006081446.09423.jhb@freebsd.org> : > : > John Baldwin writes: : > : > : On Tuesday 08 June 2010 2:04:07 pm John Baldwin wrote: : > : > : > Author: jhb : > : > : > Date: Tue Jun 8 18:04:07 2010 : > : > : > New Revision: 208921 : > : > : > URL: http://svn.freebsd.org/changeset/base/208921 : > : > : > : > : > : > Log: : > : > : > Move the machine check support code to the x86 tree since it is : > : identical : > : > : > on i386 and amd64. : > : > : > : > : > : > Requested by: alc : > : > : : > : > : It would be nice to consolidate as that is identical on : > : both : > : > : platforms, but that moving to x86/include is trickier as the header needs : > : to : > : > : be available in userland, probably as still. : > : > : would work ok (i.e. in /usr/include/x86/mca.h), but that makes things : > : trickier : > : > : in the kernel as the file should really live in sys/x86/include, not : > : sys/x86 : > : > : directly. : > : > : : > : > : I'm open to suggestions on if this is feasible and if so how to do it. : > : > : > : > I believe we had a long talk about this before. : > : > : > : > copy the current {i386,amd64}/mca.h to x86/mca.h : > : > new {i386,amd64}/mca.h == #include (no copyright notice, etc) : > : > : > : > just like we do for the pc98 stuff. The mca.h file would live in : > : > sys/x86/include. : > : : > : How does this work for the kernel? doesn't map to : > : sys/x86/include/mca.h. : > : > You still include macine/mca.h inside the kernel, except for mca.c : > itself. You shouldn't short-circuit things because you know an : > implementation detail. : : I was asking how the actual contents would work since it : would #include which only works if you have some sort of x86 : symlink. :) Yes. You've surmised how this is going to work. : > : For machine we make a symlink that points to : > : sys//include. Are you proposing an x86 symlink in the kernel build : > : directory that for i386, pc98, and amd64 that points to sys/x86/include? : > : > Yes. : > : > : Ah, looks like you are. This is handled by _ILINKS in kern.post.mk currently. : > : If you will fix all the glue magic so #include works in kernel and : > : userland I have several headers I can move (apicreg.h, mca.h, etc.). : > : > I believe this is correct... : > : > But a lot of it is dependent on the merge of tbemd branch, which is : > still at least a week away. Can you wait that long? : : Yes, I can wait for quite a while. cool. Warner From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 14:30:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17100106566B; Wed, 9 Jun 2010 14:30:22 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0572E8FC18; Wed, 9 Jun 2010 14:30:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59EUL0P049543; Wed, 9 Jun 2010 14:30:21 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59EULvZ049540; Wed, 9 Jun 2010 14:30:21 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006091430.o59EULvZ049540@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 9 Jun 2010 14:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208948 - stable/8/sbin/fsirand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 14:30:22 -0000 Author: uqs Date: Wed Jun 9 14:30:21 2010 New Revision: 208948 URL: http://svn.freebsd.org/changeset/base/208948 Log: MFC r208074: fsirand(8): make WARNS=3 clean - Drop bogus quad_t cast for di_gen, it is a 32bit type - Print di_gen with leading zeros, to get consistent output Approved by: re (kib) Modified: stable/8/sbin/fsirand/Makefile stable/8/sbin/fsirand/fsirand.c Directory Properties: stable/8/sbin/fsirand/ (props changed) Modified: stable/8/sbin/fsirand/Makefile ============================================================================== --- stable/8/sbin/fsirand/Makefile Wed Jun 9 12:30:40 2010 (r208947) +++ stable/8/sbin/fsirand/Makefile Wed Jun 9 14:30:21 2010 (r208948) @@ -2,8 +2,8 @@ # $FreeBSD$ PROG= fsirand -WARNS?= 0 MAN= fsirand.8 +WARNS?= 3 DPADD= ${LIBUTIL} LDADD= -lutil Modified: stable/8/sbin/fsirand/fsirand.c ============================================================================== --- stable/8/sbin/fsirand/fsirand.c Wed Jun 9 12:30:40 2010 (r208947) +++ stable/8/sbin/fsirand/fsirand.c Wed Jun 9 14:30:21 2010 (r208948) @@ -47,6 +47,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -112,7 +113,7 @@ fsirand(char *device) struct ufs1_dinode *dp1; struct ufs2_dinode *dp2; caddr_t inodebuf; - size_t ibufsize; + ssize_t ibufsize; struct fs *sblock; ino_t inumber, maxino; ufs2_daddr_t sblockloc, dblk; @@ -135,14 +136,17 @@ fsirand(char *device) bsize = label.d_secsize; } + dp1 = NULL; + dp2 = NULL; + /* Read in master superblock */ (void)memset(&sbuf, 0, sizeof(sbuf)); sblock = (struct fs *)&sbuf; for (i = 0; sblock_try[i] != -1; i++) { sblockloc = sblock_try[i]; if (lseek(devfd, sblockloc, SEEK_SET) == -1) { - warn("can't seek to superblock (%qd) on %s", - sblockloc, device); + warn("can't seek to superblock (%jd) on %s", + (intmax_t)sblockloc, device); return (1); } if ((n = read(devfd, (void *)sblock, SBLOCKSIZE))!=SBLOCKSIZE) { @@ -154,7 +158,7 @@ fsirand(char *device) (sblock->fs_magic == FS_UFS2_MAGIC && sblock->fs_sblockloc == sblock_try[i])) && sblock->fs_bsize <= MAXBSIZE && - sblock->fs_bsize >= sizeof(struct fs)) + sblock->fs_bsize >= (ssize_t)sizeof(struct fs)) break; } if (sblock_try[i] == -1) { @@ -175,10 +179,10 @@ fsirand(char *device) /* Make sure backup superblocks are sane. */ sblock = (struct fs *)&sbuftmp; - for (cg = 0; cg < sblock->fs_ncg; cg++) { + for (cg = 0; cg < (int)sblock->fs_ncg; cg++) { dblk = fsbtodb(sblock, cgsblock(sblock, cg)); if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { - warn("can't seek to %qd", (off_t)dblk * bsize); + warn("can't seek to %jd", (intmax_t)dblk * bsize); return (1); } else if ((n = write(devfd, (void *)sblock, SBLOCKSIZE)) != SBLOCKSIZE) { warn("can't read backup superblock %d on %s: %s", @@ -211,7 +215,7 @@ fsirand(char *device) if (printonly && (sblock->fs_id[0] || sblock->fs_id[1])) { if (sblock->fs_id[0]) (void)printf("%s was randomized on %s", device, - ctime((const time_t *)&(sblock->fs_id[0]))); + ctime((void *)&(sblock->fs_id[0]))); (void)printf("fsid: %x %x\n", sblock->fs_id[0], sblock->fs_id[1]); } @@ -223,8 +227,8 @@ fsirand(char *device) sblock->fs_id[1] = random(); if (lseek(devfd, sblockloc, SEEK_SET) == -1) { - warn("can't seek to superblock (%qd) on %s", sblockloc, - device); + warn("can't seek to superblock (%jd) on %s", + (intmax_t)sblockloc, device); return (1); } if ((n = write(devfd, (void *)sblock, SBLOCKSIZE)) != @@ -236,12 +240,13 @@ fsirand(char *device) } /* For each cylinder group, randomize inodes and update backup sblock */ - for (cg = 0, inumber = 0; cg < sblock->fs_ncg; cg++) { + for (cg = 0, inumber = 0; cg < (int)sblock->fs_ncg; cg++) { /* Update superblock if appropriate */ if (!printonly) { dblk = fsbtodb(sblock, cgsblock(sblock, cg)); if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { - warn("can't seek to %qd", (off_t)dblk * bsize); + warn("can't seek to %jd", + (intmax_t)dblk * bsize); return (1); } else if ((n = write(devfd, (void *)sblock, SBLOCKSIZE)) != SBLOCKSIZE) { @@ -255,7 +260,7 @@ fsirand(char *device) /* Read in inodes, then print or randomize generation nums */ dblk = fsbtodb(sblock, ino_to_fsba(sblock, inumber)); if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { - warn("can't seek to %qd", (off_t)dblk * bsize); + warn("can't seek to %jd", (intmax_t)dblk * bsize); return (1); } else if ((n = read(devfd, inodebuf, ibufsize)) != ibufsize) { warnx("can't read inodes: %s", @@ -263,17 +268,17 @@ fsirand(char *device) return (1); } - for (n = 0; n < sblock->fs_ipg; n++, inumber++) { + for (n = 0; n < (int)sblock->fs_ipg; n++, inumber++) { if (sblock->fs_magic == FS_UFS1_MAGIC) dp1 = &((struct ufs1_dinode *)inodebuf)[n]; else dp2 = &((struct ufs2_dinode *)inodebuf)[n]; if (inumber >= ROOTINO) { if (printonly) - (void)printf("ino %d gen %qx\n", + (void)printf("ino %d gen %08x\n", inumber, sblock->fs_magic == FS_UFS1_MAGIC ? - (quad_t)dp1->di_gen : dp2->di_gen); + dp1->di_gen : dp2->di_gen); else if (sblock->fs_magic == FS_UFS1_MAGIC) dp1->di_gen = random(); else @@ -284,8 +289,8 @@ fsirand(char *device) /* Write out modified inodes */ if (!printonly) { if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { - warn("can't seek to %qd", - (off_t)dblk * bsize); + warn("can't seek to %jd", + (intmax_t)dblk * bsize); return (1); } else if ((n = write(devfd, inodebuf, ibufsize)) != ibufsize) { From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 14:31:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D357106566C; Wed, 9 Jun 2010 14:31:12 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9C08FC29; Wed, 9 Jun 2010 14:31:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59EVCQX049773; Wed, 9 Jun 2010 14:31:12 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59EVC2N049771; Wed, 9 Jun 2010 14:31:12 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006091431.o59EVC2N049771@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 9 Jun 2010 14:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208949 - stable/8/contrib/gdtoa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 14:31:12 -0000 Author: uqs Date: Wed Jun 9 14:31:11 2010 New Revision: 208949 URL: http://svn.freebsd.org/changeset/base/208949 Log: MFC r208753: Add required header for isalnum(3) to quench compiler warnings Forgotten in: r174678 Submitted by: Alexander Best alexbestms at wwu.de Approved by: das Approved by: re (kib) Modified: stable/8/contrib/gdtoa/hexnan.c Directory Properties: stable/8/contrib/gdtoa/ (props changed) Modified: stable/8/contrib/gdtoa/hexnan.c ============================================================================== --- stable/8/contrib/gdtoa/hexnan.c Wed Jun 9 14:30:21 2010 (r208948) +++ stable/8/contrib/gdtoa/hexnan.c Wed Jun 9 14:31:11 2010 (r208949) @@ -31,6 +31,8 @@ THIS SOFTWARE. /* $FreeBSD$ */ +#include + #include "gdtoaimp.h" static void From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 14:54:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 510851065678; Wed, 9 Jun 2010 14:54:06 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26D0B8FC13; Wed, 9 Jun 2010 14:54:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59Es6OG054846; Wed, 9 Jun 2010 14:54:06 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59Es6jW054844; Wed, 9 Jun 2010 14:54:06 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201006091454.o59Es6jW054844@svn.freebsd.org> From: Attilio Rao Date: Wed, 9 Jun 2010 14:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208950 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 14:54:06 -0000 Author: attilio Date: Wed Jun 9 14:54:05 2010 New Revision: 208950 URL: http://svn.freebsd.org/changeset/base/208950 Log: MFC r208771: Improve wording and fix style. Sponsored by: Sandvine Incorporated Approved by: re (bz) Modified: stable/8/share/man/man4/io.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/io.4 ============================================================================== --- stable/8/share/man/man4/io.4 Wed Jun 9 14:31:11 2010 (r208949) +++ stable/8/share/man/man4/io.4 Wed Jun 9 14:54:05 2010 (r208950) @@ -72,22 +72,25 @@ all of them. The .Dv IODEV_PIO is used by all the architectures in order to request that an I/O operation -be performed. It takes a 'struct iodev_pio_req' argument -that must be previously setup. +be performed. +It takes a 'struct iodev_pio_req' argument that must be previously setup. .Pp The .Fa access -member specifies the type of operation requested. It may be: +member specifies the type of operation requested. +It may be: .Bl -tag -width IODEV_PIO_WRITE .It Dv IODEV_PIO_READ -The operation is an "in" type. A value will be read from the specified port +The operation is an "in" type. +A value will be read from the specified port (retrieved from the .Fa port member) and the result will be stored in the .Fa val member. .It Dv IODEV_PIO_WRITE -The operation is a "out" type. The value will be fetched from the +The operation is a "out" type. +The value will be fetched from the .Fa val member and will be written out to the specified port (defined as the .Fa port @@ -105,13 +108,14 @@ the kernel enforces that only the super- .Sh LEGACY The .Pa /dev/io -interface used to be very i386 specific and worked differently. The initial -implementation, in fact, simply raised the +interface used to be very i386 specific and worked differently. +The initial implementation simply raised the .Em IOPL of the current thread when .Xr open 2 -was called on the file. This behaviour is retained in the current -implementation as legacy support for both i386 and amd64 architectures. +was called on the device. +This behaviour is retained in the current implementation as legacy +support for both i386 and amd64 architectures. .Sh SEE ALSO .Xr close 2 , .Xr i386_get_ioperm 2 , From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 15:29:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AF671065675; Wed, 9 Jun 2010 15:29:13 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AC438FC25; Wed, 9 Jun 2010 15:29:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59FTCwR062587; Wed, 9 Jun 2010 15:29:12 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59FTCP3062583; Wed, 9 Jun 2010 15:29:12 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201006091529.o59FTCP3062583@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 9 Jun 2010 15:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208951 - head/sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 15:29:13 -0000 Author: jh Date: Wed Jun 9 15:29:12 2010 New Revision: 208951 URL: http://svn.freebsd.org/changeset/base/208951 Log: Add a new function devfs_parent_dirent() for resolving devfs parent directory entry. Use the new function in devfs_fqpn(), devfs_lookupx() and devfs_vptocnp() instead of manually resolving the parent entry. Reviewed by: kib Modified: head/sys/fs/devfs/devfs.h head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs.h ============================================================================== --- head/sys/fs/devfs/devfs.h Wed Jun 9 14:54:05 2010 (r208950) +++ head/sys/fs/devfs/devfs.h Wed Jun 9 15:29:12 2010 (r208951) @@ -180,6 +180,7 @@ void devfs_populate (struct devfs_mount void devfs_cleanup (struct devfs_mount *dm); void devfs_unmount_final(struct devfs_mount *mp); struct devfs_dirent *devfs_newdirent (char *name, int namelen); +struct devfs_dirent *devfs_parent_dirent(struct devfs_dirent *de); struct devfs_dirent *devfs_vmkdir (struct devfs_mount *, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode); struct devfs_dirent *devfs_find (struct devfs_dirent *dd, const char *name, int namelen); Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Wed Jun 9 14:54:05 2010 (r208950) +++ head/sys/fs/devfs/devfs_devs.c Wed Jun 9 15:29:12 2010 (r208951) @@ -198,6 +198,26 @@ devfs_newdirent(char *name, int namelen) } struct devfs_dirent * +devfs_parent_dirent(struct devfs_dirent *de) +{ + + if (de->de_dirent->d_type != DT_DIR) + return (de->de_dir); + + if (de->de_flags & (DE_DOT | DE_DOTDOT)) + return (NULL); + + de = TAILQ_FIRST(&de->de_dlist); /* "." */ + if (de == NULL) + return (NULL); + de = TAILQ_NEXT(de, de_list); /* ".." */ + if (de == NULL) + return (NULL); + + return (de->de_dir); +} + +struct devfs_dirent * devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode) { struct devfs_dirent *dd; Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Jun 9 14:54:05 2010 (r208950) +++ head/sys/fs/devfs/devfs_vnops.c Wed Jun 9 15:29:12 2010 (r208951) @@ -230,9 +230,11 @@ devfs_vptocnp(struct vop_vptocnp_args *a goto finished; } *buflen = i; - de = TAILQ_FIRST(&de->de_dlist); /* "." */ - de = TAILQ_NEXT(de, de_list); /* ".." */ - de = de->de_dir; + de = devfs_parent_dirent(de); + if (de == NULL) { + error = ENOENT; + goto finished; + } mtx_lock(&devfs_de_interlock); *dvp = de->de_vnode; if (*dvp != NULL) { @@ -278,9 +280,9 @@ devfs_fqpn(char *buf, struct vnode *dvp, return (NULL); bcopy(de->de_dirent->d_name, buf + i, de->de_dirent->d_namlen); - de = TAILQ_FIRST(&de->de_dlist); /* "." */ - de = TAILQ_NEXT(de, de_list); /* ".." */ - de = de->de_dir; + de = devfs_parent_dirent(de); + if (de == NULL) + return (NULL); } return (buf + i); } @@ -789,10 +791,10 @@ devfs_lookupx(struct vop_lookup_args *ap if (flags & ISDOTDOT) { if ((flags & ISLASTCN) && nameiop != LOOKUP) return (EINVAL); + de = devfs_parent_dirent(dd); + if (de == NULL) + return (ENOENT); VOP_UNLOCK(dvp, 0); - de = TAILQ_FIRST(&dd->de_dlist); /* "." */ - de = TAILQ_NEXT(de, de_list); /* ".." */ - de = de->de_dir; error = devfs_allocv(de, dvp->v_mount, vpp); *dm_unlock = 0; vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 16:39:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEB9F1065679; Wed, 9 Jun 2010 16:39:18 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEC2E8FC25; Wed, 9 Jun 2010 16:39:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59GdI7Z078004; Wed, 9 Jun 2010 16:39:18 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59GdIwE078003; Wed, 9 Jun 2010 16:39:18 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006091639.o59GdIwE078003@svn.freebsd.org> From: Randall Stewart Date: Wed, 9 Jun 2010 16:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208952 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 16:39:18 -0000 Author: rrs Date: Wed Jun 9 16:39:18 2010 New Revision: 208952 URL: http://svn.freebsd.org/changeset/base/208952 Log: BUG:Turns out we need to use both bit maps to calculate the cum-ack (we were not doing it for the NR-Sack case). With this fix NR-sack should now work correctly. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Jun 9 15:29:12 2010 (r208951) +++ head/sys/netinet/sctp_indata.c Wed Jun 9 16:39:18 2010 (r208952) @@ -2267,7 +2267,6 @@ sctp_slide_mapping_arrays(struct sctp_tc uint8_t val; int slide_from, slide_end, lgap, distance; uint32_t old_cumack, old_base, old_highest, highest_tsn; - int type; asoc = &stcb->asoc; at = 0; @@ -2279,18 +2278,9 @@ sctp_slide_mapping_arrays(struct sctp_tc * We could probably improve this a small bit by calculating the * offset of the current cum-ack as the starting point. */ - if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && - stcb->asoc.peer_supports_nr_sack) { - type = SCTP_NR_SELECTIVE_ACK; - } else { - type = SCTP_SELECTIVE_ACK; - } at = 0; for (slide_from = 0; slide_from < stcb->asoc.mapping_array_size; slide_from++) { - if (type == SCTP_NR_SELECTIVE_ACK) - val = asoc->nr_mapping_array[slide_from]; - else - val = asoc->nr_mapping_array[slide_from] | asoc->mapping_array[slide_from]; + val = asoc->nr_mapping_array[slide_from] | asoc->mapping_array[slide_from]; if (val == 0xff) { at += 8; } else { From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 16:42:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9558F1065676; Wed, 9 Jun 2010 16:42:42 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8511C8FC12; Wed, 9 Jun 2010 16:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59GggVf078789; Wed, 9 Jun 2010 16:42:42 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59Ggg0u078786; Wed, 9 Jun 2010 16:42:42 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006091642.o59Ggg0u078786@svn.freebsd.org> From: Randall Stewart Date: Wed, 9 Jun 2010 16:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208953 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 16:42:42 -0000 Author: rrs Date: Wed Jun 9 16:42:42 2010 New Revision: 208953 URL: http://svn.freebsd.org/changeset/base/208953 Log: Fix serveral bugs all having to do with freeing an sctp_inpcb: 1) Make sure not to remove the flag on the PCB until after the close() caller is back in control with the lock. Otherwise a quickly freeing assoc could kill the inpcb and cause a panic. 2) Make sure all calls to log_closing have not released the locks before calling the log function, we don't want the logging function to crash us due to a freed inpcb. 3) Make sure that when we get to the end, we release all locks (after removing them from view) and as long as we are NOT the inp-kill timer removing the inp, call the callout_drain() function so a racing timer won't later call in and cause a racing crash. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Jun 9 16:39:18 2010 (r208952) +++ head/sys/netinet/sctp_pcb.c Wed Jun 9 16:42:42 2010 (r208953) @@ -3114,12 +3114,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, * via the sockets layer. */ SCTP_ITERATOR_LOCK(); - inp->sctp_flags &= ~SCTP_PCB_FLAGS_CLOSE_IP; - /* socket is gone, so no more wakeups allowed */ - inp->sctp_flags |= SCTP_PCB_FLAGS_DONT_WAKE; - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEINPUT; - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEOUTPUT; - /* mark any iterators on the list or being processed */ sctp_iterator_inp_being_freed(inp); SCTP_ITERATOR_UNLOCK(); @@ -3137,6 +3131,14 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(inp); + if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { + inp->sctp_flags &= ~SCTP_PCB_FLAGS_CLOSE_IP; + /* socket is gone, so no more wakeups allowed */ + inp->sctp_flags |= SCTP_PCB_FLAGS_DONT_WAKE; + inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEINPUT; + inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEOUTPUT; + + } /* First time through we have the socket lock, after that no more. */ sctp_timer_stop(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL, SCTP_FROM_SCTP_PCB + SCTP_LOC_1); @@ -3334,13 +3336,13 @@ sctp_inpcb_free(struct sctp_inpcb *inp, } /* now is there some left in our SHUTDOWN state? */ if (cnt_in_sd) { - SCTP_INP_WUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 2); #endif inp->sctp_socket = NULL; + SCTP_INP_WUNLOCK(inp); + SCTP_ASOC_CREATE_UNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); return; } } @@ -3415,12 +3417,12 @@ sctp_inpcb_free(struct sctp_inpcb *inp, if (cnt) { /* Ok we have someone out there that will kill us */ (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); - SCTP_INP_WUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 3); #endif + SCTP_INP_WUNLOCK(inp); + SCTP_ASOC_CREATE_UNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); return; } if (SCTP_INP_LOCK_CONTENDED(inp)) @@ -3434,26 +3436,43 @@ sctp_inpcb_free(struct sctp_inpcb *inp, (being_refed) || (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP)) { (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); +#ifdef SCTP_LOG_CLOSING + sctp_log_closing(inp, NULL, 4); +#endif sctp_timer_start(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL); SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); -#ifdef SCTP_LOG_CLOSING - sctp_log_closing(inp, NULL, 4); -#endif return; } - (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); inp->sctp_ep.signature_change.type = 0; inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_ALLGONE; + /* + * Remove it from the list .. last thing we need a lock for. + */ + LIST_REMOVE(inp, sctp_list); + SCTP_INP_WUNLOCK(inp); + SCTP_ASOC_CREATE_UNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); + /* + * Now we release all locks. Since this INP cannot be found anymore + * except possbily by the kill timer that might be running. We call + * the drain function here. It should hit the case were it sees the + * ACTIVE flag cleared and exit out freeing us to proceed and + * destroy everything. + */ + if (from != SCTP_CALLED_FROM_INPKILL_TIMER) { + (void)SCTP_OS_TIMER_STOP_DRAIN(&inp->sctp_ep.signature_change.timer); + } else { + /* Probably un-needed */ + (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); + } #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 5); #endif - (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); - inp->sctp_ep.signature_change.type = SCTP_TIMER_TYPE_NONE; - /* Clear the read queue */ + if ((inp->sctp_asocidhash) != NULL) { SCTP_HASH_FREE(inp->sctp_asocidhash, inp->hashasocidmark); inp->sctp_asocidhash = NULL; @@ -3524,8 +3543,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, shared_key = LIST_FIRST(&inp->sctp_ep.shared_keys); } - LIST_REMOVE(inp, sctp_list); - /* * if we have an address list the following will free the list of * ifaddr's that are set into this ep. Again macro limitations here, @@ -3558,7 +3575,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_LOCK_DESTROY(inp); SCTP_INP_READ_DESTROY(inp); SCTP_ASOC_CREATE_LOCK_DESTROY(inp); - SCTP_INP_INFO_WUNLOCK(); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_DECR_EP_COUNT(); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 17:59:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53600106566B; Wed, 9 Jun 2010 17:59:53 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41B898FC22; Wed, 9 Jun 2010 17:59:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59HxrVQ096804; Wed, 9 Jun 2010 17:59:53 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59HxrJw096803; Wed, 9 Jun 2010 17:59:53 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006091759.o59HxrJw096803@svn.freebsd.org> From: Roman Divacky Date: Wed, 9 Jun 2010 17:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208954 - in head/contrib/llvm: . docs test tools/clang tools/clang/docs tools/clang/test website X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 17:59:53 -0000 Author: rdivacky Date: Wed Jun 9 17:59:52 2010 New Revision: 208954 URL: http://svn.freebsd.org/changeset/base/208954 Log: Import LLVM/clang from vendor stripped of docs/ test/ website/ www/ examples/ in llvm/ and/or llvm/contrib/clang/ respectively. Approved by: ed (mentor) Approved by: core Added: head/contrib/llvm/ - copied from r208953, vendor/llvm/dist/ head/contrib/llvm/tools/clang/ - copied from r208953, vendor/clang/dist/ Deleted: head/contrib/llvm/docs/ head/contrib/llvm/test/ head/contrib/llvm/tools/clang/docs/ head/contrib/llvm/tools/clang/test/ head/contrib/llvm/website/ From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 18:11:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F2BC1065670; Wed, 9 Jun 2010 18:11:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64F5E8FC18; Wed, 9 Jun 2010 18:11:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59IBDOp099570; Wed, 9 Jun 2010 18:11:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59IBDAO099569; Wed, 9 Jun 2010 18:11:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006091811.o59IBDAO099569@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Jun 2010 18:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208955 - in head/contrib/llvm: examples tools/clang/examples tools/clang/www X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 18:11:13 -0000 Author: ed Date: Wed Jun 9 18:11:12 2010 New Revision: 208955 URL: http://svn.freebsd.org/changeset/base/208955 Log: Remove unneeded directories. Even though Roman removed these directories in his working copy, they weren't removed from the actual repository, also causing his working copy to be corrupted. Deleted: head/contrib/llvm/examples/ head/contrib/llvm/tools/clang/examples/ head/contrib/llvm/tools/clang/www/ From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 18:46:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 523801065670; Wed, 9 Jun 2010 18:46:29 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD7E8FC19; Wed, 9 Jun 2010 18:46:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59IkTGp008041; Wed, 9 Jun 2010 18:46:29 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59IkT5m008040; Wed, 9 Jun 2010 18:46:29 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006091846.o59IkT5m008040@svn.freebsd.org> From: Matt Jacob Date: Wed, 9 Jun 2010 18:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208956 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci geom/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 18:46:29 -0000 Author: mjacob Date: Wed Jun 9 18:46:28 2010 New Revision: 208956 URL: http://svn.freebsd.org/changeset/base/208956 Log: Record merge for r198262 (done in r208894) Approved by: re (bz) Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 18:50:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18B57106566B; Wed, 9 Jun 2010 18:50:39 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5FBF08FC2D; Wed, 9 Jun 2010 18:50:37 +0000 (UTC) Received: by pvb32 with SMTP id 32so677539pvb.13 for ; Wed, 09 Jun 2010 11:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ERcWIOFk8Yw75C4xbikeShr91uYzrbOxi7obeg5tQPg=; b=VQ7mVSFddbHc3/HDMLvZFT3FnXNNQw3Sv4oWEuVRZm+e73daT7aFiJnu2qg0KAtdkX wcOHW7NEtDq7VTlKMv3dg+N2zakKIlnPPSA3rZkemxCKA9HGD0F5CzcAlnB4KyaRDTjF 6rgKxH8aJSs3tvrV3NeQh14X1GulvNtB8vaA8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=G4J/rVwB5X5nL816yGkv2yma2L2SRnze3LS0KnL6YgQEWYNpuwlG+skV1V/ucO8eo8 u9Si7BsqYxFgt+WRfgjSC9ckPJSbVFqEB3CoqCCIurOBR7EyakEmeuOIAGlNcqAf1hrg V1muqot8Q/Fyt3XKNZpt8dcpD15+8gAu9ldg4= MIME-Version: 1.0 Received: by 10.229.184.10 with SMTP id ci10mr1072884qcb.138.1276109434060; Wed, 09 Jun 2010 11:50:34 -0700 (PDT) Received: by 10.229.233.74 with HTTP; Wed, 9 Jun 2010 11:50:33 -0700 (PDT) In-Reply-To: <201006091759.o59HxrJw096803@svn.freebsd.org> References: <201006091759.o59HxrJw096803@svn.freebsd.org> Date: Wed, 9 Jun 2010 11:50:33 -0700 Message-ID: From: Garrett Cooper To: Roman Divacky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208954 - in head/contrib/llvm: . docs test tools/clang tools/clang/docs tools/clang/test website X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 18:50:39 -0000 On Wed, Jun 9, 2010 at 10:59 AM, Roman Divacky wrote= : > Author: rdivacky > Date: Wed Jun =A09 17:59:52 2010 > New Revision: 208954 > URL: http://svn.freebsd.org/changeset/base/208954 > > Log: > =A0Import LLVM/clang from vendor stripped of docs/ test/ website/ www/ ex= amples/ > =A0in llvm/ and/or llvm/contrib/clang/ respectively. > > =A0Approved by: =A0ed (mentor) > =A0Approved by: =A0core > > Added: > =A0head/contrib/llvm/ > =A0 =A0 - copied from r208953, vendor/llvm/dist/ > =A0head/contrib/llvm/tools/clang/ > =A0 =A0 - copied from r208953, vendor/clang/dist/ > Deleted: > =A0head/contrib/llvm/docs/ > =A0head/contrib/llvm/test/ > =A0head/contrib/llvm/tools/clang/docs/ > =A0head/contrib/llvm/tools/clang/test/ > =A0head/contrib/llvm/website/ Why strip test? This might actually be helpful for folks trying to evaluate whether or not they should upgrade to newer versions of clang. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 18:59:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 311C11065678; Wed, 9 Jun 2010 18:59:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20DC58FC15; Wed, 9 Jun 2010 18:59:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59Ix8fS011104; Wed, 9 Jun 2010 18:59:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59Ix8Ve011102; Wed, 9 Jun 2010 18:59:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006091859.o59Ix8Ve011102@svn.freebsd.org> From: Xin LI Date: Wed, 9 Jun 2010 18:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208957 - head/usr.bin/unzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 18:59:08 -0000 Author: delphij Date: Wed Jun 9 18:59:07 2010 New Revision: 208957 URL: http://svn.freebsd.org/changeset/base/208957 Log: Check return value from archive_read_new(). Found with: Coverity Prevent(tm) CID: 8462 Reviewed by: des MFC after: 1 week Modified: head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Wed Jun 9 18:46:28 2010 (r208956) +++ head/usr.bin/unzip/unzip.c Wed Jun 9 18:59:07 2010 (r208957) @@ -862,7 +862,9 @@ unzip(const char *fn) if ((fd = open(fn, O_RDONLY)) < 0) error("%s", fn); - a = archive_read_new(); + if ((a = archive_read_new()) == NULL) + error("archive_read_new failed"); + ac(archive_read_support_format_zip(a)); ac(archive_read_open_fd(a, fd, 8192)); From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 19:04:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 893B61065679; Wed, 9 Jun 2010 19:04:46 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa]) by mx1.freebsd.org (Postfix) with ESMTP id 44A588FC13; Wed, 9 Jun 2010 19:04:46 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 656202A28CDA; Wed, 9 Jun 2010 21:04:45 +0200 (CEST) Date: Wed, 9 Jun 2010 21:04:45 +0200 From: Ed Schouten To: Garrett Cooper Message-ID: <20100609190445.GE56080@hoeg.nl> References: <201006091759.o59HxrJw096803@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dpyLnNrSmluiWsyP" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208954 - in head/contrib/llvm: . docs test tools/clang tools/clang/docs tools/clang/test website X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:04:46 -0000 --dpyLnNrSmluiWsyP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Garrett, * Garrett Cooper wrote: > Why strip test? This might actually be helpful for folks trying to > evaluate whether or not they should upgrade to newer versions of > clang. The testsuite can be checked out separately from the vendor space. It will account for about 50 MB of additional disk space usage. --=20 Ed Schouten WWW: http://80386.nl/ --dpyLnNrSmluiWsyP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwP5c0ACgkQ52SDGA2eCwXhiACfcLO979++rGFP6GKlAbbANpmn HQwAnRfoSnpEkUwKRz1MxE0lCix6UM+k =FgpF -----END PGP SIGNATURE----- --dpyLnNrSmluiWsyP-- From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 19:08:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F28B11065670; Wed, 9 Jun 2010 19:08:18 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1EB88FC0C; Wed, 9 Jun 2010 19:08:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59J8Iv2013293; Wed, 9 Jun 2010 19:08:18 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59J8I9u013292; Wed, 9 Jun 2010 19:08:18 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006091908.o59J8I9u013292@svn.freebsd.org> From: Roman Divacky Date: Wed, 9 Jun 2010 19:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208958 - head/contrib/llvm/lib/System X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:08:19 -0000 Author: rdivacky Date: Wed Jun 9 19:08:17 2010 New Revision: 208958 URL: http://svn.freebsd.org/changeset/base/208958 Log: Comment out piece of code using __clear_cache() which FreeBSD does not have. This is only used for JIT on ARM so it's harmless. Approved by: ed (mentor) Modified: head/contrib/llvm/lib/System/Memory.cpp Modified: head/contrib/llvm/lib/System/Memory.cpp ============================================================================== --- head/contrib/llvm/lib/System/Memory.cpp Wed Jun 9 18:59:07 2010 (r208957) +++ head/contrib/llvm/lib/System/Memory.cpp Wed Jun 9 19:08:17 2010 (r208958) @@ -61,7 +61,7 @@ void llvm::sys::Memory::InvalidateInstru for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) asm volatile("icbi 0, %0" : : "r"(Line)); asm volatile("isync"); -# elif defined(__arm__) && defined(__GNUC__) +# elif defined(__arm__) && defined(__GNUC__) && !defined(__FreeBSD__) // FIXME: Can we safely always call this for __GNUC__ everywhere? char *Start = (char*) Addr; char *End = Start + Len; From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 19:08:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DE701065771; Wed, 9 Jun 2010 19:08:25 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC4A8FC12; Wed, 9 Jun 2010 19:08:24 +0000 (UTC) Received: by pxi7 with SMTP id 7so3063135pxi.13 for ; Wed, 09 Jun 2010 12:08:24 -0700 (PDT) Received: by 10.115.66.34 with SMTP id t34mr5375830wak.6.1276110504112; Wed, 09 Jun 2010 12:08:24 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.114.241.2 with HTTP; Wed, 9 Jun 2010 12:08:04 -0700 (PDT) In-Reply-To: <201006091036.o59AaPMR096200@svn.freebsd.org> References: <201006091036.o59AaPMR096200@svn.freebsd.org> From: Juli Mallett Date: Wed, 9 Jun 2010 12:08:04 -0700 X-Google-Sender-Auth: epZO8Iw7q7ivd-2f2j6UqCxQKzs Message-ID: To: Edwin Groothuis Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208943 - head/usr.bin/calendar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:08:26 -0000 On Wed, Jun 9, 2010 at 03:36, Edwin Groothuis wrote: > Author: edwin > Date: Wed Jun =A09 10:36:25 2010 > New Revision: 208943 > URL: http://svn.freebsd.org/changeset/base/208943 > > Log: > =A0fix memset() calls. > - =A0 =A0 =A0 memset(&tm, sizeof(struct tm), 0); > + =A0 =A0 =A0 memset(&tm, '\0', sizeof(struct tm)); Why use this novel spelling of 0 instead of simply reordering the arguments (which already used the normal invocation)? From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 19:09:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93B641065675; Wed, 9 Jun 2010 19:09:49 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 834378FC1B; Wed, 9 Jun 2010 19:09:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59J9nnp013685; Wed, 9 Jun 2010 19:09:49 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59J9n1S013683; Wed, 9 Jun 2010 19:09:49 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006091909.o59J9n1S013683@svn.freebsd.org> From: Roman Divacky Date: Wed, 9 Jun 2010 19:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208959 - head/contrib/llvm/tools/clang/lib/Driver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:09:49 -0000 Author: rdivacky Date: Wed Jun 9 19:09:49 2010 New Revision: 208959 URL: http://svn.freebsd.org/changeset/base/208959 Log: Change the default CPU to i486 on i386 (architecture). Approved by: ed (mentor) Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Wed Jun 9 19:08:17 2010 (r208958) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Wed Jun 9 19:09:49 2010 (r208959) @@ -628,7 +628,7 @@ void Clang::AddX86TargetArgs(const ArgLi if (getToolChain().getArchName() == "x86_64") CPUName = "x86-64"; else if (getToolChain().getArchName() == "i386") - CPUName = "pentium4"; + CPUName = "i486"; } } From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 19:12:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DB9B1065673; Wed, 9 Jun 2010 19:12:26 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 038A28FC15; Wed, 9 Jun 2010 19:12:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59JCP9Z014387; Wed, 9 Jun 2010 19:12:25 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59JCPbK014385; Wed, 9 Jun 2010 19:12:25 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006091912.o59JCPbK014385@svn.freebsd.org> From: Roman Divacky Date: Wed, 9 Jun 2010 19:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208961 - head/contrib/llvm/tools/clang/lib/Frontend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:12:26 -0000 Author: rdivacky Date: Wed Jun 9 19:12:25 2010 New Revision: 208961 URL: http://svn.freebsd.org/changeset/base/208961 Log: Adjust include paths to FreeBSD. Remove /usr/local/include and add /usr/include/clang/$VERSION (currently VERSION is 2.0). Approved by: ed (mentor) Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Wed Jun 9 19:10:27 2010 (r208960) +++ head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Wed Jun 9 19:12:25 2010 (r208961) @@ -14,6 +14,7 @@ #include "clang/Frontend/Utils.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/LangOptions.h" +#include "clang/Basic/Version.h" #include "clang/Frontend/HeaderSearchOptions.h" #include "clang/Lex/HeaderSearch.h" #include "llvm/ADT/SmallString.h" @@ -407,6 +408,7 @@ static bool getWindowsSDKDir(std::string void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, const HeaderSearchOptions &HSOpts) { +#if 0 /* Remove unneeded include paths. */ // FIXME: temporary hack: hard-coded paths. AddPath("/usr/local/include", System, true, false, false); @@ -419,6 +421,7 @@ void InitHeaderSearch::AddDefaultCInclud P.appendComponent("include"); AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true); } +#endif // Add dirs specified via 'configure --with-c-include-dirs'. llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS); @@ -519,6 +522,8 @@ void InitHeaderSearch::AddDefaultCInclud break; } + AddPath("/usr/include/clang/" CLANG_VERSION_STRING, + System, false, false, false); AddPath("/usr/include", System, false, false, false); } @@ -866,6 +871,16 @@ void clang::ApplyHeaderSearchOptions(Hea else Init.AddDelimitedPaths(HSOpts.CEnvIncPath); +#if 0 /* We place built-in includes in /usr/include. */ + if (HSOpts.UseBuiltinIncludes) { + // Ignore the sys root, we *always* look for clang headers relative to + // supplied path. + llvm::sys::Path P(HSOpts.ResourceDir); + P.appendComponent("include"); + Init.AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true); + } +#endif + if (HSOpts.UseStandardIncludes) Init.AddDefaultSystemIncludePaths(Lang, Triple, HSOpts); From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 19:15:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA3911065677; Wed, 9 Jun 2010 19:15:58 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C99008FC08; Wed, 9 Jun 2010 19:15:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59JFwgf015261; Wed, 9 Jun 2010 19:15:58 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59JFwcu015259; Wed, 9 Jun 2010 19:15:58 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006091915.o59JFwcu015259@svn.freebsd.org> From: Roman Divacky Date: Wed, 9 Jun 2010 19:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208962 - head/contrib/llvm/tools/clang/lib/Frontend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:15:58 -0000 Author: rdivacky Date: Wed Jun 9 19:15:58 2010 New Revision: 208962 URL: http://svn.freebsd.org/changeset/base/208962 Log: Remove the commented out piece that slipped as a mismerge. Approved by: ed (mentor) Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Wed Jun 9 19:12:25 2010 (r208961) +++ head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Wed Jun 9 19:15:58 2010 (r208962) @@ -871,16 +871,6 @@ void clang::ApplyHeaderSearchOptions(Hea else Init.AddDelimitedPaths(HSOpts.CEnvIncPath); -#if 0 /* We place built-in includes in /usr/include. */ - if (HSOpts.UseBuiltinIncludes) { - // Ignore the sys root, we *always* look for clang headers relative to - // supplied path. - llvm::sys::Path P(HSOpts.ResourceDir); - P.appendComponent("include"); - Init.AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true); - } -#endif - if (HSOpts.UseStandardIncludes) Init.AddDefaultSystemIncludePaths(Lang, Triple, HSOpts); From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 19:32:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AD7B1065675; Wed, 9 Jun 2010 19:32:23 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 156F78FC19; Wed, 9 Jun 2010 19:32:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59JWMj4019205; Wed, 9 Jun 2010 19:32:22 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59JWLsX019115; Wed, 9 Jun 2010 19:32:21 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006091932.o59JWLsX019115@svn.freebsd.org> From: Roman Divacky Date: Wed, 9 Jun 2010 19:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208963 - in head: lib/clang lib/clang/include lib/clang/include/clang lib/clang/include/clang/AST lib/clang/include/clang/Basic lib/clang/include/clang/Driver lib/clang/include/llvm li... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:32:23 -0000 Author: rdivacky Date: Wed Jun 9 19:32:20 2010 New Revision: 208963 URL: http://svn.freebsd.org/changeset/base/208963 Log: Import the build makefiles for clang/LLVM. Approved by: ed (mentor) Added: head/lib/clang/ head/lib/clang/Makefile (contents, props changed) head/lib/clang/clang.build.mk (contents, props changed) head/lib/clang/clang.lib.mk (contents, props changed) head/lib/clang/include/ head/lib/clang/include/ARMGenAsmWriter.inc (contents, props changed) head/lib/clang/include/ARMGenCallingConv.inc (contents, props changed) head/lib/clang/include/ARMGenCodeEmitter.inc (contents, props changed) head/lib/clang/include/ARMGenDAGISel.inc (contents, props changed) head/lib/clang/include/ARMGenInstrInfo.inc (contents, props changed) head/lib/clang/include/ARMGenInstrNames.inc (contents, props changed) head/lib/clang/include/ARMGenRegisterInfo.h.inc (contents, props changed) head/lib/clang/include/ARMGenRegisterInfo.inc (contents, props changed) head/lib/clang/include/ARMGenRegisterNames.inc (contents, props changed) head/lib/clang/include/ARMGenSubtarget.inc (contents, props changed) head/lib/clang/include/IA64GenAsmWriter.inc (contents, props changed) head/lib/clang/include/IA64GenDAGISel.inc (contents, props changed) head/lib/clang/include/IA64GenInstrInfo.inc (contents, props changed) head/lib/clang/include/IA64GenInstrNames.inc (contents, props changed) head/lib/clang/include/IA64GenRegisterInfo.h.inc (contents, props changed) head/lib/clang/include/IA64GenRegisterInfo.inc (contents, props changed) head/lib/clang/include/IA64GenRegisterNames.inc (contents, props changed) head/lib/clang/include/Makefile (contents, props changed) head/lib/clang/include/MipsGenAsmWriter.inc (contents, props changed) head/lib/clang/include/MipsGenCallingConv.inc (contents, props changed) head/lib/clang/include/MipsGenDAGISel.inc (contents, props changed) head/lib/clang/include/MipsGenInstrInfo.inc (contents, props changed) head/lib/clang/include/MipsGenInstrNames.inc (contents, props changed) head/lib/clang/include/MipsGenRegisterInfo.h.inc (contents, props changed) head/lib/clang/include/MipsGenRegisterInfo.inc (contents, props changed) head/lib/clang/include/MipsGenRegisterNames.inc (contents, props changed) head/lib/clang/include/MipsGenSubtarget.inc (contents, props changed) head/lib/clang/include/PPCGenAsmWriter.inc (contents, props changed) head/lib/clang/include/PPCGenCallingConv.inc (contents, props changed) head/lib/clang/include/PPCGenCodeEmitter.inc (contents, props changed) head/lib/clang/include/PPCGenDAGISel.inc (contents, props changed) head/lib/clang/include/PPCGenInstrInfo.inc (contents, props changed) head/lib/clang/include/PPCGenInstrNames.inc (contents, props changed) head/lib/clang/include/PPCGenRegisterInfo.h.inc (contents, props changed) head/lib/clang/include/PPCGenRegisterInfo.inc (contents, props changed) head/lib/clang/include/PPCGenRegisterNames.inc (contents, props changed) head/lib/clang/include/PPCGenSubtarget.inc (contents, props changed) head/lib/clang/include/X86GenAsmMatcher.inc (contents, props changed) head/lib/clang/include/X86GenAsmWriter.inc (contents, props changed) head/lib/clang/include/X86GenAsmWriter1.inc (contents, props changed) head/lib/clang/include/X86GenCallingConv.inc (contents, props changed) head/lib/clang/include/X86GenDAGISel.inc (contents, props changed) head/lib/clang/include/X86GenFastISel.inc (contents, props changed) head/lib/clang/include/X86GenInstrInfo.inc (contents, props changed) head/lib/clang/include/X86GenInstrNames.inc (contents, props changed) head/lib/clang/include/X86GenRegisterInfo.h.inc (contents, props changed) head/lib/clang/include/X86GenRegisterInfo.inc (contents, props changed) head/lib/clang/include/X86GenRegisterNames.inc (contents, props changed) head/lib/clang/include/X86GenSubtarget.inc (contents, props changed) head/lib/clang/include/clang/ head/lib/clang/include/clang/AST/ head/lib/clang/include/clang/AST/StmtNodes.inc (contents, props changed) head/lib/clang/include/clang/Basic/ head/lib/clang/include/clang/Basic/DiagnosticASTKinds.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticAnalysisKinds.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticCommonKinds.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticDriverKinds.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticFrontendKinds.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticGroups.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticLexKinds.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticParseKinds.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticSemaKinds.inc (contents, props changed) head/lib/clang/include/clang/Driver/ head/lib/clang/include/clang/Driver/CC1AsOptions.inc (contents, props changed) head/lib/clang/include/clang/Driver/CC1Options.inc (contents, props changed) head/lib/clang/include/clang/Driver/Options.inc (contents, props changed) head/lib/clang/include/llvm/ head/lib/clang/include/llvm/ADT/ head/lib/clang/include/llvm/ADT/iterator.h (contents, props changed) head/lib/clang/include/llvm/Config/ head/lib/clang/include/llvm/Config/AsmParsers.def (contents, props changed) head/lib/clang/include/llvm/Config/AsmPrinters.def (contents, props changed) head/lib/clang/include/llvm/Config/Disassemblers.def (contents, props changed) head/lib/clang/include/llvm/Config/Targets.def (contents, props changed) head/lib/clang/include/llvm/Config/config.h (contents, props changed) head/lib/clang/include/llvm/Intrinsics.gen (contents, props changed) head/lib/clang/include/llvm/System/ head/lib/clang/include/llvm/System/DataTypes.h (contents, props changed) head/lib/clang/libclanganalysis/ head/lib/clang/libclanganalysis/Makefile (contents, props changed) head/lib/clang/libclangast/ head/lib/clang/libclangast/Makefile (contents, props changed) head/lib/clang/libclangbasic/ head/lib/clang/libclangbasic/Makefile (contents, props changed) head/lib/clang/libclangchecker/ head/lib/clang/libclangchecker/Makefile (contents, props changed) head/lib/clang/libclangcodegen/ head/lib/clang/libclangcodegen/Makefile (contents, props changed) head/lib/clang/libclangdriver/ head/lib/clang/libclangdriver/Makefile (contents, props changed) head/lib/clang/libclangfrontend/ head/lib/clang/libclangfrontend/Makefile (contents, props changed) head/lib/clang/libclanglex/ head/lib/clang/libclanglex/Makefile (contents, props changed) head/lib/clang/libclangparse/ head/lib/clang/libclangparse/Makefile (contents, props changed) head/lib/clang/libclangrewrite/ head/lib/clang/libclangrewrite/Makefile (contents, props changed) head/lib/clang/libclangsema/ head/lib/clang/libclangsema/Makefile (contents, props changed) head/lib/clang/libllvmanalysis/ head/lib/clang/libllvmanalysis/Makefile (contents, props changed) head/lib/clang/libllvmarmasmparser/ head/lib/clang/libllvmarmasmparser/Makefile (contents, props changed) head/lib/clang/libllvmarmasmprinter/ head/lib/clang/libllvmarmasmprinter/Makefile (contents, props changed) head/lib/clang/libllvmarmcodegen/ head/lib/clang/libllvmarmcodegen/Makefile (contents, props changed) head/lib/clang/libllvmarminfo/ head/lib/clang/libllvmarminfo/Makefile (contents, props changed) head/lib/clang/libllvmasmprinter/ head/lib/clang/libllvmasmprinter/Makefile (contents, props changed) head/lib/clang/libllvmbitreader/ head/lib/clang/libllvmbitreader/Makefile (contents, props changed) head/lib/clang/libllvmbitwriter/ head/lib/clang/libllvmbitwriter/Makefile (contents, props changed) head/lib/clang/libllvmcodegen/ head/lib/clang/libllvmcodegen/Makefile (contents, props changed) head/lib/clang/libllvmcore/ head/lib/clang/libllvmcore/Makefile (contents, props changed) head/lib/clang/libllvminstcombine/ head/lib/clang/libllvminstcombine/Makefile (contents, props changed) head/lib/clang/libllvmipa/ head/lib/clang/libllvmipa/Makefile (contents, props changed) head/lib/clang/libllvmipo/ head/lib/clang/libllvmipo/Makefile (contents, props changed) head/lib/clang/libllvmmc/ head/lib/clang/libllvmmc/Makefile (contents, props changed) head/lib/clang/libllvmmcparser/ head/lib/clang/libllvmmcparser/Makefile (contents, props changed) head/lib/clang/libllvmmipsasmprinter/ head/lib/clang/libllvmmipsasmprinter/Makefile (contents, props changed) head/lib/clang/libllvmmipscodegen/ head/lib/clang/libllvmmipscodegen/Makefile (contents, props changed) head/lib/clang/libllvmmipsinfo/ head/lib/clang/libllvmmipsinfo/Makefile (contents, props changed) head/lib/clang/libllvmpowerpcasmprinter/ head/lib/clang/libllvmpowerpcasmprinter/Makefile (contents, props changed) head/lib/clang/libllvmpowerpccodegen/ head/lib/clang/libllvmpowerpccodegen/Makefile (contents, props changed) head/lib/clang/libllvmpowerpcinfo/ head/lib/clang/libllvmpowerpcinfo/Makefile (contents, props changed) head/lib/clang/libllvmscalaropts/ head/lib/clang/libllvmscalaropts/Makefile (contents, props changed) head/lib/clang/libllvmselectiondag/ head/lib/clang/libllvmselectiondag/Makefile (contents, props changed) head/lib/clang/libllvmsupport/ head/lib/clang/libllvmsupport/Makefile (contents, props changed) head/lib/clang/libllvmsystem/ head/lib/clang/libllvmsystem/Makefile (contents, props changed) head/lib/clang/libllvmtarget/ head/lib/clang/libllvmtarget/Makefile (contents, props changed) head/lib/clang/libllvmtransformutils/ head/lib/clang/libllvmtransformutils/Makefile (contents, props changed) head/lib/clang/libllvmx86asmparser/ head/lib/clang/libllvmx86asmparser/Makefile (contents, props changed) head/lib/clang/libllvmx86asmprinter/ head/lib/clang/libllvmx86asmprinter/Makefile (contents, props changed) head/lib/clang/libllvmx86codegen/ head/lib/clang/libllvmx86codegen/Makefile (contents, props changed) head/lib/clang/libllvmx86info/ head/lib/clang/libllvmx86info/Makefile (contents, props changed) head/usr.bin/clang/ head/usr.bin/clang/Makefile (contents, props changed) head/usr.bin/clang/clang/ head/usr.bin/clang/clang.prog.mk (contents, props changed) head/usr.bin/clang/clang/Makefile (contents, props changed) head/usr.bin/clang/tblgen/ head/usr.bin/clang/tblgen/Makefile (contents, props changed) Added: head/lib/clang/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/Makefile Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,50 @@ +# $FreeBSD$ + +SUBDIR= libclanganalysis \ + libclangast \ + libclangbasic \ + libclangchecker \ + libclangcodegen \ + libclangdriver \ + libclangfrontend \ + libclanglex \ + libclangparse \ + libclangrewrite \ + libclangsema \ + \ + libllvmanalysis \ + libllvmasmprinter \ + libllvmbitreader \ + libllvmbitwriter \ + libllvmcodegen \ + libllvminstcombine \ + libllvmcore \ + libllvmipa \ + libllvmipo \ + libllvmmc \ + libllvmmcparser \ + libllvmscalaropts \ + libllvmselectiondag \ + libllvmsupport \ + libllvmsystem \ + libllvmtarget \ + libllvmtransformutils \ + \ + libllvmarmasmparser \ + libllvmarmasmprinter \ + libllvmarmcodegen \ + libllvmarminfo \ + libllvmmipsasmprinter \ + libllvmmipscodegen \ + libllvmmipsinfo \ + libllvmpowerpcasmprinter \ + libllvmpowerpccodegen \ + libllvmpowerpcinfo \ + libllvmx86asmparser \ + libllvmx86asmprinter \ + libllvmx86codegen \ + libllvmx86info \ + \ + include + +.include Added: head/lib/clang/clang.build.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/clang.build.mk Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,73 @@ +# $FreeBSD$ + +CLANG_SRCS=${LLVM_SRCS}/tools/clang + +CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \ + -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ + -I${LLVM_SRCS}/../../lib/clang/include \ + -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ + -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG + +TARGET_ARCH?= ${MACHINE_ARCH} +# XXX: 8.0, to keep __FreeBSD_cc_version happy +CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\" + +.PATH: ${LLVM_SRCS}/${SRCDIR} + +TBLGEN=tblgen ${CFLAGS:M-I*} + +Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/Intrinsics.td + ${TBLGEN} -gen-intrinsic \ + ${LLVM_SRCS}/include/llvm/Intrinsics.td > ${.TARGET} +.for arch in \ + ARM/ARM Mips/Mips PowerPC/PPC X86/X86 +. for hdr in \ + AsmMatcher/-gen-asm-matcher \ + AsmWriter1/-gen-asm-writer,-asmwriternum=1 \ + AsmWriter/-gen-asm-writer \ + CallingConv/-gen-callingconv \ + CodeEmitter/-gen-emitter \ + DAGISel/-gen-dag-isel \ + FastISel/-gen-fast-isel \ + InstrInfo/-gen-instr-desc \ + InstrNames/-gen-instr-enums \ + RegisterInfo.h/-gen-register-desc-header \ + RegisterInfo/-gen-register-desc \ + RegisterNames/-gen-register-enums \ + Subtarget/-gen-subtarget +${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td + ${TBLGEN} ${hdr:T:C/,/ /g} \ + ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td > ${.TARGET} +. endfor +.endfor + +DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td + ${TBLGEN} -I${CLANG_SRCS}/include/clang/Basic \ + -gen-clang-diag-groups \ + ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td > ${.TARGET} +.for hdr in AST Analysis Common Driver Frontend Lex Parse Sema +Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td + ${TBLGEN} -I${CLANG_SRCS}/include/clang/Basic \ + -gen-clang-diags-defs -clang-component=${hdr} \ + ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td > ${.TARGET} +.endfor +CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td + ${TBLGEN} -I${CLANG_SRCS}/include/clang/Driver \ + -gen-opt-parser-defs \ + ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td > ${.TARGET} +CC1Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1Options.td + ${TBLGEN} -I${CLANG_SRCS}/include/clang/Driver \ + -gen-opt-parser-defs \ + ${CLANG_SRCS}/include/clang/Driver/CC1Options.td > ${.TARGET} +Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td + ${TBLGEN} -I${CLANG_SRCS}/include/clang/Driver \ + -gen-opt-parser-defs \ + ${CLANG_SRCS}/include/clang/Driver/Options.td > ${.TARGET} +StmtNodes.inc.h: ${CLANG_SRCS}/include/clang/AST/StmtNodes.td + ${TBLGEN} -I${CLANG_SRCS}/include/clang/AST \ + -gen-clang-stmt-nodes \ + ${CLANG_SRCS}/include/clang/AST/StmtNodes.td > ${.TARGET} + +SRCS+= ${TGHDRS:C/$/.inc.h/} +DPADD+= ${TGHDRS:C/$/.inc.h/} +CLEANFILES+= ${TGHDRS:C/$/.inc.h/} Added: head/lib/clang/clang.lib.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/clang.lib.mk Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LLVM_SRCS=${.CURDIR}/../../../contrib/llvm + +.include "clang.build.mk" + +INTERNALLIB= + +.include Added: head/lib/clang/include/ARMGenAsmWriter.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenAsmWriter.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenAsmWriter.inc.h" Added: head/lib/clang/include/ARMGenCallingConv.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenCallingConv.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenCallingConv.inc.h" Added: head/lib/clang/include/ARMGenCodeEmitter.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenCodeEmitter.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenCodeEmitter.inc.h" Added: head/lib/clang/include/ARMGenDAGISel.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenDAGISel.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenDAGISel.inc.h" Added: head/lib/clang/include/ARMGenInstrInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenInstrInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenInstrInfo.inc.h" Added: head/lib/clang/include/ARMGenInstrNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenInstrNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenInstrNames.inc.h" Added: head/lib/clang/include/ARMGenRegisterInfo.h.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenRegisterInfo.h.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenRegisterInfo.h.inc.h" Added: head/lib/clang/include/ARMGenRegisterInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenRegisterInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenRegisterInfo.inc.h" Added: head/lib/clang/include/ARMGenRegisterNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenRegisterNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenRegisterNames.inc.h" Added: head/lib/clang/include/ARMGenSubtarget.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/ARMGenSubtarget.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "ARMGenSubtarget.inc.h" Added: head/lib/clang/include/IA64GenAsmWriter.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/IA64GenAsmWriter.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "IA64GenAsmWriter.inc.h" Added: head/lib/clang/include/IA64GenDAGISel.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/IA64GenDAGISel.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "IA64GenDAGISel.inc.h" Added: head/lib/clang/include/IA64GenInstrInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/IA64GenInstrInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "IA64GenInstrInfo.inc.h" Added: head/lib/clang/include/IA64GenInstrNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/IA64GenInstrNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "IA64GenInstrNames.inc.h" Added: head/lib/clang/include/IA64GenRegisterInfo.h.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/IA64GenRegisterInfo.h.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "IA64GenRegisterInfo.h.inc.h" Added: head/lib/clang/include/IA64GenRegisterInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/IA64GenRegisterInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "IA64GenRegisterInfo.inc.h" Added: head/lib/clang/include/IA64GenRegisterNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/IA64GenRegisterNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "IA64GenRegisterNames.inc.h" Added: head/lib/clang/include/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/Makefile Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../contrib/llvm/tools/clang/lib/Headers + +INCSDIR=${INCLUDEDIR}/clang/2.0 + +INCS= emmintrin.h mm_malloc.h mmintrin.h pmmintrin.h tmmintrin.h xmmintrin.h + +.include +.include +.include Added: head/lib/clang/include/MipsGenAsmWriter.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/MipsGenAsmWriter.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "MipsGenAsmWriter.inc.h" Added: head/lib/clang/include/MipsGenCallingConv.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/MipsGenCallingConv.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "MipsGenCallingConv.inc.h" Added: head/lib/clang/include/MipsGenDAGISel.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/MipsGenDAGISel.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "MipsGenDAGISel.inc.h" Added: head/lib/clang/include/MipsGenInstrInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/MipsGenInstrInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "MipsGenInstrInfo.inc.h" Added: head/lib/clang/include/MipsGenInstrNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/MipsGenInstrNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "MipsGenInstrNames.inc.h" Added: head/lib/clang/include/MipsGenRegisterInfo.h.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/MipsGenRegisterInfo.h.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "MipsGenRegisterInfo.h.inc.h" Added: head/lib/clang/include/MipsGenRegisterInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/MipsGenRegisterInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "MipsGenRegisterInfo.inc.h" Added: head/lib/clang/include/MipsGenRegisterNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/MipsGenRegisterNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "MipsGenRegisterNames.inc.h" Added: head/lib/clang/include/MipsGenSubtarget.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/MipsGenSubtarget.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "MipsGenSubtarget.inc.h" Added: head/lib/clang/include/PPCGenAsmWriter.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenAsmWriter.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenAsmWriter.inc.h" Added: head/lib/clang/include/PPCGenCallingConv.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenCallingConv.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenCallingConv.inc.h" Added: head/lib/clang/include/PPCGenCodeEmitter.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenCodeEmitter.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenCodeEmitter.inc.h" Added: head/lib/clang/include/PPCGenDAGISel.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenDAGISel.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenDAGISel.inc.h" Added: head/lib/clang/include/PPCGenInstrInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenInstrInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenInstrInfo.inc.h" Added: head/lib/clang/include/PPCGenInstrNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenInstrNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenInstrNames.inc.h" Added: head/lib/clang/include/PPCGenRegisterInfo.h.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenRegisterInfo.h.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenRegisterInfo.h.inc.h" Added: head/lib/clang/include/PPCGenRegisterInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenRegisterInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenRegisterInfo.inc.h" Added: head/lib/clang/include/PPCGenRegisterNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenRegisterNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenRegisterNames.inc.h" Added: head/lib/clang/include/PPCGenSubtarget.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenSubtarget.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenSubtarget.inc.h" Added: head/lib/clang/include/X86GenAsmMatcher.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenAsmMatcher.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenAsmMatcher.inc.h" Added: head/lib/clang/include/X86GenAsmWriter.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenAsmWriter.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenAsmWriter.inc.h" Added: head/lib/clang/include/X86GenAsmWriter1.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenAsmWriter1.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenAsmWriter1.inc.h" Added: head/lib/clang/include/X86GenCallingConv.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenCallingConv.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenCallingConv.inc.h" Added: head/lib/clang/include/X86GenDAGISel.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenDAGISel.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenDAGISel.inc.h" Added: head/lib/clang/include/X86GenFastISel.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenFastISel.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenFastISel.inc.h" Added: head/lib/clang/include/X86GenInstrInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenInstrInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenInstrInfo.inc.h" Added: head/lib/clang/include/X86GenInstrNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenInstrNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenInstrNames.inc.h" Added: head/lib/clang/include/X86GenRegisterInfo.h.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenRegisterInfo.h.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenRegisterInfo.h.inc.h" Added: head/lib/clang/include/X86GenRegisterInfo.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenRegisterInfo.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenRegisterInfo.inc.h" Added: head/lib/clang/include/X86GenRegisterNames.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenRegisterNames.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenRegisterNames.inc.h" Added: head/lib/clang/include/X86GenSubtarget.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/X86GenSubtarget.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "X86GenSubtarget.inc.h" Added: head/lib/clang/include/clang/AST/StmtNodes.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/AST/StmtNodes.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "StmtNodes.inc.h" Added: head/lib/clang/include/clang/Basic/DiagnosticASTKinds.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Basic/DiagnosticASTKinds.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "DiagnosticASTKinds.inc.h" Added: head/lib/clang/include/clang/Basic/DiagnosticAnalysisKinds.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Basic/DiagnosticAnalysisKinds.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "DiagnosticAnalysisKinds.inc.h" Added: head/lib/clang/include/clang/Basic/DiagnosticCommonKinds.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Basic/DiagnosticCommonKinds.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "DiagnosticCommonKinds.inc.h" Added: head/lib/clang/include/clang/Basic/DiagnosticDriverKinds.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Basic/DiagnosticDriverKinds.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "DiagnosticDriverKinds.inc.h" Added: head/lib/clang/include/clang/Basic/DiagnosticFrontendKinds.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Basic/DiagnosticFrontendKinds.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "DiagnosticFrontendKinds.inc.h" Added: head/lib/clang/include/clang/Basic/DiagnosticGroups.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Basic/DiagnosticGroups.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "DiagnosticGroups.inc.h" Added: head/lib/clang/include/clang/Basic/DiagnosticLexKinds.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Basic/DiagnosticLexKinds.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "DiagnosticLexKinds.inc.h" Added: head/lib/clang/include/clang/Basic/DiagnosticParseKinds.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Basic/DiagnosticParseKinds.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "DiagnosticParseKinds.inc.h" Added: head/lib/clang/include/clang/Basic/DiagnosticSemaKinds.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Basic/DiagnosticSemaKinds.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "DiagnosticSemaKinds.inc.h" Added: head/lib/clang/include/clang/Driver/CC1AsOptions.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Driver/CC1AsOptions.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "CC1AsOptions.inc.h" Added: head/lib/clang/include/clang/Driver/CC1Options.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Driver/CC1Options.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "CC1Options.inc.h" Added: head/lib/clang/include/clang/Driver/Options.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/clang/Driver/Options.inc Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "Options.inc.h" Added: head/lib/clang/include/llvm/ADT/iterator.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/llvm/ADT/iterator.h Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,78 @@ +/* include/llvm/ADT/iterator.h. Generated from iterator.h.in by configure. */ +//==-- llvm/ADT/iterator.h - Portable wrapper around --*- C++ -*-==// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file provides a wrapper around the mysterious header file. +// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other +// friends), instead of the standard iterator class. In GCC 3.1, the +// bidirectional_iterator class got moved out and the new, standards compliant, +// iterator<> class was added. Because there is nothing that we can do to get +// correct behavior on both compilers, we have this header with #ifdef's. Gross +// huh? +// +// By #includ'ing this file, you get the contents of plus the +// following classes in the global namespace: +// +// 1. bidirectional_iterator +// 2. forward_iterator +// +// The #if directives' expressions are filled in by Autoconf. +// +// $FreeBSD$ +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ADT_ITERATOR_H +#define LLVM_ADT_ITERATOR_H + +#include + +#define HAVE_BI_ITERATOR 0 +#define HAVE_STD_ITERATOR 1 +#define HAVE_FWD_ITERATOR 0 + +#ifdef _MSC_VER +# define HAVE_BI_ITERATOR 0 +# define HAVE_STD_ITERATOR 1 +# define HAVE_FWD_ITERATOR 0 +#endif + +#if !HAVE_BI_ITERATOR +# if HAVE_STD_ITERATOR +/// If the bidirectional iterator is not defined, we attempt to define it in +/// terms of the C++ standard iterator. Otherwise, we import it with a "using" +/// statement. +/// +template +struct bidirectional_iterator + : public std::iterator { +}; +# else +# error "Need to have standard iterator to define bidirectional iterator!" +# endif +#else +using std::bidirectional_iterator; +#endif + +#if !HAVE_FWD_ITERATOR +# if HAVE_STD_ITERATOR +/// If the forward iterator is not defined, attempt to define it in terms of +/// the C++ standard iterator. Otherwise, we import it with a "using" statement. +/// +template +struct forward_iterator + : public std::iterator { +}; +# else +# error "Need to have standard iterator to define forward iterator!" +# endif +#else +using std::forward_iterator; +#endif + +#endif // LLVM_ADT_ITERATOR_H Added: head/lib/clang/include/llvm/Config/AsmParsers.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/llvm/Config/AsmParsers.def Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,30 @@ +/* $FreeBSD$ */ +//===- llvm/Config/AsmParsers.def - LLVM Assembly Parsers -------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file enumerates all of the assembly-language parsers +// supported by this build of LLVM. Clients of this file should define +// the LLVM_ASM_PARSER macro to be a function-like macro with a +// single parameter (the name of the target whose assembly can be +// generated); including this file will then enumerate all of the +// targets with assembly parsers. +// +// The set of targets supported by LLVM is generated at configuration +// time, at which point this header is generated. Do not modify this +// header directly. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ASM_PARSER +# error Please define the macro LLVM_ASM_PARSER(TargetName) +#endif + +LLVM_ASM_PARSER(ARM) LLVM_ASM_PARSER(X86) + +#undef LLVM_ASM_PARSER Added: head/lib/clang/include/llvm/Config/AsmPrinters.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/llvm/Config/AsmPrinters.def Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,30 @@ +/* $FreeBSD$ */ +//===- llvm/Config/AsmPrinters.def - LLVM Assembly Printers -----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file enumerates all of the assembly-language printers +// supported by this build of LLVM. Clients of this file should define +// the LLVM_ASM_PRINTER macro to be a function-like macro with a +// single parameter (the name of the target whose assembly can be +// generated); including this file will then enumerate all of the +// targets with assembly printers. +// +// The set of targets supported by LLVM is generated at configuration +// time, at which point this header is generated. Do not modify this +// header directly. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ASM_PRINTER +# error Please define the macro LLVM_ASM_PRINTER(TargetName) +#endif + +LLVM_ASM_PRINTER(Mips) LLVM_ASM_PRINTER(ARM) LLVM_ASM_PRINTER(PowerPC) LLVM_ASM_PRINTER(X86) + +#undef LLVM_ASM_PRINTER Added: head/lib/clang/include/llvm/Config/Disassemblers.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/llvm/Config/Disassemblers.def Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,30 @@ +/* $FreeBSD$ */ +//===- llvm/Config/Disassemblers.def - LLVM Assembly Parsers ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file enumerates all of the assembly-language parsers +// supported by this build of LLVM. Clients of this file should define +// the LLVM_ASM_PARSER macro to be a function-like macro with a +// single parameter (the name of the target whose assembly can be +// generated); including this file will then enumerate all of the +// targets with assembly parsers. +// +// The set of targets supported by LLVM is generated at configuration +// time, at which point this header is generated. Do not modify this +// header directly. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_DISASSEMBLER +# error Please define the macro LLVM_DISASSEMBLER(TargetName) +#endif + +LLVM_DISASSEMBLER(X86) + +#undef LLVM_DISASSEMBLER Added: head/lib/clang/include/llvm/Config/Targets.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/llvm/Config/Targets.def Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,29 @@ +/* $FreeBSD$ */ +/*===- llvm/Config/Targets.def - LLVM Target Architectures ------*- C++ -*-===*\ +|* *| +|* The LLVM Compiler Infrastructure *| +|* *| +|* This file is distributed under the University of Illinois Open Source *| +|* License. See LICENSE.TXT for details. *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file enumerates all of the target architectures supported by *| +|* this build of LLVM. Clients of this file should define the *| +|* LLVM_TARGET macro to be a function-like macro with a single *| +|* parameter (the name of the target); including this file will then *| +|* enumerate all of the targets. *| +|* *| +|* The set of targets supported by LLVM is generated at configuration *| +|* time, at which point this header is generated. Do not modify this *| +|* header directly. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_TARGET +# error Please define the macro LLVM_TARGET(TargetName) +#endif + +LLVM_TARGET(Mips) LLVM_TARGET(ARM) LLVM_TARGET(PowerPC) LLVM_TARGET(X86) + +#undef LLVM_TARGET Added: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/llvm/Config/config.h Wed Jun 9 19:32:20 2010 (r208963) @@ -0,0 +1,569 @@ +/* $FreeBSD$ */ +/* include/llvm/Config/config.h. Generated from config.h.in by configure. */ +/* include/llvm/Config/config.h.in. Generated from autoconf/configure.ac by autoheader. */ + +/* 32 bit multilib directory. */ +#define CXX_INCLUDE_32BIT_DIR "" + +/* 64 bit multilib directory. */ +#define CXX_INCLUDE_64BIT_DIR "" + +/* Arch the libstdc++ headers. */ +#define CXX_INCLUDE_ARCH "" + +/* Directory with the libstdc++ headers. */ +#define CXX_INCLUDE_ROOT "" + +/* Directories clang will search for headers */ +#define C_INCLUDE_DIRS "" + +/* Define if CBE is enabled for printf %a output */ +#define ENABLE_CBE_PRINTF_A 1 + +/* Define if position independent code is enabled */ +#define ENABLE_PIC 1 + +/* Define if threads enabled */ +/* #undef ENABLE_THREADS */ + +/* Define if timestamp information (e.g., __DATE___) is allowed */ +#define ENABLE_TIMESTAMPS 1 + +/* Define to 1 if you have the `argz_append' function. */ +/* #undef HAVE_ARGZ_APPEND */ + +/* Define to 1 if you have the `argz_create_sep' function. */ +/* #undef HAVE_ARGZ_CREATE_SEP */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARGZ_H */ + +/* Define to 1 if you have the `argz_insert' function. */ +/* #undef HAVE_ARGZ_INSERT */ + +/* Define to 1 if you have the `argz_next' function. */ +/* #undef HAVE_ARGZ_NEXT */ + +/* Define to 1 if you have the `argz_stringify' function. */ +/* #undef HAVE_ARGZ_STRINGIFY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `backtrace' function. */ +/* #undef HAVE_BACKTRACE */ + +/* Define to 1 if you have the `bcopy' function. */ +/* #undef HAVE_BCOPY */ + +/* Define to 1 if you have the `ceilf' function. */ +#define HAVE_CEILF 1 + +/* Define if the neat program is available */ +/* #undef HAVE_CIRCO */ + +/* Define to 1 if you have the `closedir' function. */ +#define HAVE_CLOSEDIR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define if you have the GNU dld library. */ +/* #undef HAVE_DLD */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLD_H */ + +/* Define to 1 if you have the `dlerror' function. */ +#define HAVE_DLERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if dlopen() is available on this platform. */ +#define HAVE_DLOPEN 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DL_H */ + +/* Define if the dot program is available */ +/* #undef HAVE_DOT */ + +/* Define if the dotty program is available */ +/* #undef HAVE_DOTTY */ + +/* Define if you have the _dyld_func_lookup function. */ +/* #undef HAVE_DYLD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if the system has the type `error_t'. */ +/* #undef HAVE_ERROR_T */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_EXECINFO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define if the neat program is available */ +/* #undef HAVE_FDP */ + +/* Define if libffi is available on this platform. */ +/* #undef HAVE_FFI_CALL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_FFI_FFI_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_FFI_H */ + +/* Set to 1 if the finite function is found in */ +/* #undef HAVE_FINITE_IN_IEEEFP_H */ + +/* Define to 1 if you have the `floorf' function. */ +#define HAVE_FLOORF 1 + +/* Define to 1 if you have the `fmodf' function. */ +#define HAVE_FMODF 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define if the Graphviz program is available */ +/* #undef HAVE_GRAPHVIZ */ + +/* Define if the gv program is available */ +/* #undef HAVE_GV */ + +/* Define to 1 if you have the `index' function. */ +/* #undef HAVE_INDEX */ + +/* Define to 1 if the system has the type `int64_t'. */ +#define HAVE_INT64_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isatty' function. */ +#define HAVE_ISATTY 1 + +/* Set to 1 if the isinf function is found in */ +#define HAVE_ISINF_IN_CMATH 1 + +/* Set to 1 if the isinf function is found in */ +#define HAVE_ISINF_IN_MATH_H 1 + +/* Set to 1 if the isnan function is found in */ +#define HAVE_ISNAN_IN_CMATH 1 + +/* Set to 1 if the isnan function is found in */ +#define HAVE_ISNAN_IN_MATH_H 1 + +/* Define if you have the libdl library or equivalent. */ +#define HAVE_LIBDL 1 + +/* Define to 1 if you have the `imagehlp' library (-limagehlp). */ +/* #undef HAVE_LIBIMAGEHLP */ + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `psapi' library (-lpsapi). */ +/* #undef HAVE_LIBPSAPI */ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the `udis86' library (-ludis86). */ +/* #undef HAVE_LIBUDIS86 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you can use -Wl,-export-dynamic. */ +#define HAVE_LINK_EXPORT_DYNAMIC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINK_H 1 + +/* Define if you can use -Wl,-R. to pass -R. to the linker, in order to add + the current directory to the dynamic linker search path. */ +#define HAVE_LINK_R 1 + +/* Define to 1 if you have the `longjmp' function. */ +#define HAVE_LONGJMP 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_MACH_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_O_DYLD_H */ + +/* Define if mallinfo() is available on this platform. */ +/* #undef HAVE_MALLINFO */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MALLOC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MALLOC_MALLOC_H */ + +/* Define to 1 if you have the `malloc_zone_statistics' function. */ +/* #undef HAVE_MALLOC_ZONE_STATISTICS */ + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkdtemp' function. */ +#define HAVE_MKDTEMP 1 + +/* Define to 1 if you have the `mkstemp' function. */ +#define HAVE_MKSTEMP 1 + +/* Define to 1 if you have the `mktemp' function. */ +#define HAVE_MKTEMP 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if + it uses MAP_ANON */ +/* #undef HAVE_MMAP_ANONYMOUS */ + +/* Define if mmap() can map files into memory */ +#define HAVE_MMAP_FILE + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the `nearbyintf' function. */ +#define HAVE_NEARBYINTF 1 + +/* Define if the neat program is available */ +/* #undef HAVE_NEATO */ + +/* Define to 1 if you have the `opendir' function. */ +#define HAVE_OPENDIR 1 + +/* Define to 1 if you have the `posix_spawn' function. */ +#define HAVE_POSIX_SPAWN 1 + +/* Define to 1 if you have the `powf' function. */ +#define HAVE_POWF 1 + +/* Define if libtool can extract symbol lists from object files. */ +#define HAVE_PRELOADED_SYMBOLS 1 + +/* Define to have the %a format string */ +#define HAVE_PRINTF_A 1 + +/* Have pthread_getspecific */ +#define HAVE_PTHREAD_GETSPECIFIC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PTHREAD_H 1 + +/* Have pthread_mutex_lock */ +#define HAVE_PTHREAD_MUTEX_LOCK 1 + +/* Have pthread_rwlock_init */ +#define HAVE_PTHREAD_RWLOCK_INIT 1 + +/* Define to 1 if srand48/lrand48/drand48 exist in */ +#define HAVE_RAND48 1 + +/* Define to 1 if you have the `readdir' function. */ +#define HAVE_READDIR 1 + +/* Define to 1 if you have the `realpath' function. */ +#define HAVE_REALPATH 1 + +/* Define to 1 if you have the `rindex' function. */ +/* #undef HAVE_RINDEX */ + +/* Define to 1 if you have the `rintf' function. */ +#define HAVE_RINTF 1 + +/* Define to 1 if you have the `round' function. */ +#define HAVE_ROUND 1 + +/* Define to 1 if you have the `roundf' function. */ +#define HAVE_ROUNDF 1 + +/* Define to 1 if you have the `sbrk' function. */ +#define HAVE_SBRK 1 + +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + +/* Define to 1 if you have the `setjmp' function. */ +#define HAVE_SETJMP 1 + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 19:57:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3E9E10656CD; Wed, 9 Jun 2010 19:57:20 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF96C8FC16; Wed, 9 Jun 2010 19:57:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59JvKtw025127; Wed, 9 Jun 2010 19:57:20 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59JvKbu025122; Wed, 9 Jun 2010 19:57:20 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006091957.o59JvKbu025122@svn.freebsd.org> From: Roman Divacky Date: Wed, 9 Jun 2010 19:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208964 - in head: . etc/mtree lib share/mk usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:57:21 -0000 Author: rdivacky Date: Wed Jun 9 19:57:20 2010 New Revision: 208964 URL: http://svn.freebsd.org/changeset/base/208964 Log: Hook clang into the build on i386/amd64/powerpc. Approved by: ed (mentor) Modified: head/Makefile.inc1 head/etc/mtree/BSD.include.dist head/lib/Makefile head/share/mk/bsd.own.mk head/usr.bin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 9 19:32:20 2010 (r208963) +++ head/Makefile.inc1 Wed Jun 9 19:57:20 2010 (r208964) @@ -956,6 +956,13 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptre _crunchgen= usr.sbin/crunch/crunchgen .endif +# XXX: There is no way to specify bootstrap tools depending on MK-flags +# with different per-architecture default values. Always build tblgen. +_clang_tblgen= \ + lib/clang/libllvmsupport \ + lib/clang/libllvmsystem \ + usr.bin/clang/tblgen + .if ${MK_CDDL} != "no" _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge @@ -963,6 +970,7 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/ bootstrap-tools: .for _tool in \ + ${_clang_tblgen} \ ${_dtrace_tools} \ ${_strfile} \ ${_gperf} \ Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Wed Jun 9 19:32:20 2010 (r208963) +++ head/etc/mtree/BSD.include.dist Wed Jun 9 19:57:20 2010 (r208964) @@ -83,6 +83,10 @@ scsi .. .. + clang + 2.0 + .. + .. crypto .. dev Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Jun 9 19:32:20 2010 (r208963) +++ head/lib/Makefile Wed Jun 9 19:57:20 2010 (r208964) @@ -108,7 +108,8 @@ SUBDIR= ${SUBDIR_ORDERED} \ libwrap \ liby \ libz \ - ${_bind} + ${_bind} \ + ${_clang} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) _csu=csu/${MACHINE_ARCH}-elf @@ -137,6 +138,10 @@ _libsdp= libsdp _libbsnmp= libbsnmp .endif +.if ${MK_CLANG} != "no" +_clang= clang +.endif + .if ${MK_GPIB} != "no" _libgpib= libgpib .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Jun 9 19:32:20 2010 (r208963) +++ head/share/mk/bsd.own.mk Wed Jun 9 19:57:20 2010 (r208964) @@ -288,6 +288,18 @@ _no_fdt= FDT .endif # +# Default behaviour of MK_CLANG depends on the architecture. +# +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_ARCH} == "powerpc" +_clang_yes=CLANG +_clang_no= +.else +_clang_yes= +_clang_no=CLANG +.endif + +# # MK_* options which default to "yes". # .for var in \ @@ -314,6 +326,7 @@ _no_fdt= FDT BZIP2 \ CALENDAR \ CDDL \ + ${_clang_yes} \ CPP \ CRYPT \ CTM \ @@ -417,6 +430,7 @@ MK_${var}:= yes BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + ${_clang_no} \ ${_no_fdt} \ HESIOD \ IDEA @@ -497,6 +511,7 @@ MK_GROFF:= no .endif .if ${MK_TOOLCHAIN} == "no" +MK_CLANG:= no MK_GDB:= no .endif Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Wed Jun 9 19:32:20 2010 (r208963) +++ head/usr.bin/Makefile Wed Jun 9 19:57:20 2010 (r208964) @@ -35,6 +35,7 @@ SUBDIR= alias \ ${_chkey} \ chpass \ cksum \ + ${_clang} \ cmp \ col \ ${_colcrt} \ @@ -279,6 +280,10 @@ _cpio= cpio _calendar= calendar .endif +.if ${MK_CLANG} != "no" +_clang= clang +.endif + .if ${MK_HESIOD} != "no" _hesinfo= hesinfo .endif From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 19:58:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D218C106579A; Wed, 9 Jun 2010 19:58:31 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC8D8FC16; Wed, 9 Jun 2010 19:58:31 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id DB5092A28CDC; Wed, 9 Jun 2010 21:58:30 +0200 (CEST) Date: Wed, 9 Jun 2010 21:58:30 +0200 From: Ed Schouten To: Roman Divacky Message-ID: <20100609195830.GF56080@hoeg.nl> References: <201006091957.o59JvKbu025122@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eBmOXtSL6ELarkSF" Content-Disposition: inline In-Reply-To: <201006091957.o59JvKbu025122@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208964 - in head: . etc/mtree lib share/mk usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:58:31 -0000 --eBmOXtSL6ELarkSF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Roman Divacky wrote: > Log: > Hook clang into the build on i386/amd64/powerpc. > =20 > Approved by: ed (mentor) Yeeehaw! --=20 Ed Schouten WWW: http://80386.nl/ --eBmOXtSL6ELarkSF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwP8mYACgkQ52SDGA2eCwUk1gCbBwTgzKwJqSVB6znKxcUwz/ue KGQAn0omLjinS7lOc5/3pBW2GjguCNgD =JJW6 -----END PGP SIGNATURE----- --eBmOXtSL6ELarkSF-- From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 20:11:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BFCF1065670; Wed, 9 Jun 2010 20:11:36 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D69E28FC17; Wed, 9 Jun 2010 20:11:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59KBZn1028434; Wed, 9 Jun 2010 20:11:35 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59KBZq1028432; Wed, 9 Jun 2010 20:11:35 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006092011.o59KBZq1028432@svn.freebsd.org> From: Roman Divacky Date: Wed, 9 Jun 2010 20:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208965 - head/tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 20:11:36 -0000 Author: rdivacky Date: Wed Jun 9 20:11:35 2010 New Revision: 208965 URL: http://svn.freebsd.org/changeset/base/208965 Log: Add WITHOUT_CLANG file with a description. Approved by: ed (mentor) Added: head/tools/build/options/WITHOUT_CLANG (contents, props changed) Added: head/tools/build/options/WITHOUT_CLANG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_CLANG Wed Jun 9 20:11:35 2010 (r208965) @@ -0,0 +1,2 @@ +$FreeBSD$ +Set to not build the Clang C/C++ commpiler. From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 20:13:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6630E1065670; Wed, 9 Jun 2010 20:13:50 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55DFF8FC0A; Wed, 9 Jun 2010 20:13:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59KDo46028958; Wed, 9 Jun 2010 20:13:50 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59KDoXu028956; Wed, 9 Jun 2010 20:13:50 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006092013.o59KDoXu028956@svn.freebsd.org> From: Roman Divacky Date: Wed, 9 Jun 2010 20:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208966 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 20:13:50 -0000 Author: rdivacky Date: Wed Jun 9 20:13:50 2010 New Revision: 208966 URL: http://svn.freebsd.org/changeset/base/208966 Log: Regen src.conf.5 Approved by: ed (mentor) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jun 9 20:11:35 2010 (r208965) +++ head/share/man/man5/src.conf.5 Wed Jun 9 20:13:50 2010 (r208966) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd May 19, 2010 +.Dd June 9, 2010 .Dt SRC.CONF 5 .Os .Sh NAME @@ -247,6 +247,9 @@ When set, it also enforces the following .It .Va WITHOUT_ZFS .El +.It Va WITHOUT_CLANG +from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208965 2010-06-09 20:11:35Z rdivacky +Set to not build the Clang C/C++ commpiler. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build @@ -297,6 +300,10 @@ dynamically. .\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to .Pa /usr/share/examples/ . +.It Va WITH_FDT +.\" from FreeBSD: head/tools/build/options/WITH_FDT 208537 2010-05-25 15:12:21Z raj +Set to build Flattened Device Tree support as part of the base system. This +includes the device tree compiler (dtc) and libfdt support library. .It Va WITHOUT_FLOPPY .\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 183306 2008-09-23 16:15:42Z sam Set to not build or install programs @@ -799,6 +806,8 @@ When set, it also enforces the following .Pp .Bl -item -compact .It +.Va WITHOUT_CLANG +.It .Va WITHOUT_GDB .El .It Va WITHOUT_USB From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 20:14:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 552CB1065672; Wed, 9 Jun 2010 20:14:15 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6098FC19; Wed, 9 Jun 2010 20:14:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id BA1039CB0D0; Wed, 9 Jun 2010 22:10:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pnGl6bnMxOXD; Wed, 9 Jun 2010 22:10:29 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 7EDEA9CB193; Wed, 9 Jun 2010 22:10:29 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id o59KATZL091404; Wed, 9 Jun 2010 22:10:29 +0200 (CEST) (envelope-from rdivacky) Date: Wed, 9 Jun 2010 22:10:29 +0200 From: Roman Divacky To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20100609201029.GA91358@freebsd.org> References: <201006092011.o59KBZq1028432@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201006092011.o59KBZq1028432@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: svn commit: r208965 - head/tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 20:14:15 -0000 On Wed, Jun 09, 2010 at 08:11:35PM +0000, Roman Divacky wrote: > Author: rdivacky > Date: Wed Jun 9 20:11:35 2010 > New Revision: 208965 > URL: http://svn.freebsd.org/changeset/base/208965 > > Log: > Add WITHOUT_CLANG file with a description. > > Approved by: ed (mentor) noticed and submitted by Pawel Worach... From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 20:18:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA9E01065673; Wed, 9 Jun 2010 20:18:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C16698FC16; Wed, 9 Jun 2010 20:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59KIIlu030010; Wed, 9 Jun 2010 20:18:18 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59KIIQ7030008; Wed, 9 Jun 2010 20:18:18 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006092018.o59KIIQ7030008@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Jun 2010 20:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208967 - head/tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 20:18:19 -0000 Author: ed Date: Wed Jun 9 20:18:18 2010 New Revision: 208967 URL: http://svn.freebsd.org/changeset/base/208967 Log: This should be commented out. Modified: head/tools/build/options/WITHOUT_CLANG Modified: head/tools/build/options/WITHOUT_CLANG ============================================================================== --- head/tools/build/options/WITHOUT_CLANG Wed Jun 9 20:13:50 2010 (r208966) +++ head/tools/build/options/WITHOUT_CLANG Wed Jun 9 20:18:18 2010 (r208967) @@ -1,2 +1,2 @@ -$FreeBSD$ +.\" $FreeBSD$ Set to not build the Clang C/C++ commpiler. From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 20:20:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD6021065676; Wed, 9 Jun 2010 20:20:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8638FC21; Wed, 9 Jun 2010 20:20:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59KKOf0030534; Wed, 9 Jun 2010 20:20:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59KKO09030532; Wed, 9 Jun 2010 20:20:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006092020.o59KKO09030532@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Jun 2010 20:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208968 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 20:20:24 -0000 Author: ed Date: Wed Jun 9 20:20:24 2010 New Revision: 208968 URL: http://svn.freebsd.org/changeset/base/208968 Log: Regenerate. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jun 9 20:18:18 2010 (r208967) +++ head/share/man/man5/src.conf.5 Wed Jun 9 20:20:24 2010 (r208968) @@ -248,7 +248,7 @@ When set, it also enforces the following .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG -from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208965 2010-06-09 20:11:35Z rdivacky +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208967 2010-06-09 20:18:18Z ed Set to not build the Clang C/C++ commpiler. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 21:40:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 841501065686; Wed, 9 Jun 2010 21:40:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72C6A8FC14; Wed, 9 Jun 2010 21:40:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59Lec21048598; Wed, 9 Jun 2010 21:40:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59LecIF048587; Wed, 9 Jun 2010 21:40:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006092140.o59LecIF048587@svn.freebsd.org> From: Xin LI Date: Wed, 9 Jun 2010 21:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208969 - head/sys/dev/twa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 21:40:38 -0000 Author: delphij Date: Wed Jun 9 21:40:38 2010 New Revision: 208969 URL: http://svn.freebsd.org/changeset/base/208969 Log: Apply driver update from LSI. Many thanks to LSI for continuing to support FreeBSD. 1) Timeout ioctl command timeouts. Do not reset the controller if ioctl command completed successfully. 2) Remove G66_WORKAROUND code (this bug never shipped). 3) Remove unnecessary interrupt lock (intr_lock). 4) Timeout firmware handshake for PChip reset (don't wait forever). 5) Handle interrupts inline. 6) Unmask command interrupt ONLY when adding a command to the pending queue. 7) Mask command interrupt ONLY after removing the last command from the pending queue. 8) Remove TW_OSLI_DEFERRED_INTR_USED code. 9) Replace controller "state" with separate data fields to avoid races: TW_CLI_CTLR_STATE_ACTIVE ctlr->active TW_CLI_CTLR_STATE_INTR_ENABLED ctlr->interrupts_enabled TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY ctlr->internal_req_busy TW_CLI_CTLR_STATE_GET_MORE_AENS ctlr->get_more_aens TW_CLI_CTLR_STATE_RESET_IN_PROGRESS ctlr->reset_in_progress TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS ctlr->reset_phase1_in_progress 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT null. 11) Replace softc "state" with separate data fields to avoid races: TW_OSLI_CTLR_STATE_OPEN sc->open TW_OSLI_CTLR_STATE_SIMQ_FROZEN sc->simq_frozen 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in tw_osl_complete_passthru() 13) Use correct CAM status values. Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID. Remove use of CAM_RELEASE_SIMQ for physical data addresses. 14) Do not freeze/ release the simq with non I/O commands. When it is appropriate to temporarily freeze the simq with an I/O command use: xpt_freeze_simq(sim, 1); ccb->ccb_h.status |= CAM_RELEASE_SIMQ; otherwise use: xpt_freeze_simq(sim, 1); xpt_release_simq(sim, 1); Submitted by: Tom Couch PR: kern/147695 MFC after: 3 days Modified: head/sys/dev/twa/tw_cl.h head/sys/dev/twa/tw_cl_fwif.h head/sys/dev/twa/tw_cl_init.c head/sys/dev/twa/tw_cl_intr.c head/sys/dev/twa/tw_cl_io.c head/sys/dev/twa/tw_cl_misc.c head/sys/dev/twa/tw_cl_share.h head/sys/dev/twa/tw_osl.h head/sys/dev/twa/tw_osl_cam.c head/sys/dev/twa/tw_osl_externs.h head/sys/dev/twa/tw_osl_freebsd.c head/sys/dev/twa/tw_osl_inline.h head/sys/dev/twa/tw_osl_share.h Modified: head/sys/dev/twa/tw_cl.h ============================================================================== --- head/sys/dev/twa/tw_cl.h Wed Jun 9 20:20:24 2010 (r208968) +++ head/sys/dev/twa/tw_cl.h Wed Jun 9 21:40:38 2010 (r208969) @@ -51,22 +51,6 @@ #define TW_CLI_RESET_TIMEOUT_PERIOD 60 /* seconds */ #define TW_CLI_MAX_RESET_ATTEMPTS 2 -/* Possible values of ctlr->state. */ -/* Initialization done, and controller is active. */ -#define TW_CLI_CTLR_STATE_ACTIVE (1<<0) -/* Interrupts on controller enabled. */ -#define TW_CLI_CTLR_STATE_INTR_ENABLED (1<<1) -/* Data buffer for internal requests in use. */ -#define TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY (1<<2) -/* More AEN's need to be retrieved. */ -#define TW_CLI_CTLR_STATE_GET_MORE_AENS (1<<3) -/* Controller is being reset. */ -#define TW_CLI_CTLR_STATE_RESET_IN_PROGRESS (1<<4) -/* G133 controller is in 'phase 1' of being reset. */ -#define TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS (1<<5) -/* G66 register write access bug needs to be worked around. */ -#define TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED (1<<6) - /* Possible values of ctlr->ioctl_lock.lock. */ #define TW_CLI_LOCK_FREE 0x0 /* lock is free */ #define TW_CLI_LOCK_HELD 0x1 /* lock is held */ @@ -146,7 +130,12 @@ struct tw_cli_ctlr_context { TW_UINT32 device_id; /* controller device id */ TW_UINT32 arch_id; /* controller architecture id */ - TW_UINT32 state; /* controller state */ + TW_UINT8 active; /* Initialization done, and controller is active. */ + TW_UINT8 interrupts_enabled; /* Interrupts on controller enabled. */ + TW_UINT8 internal_req_busy; /* Data buffer for internal requests in use. */ + TW_UINT8 get_more_aens; /* More AEN's need to be retrieved. */ + TW_UINT8 reset_in_progress; /* Controller is being reset. */ + TW_UINT8 reset_phase1_in_progress; /* In 'phase 1' of reset. */ TW_UINT32 flags; /* controller settings */ TW_UINT32 sg_size_factor; /* SG element size should be a multiple of this */ @@ -199,10 +188,6 @@ struct tw_cli_ctlr_context { submission */ TW_LOCK_HANDLE *io_lock;/* ptr to lock held during cmd submission */ - TW_LOCK_HANDLE intr_lock_handle;/* lock held during - ISR/response intr processing */ - TW_LOCK_HANDLE *intr_lock;/* ptr to lock held during ISR/ - response intr processing */ #ifdef TW_OSL_CAN_SLEEP TW_SLEEP_HANDLE sleep_handle; /* handle to co-ordinate sleeps Modified: head/sys/dev/twa/tw_cl_fwif.h ============================================================================== --- head/sys/dev/twa/tw_cl_fwif.h Wed Jun 9 20:20:24 2010 (r208968) +++ head/sys/dev/twa/tw_cl_fwif.h Wed Jun 9 21:40:38 2010 (r208969) @@ -89,7 +89,6 @@ #define TWA_STATUS_MINOR_VERSION_MASK 0x0F000000 #define TWA_STATUS_MAJOR_VERSION_MASK 0xF0000000 -#define TWA_STATUS_EXPECTED_BITS 0x00002000 #define TWA_STATUS_UNEXPECTED_BITS 0x00F00000 @@ -142,7 +141,7 @@ #define TWA_BASE_FW_SRL 24 #define TWA_BASE_FW_BRANCH 0 #define TWA_BASE_FW_BUILD 1 -#define TWA_CURRENT_FW_SRL 30 +#define TWA_CURRENT_FW_SRL 41 #define TWA_CURRENT_FW_BRANCH_9K 4 #define TWA_CURRENT_FW_BUILD_9K 8 #define TWA_CURRENT_FW_BRANCH_9K_X 8 Modified: head/sys/dev/twa/tw_cl_init.c ============================================================================== --- head/sys/dev/twa/tw_cl_init.c Wed Jun 9 20:20:24 2010 (r208968) +++ head/sys/dev/twa/tw_cl_init.c Wed Jun 9 21:40:38 2010 (r208969) @@ -208,7 +208,7 @@ tw_cl_get_mem_requirements(struct tw_cl_ */ *non_dma_mem_size = sizeof(struct tw_cli_ctlr_context) + - (sizeof(struct tw_cli_req_context) * (max_simult_reqs + 1)) + + (sizeof(struct tw_cli_req_context) * max_simult_reqs) + (sizeof(struct tw_cl_event_packet) * max_aens); @@ -220,7 +220,7 @@ tw_cl_get_mem_requirements(struct tw_cl_ */ *dma_mem_size = (sizeof(struct tw_cl_command_packet) * - (max_simult_reqs + 1)) + (TW_CLI_SECTOR_SIZE); + (max_simult_reqs)) + (TW_CLI_SECTOR_SIZE); return(0); } @@ -287,12 +287,12 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle } tw_osl_memzero(non_dma_mem, sizeof(struct tw_cli_ctlr_context) + - (sizeof(struct tw_cli_req_context) * (max_simult_reqs + 1)) + + (sizeof(struct tw_cli_req_context) * max_simult_reqs) + (sizeof(struct tw_cl_event_packet) * max_aens)); tw_osl_memzero(dma_mem, (sizeof(struct tw_cl_command_packet) * - (max_simult_reqs + 1)) + + max_simult_reqs) + TW_CLI_SECTOR_SIZE); free_non_dma_mem = (TW_UINT8 *)non_dma_mem; @@ -307,7 +307,7 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle ctlr->arch_id = TWA_ARCH_ID(device_id); ctlr->flags = flags; ctlr->sg_size_factor = TWA_SG_ELEMENT_SIZE_FACTOR(device_id); - ctlr->max_simult_reqs = max_simult_reqs + 1; + ctlr->max_simult_reqs = max_simult_reqs; ctlr->max_aens_supported = max_aens; /* Initialize queues of CL internal request context packets. */ @@ -321,55 +321,23 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle tw_osl_init_lock(ctlr_handle, "tw_cl_gen_lock", ctlr->gen_lock); ctlr->io_lock = &(ctlr->io_lock_handle); tw_osl_init_lock(ctlr_handle, "tw_cl_io_lock", ctlr->io_lock); - /* - * If 64 bit cmd pkt addresses are used, we will need to serialize - * writes to the hardware (across registers), since existing (G66) - * hardware will get confused if, for example, we wrote the low 32 bits - * of the cmd pkt address, followed by a response interrupt mask to the - * control register, followed by the high 32 bits of the cmd pkt - * address. It will then interpret the value written to the control - * register as the low cmd pkt address. So, for this case, we will - * make a note that we will need to synchronize control register writes - * with command register writes. - */ - if ((ctlr->flags & TW_CL_64BIT_ADDRESSES) && - ((ctlr->device_id == TW_CL_DEVICE_ID_9K) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_X) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_E) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_SA))) { - ctlr->state |= TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED; - ctlr->intr_lock = ctlr->io_lock; - } else { - ctlr->intr_lock = &(ctlr->intr_lock_handle); - tw_osl_init_lock(ctlr_handle, "tw_cl_intr_lock", - ctlr->intr_lock); - } /* Initialize CL internal request context packets. */ ctlr->req_ctxt_buf = (struct tw_cli_req_context *)free_non_dma_mem; free_non_dma_mem += (sizeof(struct tw_cli_req_context) * - ( - max_simult_reqs + - 1)); + max_simult_reqs); ctlr->cmd_pkt_buf = (struct tw_cl_command_packet *)dma_mem; ctlr->cmd_pkt_phys = dma_mem_phys; ctlr->internal_req_data = (TW_UINT8 *) (ctlr->cmd_pkt_buf + - ( - max_simult_reqs + - 1)); + max_simult_reqs); ctlr->internal_req_data_phys = ctlr->cmd_pkt_phys + (sizeof(struct tw_cl_command_packet) * - ( - max_simult_reqs + - 1)); - - for (i = 0; - i < ( - max_simult_reqs + - 1); i++) { + max_simult_reqs); + + for (i = 0; i < max_simult_reqs; i++) { req = &(ctlr->req_ctxt_buf[i]); req->cmd_pkt = &(ctlr->cmd_pkt_buf[i]); @@ -421,8 +389,8 @@ start_ctlr: /* Notify some info about the controller to the OSL. */ tw_cli_notify_ctlr_info(ctlr); - /* Mark the controller as active. */ - ctlr->state |= TW_CLI_CTLR_STATE_ACTIVE; + /* Mark the controller active. */ + ctlr->active = TW_CL_TRUE; return(error); } @@ -597,7 +565,7 @@ tw_cl_shutdown_ctlr(struct tw_cl_ctlr_ha * Mark the controller as inactive, disable any further interrupts, * and notify the controller that we are going down. */ - ctlr->state &= ~TW_CLI_CTLR_STATE_ACTIVE; + ctlr->active = TW_CL_FALSE; tw_cli_disable_interrupts(ctlr); @@ -617,8 +585,6 @@ tw_cl_shutdown_ctlr(struct tw_cl_ctlr_ha /* Destroy all locks used by CL. */ tw_osl_destroy_lock(ctlr_handle, ctlr->gen_lock); tw_osl_destroy_lock(ctlr_handle, ctlr->io_lock); - if (!(ctlr->flags & TW_CL_64BIT_ADDRESSES)) - tw_osl_destroy_lock(ctlr_handle, ctlr->intr_lock); ret: return(error); Modified: head/sys/dev/twa/tw_cl_intr.c ============================================================================== --- head/sys/dev/twa/tw_cl_intr.c Wed Jun 9 20:20:24 2010 (r208968) +++ head/sys/dev/twa/tw_cl_intr.c Wed Jun 9 21:40:38 2010 (r208969) @@ -75,22 +75,16 @@ tw_cl_interrupt(struct tw_cl_ctlr_handle if (ctlr == NULL) goto out; - /* If we get an interrupt while resetting, it is a shared - one for another device, so just bail */ - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) - goto out; - /* - * Synchronize access between writes to command and control registers - * in 64-bit environments, on G66. + * Bail If we get an interrupt while resetting, or shutting down. */ - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_get_lock(ctlr_handle, ctlr->io_lock); + if (ctlr->reset_in_progress || !(ctlr->active)) + goto out; /* Read the status register to determine the type of interrupt. */ status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr_handle); if (tw_cli_check_ctlr_state(ctlr, status_reg)) - goto out_unlock; + goto out; /* Clear the interrupt. */ if (status_reg & TWA_STATUS_HOST_INTERRUPT) { @@ -98,36 +92,30 @@ tw_cl_interrupt(struct tw_cl_ctlr_handle "Host interrupt"); TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, TWA_CONTROL_CLEAR_HOST_INTERRUPT); - ctlr->host_intr_pending = 0; /* we don't use this */ - rc |= TW_CL_FALSE; /* don't request for a deferred isr call */ } if (status_reg & TWA_STATUS_ATTENTION_INTERRUPT) { tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), "Attention interrupt"); + rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_attn_intr(ctlr); TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT); - ctlr->attn_intr_pending = 1; - rc |= TW_CL_TRUE; /* request for a deferred isr call */ } if (status_reg & TWA_STATUS_COMMAND_INTERRUPT) { tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), "Command interrupt"); - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_MASK_COMMAND_INTERRUPT); - ctlr->cmd_intr_pending = 1; rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_cmd_intr(ctlr); + if ((TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[TW_CLI_PENDING_Q]))) == TW_CL_NULL) + TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, + TWA_CONTROL_MASK_COMMAND_INTERRUPT); } if (status_reg & TWA_STATUS_RESPONSE_INTERRUPT) { tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "Response interrupt"); - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_MASK_RESPONSE_INTERRUPT); - ctlr->resp_intr_pending = 1; rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_resp_intr(ctlr); } -out_unlock: - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_free_lock(ctlr_handle, ctlr->io_lock); out: return(rc); } @@ -135,52 +123,6 @@ out: /* - * Function name: tw_cl_deferred_interrupt - * Description: Deferred interrupt handler. Does most of the processing - * related to an interrupt. - * - * Input: ctlr_handle -- controller handle - * Output: None - * Return value: None - */ -TW_VOID -tw_cl_deferred_interrupt(struct tw_cl_ctlr_handle *ctlr_handle) -{ - struct tw_cli_ctlr_context *ctlr = - (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - - tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered"); - - /* Dispatch based on the kind of interrupt. */ - if (ctlr->host_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Host interrupt"); - ctlr->host_intr_pending = 0; - tw_cli_process_host_intr(ctlr); - } - if (ctlr->attn_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Attention interrupt"); - ctlr->attn_intr_pending = 0; - tw_cli_process_attn_intr(ctlr); - } - if (ctlr->cmd_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Command interrupt"); - ctlr->cmd_intr_pending = 0; - tw_cli_process_cmd_intr(ctlr); - } - if (ctlr->resp_intr_pending) { - tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), - "Processing Response interrupt"); - ctlr->resp_intr_pending = 0; - tw_cli_process_resp_intr(ctlr); - } -} - - - -/* * Function name: tw_cli_process_host_intr * Description: This function gets called if we triggered an interrupt. * We don't use it as of now. @@ -248,12 +190,6 @@ tw_cli_process_cmd_intr(struct tw_cli_ct { tw_cli_dbg_printf(6, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - /* - * Let the OS Layer submit any requests in its pending queue, - * if it has one. - */ - tw_osl_ctlr_ready(ctlr->ctlr_handle); - /* Start any requests that might be in the pending queue. */ tw_cli_submit_pending_queue(ctlr); @@ -286,9 +222,6 @@ tw_cli_process_resp_intr(struct tw_cli_c tw_cli_dbg_printf(10, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - /* Serialize access to the controller response queue. */ - tw_osl_get_lock(ctlr->ctlr_handle, ctlr->intr_lock); - for (;;) { status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr->ctlr_handle); if ((error = tw_cli_check_ctlr_state(ctlr, status_reg))) @@ -315,7 +248,6 @@ tw_cli_process_resp_intr(struct tw_cli_c #ifdef TW_OSL_DEBUG tw_cl_print_ctlr_stats(ctlr->ctlr_handle); #endif /* TW_OSL_DEBUG */ - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock); tw_cl_reset_ctlr(ctlr->ctlr_handle); return(TW_OSL_EIO); } @@ -330,12 +262,6 @@ tw_cli_process_resp_intr(struct tw_cli_c } - /* Unmask the response interrupt. */ - TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, - TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT); - - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock); - /* Complete this, and other requests in the complete queue. */ tw_cli_process_complete_queue(ctlr); @@ -614,12 +540,11 @@ tw_cli_param_callback(struct tw_cli_req_ "status = %d", cmd->param.status); } - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); - if ((ctlr->state & TW_CLI_CTLR_STATE_GET_MORE_AENS) && - (!(ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS))) { - ctlr->state &= ~TW_CLI_CTLR_STATE_GET_MORE_AENS; + if ((ctlr->get_more_aens) && (!(ctlr->reset_in_progress))) { + ctlr->get_more_aens = TW_CL_FALSE; tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "Fetching more AEN's"); if ((error = tw_cli_get_aen(ctlr))) @@ -677,7 +602,7 @@ tw_cli_aen_callback(struct tw_cli_req_co } if (error) { - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return; } @@ -688,7 +613,7 @@ tw_cli_aen_callback(struct tw_cli_req_co aen_code = tw_cli_manage_aen(ctlr, req); if (aen_code != TWA_AEN_SYNC_TIME_WITH_HOST) { - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); if (aen_code != TWA_AEN_QUEUE_EMPTY) if ((error = tw_cli_get_aen(ctlr))) @@ -736,25 +661,25 @@ tw_cli_manage_aen(struct tw_cli_ctlr_con * Free the internal req pkt right here, since * tw_cli_set_param will need it. */ - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); /* * We will use a callback in tw_cli_set_param only when * interrupts are enabled and we can expect our callback - * to get called. Setting the TW_CLI_CTLR_STATE_GET_MORE_AENS + * to get called. Setting the get_more_aens * flag will make the callback continue to try to retrieve * more AEN's. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED) - ctlr->state |= TW_CLI_CTLR_STATE_GET_MORE_AENS; + if (ctlr->interrupts_enabled) + ctlr->get_more_aens = TW_CL_TRUE; /* Calculate time (in seconds) since last Sunday 12.00 AM. */ local_time = tw_osl_get_local_time(); sync_time = (local_time - (3 * 86400)) % 604800; if ((error = tw_cli_set_param(ctlr, TWA_PARAM_TIME_TABLE, TWA_PARAM_TIME_SCHED_TIME, 4, &sync_time, - (ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED) + (ctlr->interrupts_enabled) ? tw_cli_param_callback : TW_CL_NULL))) tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, @@ -799,7 +724,7 @@ tw_cli_enable_interrupts(struct tw_cli_c { tw_cli_dbg_printf(3, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - ctlr->state |= TW_CLI_CTLR_STATE_INTR_ENABLED; + ctlr->interrupts_enabled = TW_CL_TRUE; TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT | TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT | @@ -823,6 +748,6 @@ tw_cli_disable_interrupts(struct tw_cli_ TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, TWA_CONTROL_DISABLE_INTERRUPTS); - ctlr->state &= ~TW_CLI_CTLR_STATE_INTR_ENABLED; + ctlr->interrupts_enabled = TW_CL_FALSE; } Modified: head/sys/dev/twa/tw_cl_io.c ============================================================================== --- head/sys/dev/twa/tw_cl_io.c Wed Jun 9 20:20:24 2010 (r208968) +++ head/sys/dev/twa/tw_cl_io.c Wed Jun 9 21:40:38 2010 (r208969) @@ -49,6 +49,10 @@ #include "tw_cl_externs.h" #include "tw_osl_ioctl.h" +#include +#include +#include + /* @@ -76,11 +80,9 @@ tw_cl_start_io(struct tw_cl_ctlr_handle ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) { + if (ctlr->reset_in_progress) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), - "I/O during reset: returning busy. Ctlr state = 0x%x", - ctlr->state); - tw_osl_ctlr_busy(ctlr_handle, req_handle); + "I/O during reset: returning busy."); return(TW_OSL_EBUSY); } @@ -101,7 +103,6 @@ tw_cl_start_io(struct tw_cl_ctlr_handle )) == TW_CL_NULL) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "Out of request context packets: returning busy"); - tw_osl_ctlr_busy(ctlr_handle, req_handle); return(TW_OSL_EBUSY); } @@ -171,7 +172,6 @@ tw_cli_submit_cmd(struct tw_cli_req_cont struct tw_cl_ctlr_handle *ctlr_handle = ctlr->ctlr_handle; TW_UINT32 status_reg; TW_INT32 error; - TW_UINT8 notify_osl_of_ctlr_busy = TW_CL_FALSE; tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered"); @@ -208,10 +208,13 @@ tw_cli_submit_cmd(struct tw_cli_req_cont req->state = TW_CLI_REQ_STATE_PENDING; tw_cli_req_q_insert_tail(req, TW_CLI_PENDING_Q); error = 0; + /* Unmask command interrupt. */ + TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, + TWA_CONTROL_UNMASK_COMMAND_INTERRUPT); } else error = TW_OSL_EBUSY; } else { - notify_osl_of_ctlr_busy = TW_CL_TRUE; + tw_osl_ctlr_busy(ctlr_handle, req->req_handle); error = TW_OSL_EBUSY; } } else { @@ -246,25 +249,6 @@ tw_cli_submit_cmd(struct tw_cli_req_cont out: tw_osl_free_lock(ctlr_handle, ctlr->io_lock); - if (status_reg & TWA_STATUS_COMMAND_QUEUE_FULL) { - if (notify_osl_of_ctlr_busy) - tw_osl_ctlr_busy(ctlr_handle, req->req_handle); - - /* - * Synchronize access between writes to command and control - * registers in 64-bit environments, on G66. - */ - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_get_lock(ctlr_handle, ctlr->io_lock); - - /* Unmask command interrupt. */ - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_UNMASK_COMMAND_INTERRUPT); - - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_free_lock(ctlr_handle, ctlr->io_lock); - } - return(error); } @@ -299,12 +283,9 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_hand ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) { + if (ctlr->reset_in_progress) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), - "Passthru request during reset: returning busy. " - "Ctlr state = 0x%x", - ctlr->state); - tw_osl_ctlr_busy(ctlr_handle, req_handle); + "Passthru request during reset: returning busy."); return(TW_OSL_EBUSY); } @@ -312,7 +293,6 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_hand )) == TW_CL_NULL) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "Out of request context packets: returning busy"); - tw_osl_ctlr_busy(ctlr_handle, req_handle); return(TW_OSL_EBUSY); } @@ -759,11 +739,11 @@ tw_cli_get_param(struct tw_cli_ctlr_cont goto out; /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) { + if (ctlr->internal_req_busy) { error = TW_OSL_EBUSY; goto out; } - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; req->length = TW_CLI_SECTOR_SIZE; @@ -821,7 +801,7 @@ tw_cli_get_param(struct tw_cli_ctlr_cont goto out; } tw_osl_memcpy(param_data, param->data, param_size); - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } else { /* There's a call back. Simply submit the command. */ @@ -838,7 +818,7 @@ out: "get_param failed", "error = %d", error); if (param) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; if (req) tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return(1); @@ -878,11 +858,11 @@ tw_cli_set_param(struct tw_cli_ctlr_cont goto out; /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) { + if (ctlr->internal_req_busy) { error = TW_OSL_EBUSY; goto out; } - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; req->length = TW_CLI_SECTOR_SIZE; @@ -939,7 +919,7 @@ tw_cli_set_param(struct tw_cli_ctlr_cont &(req->cmd_pkt->cmd_hdr)); goto out; } - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } else { /* There's a call back. Simply submit the command. */ @@ -956,7 +936,7 @@ out: "set_param failed", "error = %d", error); if (param) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; if (req) tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return(error); @@ -1054,8 +1034,11 @@ tw_cli_submit_and_poll_request(struct tw * taking care of it). */ tw_cli_req_q_remove_item(req, TW_CLI_PENDING_Q); + if ((TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[TW_CLI_PENDING_Q]))) == TW_CL_NULL) + TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, + TWA_CONTROL_MASK_COMMAND_INTERRUPT); if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } @@ -1079,12 +1062,16 @@ tw_cl_reset_ctlr(struct tw_cl_ctlr_handl { struct tw_cli_ctlr_context *ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); + struct twa_softc *sc = ctlr_handle->osl_ctlr_ctxt; TW_INT32 reset_attempt = 1; TW_INT32 error; tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "entered"); - ctlr->state |= TW_CLI_CTLR_STATE_RESET_IN_PROGRESS; + ctlr->reset_in_progress = TW_CL_TRUE; + xpt_freeze_simq(sc->sim, 1); + + tw_cli_disable_interrupts(ctlr); /* * Error back all requests in the complete, busy, and pending queues. @@ -1098,8 +1085,8 @@ tw_cl_reset_ctlr(struct tw_cl_ctlr_handl tw_cli_drain_complete_queue(ctlr); tw_cli_drain_busy_queue(ctlr); tw_cli_drain_pending_queue(ctlr); - - tw_cli_disable_interrupts(ctlr); + ctlr->internal_req_busy = TW_CL_FALSE; + ctlr->get_more_aens = TW_CL_FALSE; /* Soft reset the controller. */ try_reset: @@ -1135,7 +1122,9 @@ try_reset: " "); out: - ctlr->state &= ~TW_CLI_CTLR_STATE_RESET_IN_PROGRESS; + ctlr->reset_in_progress = TW_CL_FALSE; + xpt_release_simq(sc->sim, 1); + /* * Enable interrupts, and also clear attention and response interrupts. */ @@ -1163,6 +1152,8 @@ tw_cli_soft_reset(struct tw_cli_ctlr_con { struct tw_cl_ctlr_handle *ctlr_handle = ctlr->ctlr_handle; TW_UINT32 status_reg; + int found; + int loop_count; TW_UINT32 error; tw_cli_dbg_printf(1, ctlr_handle, tw_osl_cur_func(), "entered"); @@ -1192,12 +1183,27 @@ tw_cli_soft_reset(struct tw_cli_ctlr_con * make sure we don't access any hardware registers (for * polling) during that window. */ - ctlr->state |= TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS; - while (tw_cli_find_response(ctlr, - TWA_RESET_PHASE1_NOTIFICATION_RESPONSE) != TW_OSL_ESUCCESS) + ctlr->reset_phase1_in_progress = TW_CL_TRUE; + loop_count = 0; + do { + found = (tw_cli_find_response(ctlr, TWA_RESET_PHASE1_NOTIFICATION_RESPONSE) == TW_OSL_ESUCCESS); tw_osl_delay(10); + loop_count++; + error = 0x7888; + } while (!found && (loop_count < 6000000)); /* Loop for no more than 60 seconds */ + + if (!found) { + tw_cl_create_event(ctlr_handle, TW_CL_TRUE, + TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, + 0x1109, 0x1, TW_CL_SEVERITY_ERROR_STRING, + "Missed firmware handshake after soft-reset", + "error = %d", error); + tw_osl_free_lock(ctlr_handle, ctlr->io_lock); + return(error); + } + tw_osl_delay(TWA_RESET_PHASE1_WAIT_TIME_MS * 1000); - ctlr->state &= ~TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS; + ctlr->reset_phase1_in_progress = TW_CL_FALSE; } if ((error = tw_cli_poll_status(ctlr, @@ -1285,9 +1291,9 @@ tw_cli_send_scsi_cmd(struct tw_cli_req_c tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) + if (ctlr->internal_req_busy) return(TW_OSL_EBUSY); - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; tw_osl_memzero(req->data, TW_CLI_SECTOR_SIZE); @@ -1365,7 +1371,7 @@ tw_cli_get_aen(struct tw_cli_ctlr_contex "Could not send SCSI command", "request = %p, error = %d", req, error); if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } return(error); Modified: head/sys/dev/twa/tw_cl_misc.c ============================================================================== --- head/sys/dev/twa/tw_cl_misc.c Wed Jun 9 20:20:24 2010 (r208968) +++ head/sys/dev/twa/tw_cl_misc.c Wed Jun 9 21:40:38 2010 (r208969) @@ -368,14 +368,14 @@ tw_cli_drain_aen_queue(struct tw_cli_ctl if (aen_code == TWA_AEN_SYNC_TIME_WITH_HOST) continue; - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } out: if (req) { if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } return(error); @@ -447,34 +447,7 @@ tw_cli_poll_status(struct tw_cli_ctlr_co /* got the required bit(s) */ return(TW_OSL_ESUCCESS); - /* - * The OSL should not define TW_OSL_CAN_SLEEP if it calls - * tw_cl_deferred_interrupt from within the ISR and not a - * lower interrupt level, since, in that case, we might end - * up here, and try to sleep (within an ISR). - */ -#ifndef TW_OSL_CAN_SLEEP - /* OSL doesn't support sleeping; will spin. */ tw_osl_delay(1000); -#else /* TW_OSL_CAN_SLEEP */ -#if 0 - /* Will spin if initializing, sleep otherwise. */ - if (!(ctlr->state & TW_CLI_CTLR_STATE_ACTIVE)) - tw_osl_delay(1000); - else - tw_osl_sleep(ctlr->ctlr_handle, - &(ctlr->sleep_handle), 1 /* ms */); -#else /* #if 0 */ - /* - * Will always spin for now (since reset holds a spin lock). - * We could free io_lock after the call to TW_CLI_SOFT_RESET, - * so we could sleep here. To block new requests (since - * the lock will have been released) we could use the - * ...RESET_IN_PROGRESS flag. Need to revisit. - */ - tw_osl_delay(1000); -#endif /* #if 0 */ -#endif /* TW_OSL_CAN_SLEEP */ } while (tw_osl_get_local_time() <= end_time); return(TW_OSL_ETIMEDOUT); @@ -736,22 +709,20 @@ tw_cli_check_ctlr_state(struct tw_cli_ct tw_cli_dbg_printf(8, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); /* Check if the 'micro-controller ready' bit is not set. */ - if ((status_reg & TWA_STATUS_EXPECTED_BITS) != - TWA_STATUS_EXPECTED_BITS) { + if (!(status_reg & TWA_STATUS_MICROCONTROLLER_READY)) { TW_INT8 desc[200]; tw_osl_memzero(desc, 200); - if ((status_reg & TWA_STATUS_MICROCONTROLLER_READY) || - (!(ctlr->state & - TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS))) { + if (!(ctlr->reset_phase1_in_progress)) { tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, 0x1301, 0x1, TW_CL_SEVERITY_ERROR_STRING, "Missing expected status bit(s)", "status reg = 0x%x; Missing bits: %s", status_reg, - tw_cli_describe_bits (~status_reg & - TWA_STATUS_EXPECTED_BITS, desc)); + tw_cli_describe_bits( + TWA_STATUS_MICROCONTROLLER_READY, + desc)); error = TW_OSL_EGENFAILURE; } } @@ -765,7 +736,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct /* Skip queue error msgs during 9650SE/9690SA reset */ if (((ctlr->device_id != TW_CL_DEVICE_ID_9K_E) && (ctlr->device_id != TW_CL_DEVICE_ID_9K_SA)) || - ((ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) == 0) || + (!(ctlr->reset_in_progress)) || ((status_reg & TWA_STATUS_QUEUE_ERROR_INTERRUPT) == 0)) tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, @@ -819,7 +790,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct /* Skip queue error msgs during 9650SE/9690SA reset */ if (((ctlr->device_id != TW_CL_DEVICE_ID_9K_E) && (ctlr->device_id != TW_CL_DEVICE_ID_9K_SA)) || - ((ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) == 0)) + (!(ctlr->reset_in_progress))) tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, 0x1305, 0x1, TW_CL_SEVERITY_ERROR_STRING, @@ -839,7 +810,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct "status reg = 0x%x %s", status_reg, tw_cli_describe_bits(status_reg, desc)); - error = TW_OSL_EGENFAILURE; + error = TW_OSL_EGENFAILURE; // tw_cl_reset_ctlr(ctlr_handle); } } return(error); Modified: head/sys/dev/twa/tw_cl_share.h ============================================================================== --- head/sys/dev/twa/tw_cl_share.h Wed Jun 9 20:20:24 2010 (r208968) +++ head/sys/dev/twa/tw_cl_share.h Wed Jun 9 21:40:38 2010 (r208969) @@ -76,7 +76,7 @@ * of supporting only 255, since we want to keep one CL internal request * context packet always available for internal requests. */ -#define TW_CL_MAX_SIMULTANEOUS_REQUESTS 0xFF /* max simult reqs supported */ +#define TW_CL_MAX_SIMULTANEOUS_REQUESTS 256 /* max simult reqs supported */ #define TW_CL_MAX_32BIT_SG_ELEMENTS 109 /* max 32-bit sg elements */ #define TW_CL_MAX_64BIT_SG_ELEMENTS 72 /* max 64-bit sg elements */ @@ -144,6 +144,7 @@ struct tw_cl_ctlr_handle { struct tw_cl_req_handle { TW_VOID *osl_req_ctxt; /* OSL's request context */ TW_VOID *cl_req_ctxt; /* CL's request context */ + TW_UINT8 is_io; /* Only freeze/release simq for IOs */ }; @@ -353,12 +354,6 @@ extern TW_VOID tw_osl_ctlr_busy(struct t #endif -#ifndef tw_osl_ctlr_ready -/* Called on cmd interrupt. Allows re-submission of any pending requests. */ -extern TW_VOID tw_osl_ctlr_ready(struct tw_cl_ctlr_handle *ctlr_handle); -#endif - - #ifndef tw_osl_cur_func /* Text name of current function. */ extern TW_INT8 *tw_osl_cur_func(TW_VOID); @@ -528,10 +523,6 @@ extern TW_VOID tw_cl_create_event(struct extern TW_INT32 tw_cl_ctlr_supported(TW_INT32 vendor_id, TW_INT32 device_id); -/* Deferred interrupt handler. */ -extern TW_VOID tw_cl_deferred_interrupt(struct tw_cl_ctlr_handle *ctlr_handle); - - /* Submit a firmware cmd packet. */ extern TW_INT32 tw_cl_fw_passthru(struct tw_cl_ctlr_handle *ctlr_handle, struct tw_cl_req_packet *req_pkt, struct tw_cl_req_handle *req_handle); Modified: head/sys/dev/twa/tw_osl.h ============================================================================== --- head/sys/dev/twa/tw_osl.h Wed Jun 9 20:20:24 2010 (r208968) +++ head/sys/dev/twa/tw_osl.h Wed Jun 9 21:40:38 2010 (r208969) @@ -50,13 +50,11 @@ #define TW_OSLI_DEVICE_NAME "3ware 9000 series Storage Controller" #define TW_OSLI_MALLOC_CLASS M_TWA -#define TW_OSLI_MAX_NUM_IOS TW_CL_MAX_SIMULTANEOUS_REQUESTS +#define TW_OSLI_MAX_NUM_REQUESTS TW_CL_MAX_SIMULTANEOUS_REQUESTS +/* Reserve two command packets. One for ioctls and one for AENs */ +#define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - 2) #define TW_OSLI_MAX_NUM_AENS 0x100 -/* Disabled, doesn't work yet. -#define TW_OSLI_DEFERRED_INTR_USED -*/ - #ifdef PAE #define TW_OSLI_DMA_BOUNDARY (1u << 31) #else @@ -80,10 +78,6 @@ #define TW_OSLI_REQ_FLAGS_PASSTHRU (1<<5) /* pass through request */ #define TW_OSLI_REQ_FLAGS_SLEEPING (1<<6) /* owner sleeping on this cmd */ -/* Possible values of sc->state. */ -#define TW_OSLI_CTLR_STATE_OPEN (1<<0) /* control device is open */ -#define TW_OSLI_CTLR_STATE_SIMQ_FROZEN (1<<1) /* simq frozen */ - #ifdef TW_OSL_DEBUG struct tw_osli_q_stats { @@ -101,6 +95,8 @@ struct tw_osli_q_stats { /* Driver's request packet. */ struct tw_osli_req_context { struct tw_cl_req_handle req_handle;/* tag to track req b/w OSL & CL */ + struct mtx ioctl_wake_timeout_lock_handle;/* non-spin lock used to detect ioctl timeout */ + struct mtx *ioctl_wake_timeout_lock;/* ptr to above lock */ struct twa_softc *ctlr; /* ptr to OSL's controller context */ TW_VOID *data; /* ptr to data being passed to CL */ TW_UINT32 length; /* length of buf being passed to CL */ @@ -130,10 +126,10 @@ struct tw_osli_req_context { /* Per-controller structure. */ struct twa_softc { struct tw_cl_ctlr_handle ctlr_handle; - struct tw_osli_req_context *req_ctxt_buf; + struct tw_osli_req_context *req_ctx_buf; /* Controller state. */ - TW_UINT32 state; + TW_UINT8 open; TW_UINT32 flags; TW_INT32 device_id; Modified: head/sys/dev/twa/tw_osl_cam.c ============================================================================== --- head/sys/dev/twa/tw_osl_cam.c Wed Jun 9 20:20:24 2010 (r208968) +++ head/sys/dev/twa/tw_osl_cam.c Wed Jun 9 21:40:38 2010 (r208969) @@ -81,7 +81,7 @@ tw_osli_cam_attach(struct twa_softc *sc) /* * Create the device queue for our SIM. */ - if ((devq = cam_simq_alloc(TW_OSLI_MAX_NUM_IOS)) == NULL) { + if ((devq = cam_simq_alloc(TW_OSLI_MAX_NUM_REQUESTS)) == NULL) { tw_osli_printf(sc, "error = %d", TW_CL_SEVERITY_ERROR_STRING, TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, @@ -92,15 +92,15 @@ tw_osli_cam_attach(struct twa_softc *sc) } /* - * Create a SIM entry. Though we can support TW_OSLI_MAX_NUM_IOS + * Create a SIM entry. Though we can support TW_OSLI_MAX_NUM_REQUESTS * simultaneous requests, we claim to be able to handle only - * (TW_OSLI_MAX_NUM_IOS - 1), so that we always have a request - * packet available to service ioctls. + * TW_OSLI_MAX_NUM_IOS (two less), so that we always have a request + * packet available to service ioctls and AENs. */ tw_osli_dbg_dprintf(3, sc, "Calling cam_sim_alloc"); sc->sim = cam_sim_alloc(twa_action, twa_poll, "twa", sc, device_get_unit(sc->bus_dev), sc->sim_lock, - TW_OSLI_MAX_NUM_IOS - 1, 1, devq); + TW_OSLI_MAX_NUM_IOS, 1, devq); if (sc->sim == NULL) { cam_simq_free(devq); tw_osli_printf(sc, "error = %d", @@ -168,14 +168,6 @@ tw_osli_cam_detach(struct twa_softc *sc) { tw_osli_dbg_dprintf(3, sc, "entered"); -#ifdef TW_OSLI_DEFERRED_INTR_USED - /* - drain the taskqueue - Ctrl is already went down so, no more enqueuetask will - happen . Don't hold any locks, that task might need. - */ - - taskqueue_drain(taskqueue_fast, &(sc->deferred_intr_callback)); -#endif mtx_lock(sc->sim_lock); if (sc->path) @@ -236,7 +228,7 @@ tw_osli_execute_scsi(struct tw_osli_req_ TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, 0x2105, "Physical CDB address!"); - ccb_h->status = CAM_REQ_CMP_ERR; + ccb_h->status = CAM_REQ_INVALID; xpt_done(ccb); return(1); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 21:58:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35FDE106566C; Wed, 9 Jun 2010 21:58:24 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-yw0-f182.google.com (mail-yw0-f182.google.com [209.85.211.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8ABC68FC17; Wed, 9 Jun 2010 21:58:23 +0000 (UTC) Received: by ywh12 with SMTP id 12so5189791ywh.14 for ; Wed, 09 Jun 2010 14:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=aOXRg77edLz5I9fCjPUh7ZRaIC3waUlQ8bmzdia97ZU=; b=wstH4oMaxgeIBiaUphyCruAq+SEHb3NqtmlSsf2ZLvAf6WdDcC2IXhWYsO86Mz/L6C qHBhNxEty/4g0tc2EAYTFFk5V2iPtWFb7L4Gv7KPRM2MTI8i/QxcStbG137fuwjougJK hHJUgWcSId9DyVSWdYbTSHy+bSKByquISyfVw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=C09HhrsBiQKjVetkhsqrc+8uchb36zoBJiiuTRu6/ULLPol98f4mv4GTrk0rcJKHsZ zT7g5YDEiIm3EoTUHMD3nUlOkvVE188EhAdDns5kikh+c9vyinobbCQaZ2uUk/FKXYDy Dw4Uiuzq4zTgvKXFkim3XCdLliyGEYM79TuKs= MIME-Version: 1.0 Received: by 10.229.250.201 with SMTP id mp9mr7411407qcb.67.1276120697395; Wed, 09 Jun 2010 14:58:17 -0700 (PDT) Received: by 10.229.233.74 with HTTP; Wed, 9 Jun 2010 14:58:17 -0700 (PDT) In-Reply-To: <20100609190445.GE56080@hoeg.nl> References: <201006091759.o59HxrJw096803@svn.freebsd.org> <20100609190445.GE56080@hoeg.nl> Date: Wed, 9 Jun 2010 14:58:17 -0700 Message-ID: From: Garrett Cooper To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208954 - in head/contrib/llvm: . docs test tools/clang tools/clang/docs tools/clang/test website X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 21:58:24 -0000 On Wed, Jun 9, 2010 at 12:04 PM, Ed Schouten wrote: > Hi Garrett, > > * Garrett Cooper wrote: >> Why strip test? This might actually be helpful for folks trying to >> evaluate whether or not they should upgrade to newer versions of >> clang. > > The testsuite can be checked out separately from the vendor space. It > will account for about 50 MB of additional disk space usage. Yes, but the tests can change at any point in time and might not reflect the code stored in the repository. Could a note at least be provided, or a port maintained to help others (say vendors) who have to qualify FreeBSD that this is the particular version that needs to be picked up from in order to test our shiny new compiler? That would make things considerably easier to work with, as I've worked as QA in a Linux shop in the past, where a lot of Linux provided packages that we had in the tree did not have the associated test code, and as QA that made my job a pain to deal with. Just a small file that stated where and/or how to obtain things would make this a lot easier. I would think that developers would also like the same to see whether or not there are any particular known issues with clang/llvm. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 22:03:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D9551065689; Wed, 9 Jun 2010 22:03:15 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id E1B348FC19; Wed, 9 Jun 2010 22:03:14 +0000 (UTC) Received: by gyh20 with SMTP id 20so5664736gyh.13 for ; Wed, 09 Jun 2010 15:03:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=I9I4ouzWolgKG8rziDHvrisr0tThQeiWEnvfrm45n4I=; b=fLw3TZttw1FLY3t09XcE4GFK8vDYca7ZXZ+4YFXvxyQVnxIY5VDLsqsijVxQSJcJlT IO7K40JD5oNBrgs11q+w9lDtcPEet2l6CPr1TIUpZ2dsbAbzkMRsvn9GiY3TITMzuZeI Xu7oD4tVMRH84eNvXl0QPYu5Y686L+URvIlf8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=xhY4AcOQMU6vduOF76oyJIKPvmyLXpzx5dnpoqavzCgY5LS2QarGWPwdVDy0cp8C3L 8PXB5ieT/uSg93AE9q+oclxkG1fhFruSrnXy/zPZkzKft5bUmYYswBadtYszBrAuPfUd e+q4mdtnG3jprv3u4dXlcouArC16+ImQfAbMc= MIME-Version: 1.0 Received: by 10.229.227.209 with SMTP id jb17mr4732084qcb.295.1276120993760; Wed, 09 Jun 2010 15:03:13 -0700 (PDT) Received: by 10.229.233.74 with HTTP; Wed, 9 Jun 2010 15:03:13 -0700 (PDT) In-Reply-To: <201006092011.o59KBZq1028432@svn.freebsd.org> References: <201006092011.o59KBZq1028432@svn.freebsd.org> Date: Wed, 9 Jun 2010 15:03:13 -0700 Message-ID: From: Garrett Cooper To: Roman Divacky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208965 - head/tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 22:03:15 -0000 On Wed, Jun 9, 2010 at 1:11 PM, Roman Divacky wrote: > Author: rdivacky > Date: Wed Jun =A09 20:11:35 2010 > New Revision: 208965 > URL: http://svn.freebsd.org/changeset/base/208965 > > Log: > =A0Add WITHOUT_CLANG file with a description. > > =A0Approved by: =A0ed (mentor) > > Added: > =A0head/tools/build/options/WITHOUT_CLANG =A0 (contents, props changed) > > Added: head/tools/build/options/WITHOUT_CLANG > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null =A0 00:00:00 1970 =A0 (empty, because file is newly added) > +++ head/tools/build/options/WITHOUT_CLANG =A0 =A0 =A0Wed Jun =A09 20:11:= 35 2010 =A0 =A0 =A0 =A0(r208965) > @@ -0,0 +1,2 @@ > +$FreeBSD$ > +Set to not build the Clang C/C++ commpiler. Typo (s/commpiler/compiler/). Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 22:05:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9005B1065678; Wed, 9 Jun 2010 22:05:29 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 806318FC15; Wed, 9 Jun 2010 22:05:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59M5T6f054139; Wed, 9 Jun 2010 22:05:29 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59M5TsI054137; Wed, 9 Jun 2010 22:05:29 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006092205.o59M5TsI054137@svn.freebsd.org> From: Randall Stewart Date: Wed, 9 Jun 2010 22:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208970 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 22:05:29 -0000 Author: rrs Date: Wed Jun 9 22:05:29 2010 New Revision: 208970 URL: http://svn.freebsd.org/changeset/base/208970 Log: Found by Michael. In cases where we run out of memory (no more inp space) we don't propely NULL the INP on return. Obtained from: tuexen MFC after: 3 Days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Jun 9 21:40:38 2010 (r208969) +++ head/sys/netinet/sctp_pcb.c Wed Jun 9 22:05:29 2010 (r208970) @@ -2338,6 +2338,7 @@ sctp_inpcb_alloc(struct socket *so, uint * in protosw */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EOPNOTSUPP); + so->so_pcb = NULL; SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (EOPNOTSUPP); } @@ -2356,6 +2357,7 @@ sctp_inpcb_alloc(struct socket *so, uint if (inp->sctp_tcbhash == NULL) { SCTP_PRINTF("Out of SCTP-INPCB->hashinit - no resources\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOBUFS); + so->so_pcb = NULL; SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (ENOBUFS); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 22:20:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6BBC106567B; Wed, 9 Jun 2010 22:20:26 +0000 (UTC) (envelope-from pawel.worach@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id 094418FC24; Wed, 9 Jun 2010 22:20:25 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 25so265020eya.9 for ; Wed, 09 Jun 2010 15:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=AM/7sz1T5+0X9bMRwE8eCxsBxoekePicBbSlFBEGKMY=; b=PiieTZtB6S/tA3tEF7hPWoQKH36uQb/g1ZewPinmZzULT430oRaZPDDHTd6wj4MfFJ 9JputZ4f6I3docBN1yTDNnKbn+cWR2DHPswvfQKTxF82AxnDW0oeH4jtkEVNU2Ix+P8M coLIbVeVcyUjnDMB+dQp1WETl7eCn8ifNtX6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=bCg9+TTYjrXtcTHUQTWY83UuhlHA4fekmbpedCMvoFcaRTnHMXuJQuPgRJUT65fg3j nQaW2a4EmkxZTIQV5gW2ceqcKOLPEKkY0mcZkNNj1OMbZ/DqG/dBDUlgOSkNge+eIj/0 nbSDqwEYcyw3SKVOrcW8sSzh9h5UDULDSCMTY= Received: by 10.213.108.203 with SMTP id g11mr390266ebp.35.1276122024362; Wed, 09 Jun 2010 15:20:24 -0700 (PDT) Received: from [172.16.0.199] (c80-216-186-179.bredband.comhem.se [80.216.186.179]) by mx.google.com with ESMTPS id 15sm4370002ewy.0.2010.06.09.15.20.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 09 Jun 2010 15:20:23 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Pawel Worach In-Reply-To: Date: Thu, 10 Jun 2010 00:20:21 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <82F59C7F-7984-449A-BA04-796F0A17DC3E@gmail.com> References: <201006091759.o59HxrJw096803@svn.freebsd.org> <20100609190445.GE56080@hoeg.nl> To: Garrett Cooper X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208954 - in head/contrib/llvm: . docs test tools/clang tools/clang/docs tools/clang/test website X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 22:20:27 -0000 On Jun 9, 2010, at 23:58, Garrett Cooper wrote: > On Wed, Jun 9, 2010 at 12:04 PM, Ed Schouten wrote: >> Hi Garrett, >>=20 >> * Garrett Cooper wrote: >>> Why strip test? This might actually be helpful for folks trying to >>> evaluate whether or not they should upgrade to newer versions of >>> clang. >>=20 >> The testsuite can be checked out separately from the vendor space. It >> will account for about 50 MB of additional disk space usage. >=20 > Yes, but the tests can change at any point in time and might not > reflect the code stored in the repository. >=20 > Could a note at least be provided, or a port maintained to help others > (say vendors) who have to qualify FreeBSD that this is the particular > version that needs to be picked up from in order to test our > shiny new compiler? That would make things considerably easier to work > with, as I've worked as QA in a Linux shop in the past, where a lot of > Linux provided packages that we had in the tree did not have the > associated test code, and as QA that made my job a pain to deal with. >=20 > Just a small file that stated where and/or how to obtain things would > make this a lot easier. >=20 > I would think that developers would also like the same to see whether > or not there are any particular known issues with clang/llvm. >=20 We have a buildbot running here[1] that has the goal of serving as a = qualification system. It does a nightly build of llvm/clang trunk in a self-host config, runs = the test suite in both stages and then builds freebsd trunk world+kernel = and boots the result. [1] http://amd64-clang-bot.qat.freebsd.org:8010/waterfall --=20 Pawel From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 04:50:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B6371065674; Thu, 10 Jun 2010 04:50:21 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa]) by mx1.freebsd.org (Postfix) with ESMTP id 54E628FC1E; Thu, 10 Jun 2010 04:50:21 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 9BBA02A28CDA; Thu, 10 Jun 2010 06:50:20 +0200 (CEST) Date: Thu, 10 Jun 2010 06:50:20 +0200 From: Ed Schouten To: Garrett Cooper Message-ID: <20100610045020.GH56080@hoeg.nl> References: <201006091759.o59HxrJw096803@svn.freebsd.org> <20100609190445.GE56080@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/aqkQhmPSFFRXP6G" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208954 - in head/contrib/llvm: . docs test tools/clang tools/clang/docs tools/clang/test website X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 04:50:21 -0000 --/aqkQhmPSFFRXP6G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Garrett Cooper wrote: > On Wed, Jun 9, 2010 at 12:04 PM, Ed Schouten wrote: > > Hi Garrett, > > > > * Garrett Cooper wrote: > >> Why strip test? This might actually be helpful for folks trying to > >> evaluate whether or not they should upgrade to newer versions of > >> clang. > > > > The testsuite can be checked out separately from the vendor space. It > > will account for about 50 MB of additional disk space usage. >=20 > Yes, but the tests can change at any point in time and might not > reflect the code stored in the repository. I really don't see the problem here. In the vendor space all imports are tagged, so the tests there *do* reflect the code stored in the repository. --=20 Ed Schouten WWW: http://80386.nl/ --/aqkQhmPSFFRXP6G Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwQbwwACgkQ52SDGA2eCwWfvQCeL+jjfTQ6g32Ypfgr30VikWYN F+UAn1Qv61IdaLsr4tJ+vYsKP8x3CLI9 =bfnl -----END PGP SIGNATURE----- --/aqkQhmPSFFRXP6G-- From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 06:20:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E7A81065673; Thu, 10 Jun 2010 06:20:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1526F8FC17; Thu, 10 Jun 2010 06:20:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5A6KQOo064182; Thu, 10 Jun 2010 06:20:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5A6KQHs064181; Thu, 10 Jun 2010 06:20:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006100620.o5A6KQHs064181@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 06:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208971 - head/tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 06:20:27 -0000 Author: ed Date: Thu Jun 10 06:20:26 2010 New Revision: 208971 URL: http://svn.freebsd.org/changeset/base/208971 Log: Fix typo. Spotted by: Garrett Cooper Modified: head/tools/build/options/WITHOUT_CLANG Modified: head/tools/build/options/WITHOUT_CLANG ============================================================================== --- head/tools/build/options/WITHOUT_CLANG Wed Jun 9 22:05:29 2010 (r208970) +++ head/tools/build/options/WITHOUT_CLANG Thu Jun 10 06:20:26 2010 (r208971) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build the Clang C/C++ commpiler. +Set to not build the Clang C/C++ compiler. From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 06:22:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A8FA106567B; Thu, 10 Jun 2010 06:22:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0D88FC0C; Thu, 10 Jun 2010 06:22:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5A6MARk064594; Thu, 10 Jun 2010 06:22:10 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5A6MAYm064592; Thu, 10 Jun 2010 06:22:10 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006100622.o5A6MAYm064592@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 06:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208972 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 06:22:11 -0000 Author: ed Date: Thu Jun 10 06:22:10 2010 New Revision: 208972 URL: http://svn.freebsd.org/changeset/base/208972 Log: Regenerate. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Jun 10 06:20:26 2010 (r208971) +++ head/share/man/man5/src.conf.5 Thu Jun 10 06:22:10 2010 (r208972) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd June 9, 2010 +.Dd June 10, 2010 .Dt SRC.CONF 5 .Os .Sh NAME @@ -248,8 +248,8 @@ When set, it also enforces the following .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208967 2010-06-09 20:18:18Z ed -Set to not build the Clang C/C++ commpiler. +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208971 2010-06-10 06:20:26Z ed +Set to not build the Clang C/C++ compiler. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 06:39:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F06F1065672; Thu, 10 Jun 2010 06:39:55 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id D23928FC17; Thu, 10 Jun 2010 06:39:54 +0000 (UTC) Received: by pvb32 with SMTP id 32so959977pvb.13 for ; Wed, 09 Jun 2010 23:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=4AO/qAGuucOcfkoJIelOS9vENJ9ttsaVdXWVlRXX7zk=; b=ET3egQnnqhn/qaEJ0ssRdMABVE8etnufjzHYPDbH+KlnyjZZ4zICLU6et+ueIHchgP lquayx+3qftUenzBNyX6PvDBzD+ZEpGSSI/SAlay5pA6ESXR5hSo1pQJM6Gj8GCgMXSz iAnem1SUvJiXPnf6dMlRYpjd/GDOqNCPeSn18= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=txZZZbmoJaU8T4GB9+aP0uvEnc6K4ftkW+z2SV1xlFsOv/85kyGSMi6TmFWYmbJBah cn1whlC5ljt60dRTnRibuKWH5Wo5/cGmW+WiWQAsXO7sgdD9EPS8+Wt0cFv4KVGnMqQ6 R191EBKU+8xNp+aGZ1wJiTT2naSy1jiTv48wQ= Received: by 10.141.23.19 with SMTP id a19mr3179353rvj.63.1276150377291; Wed, 09 Jun 2010 23:12:57 -0700 (PDT) Received: from [192.168.0.204] (deviant.freebsdgirl.com [173.8.183.73]) by mx.google.com with ESMTPS id o38sm3642620rvp.2.2010.06.09.23.12.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 09 Jun 2010 23:12:56 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <82F59C7F-7984-449A-BA04-796F0A17DC3E@gmail.com> Date: Wed, 9 Jun 2010 23:12:52 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006091759.o59HxrJw096803@svn.freebsd.org> <20100609190445.GE56080@hoeg.nl> <82F59C7F-7984-449A-BA04-796F0A17DC3E@gmail.com> To: Pawel Worach X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208954 - in head/contrib/llvm: . docs test tools/clang tools/clang/docs tools/clang/test website X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 06:39:55 -0000 On Jun 9, 2010, at 3:20 PM, Pawel Worach wrote: > On Jun 9, 2010, at 23:58, Garrett Cooper wrote: >=20 >> On Wed, Jun 9, 2010 at 12:04 PM, Ed Schouten wrote: >>> Hi Garrett, >>>=20 >>> * Garrett Cooper wrote: >>>> Why strip test? This might actually be helpful for folks trying to >>>> evaluate whether or not they should upgrade to newer versions of >>>> clang. >>>=20 >>> The testsuite can be checked out separately from the vendor space. = It >>> will account for about 50 MB of additional disk space usage. >>=20 >> Yes, but the tests can change at any point in time and might not >> reflect the code stored in the repository. >>=20 >> Could a note at least be provided, or a port maintained to help = others >> (say vendors) who have to qualify FreeBSD that this is the particular >> version that needs to be picked up from in order to test our >> shiny new compiler? That would make things considerably easier to = work >> with, as I've worked as QA in a Linux shop in the past, where a lot = of >> Linux provided packages that we had in the tree did not have the >> associated test code, and as QA that made my job a pain to deal with. >>=20 >> Just a small file that stated where and/or how to obtain things would >> make this a lot easier. >>=20 >> I would think that developers would also like the same to see whether >> or not there are any particular known issues with clang/llvm. >>=20 >=20 > We have a buildbot running here[1] that has the goal of serving as a = qualification system. >=20 > It does a nightly build of llvm/clang trunk in a self-host config, = runs the test suite in both stages and then builds freebsd trunk = world+kernel and boots the result. Yes, but how much is tested, and what code paths are tested in the = compiled kernel? Do you have all of the devices required to test all of = the drivers and extensive tests to exercise everything? Probably not; it = sounds like what you have setup wise is a smoke test box -- which is = good but it's not comprehensive enough to catch all issues... That also doesn't test out i386, or powerpc. Ideally the project should have a cluster of dedicated machines for = regression testing available in a colo somewhere where someone can load = images on the machine via netboot, or install, then execute a set of = functional and/or performance tests to gauge whether or not the code has = functional or performance regressions. Don't get me wrong, what you guys have is good -- but it's just not 100% = convincing for someone making a switchover to a newer toolchain, because = of all of the different variables that might be out there with all of = the code in FreeBSD, as well as interactions with compiled code, and 3rd = party software as well. But this is just the beginning of clang on FreeBSD and the project in = and of itself has a long way to go. Adding the bits so that other groups = could help evaluate, add tests, etc to ensure that clang/llvm works as = expected is what we should be focusing on, not just runtime tests and = `works for me' scenarios. Thanks, -Garrett= From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 06:48:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28EF9106566B; Thu, 10 Jun 2010 06:48:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 183D98FC08; Thu, 10 Jun 2010 06:48:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5A6m9d4070329; Thu, 10 Jun 2010 06:48:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5A6m9mG070327; Thu, 10 Jun 2010 06:48:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006100648.o5A6m9mG070327@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 06:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208973 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 06:48:10 -0000 Author: ed Date: Thu Jun 10 06:48:09 2010 New Revision: 208973 URL: http://svn.freebsd.org/changeset/base/208973 Log: Bump __FreeBSD_version to indicate the addition of Clang to HEAD. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Jun 10 06:22:10 2010 (r208972) +++ head/sys/sys/param.h Thu Jun 10 06:48:09 2010 (r208973) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900013 /* Master, propagated to newvers */ +#define __FreeBSD_version 900014 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 10:17:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C3001065675; Thu, 10 Jun 2010 10:17:02 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5398FC15; Thu, 10 Jun 2010 10:17:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AAH0ZA016417; Thu, 10 Jun 2010 10:17:00 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AAH04d016415; Thu, 10 Jun 2010 10:17:00 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201006101017.o5AAH04d016415@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 10 Jun 2010 10:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208974 - head/usr.bin/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 10:17:02 -0000 Author: gabor Date: Thu Jun 10 10:17:00 2010 New Revision: 208974 URL: http://svn.freebsd.org/changeset/base/208974 Log: - Fix style(9) Submitted by: ed Approved by: delphij (mentor) Modified: head/usr.bin/dc/dc.c Modified: head/usr.bin/dc/dc.c ============================================================================== --- head/usr.bin/dc/dc.c Thu Jun 10 06:48:09 2010 (r208973) +++ head/usr.bin/dc/dc.c Thu Jun 10 10:17:00 2010 (r208974) @@ -87,7 +87,7 @@ main(int argc, char *argv[]) while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) { switch (ch) { case 'e': - if(!preproc_done) + if (!preproc_done) init_bmachine(extended_regs); src_setstring(&src, optarg); reset_bmachine(&src); @@ -95,7 +95,7 @@ main(int argc, char *argv[]) preproc_done = true; break; case 'f': - if(!preproc_done) + if (!preproc_done) init_bmachine(extended_regs); procfile(optarg); preproc_done = true; From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 10:19:03 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 777F31065674; Thu, 10 Jun 2010 10:19:03 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 27FD18FC1A; Thu, 10 Jun 2010 10:19:02 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 4CFA414DB9C9; Thu, 10 Jun 2010 12:19:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CWLto64nVM6w; Thu, 10 Jun 2010 12:18:59 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id BE46814DB7AE; Thu, 10 Jun 2010 12:18:59 +0200 (CEST) Message-ID: <4C10BC10.3090903@FreeBSD.org> Date: Thu, 10 Jun 2010 12:18:56 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; es-ES; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Jilles Tjoelker References: <201006061136.o56Ba9tr029717@svn.freebsd.org> <20100606120004.GH83316@deviant.kiev.zoral.com.ua> <20100606121444.GA82819@nagual.pp.ru> <20100606131841.GA68034@stack.nl> In-Reply-To: <20100606131841.GA68034@stack.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , Andrey Chernov , svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Subject: Re: svn commit: r208868 - in head/usr.bin: bc dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 10:19:03 -0000 > >> Yes, better use write(2) and _exit(2) here. >> > I wonder if a signal handler is necessary at all here. The shell should > print a newline after an interruption. This does not appear to work in > sh(1) in the (default) interactive job control mode, but works in tcsh, > bash and zsh for example. > > Yes, it was indeed a good suggestion and then we don't have to deal with undefined behaviour. I've just committed the fix. Thanks for the suggestion. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 10:28:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD89B106566B; Thu, 10 Jun 2010 10:28:38 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD9698FC12; Thu, 10 Jun 2010 10:28:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AAScvj018975; Thu, 10 Jun 2010 10:28:38 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AAScuj018973; Thu, 10 Jun 2010 10:28:38 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201006101028.o5AAScuj018973@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 10 Jun 2010 10:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208975 - head/usr.bin/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 10:28:38 -0000 Author: gabor Date: Thu Jun 10 10:28:38 2010 New Revision: 208975 URL: http://svn.freebsd.org/changeset/base/208975 Log: - Axe out signal handling code, the shell will take care of this Suggested by: jilles Approved by: delphij (mentor) Modified: head/usr.bin/dc/bcode.c Modified: head/usr.bin/dc/bcode.c ============================================================================== --- head/usr.bin/dc/bcode.c Thu Jun 10 10:17:00 2010 (r208974) +++ head/usr.bin/dc/bcode.c Thu Jun 10 10:28:38 2010 (r208975) @@ -54,7 +54,6 @@ struct bmachine { }; static struct bmachine bmachine; -static void got_sigint(int); static __inline int readch(void); static __inline void unreadch(void); @@ -221,14 +220,6 @@ static const struct jump_entry jump_tabl #define JUMP_TABLE_DATA_SIZE \ (sizeof(jump_table_data)/sizeof(jump_table_data[0])) -static void -got_sigint(int ignored __unused) -{ - - putchar('\n'); - exit(0); -} - void init_bmachine(bool extended_registers) { @@ -261,7 +252,6 @@ init_bmachine(bool extended_registers) bmachine.obase = bmachine.ibase = 10; BN_init(&zero); bn_check(BN_zero(&zero)); - signal(SIGINT, got_sigint); } /* Reset the things needed before processing a (new) file */ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 10:39:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 686E8106566C; Thu, 10 Jun 2010 10:39:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8438FC1B; Thu, 10 Jun 2010 10:39:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AAdXWR021468; Thu, 10 Jun 2010 10:39:33 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AAdXeG021467; Thu, 10 Jun 2010 10:39:33 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006101039.o5AAdXeG021467@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 10:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208976 - vendor/llvm/llvm-r104832 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 10:39:33 -0000 Author: ed Date: Thu Jun 10 10:39:32 2010 New Revision: 208976 URL: http://svn.freebsd.org/changeset/base/208976 Log: Properly tag LLVM. Tags are cheap. Added: vendor/llvm/llvm-r104832/ - copied from r208975, vendor/llvm/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 10:39:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBA3E1065675; Thu, 10 Jun 2010 10:39:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2AEF8FC29; Thu, 10 Jun 2010 10:39:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AAdtZZ021572; Thu, 10 Jun 2010 10:39:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AAdt3K021571; Thu, 10 Jun 2010 10:39:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006101039.o5AAdt3K021571@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 10:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208977 - vendor/clang/clang-r104832 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 10:39:56 -0000 Author: ed Date: Thu Jun 10 10:39:55 2010 New Revision: 208977 URL: http://svn.freebsd.org/changeset/base/208977 Log: Finally tag Clang. Added: vendor/clang/clang-r104832/ - copied from r208976, vendor/clang/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 10:42:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D956F1065672; Thu, 10 Jun 2010 10:42:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B00668FC21; Thu, 10 Jun 2010 10:42:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AAg8AA022111; Thu, 10 Jun 2010 10:42:08 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AAg8Ir022110; Thu, 10 Jun 2010 10:42:08 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006101042.o5AAg8Ir022110@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 10:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208978 - in vendor/llvm: llvm-84119 llvm-r84119 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 10:42:08 -0000 Author: ed Date: Thu Jun 10 10:42:08 2010 New Revision: 208978 URL: http://svn.freebsd.org/changeset/base/208978 Log: Use consistent naming. Added: vendor/llvm/llvm-r84119/ - copied from r208977, vendor/llvm/llvm-84119/ Deleted: vendor/llvm/llvm-84119/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 10:42:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38BD610656C9; Thu, 10 Jun 2010 10:42:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F5F68FC16; Thu, 10 Jun 2010 10:42:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AAgZuh022251; Thu, 10 Jun 2010 10:42:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AAgZcH022250; Thu, 10 Jun 2010 10:42:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006101042.o5AAgZcH022250@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 10:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208979 - in vendor/llvm: llvm-84176 llvm-r84176 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 10:42:36 -0000 Author: ed Date: Thu Jun 10 10:42:35 2010 New Revision: 208979 URL: http://svn.freebsd.org/changeset/base/208979 Log: Use consistent naming. Added: vendor/llvm/llvm-r84176/ - copied from r208978, vendor/llvm/llvm-84176/ Deleted: vendor/llvm/llvm-84176/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 10:43:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB743106566B; Thu, 10 Jun 2010 10:43:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A23498FC1B; Thu, 10 Jun 2010 10:43:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AAhGJs022429; Thu, 10 Jun 2010 10:43:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AAhGfg022428; Thu, 10 Jun 2010 10:43:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006101043.o5AAhGfg022428@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 10:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208980 - in vendor/clang: clang-84119 clang-r84119 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 10:43:16 -0000 Author: ed Date: Thu Jun 10 10:43:16 2010 New Revision: 208980 URL: http://svn.freebsd.org/changeset/base/208980 Log: Use consistent naming. Added: vendor/clang/clang-r84119/ - copied from r208979, vendor/clang/clang-84119/ Deleted: vendor/clang/clang-84119/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 10:43:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1D73106566B; Thu, 10 Jun 2010 10:43:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 986EA8FC16; Thu, 10 Jun 2010 10:43:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AAhiHj022566; Thu, 10 Jun 2010 10:43:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AAhixt022565; Thu, 10 Jun 2010 10:43:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006101043.o5AAhixt022565@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 10:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208981 - in vendor/clang: clang-84175 clang-r84175 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 10:43:44 -0000 Author: ed Date: Thu Jun 10 10:43:44 2010 New Revision: 208981 URL: http://svn.freebsd.org/changeset/base/208981 Log: Use consistent naming. Added: vendor/clang/clang-r84175/ - copied from r208980, vendor/clang/clang-84175/ Deleted: vendor/clang/clang-84175/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 11:01:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3A4A106566C; Thu, 10 Jun 2010 11:01:17 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39028FC0C; Thu, 10 Jun 2010 11:01:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AB1HbC030148; Thu, 10 Jun 2010 11:01:17 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AB1Hlb030146; Thu, 10 Jun 2010 11:01:17 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201006101101.o5AB1Hlb030146@svn.freebsd.org> From: Ivan Voras Date: Thu, 10 Jun 2010 11:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208982 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 11:01:17 -0000 Author: ivoras Date: Thu Jun 10 11:01:17 2010 New Revision: 208982 URL: http://svn.freebsd.org/changeset/base/208982 Log: Cosmetic change to XML - less ugly newlines Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Jun 10 10:43:44 2010 (r208981) +++ head/sys/kern/sched_ule.c Thu Jun 10 11:01:17 2010 (r208982) @@ -2661,9 +2661,9 @@ sysctl_kern_sched_topology_spec_internal sbuf_printf(sb, "%*s ", indent, ""); if (cg->cg_flags != 0) { if ((cg->cg_flags & CG_FLAG_HTT) != 0) - sbuf_printf(sb, "HTT group\n"); + sbuf_printf(sb, "HTT group"); if ((cg->cg_flags & CG_FLAG_SMT) != 0) - sbuf_printf(sb, "SMT group\n"); + sbuf_printf(sb, "SMT group"); } sbuf_printf(sb, "\n"); From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 11:14:29 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98BED1065677; Thu, 10 Jun 2010 11:14:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 149098FC08; Thu, 10 Jun 2010 11:14:28 +0000 (UTC) Received: from c122-106-175-69.carlnfd1.nsw.optusnet.com.au (c122-106-175-69.carlnfd1.nsw.optusnet.com.au [122.106.175.69]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5ABEPnl018348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 Jun 2010 21:14:27 +1000 Date: Thu, 10 Jun 2010 21:14:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <201006081446.09423.jhb@freebsd.org> Message-ID: <20100610205617.Y33786@delplex.bde.org> References: <201006081804.o58I473g073875@svn.freebsd.org> <201006081446.09423.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208921 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 11:14:29 -0000 On Tue, 8 Jun 2010, John Baldwin wrote: > On Tuesday 08 June 2010 2:04:07 pm John Baldwin wrote: >> Log: >> Move the machine check support code to the x86 tree since it is identical >> on i386 and amd64. >> >> Requested by: alc > > It would be nice to consolidate as that is identical on both > platforms, but that moving to x86/include is trickier as the header needs to > be available in userland, probably as still. > would work ok (i.e. in /usr/include/x86/mca.h), but that makes things trickier > in the kernel as the file should really live in sys/x86/include, not sys/x86 > directly. Having x86/include would defeat . However, is only good for MD implentations of MI interfaces (things like PAGE_SIZE and va_arg()), so mca.h, like many other headers now there, should never have been in . mca.h is very MD and currently only exists for amd64, i386, ia64 and pc98. Applications that know that there is such a file can also know where it is. It should be somewhere like for amd64, i386 and pc98. This is mainly for userland. In the kernel, the natural place for most arch-specific headers is in the arch/arch subdir, not arch/include where they are now. That would be sys/x86/x86 here. There seems to be no reason for the arch/include subdir to exist for pseudo-arches like x86. It would just be a little easier to export only the headers in it if the headers are separate. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 11:48:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98E4F106566B; Thu, 10 Jun 2010 11:48:14 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88C598FC08; Thu, 10 Jun 2010 11:48:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ABmESS040416; Thu, 10 Jun 2010 11:48:14 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ABmEcq040414; Thu, 10 Jun 2010 11:48:14 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201006101148.o5ABmEcq040414@svn.freebsd.org> From: Ivan Voras Date: Thu, 10 Jun 2010 11:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208983 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 11:48:14 -0000 Author: ivoras Date: Thu Jun 10 11:48:14 2010 New Revision: 208983 URL: http://svn.freebsd.org/changeset/base/208983 Log: Unconfuse THREAD and SMT flags Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Jun 10 11:01:17 2010 (r208982) +++ head/sys/kern/sched_ule.c Thu Jun 10 11:48:14 2010 (r208983) @@ -2662,8 +2662,10 @@ sysctl_kern_sched_topology_spec_internal if (cg->cg_flags != 0) { if ((cg->cg_flags & CG_FLAG_HTT) != 0) sbuf_printf(sb, "HTT group"); + if ((cg->cg_flags & CG_FLAG_THREAD) != 0) + sbuf_printf(sb, "THREAD group"); if ((cg->cg_flags & CG_FLAG_SMT) != 0) - sbuf_printf(sb, "SMT group"); + sbuf_printf(sb, "SMT group"); } sbuf_printf(sb, "\n"); From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 12:06:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FE441065677; Thu, 10 Jun 2010 12:06:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FEA38FC15; Thu, 10 Jun 2010 12:06:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AC6aV7044529; Thu, 10 Jun 2010 12:06:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AC6apk044527; Thu, 10 Jun 2010 12:06:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006101206.o5AC6apk044527@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 12:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208984 - head/lib/clang X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 12:06:36 -0000 Author: ed Date: Thu Jun 10 12:06:35 2010 New Revision: 208984 URL: http://svn.freebsd.org/changeset/base/208984 Log: Brand our Clang binary. That way it's easier for the Clang folks to keep track of what we're doing. Modified: head/lib/clang/clang.build.mk Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Thu Jun 10 11:48:14 2010 (r208983) +++ head/lib/clang/clang.build.mk Thu Jun 10 12:06:35 2010 (r208984) @@ -10,7 +10,8 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG TARGET_ARCH?= ${MACHINE_ARCH} # XXX: 8.0, to keep __FreeBSD_cc_version happy -CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\" +CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\" \ + -DCLANG_VENDOR=\"clang\ r104832\ 20100610\ [FreeBSD]\\n\" .PATH: ${LLVM_SRCS}/${SRCDIR} From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 12:15:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB5331065670; Thu, 10 Jun 2010 12:15:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B0858FC1F; Thu, 10 Jun 2010 12:15:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ACF94X046498; Thu, 10 Jun 2010 12:15:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ACF99h046496; Thu, 10 Jun 2010 12:15:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006101215.o5ACF99h046496@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Jun 2010 12:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208985 - head/lib/clang/include/llvm/Config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 12:15:09 -0000 Author: ed Date: Thu Jun 10 12:15:09 2010 New Revision: 208985 URL: http://svn.freebsd.org/changeset/base/208985 Log: Disable usage of __DATE__. This ensures that the Clang binary doesn't change checksums every time it's built. Modified: head/lib/clang/include/llvm/Config/config.h Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Thu Jun 10 12:06:35 2010 (r208984) +++ head/lib/clang/include/llvm/Config/config.h Thu Jun 10 12:15:09 2010 (r208985) @@ -27,7 +27,7 @@ /* #undef ENABLE_THREADS */ /* Define if timestamp information (e.g., __DATE___) is allowed */ -#define ENABLE_TIMESTAMPS 1 +/* #undef ENABLE_TIMESTAMPS */ /* Define to 1 if you have the `argz_append' function. */ /* #undef HAVE_ARGZ_APPEND */ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 14:19:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D210A1065677; Thu, 10 Jun 2010 14:19:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6EC48FC1B; Thu, 10 Jun 2010 14:19:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AEJpPU074095; Thu, 10 Jun 2010 14:19:51 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AEJpX7074091; Thu, 10 Jun 2010 14:19:51 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201006101419.o5AEJpX7074091@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 10 Jun 2010 14:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208986 - in head: share/man/man5 sys/sys usr.bin/ipcs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 14:19:52 -0000 Author: bz Date: Thu Jun 10 14:19:51 2010 New Revision: 208986 URL: http://svn.freebsd.org/changeset/base/208986 Log: Make the char *n_name member of struct nlist 'const'. This avoids errors or __DECONST() from places with higher WARNS levels. Adjust a local cache variable in ipcs to const as well to compile in the new world order. Suggested by: jhb Reviewed by: jhb, kib, brueffer (man) Modified: head/share/man/man5/a.out.5 head/share/man/man5/stab.5 head/sys/sys/nlist_aout.h head/usr.bin/ipcs/ipc.c Modified: head/share/man/man5/a.out.5 ============================================================================== --- head/share/man/man5/a.out.5 Thu Jun 10 12:15:09 2010 (r208985) +++ head/share/man/man5/a.out.5 Thu Jun 10 14:19:51 2010 (r208986) @@ -35,7 +35,7 @@ .\" @(#)a.out.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd June 10, 2010 .Dt A.OUT 5 .Os .Sh NAME @@ -307,13 +307,13 @@ structures: .Bd -literal -offset indent struct nlist { union { - char *n_name; - long n_strx; + const char *n_name; + long n_strx; } n_un; - unsigned char n_type; - char n_other; - short n_desc; - unsigned long n_value; + unsigned char n_type; + char n_other; + short n_desc; + unsigned long n_value; }; .Ed .Pp Modified: head/share/man/man5/stab.5 ============================================================================== --- head/share/man/man5/stab.5 Thu Jun 10 12:15:09 2010 (r208985) +++ head/share/man/man5/stab.5 Thu Jun 10 14:19:51 2010 (r208986) @@ -32,7 +32,7 @@ .\" @(#)stab.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd June 10, 2010 .Dt STAB 5 .Os .Sh NAME @@ -79,7 +79,7 @@ consists of the following structure: struct nlist { union { - char *n_name; /* for use when in-core */ + const char *n_name; /* for use when in-core */ long n_strx; /* index into file string table */ } n_un; unsigned char n_type; /* type flag */ Modified: head/sys/sys/nlist_aout.h ============================================================================== --- head/sys/sys/nlist_aout.h Thu Jun 10 12:15:09 2010 (r208985) +++ head/sys/sys/nlist_aout.h Thu Jun 10 14:19:51 2010 (r208986) @@ -51,11 +51,11 @@ struct nlist { #ifdef _AOUT_INCLUDE_ union { - char *n_name; /* symbol name (in memory) */ + const char *n_name; /* symbol name (in memory) */ long n_strx; /* file string table offset (on disk) */ } n_un; #else - char *n_name; /* symbol name (in memory) */ + const char *n_name; /* symbol name (in memory) */ int : 8 * (sizeof(long) > sizeof(char *) ? sizeof(long) - sizeof(char *) : sizeof(char *) - sizeof(long)); #endif Modified: head/usr.bin/ipcs/ipc.c ============================================================================== --- head/usr.bin/ipcs/ipc.c Thu Jun 10 12:15:09 2010 (r208985) +++ head/usr.bin/ipcs/ipc.c Thu Jun 10 14:19:51 2010 (r208986) @@ -128,7 +128,7 @@ sysctlgatherstruct(void *addr, size_t si void kget(int idx, void *addr, size_t size) { - char *symn; /* symbol name */ + const char *symn; /* symbol name */ size_t tsiz; int rv; unsigned long kaddr; From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 15:30:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33327106567C; Thu, 10 Jun 2010 15:30:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E6E118FC08; Thu, 10 Jun 2010 15:30:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5AFOxww038374; Thu, 10 Jun 2010 09:24:59 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 10 Jun 2010 09:25:02 -0600 (MDT) Message-Id: <20100610.092502.72112000528403516.imp@bsdimp.com> To: rdivacky@freebsd.org From: "M. Warner Losh" In-Reply-To: <201006091957.o59JvKbu025122@svn.freebsd.org> References: <201006091957.o59JvKbu025122@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208964 - in head: . etc/mtree lib share/mk usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 15:30:45 -0000 In message: <201006091957.o59JvKbu025122@svn.freebsd.org> Roman Divacky writes: : Modified: head/share/mk/bsd.own.mk : ============================================================================== : --- head/share/mk/bsd.own.mk Wed Jun 9 19:32:20 2010 (r208963) : +++ head/share/mk/bsd.own.mk Wed Jun 9 19:57:20 2010 (r208964) : @@ -288,6 +288,18 @@ _no_fdt= FDT : .endif : : # : +# Default behaviour of MK_CLANG depends on the architecture. : +# : +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ : + ${MACHINE_ARCH} == "powerpc" : +_clang_yes=CLANG : +_clang_no= : +.else : +_clang_yes= : +_clang_no=CLANG : +.endif We really should *NOT* be encoding architecture stuff like this into bsd.own.mk. Sometimes the right thing here is MACHINE_ARCH, and for the moment, since clang is not a bootstrap tool, this is correct. However, once clang is a bootstrap tool, this will be incorrect because during the bootstrapping for cross building TARGET_ARCH is what should be tested. We have the same problem with the FTD stuff that was recently committed. raj@ and I have been talking about the best ways to fix it. I'm merging my tbemd code in the next few days/weeks and hope to start to address this problem. It already starts to address the insanity we have in the Makefile.incs. Warner From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 16:13:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 602B01065670; Thu, 10 Jun 2010 16:13:33 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC958FC13; Thu, 10 Jun 2010 16:13:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AGDXKw099246; Thu, 10 Jun 2010 16:13:33 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AGDXHA099237; Thu, 10 Jun 2010 16:13:33 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006101613.o5AGDXHA099237@svn.freebsd.org> From: Roman Divacky Date: Thu, 10 Jun 2010 16:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208987 - in head/contrib/llvm/tools/clang: include/clang/Analysis/Analyses include/clang/Basic include/clang/Driver lib/Analysis lib/Driver lib/Frontend lib/Sema X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 16:13:33 -0000 Author: rdivacky Date: Thu Jun 10 16:13:32 2010 New Revision: 208987 URL: http://svn.freebsd.org/changeset/base/208987 Log: Introduce -fformat-extensions. A local FreeBSD extension used for additional printf modifiers in kernel. Approved by: ed (mentor) Modified: head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Modified: head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h Thu Jun 10 14:19:51 2010 (r208986) +++ head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h Thu Jun 10 16:13:32 2010 (r208987) @@ -57,6 +57,7 @@ public: InvalidSpecifier = 0, // C99 conversion specifiers. dArg, // 'd' + DArg, // 'D' FreeBSD specific specifiers iArg, // 'i', oArg, // 'o', uArg, // 'u', @@ -82,6 +83,7 @@ public: ObjCObjArg, // '@' // GlibC specific specifiers. PrintErrno, // 'm' + bArg, // FreeBSD specific specifiers // Specifier ranges. IntArgBeg = dArg, IntArgEnd = iArg, @@ -306,7 +308,7 @@ public: }; bool ParseFormatString(FormatStringHandler &H, - const char *beg, const char *end); + const char *beg, const char *end, bool FormatExtensions); } // end printf namespace } // end clang namespace Modified: head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h Thu Jun 10 14:19:51 2010 (r208986) +++ head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h Thu Jun 10 16:13:32 2010 (r208987) @@ -54,6 +54,7 @@ public: unsigned NeXTRuntime : 1; // Use NeXT runtime. unsigned Freestanding : 1; // Freestanding implementation + unsigned FormatExtensions : 1; // FreeBSD format extensions (-fformat-extensions) unsigned NoBuiltin : 1; // Do not use builtin functions (-fno-builtin) unsigned ThreadsafeStatics : 1; // Whether static initializers are protected Modified: head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td Thu Jun 10 14:19:51 2010 (r208986) +++ head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td Thu Jun 10 16:13:32 2010 (r208987) @@ -377,6 +377,8 @@ def fsjlj_exceptions : Flag<"-fsjlj-exce HelpText<"Use SjLj style exceptions">; def ffreestanding : Flag<"-ffreestanding">, HelpText<"Assert that the compilation takes place in a freestanding environment">; +def fformat_extensions : Flag<"-fformat-extensions">, + HelpText<"FreeBSD printf format extensions">; def fgnu_runtime : Flag<"-fgnu-runtime">, HelpText<"Generate output compatible with the standard GNU Objective-C runtime">; def std_EQ : Joined<"-std=">, Modified: head/contrib/llvm/tools/clang/include/clang/Driver/Options.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Driver/Options.td Thu Jun 10 14:19:51 2010 (r208986) +++ head/contrib/llvm/tools/clang/include/clang/Driver/Options.td Thu Jun 10 16:13:32 2010 (r208987) @@ -268,6 +268,7 @@ def fexceptions : Flag<"-fexceptions">, def fextdirs_EQ : Joined<"-fextdirs=">, Group; def fhosted : Flag<"-fhosted">, Group; def ffreestanding : Flag<"-ffreestanding">, Group; +def fformat_extensions: Flag<"-fformat-extensions">; def fgnu_keywords : Flag<"-fgnu-keywords">, Group; def fgnu_runtime : Flag<"-fgnu-runtime">, Group; def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">; Modified: head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Thu Jun 10 14:19:51 2010 (r208986) +++ head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Thu Jun 10 16:13:32 2010 (r208987) @@ -210,7 +210,8 @@ static bool ParseArgPosition(FormatStrin static FormatSpecifierResult ParseFormatSpecifier(FormatStringHandler &H, const char *&Beg, const char *E, - unsigned &argIndex) { + unsigned &argIndex, + bool FormatExtensions) { using namespace clang::analyze_printf; @@ -369,11 +370,19 @@ static FormatSpecifierResult ParseFormat case '@': k = ConversionSpecifier::ObjCObjArg; break; // Glibc specific. case 'm': k = ConversionSpecifier::PrintErrno; break; + // FreeBSD format extensions + case 'b': if (FormatExtensions) k = ConversionSpecifier::bArg; break; /* check for int and then char * */ + case 'r': if (FormatExtensions) k = ConversionSpecifier::xArg; break; + case 'y': if (FormatExtensions) k = ConversionSpecifier::iArg; break; + case 'D': if (FormatExtensions) k = ConversionSpecifier::DArg; break; /* check for u_char * pointer and a char * string */ } ConversionSpecifier CS(conversionPosition, k); FS.setConversionSpecifier(CS); if (CS.consumesDataArgument() && !FS.usesPositionalArg()) FS.setArgIndex(argIndex++); + // FreeBSD extension + if (k == ConversionSpecifier::bArg || k == ConversionSpecifier::DArg) + argIndex++; if (k == ConversionSpecifier::InvalidSpecifier) { // Assume the conversion takes one argument. @@ -383,13 +392,13 @@ static FormatSpecifierResult ParseFormat } bool clang::analyze_printf::ParseFormatString(FormatStringHandler &H, - const char *I, const char *E) { + const char *I, const char *E, bool FormatExtensions) { unsigned argIndex = 0; // Keep looking for a format specifier until we have exhausted the string. while (I != E) { - const FormatSpecifierResult &FSR = ParseFormatSpecifier(H, I, E, argIndex); + const FormatSpecifierResult &FSR = ParseFormatSpecifier(H, I, E, argIndex, FormatExtensions); // Did a fail-stop error of any kind occur when parsing the specifier? // If so, don't do any more processing. if (FSR.shouldStop()) Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Thu Jun 10 14:19:51 2010 (r208986) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Thu Jun 10 16:13:32 2010 (r208987) @@ -1156,6 +1156,7 @@ void Clang::ConstructJob(Compilation &C, Args.AddLastArg(CmdArgs, options::OPT_fcatch_undefined_behavior); Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls); Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions); + Args.AddLastArg(CmdArgs, options::OPT_fformat_extensions); // -flax-vector-conversions is default. if (!Args.hasFlag(options::OPT_flax_vector_conversions, Modified: head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp Thu Jun 10 14:19:51 2010 (r208986) +++ head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp Thu Jun 10 16:13:32 2010 (r208987) @@ -530,6 +530,8 @@ static void LangOptsToArgs(const LangOpt Res.push_back("-fgnu-runtime"); if (Opts.Freestanding) Res.push_back("-ffreestanding"); + if (Opts.FormatExtensions) + Res.push_back("-fformat-extensions"); if (Opts.NoBuiltin) Res.push_back("-fno-builtin"); if (!Opts.AssumeSaneOperatorNew) @@ -1245,6 +1247,7 @@ static void ParseLangArgs(LangOptions &O Opts.CharIsSigned = !Args.hasArg(OPT_fno_signed_char); Opts.ShortWChar = Args.hasArg(OPT_fshort_wchar); Opts.Freestanding = Args.hasArg(OPT_ffreestanding); + Opts.FormatExtensions = Args.hasArg(OPT_fformat_extensions); Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding; Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new); Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions); Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Thu Jun 10 14:19:51 2010 (r208986) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Thu Jun 10 16:13:32 2010 (r208987) @@ -1276,6 +1276,39 @@ CheckPrintfHandler::HandleFormatSpecifie CoveredArgs.set(argIndex); } + // FreeBSD extensions + if (CS.getKind() == ConversionSpecifier::bArg || CS.getKind() == ConversionSpecifier::DArg) { + // claim the second argument + CoveredArgs.set(argIndex + 1); + + // Now type check the data expression that matches the + // format specifier. + const Expr *Ex = getDataArg(argIndex); + QualType type = (CS.getKind() == ConversionSpecifier::bArg) ? S.Context.IntTy : S.Context.getPointerType(S.Context.UnsignedCharTy); + //const analyze_printf::ArgTypeResult &ATR = S.Context.IntTy; + const analyze_printf::ArgTypeResult &ATR = type; + if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType())) + S.Diag(getLocationOfByte(CS.getStart()), + diag::warn_printf_conversion_argument_type_mismatch) + << ATR.getRepresentativeType(S.Context) << Ex->getType() + << getFormatSpecifierRange(startSpecifier, specifierLen) + << Ex->getSourceRange(); + + // Now type check the data expression that matches the + // format specifier. + Ex = getDataArg(argIndex + 1); + const analyze_printf::ArgTypeResult &ATR2 = ArgTypeResult::CStrTy; + if (ATR2.isValid() && !ATR2.matchesType(S.Context, Ex->getType())) + S.Diag(getLocationOfByte(CS.getStart()), + diag::warn_printf_conversion_argument_type_mismatch) + << ATR2.getRepresentativeType(S.Context) << Ex->getType() + << getFormatSpecifierRange(startSpecifier, specifierLen) + << Ex->getSourceRange(); + + return true; + } + // END OF FREEBSD EXTENSIONS + // Check for using an Objective-C specific conversion specifier // in a non-ObjC literal. if (!IsObjCLiteral && CS.isObjCArg()) { @@ -1400,7 +1433,8 @@ void Sema::CheckPrintfString(const Strin isa(OrigFormatExpr), Str, HasVAListArg, TheCall, format_idx); - if (!analyze_printf::ParseFormatString(H, Str, Str + StrLen)) + bool FormatExtensions = getLangOptions().FormatExtensions; + if (!analyze_printf::ParseFormatString(H, Str, Str + StrLen, FormatExtensions)) H.DoneProcessing(); } From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 16:14:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64DB31065672; Thu, 10 Jun 2010 16:14:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54DB58FC17; Thu, 10 Jun 2010 16:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AGE5vY099386; Thu, 10 Jun 2010 16:14:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AGE5Zh099383; Thu, 10 Jun 2010 16:14:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006101614.o5AGE5Zh099383@svn.freebsd.org> From: Alexander Motin Date: Thu, 10 Jun 2010 16:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208988 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 16:14:05 -0000 Author: mav Date: Thu Jun 10 16:14:05 2010 New Revision: 208988 URL: http://svn.freebsd.org/changeset/base/208988 Log: Store interrupt trap frame into struct thread. It allows interrupt handler to obtain both trap frame and opaque argument submitted on registrction. After kernel and all drivers get used to it, legacy hack can be removed. Reviewed by: jhb@ Modified: head/sys/kern/kern_intr.c head/sys/sys/proc.h Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Thu Jun 10 16:13:32 2010 (r208987) +++ head/sys/kern/kern_intr.c Thu Jun 10 16:14:05 2010 (r208988) @@ -1347,6 +1347,7 @@ int intr_event_handle(struct intr_event *ie, struct trapframe *frame) { struct intr_handler *ih; + struct trapframe *oldframe; struct thread *td; int error, ret, thread; @@ -1366,6 +1367,8 @@ intr_event_handle(struct intr_event *ie, thread = 0; ret = 0; critical_enter(); + oldframe = td->td_intr_frame; + td->td_intr_frame = frame; TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { if (ih->ih_filter == NULL) { thread = 1; @@ -1403,6 +1406,7 @@ intr_event_handle(struct intr_event *ie, thread = 1; } } + td->td_intr_frame = oldframe; if (thread) { if (ie->ie_pre_ithread != NULL) @@ -1592,6 +1596,7 @@ int intr_event_handle(struct intr_event *ie, struct trapframe *frame) { struct intr_thread *ithd; + struct trapframe *oldframe; struct thread *td; int thread; @@ -1604,6 +1609,8 @@ intr_event_handle(struct intr_event *ie, td->td_intr_nesting_level++; thread = 0; critical_enter(); + oldframe = td->td_intr_frame; + td->td_intr_frame = frame; thread = intr_filter_loop(ie, frame, &ithd); if (thread & FILTER_HANDLED) { if (ie->ie_post_filter != NULL) @@ -1612,6 +1619,7 @@ intr_event_handle(struct intr_event *ie, if (ie->ie_pre_ithread != NULL) ie->ie_pre_ithread(ie->ie_source); } + td->td_intr_frame = oldframe; critical_exit(); /* Interrupt storm logic */ Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jun 10 16:13:32 2010 (r208987) +++ head/sys/sys/proc.h Thu Jun 10 16:14:05 2010 (r208988) @@ -301,6 +301,7 @@ struct thread { int td_errno; /* Error returned by last syscall. */ struct vnet *td_vnet; /* (k) Effective vnet. */ const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */ + struct trapframe *td_intr_frame;/* (k) Frame of the current irq */ }; struct mtx *thread_lock_block(struct thread *); From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 16:45:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6C771065673; Thu, 10 Jun 2010 16:45:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D64D68FC18; Thu, 10 Jun 2010 16:45:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AGjUKw006457; Thu, 10 Jun 2010 16:45:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AGjUGV006454; Thu, 10 Jun 2010 16:45:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006101645.o5AGjUGV006454@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 10 Jun 2010 16:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208989 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 16:45:31 -0000 Author: ae Date: Thu Jun 10 16:45:30 2010 New Revision: 208989 URL: http://svn.freebsd.org/changeset/base/208989 Log: Style(9) fixes: * Sort includes * Replace #define to #define * Split declarations and initializations * Split long lines Requested by: kib Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/netgraph/ng_patch.c head/sys/netgraph/ng_patch.h Modified: head/sys/netgraph/ng_patch.c ============================================================================== --- head/sys/netgraph/ng_patch.c Thu Jun 10 16:14:05 2010 (r208988) +++ head/sys/netgraph/ng_patch.c Thu Jun 10 16:45:30 2010 (r208989) @@ -30,11 +30,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include -#include #include /* be64toh(), htobe64() */ +#include +#include +#include #include #include #include @@ -47,11 +47,11 @@ static ng_newhook_t ng_patch_newhook; static ng_rcvdata_t ng_patch_rcvdata; static ng_disconnect_t ng_patch_disconnect; -#define OFFSETOF(s, e) ((char *)&((s *)0)->e - (char *)((s *)0)) +#define OFFSETOF(s, e) ((char *)&((s *)0)->e - (char *)((s *)0)) static int -ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, - const u_char *buf) +ng_patch_config_getlen(const struct ng_parse_type *type, + const u_char *start, const u_char *buf) { const struct ng_patch_config *p; @@ -158,7 +158,7 @@ struct ng_patch_priv { }; typedef struct ng_patch_priv *priv_p; -#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ +#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ (count) * sizeof(struct ng_patch_op)) static void do_patch(priv_p conf, struct mbuf *m); @@ -195,12 +195,14 @@ static int ng_patch_rcvmsg(node_p node, item_p item, hook_p lasthook) { const priv_p privp = NG_NODE_PRIVATE(node); - struct ng_patch_config *conf; + struct ng_patch_config *conf, *newconf; + union patch_val *newval; struct ng_mesg *msg; - struct ng_mesg *resp = NULL; - int i, clear = 0; - int error = 0; + struct ng_mesg *resp; + int i, clear, error; + clear = error = 0; + resp = NULL; NGI_GET_MSG(item, msg); switch (msg->header.typecookie) { case NGM_PATCH_COOKIE: @@ -215,16 +217,15 @@ ng_patch_rcvmsg(node_p node, item_p item break; case NGM_PATCH_SETCONFIG: { - struct ng_patch_config *newconf; - union patch_val *newval; - - if (msg->header.arglen < sizeof(struct ng_patch_config)) { + if (msg->header.arglen < + sizeof(struct ng_patch_config)) { error = EINVAL; break; } conf = (struct ng_patch_config *)msg->data; - if (msg->header.arglen < NG_PATCH_CONF_SIZE(conf->count)) { + if (msg->header.arglen < + NG_PATCH_CONF_SIZE(conf->count)) { error = EINVAL; break; } @@ -248,27 +249,34 @@ ng_patch_rcvmsg(node_p node, item_p item CSUM_SCTP; if (error == 0) { - newconf = malloc(NG_PATCH_CONF_SIZE(conf->count), - M_NETGRAPH, M_WAIT); - newval = malloc(conf->count * sizeof(union patch_val), + newconf = malloc( + NG_PATCH_CONF_SIZE(conf->count), M_NETGRAPH, M_WAIT); + newval = malloc(conf->count * + sizeof(union patch_val), M_NETGRAPH, + M_WAIT); for(i = 0; i < conf->count; i++) { switch (conf->ops[i].length) { case 1: - newval[i].v1 = conf->ops[i].value; + newval[i].v1 = + conf->ops[i].value; break; case 2: - newval[i].v2 = conf->ops[i].value; + newval[i].v2 = + conf->ops[i].value; break; case 4: - newval[i].v4 = conf->ops[i].value; + newval[i].v4 = + conf->ops[i].value; break; case 8: - newval[i].v8 = conf->ops[i].value; + newval[i].v8 = + conf->ops[i].value; break; } } - bcopy(conf, newconf, NG_PATCH_CONF_SIZE(conf->count)); + bcopy(conf, newconf, + NG_PATCH_CONF_SIZE(conf->count)); if (privp->val != NULL) free(privp->val, M_NETGRAPH); privp->val = newval; @@ -310,12 +318,15 @@ ng_patch_rcvmsg(node_p node, item_p item static void do_patch(priv_p privp, struct mbuf *m) { - struct ng_patch_config *conf = privp->config; + struct ng_patch_config *conf; uint64_t buf; - int i, patched = 0; + int i, patched; + conf = privp->config; + patched = 0; for(i = 0; i < conf->count; i++) { - if (conf->ops[i].offset + conf->ops[i].length > m->m_pkthdr.len) + if (conf->ops[i].offset + conf->ops[i].length > + m->m_pkthdr.len) continue; /* for "=" operation we don't need to copy data from mbuf */ @@ -323,7 +334,7 @@ do_patch(priv_p privp, struct mbuf *m) m_copydata(m, conf->ops[i].offset, conf->ops[i].length, (caddr_t)&buf); } - + switch (conf->ops[i].length) { case 1: switch (conf->ops[i].mode) { @@ -550,16 +561,17 @@ ng_patch_shutdown(node_p node) static int ng_patch_disconnect(hook_p hook) { - priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + priv_p priv; + priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); if (hook == priv->in) { priv->in = NULL; } if (hook == priv->out) { priv->out = NULL; } - if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) - && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) /* already shutting down? */ + if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0 && + NG_NODE_IS_VALID(NG_HOOK_NODE(hook))) /* already shutting down? */ ng_rmnode_self(NG_HOOK_NODE(hook)); return (0); } Modified: head/sys/netgraph/ng_patch.h ============================================================================== --- head/sys/netgraph/ng_patch.h Thu Jun 10 16:14:05 2010 (r208988) +++ head/sys/netgraph/ng_patch.h Thu Jun 10 16:45:30 2010 (r208989) @@ -30,14 +30,14 @@ #define _NETGRAPH_NG_PATCH_H_ /* Node type name. */ -#define NG_PATCH_NODE_TYPE "patch" +#define NG_PATCH_NODE_TYPE "patch" /* Node type cookie. */ -#define NGM_PATCH_COOKIE 1262445509 +#define NGM_PATCH_COOKIE 1262445509 /* Hook names */ -#define NG_PATCH_HOOK_IN "in" -#define NG_PATCH_HOOK_OUT "out" +#define NG_PATCH_HOOK_IN "in" +#define NG_PATCH_HOOK_OUT "out" /* Netgraph commands understood by this node type */ enum { @@ -70,7 +70,7 @@ struct ng_patch_op { uint16_t mode; }; -#define NG_PATCH_OP_TYPE_INFO { \ +#define NG_PATCH_OP_TYPE_INFO { \ { "value", &ng_parse_uint64_type }, \ { "offset", &ng_parse_uint32_type }, \ { "length", &ng_parse_uint16_type }, \ @@ -84,7 +84,7 @@ struct ng_patch_config { struct ng_patch_op ops[]; }; -#define NG_PATCH_CONFIG_TYPE_INFO { \ +#define NG_PATCH_CONFIG_TYPE_INFO { \ { "count", &ng_parse_uint32_type }, \ { "csum_flags", &ng_parse_uint32_type }, \ { "ops", &ng_patch_confarr_type }, \ @@ -97,7 +97,7 @@ struct ng_patch_stats { uint64_t dropped; }; -#define NG_PATCH_STATS_TYPE_INFO { \ +#define NG_PATCH_STATS_TYPE_INFO { \ { "received", &ng_parse_uint64_type }, \ { "patched", &ng_parse_uint64_type }, \ { "dropped", &ng_parse_uint64_type }, \ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 16:56:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 175881065672; Thu, 10 Jun 2010 16:56:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 048608FC0C; Thu, 10 Jun 2010 16:56:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AGuZ3e009017; Thu, 10 Jun 2010 16:56:35 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AGuZuO009002; Thu, 10 Jun 2010 16:56:35 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006101656.o5AGuZuO009002@svn.freebsd.org> From: Alan Cox Date: Thu, 10 Jun 2010 16:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208990 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 sun4v/sun4v vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 16:56:36 -0000 Author: alc Date: Thu Jun 10 16:56:35 2010 New Revision: 208990 URL: http://svn.freebsd.org/changeset/base/208990 Log: Reduce the scope of the page queues lock and the number of PG_REFERENCED changes in vm_pageout_object_deactivate_pages(). Simplify this function's inner loop using TAILQ_FOREACH(), and shorten some of its overly long lines. Update a stale comment. Assert that PG_REFERENCED may be cleared only if the object containing the page is locked. Add a comment documenting this. Assert that a caller to vm_page_requeue() holds the page queues lock, and assert that the page is on a page queue. Push down the page queues lock into pmap_ts_referenced() and pmap_page_exists_quick(). (As of now, there are no longer any pmap functions that expect to be called with the page queues lock held.) Neither pmap_ts_referenced() nor pmap_page_exists_quick() should ever be passed an unmanaged page. Assert this rather than returning "0" and "FALSE" respectively. ARM: Simplify pmap_page_exists_quick() by switching to TAILQ_FOREACH(). Push down the page queues lock inside of pmap_clearbit(), simplifying pmap_clear_modify(), pmap_clear_reference(), and pmap_remove_write(). Additionally, this allows for avoiding the acquisition of the page queues lock in some cases. PowerPC/AIM: moea*_page_exits_quick() and moea*_page_wired_mappings() will never be called before pmap initialization is complete. Therefore, the check for moea_initialized can be eliminated. Push down the page queues lock inside of moea*_clear_bit(), simplifying moea*_clear_modify() and moea*_clear_reference(). The last parameter to moea*_clear_bit() is never used. Eliminate it. PowerPC/BookE: Simplify mmu_booke_page_exists_quick()'s control flow. Reviewed by: kib@ Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/sun4v/sun4v/pmap.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/amd64/amd64/pmap.c Thu Jun 10 16:56:35 2010 (r208990) @@ -3899,30 +3899,35 @@ pmap_page_exists_quick(pmap_t pmap, vm_p struct md_page *pvh; pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (PV_PMAP(pv) == pmap) { - return (TRUE); + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - if (loops < 16) { + if (!rv && loops < 16) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { - if (PV_PMAP(pv) == pmap) - return (TRUE); + if (PV_PMAP(pv) == pmap) { + rv = TRUE; + break; + } loops++; if (loops >= 16) break; } } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -4335,10 +4340,10 @@ pmap_ts_referenced(vm_page_t m) vm_offset_t va; int rtval = 0; - if (m->flags & PG_FICTITIOUS) - return (rtval); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + vm_page_lock_queues(); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4362,7 +4367,7 @@ pmap_ts_referenced(vm_page_t m) rtval++; if (rtval > 4) { PMAP_UNLOCK(pmap); - return (rtval); + goto out; } } } @@ -4391,6 +4396,8 @@ pmap_ts_referenced(vm_page_t m) PMAP_UNLOCK(pmap); } while ((pv = pvn) != NULL && pv != pvf); } +out: + vm_page_unlock_queues(); return (rtval); } Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/arm/arm/pmap.c Thu Jun 10 16:56:35 2010 (r208990) @@ -1423,7 +1423,7 @@ pmap_clearbit(struct vm_page *pg, u_int u_int oflags; int count = 0; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); if (maskbits & PVF_WRITE) maskbits |= PVF_MOD; @@ -1433,6 +1433,7 @@ pmap_clearbit(struct vm_page *pg, u_int pg->md.pvh_attrs &= ~(maskbits & (PVF_MOD | PVF_REF)); if (TAILQ_EMPTY(&pg->md.pv_list)) { + vm_page_unlock_queues(); return (0); } @@ -1568,6 +1569,7 @@ pmap_clearbit(struct vm_page *pg, u_int if (maskbits & PVF_WRITE) vm_page_flag_clear(pg, PG_WRITEABLE); + vm_page_unlock_queues(); return (count); } @@ -4417,24 +4419,23 @@ pmap_page_exists_quick(pmap_t pmap, vm_p { pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - - /* - * Not found, check current mappings returning immediately - */ - for (pv = TAILQ_FIRST(&m->md.pv_list); - pv; - pv = TAILQ_NEXT(pv, pv_list)) { + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (pv->pv_pmap == pmap) { - return (TRUE); + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -4469,8 +4470,8 @@ int pmap_ts_referenced(vm_page_t m) { - if (m->flags & PG_FICTITIOUS) - return (0); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); return (pmap_clearbit(m, PVF_REF)); } @@ -4508,10 +4509,8 @@ pmap_clear_modify(vm_page_t m) */ if ((m->flags & PG_WRITEABLE) == 0) return; - vm_page_lock_queues(); if (m->md.pvh_attrs & PVF_MOD) pmap_clearbit(m, PVF_MOD); - vm_page_unlock_queues(); } @@ -4541,10 +4540,8 @@ pmap_clear_reference(vm_page_t m) KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("pmap_clear_reference: page %p is not managed", m)); - vm_page_lock_queues(); if (m->md.pvh_attrs & PVF_REF) pmap_clearbit(m, PVF_REF); - vm_page_unlock_queues(); } @@ -4565,11 +4562,8 @@ pmap_remove_write(vm_page_t m) */ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->oflags & VPO_BUSY) != 0 || - (m->flags & PG_WRITEABLE) != 0) { - vm_page_lock_queues(); + (m->flags & PG_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); - vm_page_unlock_queues(); - } } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/i386/i386/pmap.c Thu Jun 10 16:56:35 2010 (r208990) @@ -4061,30 +4061,35 @@ pmap_page_exists_quick(pmap_t pmap, vm_p struct md_page *pvh; pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (PV_PMAP(pv) == pmap) { - return (TRUE); + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - if (loops < 16) { + if (!rv && loops < 16) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { - if (PV_PMAP(pv) == pmap) - return (TRUE); + if (PV_PMAP(pv) == pmap) { + rv = TRUE; + break; + } loops++; if (loops >= 16) break; } } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -4512,11 +4517,11 @@ pmap_ts_referenced(vm_page_t m) vm_offset_t va; int rtval = 0; - if (m->flags & PG_FICTITIOUS) - return (rtval); - sched_pin(); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + vm_page_lock_queues(); + sched_pin(); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) { va = pv->pv_va; pmap = PV_PMAP(pv); @@ -4571,6 +4576,7 @@ pmap_ts_referenced(vm_page_t m) } out: sched_unpin(); + vm_page_unlock_queues(); return (rtval); } Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/i386/xen/pmap.c Thu Jun 10 16:56:35 2010 (r208990) @@ -3449,20 +3449,23 @@ pmap_page_exists_quick(pmap_t pmap, vm_p { pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (PV_PMAP(pv) == pmap) { - return TRUE; + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -3839,10 +3842,10 @@ pmap_ts_referenced(vm_page_t m) pt_entry_t *pte; int rtval = 0; - if (m->flags & PG_FICTITIOUS) - return (rtval); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); + vm_page_lock_queues(); sched_pin(); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pvf = pv; do { @@ -3867,6 +3870,7 @@ pmap_ts_referenced(vm_page_t m) PT_SET_MA(PADDR1, 0); sched_unpin(); + vm_page_unlock_queues(); return (rtval); } Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/ia64/ia64/pmap.c Thu Jun 10 16:56:35 2010 (r208990) @@ -1837,23 +1837,23 @@ pmap_page_exists_quick(pmap_t pmap, vm_p { pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return FALSE; - - /* - * Not found, check current mappings returning immediately if found. - */ - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (pv->pv_pmap == pmap) { - return TRUE; + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -1949,9 +1949,9 @@ pmap_ts_referenced(vm_page_t m) pv_entry_t pv; int count = 0; - if (m->flags & PG_FICTITIOUS) - return 0; - + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { PMAP_LOCK(pv->pv_pmap); oldpmap = pmap_switch(pv->pv_pmap); @@ -1965,8 +1965,8 @@ pmap_ts_referenced(vm_page_t m) pmap_switch(oldpmap); PMAP_UNLOCK(pv->pv_pmap); } - - return count; + vm_page_unlock_queues(); + return (count); } /* Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/mips/mips/pmap.c Thu Jun 10 16:56:35 2010 (r208990) @@ -2348,20 +2348,23 @@ pmap_page_exists_quick(pmap_t pmap, vm_p { pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return FALSE; - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (pv->pv_pmap == pmap) { - return TRUE; + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -2594,14 +2597,16 @@ pmap_remove_write(vm_page_t m) int pmap_ts_referenced(vm_page_t m) { - if (m->flags & PG_FICTITIOUS) - return (0); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); if (m->md.pv_flags & PV_TABLE_REF) { + vm_page_lock_queues(); m->md.pv_flags &= ~PV_TABLE_REF; - return 1; + vm_page_unlock_queues(); + return (1); } - return 0; + return (0); } /* Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/powerpc/aim/mmu_oea.c Thu Jun 10 16:56:35 2010 (r208990) @@ -286,7 +286,7 @@ static void moea_enter_locked(pmap_t, v vm_prot_t, boolean_t); static void moea_syncicache(vm_offset_t, vm_size_t); static boolean_t moea_query_bit(vm_page_t, int); -static u_int moea_clear_bit(vm_page_t, int, int *); +static u_int moea_clear_bit(vm_page_t, int); static void moea_kremove(mmu_t, vm_offset_t); int moea_pte_spill(vm_offset_t); @@ -1315,9 +1315,7 @@ moea_clear_reference(mmu_t mmu, vm_page_ KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("moea_clear_reference: page %p is not managed", m)); - vm_page_lock_queues(); - moea_clear_bit(m, PTE_REF, NULL); - vm_page_unlock_queues(); + moea_clear_bit(m, PTE_REF); } void @@ -1337,9 +1335,7 @@ moea_clear_modify(mmu_t mmu, vm_page_t m */ if ((m->flags & PG_WRITEABLE) == 0) return; - vm_page_lock_queues(); - moea_clear_bit(m, PTE_CHG, NULL); - vm_page_unlock_queues(); + moea_clear_bit(m, PTE_CHG); } /* @@ -1409,14 +1405,10 @@ moea_remove_write(mmu_t mmu, vm_page_t m boolean_t moea_ts_referenced(mmu_t mmu, vm_page_t m) { - int count; - - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (0); - count = moea_clear_bit(m, PTE_REF, NULL); - - return (count); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("moea_ts_referenced: page %p is not managed", m)); + return (moea_clear_bit(m, PTE_REF)); } /* @@ -1531,19 +1523,23 @@ moea_page_exists_quick(mmu_t mmu, pmap_t { int loops; struct pvo_entry *pvo; + boolean_t rv; - if (!moea_initialized || (m->flags & PG_FICTITIOUS)) - return FALSE; - + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("moea_page_exists_quick: page %p is not managed", m)); loops = 0; + rv = FALSE; + vm_page_lock_queues(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { - if (pvo->pvo_pmap == pmap) - return (TRUE); + if (pvo->pvo_pmap == pmap) { + rv = TRUE; + break; + } if (++loops >= 16) break; } - - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -1557,7 +1553,7 @@ moea_page_wired_mappings(mmu_t mmu, vm_p int count; count = 0; - if (!moea_initialized || (m->flags & PG_FICTITIOUS) != 0) + if ((m->flags & PG_FICTITIOUS) != 0) return (count); vm_page_lock_queues(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) @@ -2315,17 +2311,17 @@ moea_query_bit(vm_page_t m, int ptebit) } static u_int -moea_clear_bit(vm_page_t m, int ptebit, int *origbit) +moea_clear_bit(vm_page_t m, int ptebit) { u_int count; struct pvo_entry *pvo; struct pte *pt; - int rv; + + vm_page_lock_queues(); /* * Clear the cached value. */ - rv = moea_attr_fetch(m); moea_attr_clear(m, ptebit); /* @@ -2353,15 +2349,11 @@ moea_clear_bit(vm_page_t m, int ptebit, } mtx_unlock(&moea_table_mutex); } - rv |= pvo->pvo_pte.pte.pte_lo; pvo->pvo_pte.pte.pte_lo &= ~ptebit; MOEA_PVO_CHECK(pvo); /* sanity check */ } - if (origbit != NULL) { - *origbit = rv; - } - + vm_page_unlock_queues(); return (count); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Jun 10 16:56:35 2010 (r208990) @@ -358,7 +358,7 @@ static void moea64_bridge_cpu_bootstrap static void moea64_enter_locked(pmap_t, vm_offset_t, vm_page_t, vm_prot_t, boolean_t); static boolean_t moea64_query_bit(vm_page_t, u_int64_t); -static u_int moea64_clear_bit(vm_page_t, u_int64_t, u_int64_t *); +static u_int moea64_clear_bit(vm_page_t, u_int64_t); static void moea64_kremove(mmu_t, vm_offset_t); static void moea64_syncicache(pmap_t pmap, vm_offset_t va, vm_offset_t pa, vm_size_t sz); @@ -1510,9 +1510,7 @@ moea64_clear_reference(mmu_t mmu, vm_pag KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("moea64_clear_reference: page %p is not managed", m)); - vm_page_lock_queues(); - moea64_clear_bit(m, LPTE_REF, NULL); - vm_page_unlock_queues(); + moea64_clear_bit(m, LPTE_REF); } void @@ -1532,9 +1530,7 @@ moea64_clear_modify(mmu_t mmu, vm_page_t */ if ((m->flags & PG_WRITEABLE) == 0) return; - vm_page_lock_queues(); - moea64_clear_bit(m, LPTE_CHG, NULL); - vm_page_unlock_queues(); + moea64_clear_bit(m, LPTE_CHG); } /* @@ -1605,14 +1601,10 @@ moea64_remove_write(mmu_t mmu, vm_page_t boolean_t moea64_ts_referenced(mmu_t mmu, vm_page_t m) { - int count; - - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (0); - count = moea64_clear_bit(m, LPTE_REF, NULL); - - return (count); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("moea64_ts_referenced: page %p is not managed", m)); + return (moea64_clear_bit(m, LPTE_REF)); } /* @@ -1721,21 +1713,23 @@ moea64_page_exists_quick(mmu_t mmu, pmap { int loops; struct pvo_entry *pvo; + boolean_t rv; - if (!moea64_initialized || (m->flags & PG_FICTITIOUS)) - return FALSE; - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("moea64_page_exists_quick: page %p is not managed", m)); loops = 0; + rv = FALSE; + vm_page_lock_queues(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { - if (pvo->pvo_pmap == pmap) - return (TRUE); + if (pvo->pvo_pmap == pmap) { + rv = TRUE; + break; + } if (++loops >= 16) break; } - - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -1749,7 +1743,7 @@ moea64_page_wired_mappings(mmu_t mmu, vm int count; count = 0; - if (!moea64_initialized || (m->flags & PG_FICTITIOUS) != 0) + if ((m->flags & PG_FICTITIOUS) != 0) return (count); vm_page_lock_queues(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) @@ -2445,19 +2439,17 @@ moea64_query_bit(vm_page_t m, u_int64_t } static u_int -moea64_clear_bit(vm_page_t m, u_int64_t ptebit, u_int64_t *origbit) +moea64_clear_bit(vm_page_t m, u_int64_t ptebit) { u_int count; struct pvo_entry *pvo; struct lpte *pt; - uint64_t rv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); /* * Clear the cached value. */ - rv = moea64_attr_fetch(m); moea64_attr_clear(m, ptebit); /* @@ -2486,16 +2478,12 @@ moea64_clear_bit(vm_page_t m, u_int64_t moea64_pte_clear(pt, pvo->pvo_pmap, PVO_VADDR(pvo), ptebit); } } - rv |= pvo->pvo_pte.lpte.pte_lo; pvo->pvo_pte.lpte.pte_lo &= ~ptebit; MOEA_PVO_CHECK(pvo); /* sanity check */ UNLOCK_TABLE(); } - if (origbit != NULL) { - *origbit = rv; - } - + vm_page_unlock_queues(); return (count); } Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/powerpc/booke/pmap.c Thu Jun 10 16:56:35 2010 (r208990) @@ -2293,17 +2293,14 @@ mmu_booke_ts_referenced(mmu_t mmu, vm_pa pv_entry_t pv; int count; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (0); - + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("mmu_booke_ts_referenced: page %p is not managed", m)); count = 0; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { PMAP_LOCK(pv->pv_pmap); - if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL) { - if (!PTE_ISVALID(pte)) - goto make_sure_to_unlock; - + if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL && + PTE_ISVALID(pte)) { if (PTE_ISREFERENCED(pte)) { mtx_lock_spin(&tlbivax_mutex); tlb_miss_lock(); @@ -2320,9 +2317,9 @@ mmu_booke_ts_referenced(mmu_t mmu, vm_pa } } } -make_sure_to_unlock: PMAP_UNLOCK(pv->pv_pmap); } + vm_page_unlock_queues(); return (count); } @@ -2394,20 +2391,23 @@ mmu_booke_page_exists_quick(mmu_t mmu, p { pv_entry_t pv; int loops; + boolean_t rv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (FALSE); - + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("mmu_booke_page_exists_quick: page %p is not managed", m)); loops = 0; + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { - if (pv->pv_pmap == pmap) - return (TRUE); - + if (pv->pv_pmap == pmap) { + rv = TRUE; + break; + } if (++loops >= 16) break; } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/sparc64/sparc64/pmap.c Thu Jun 10 16:56:35 2010 (r208990) @@ -1789,20 +1789,25 @@ pmap_page_exists_quick(pmap_t pm, vm_pag { struct tte *tp; int loops; + boolean_t rv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (FALSE); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); loops = 0; + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) continue; - if (TTE_GET_PMAP(tp) == pm) - return (TRUE); + if (TTE_GET_PMAP(tp) == pm) { + rv = TRUE; + break; + } if (++loops >= 16) break; } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -1878,10 +1883,10 @@ pmap_ts_referenced(vm_page_t m) u_long data; int count; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (0); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); count = 0; + vm_page_lock_queues(); if ((tp = TAILQ_FIRST(&m->md.tte_list)) != NULL) { tpf = tp; do { @@ -1895,6 +1900,7 @@ pmap_ts_referenced(vm_page_t m) break; } while ((tp = tpn) != NULL && tp != tpf); } + vm_page_unlock_queues(); return (count); } Modified: head/sys/sun4v/sun4v/pmap.c ============================================================================== --- head/sys/sun4v/sun4v/pmap.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/sun4v/sun4v/pmap.c Thu Jun 10 16:56:35 2010 (r208990) @@ -1738,20 +1738,23 @@ pmap_page_exists_quick(pmap_t pmap, vm_p { pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return FALSE; - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (pv->pv_pmap == pmap) { - return TRUE; + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -2309,17 +2312,15 @@ pmap_tte_hash_resize(pmap_t pmap) int pmap_ts_referenced(vm_page_t m) { - int rv; pv_entry_t pv, pvf, pvn; pmap_t pmap; tte_t otte_data; + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); rv = 0; - if (m->flags & PG_FICTITIOUS) - return (rv); - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pvf = pv; @@ -2347,6 +2348,7 @@ pmap_ts_referenced(vm_page_t m) PMAP_UNLOCK(pmap); } while ((pv = pvn) != NULL && pv != pvf); } + vm_page_unlock_queues(); return (rv); } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/vm/vm_page.c Thu Jun 10 16:56:35 2010 (r208990) @@ -502,6 +502,8 @@ vm_page_flag_clear(vm_page_t m, unsigned { mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((bits & PG_REFERENCED) == 0 || VM_OBJECT_LOCKED(m->object), + ("PG_REFERENCED and !VM_OBJECT_LOCKED")); m->flags &= ~bits; } @@ -1333,8 +1335,7 @@ vm_waitpfault(void) /* * vm_page_requeue: * - * If the given page is contained within a page queue, move it to the tail - * of that queue. + * Move the given page to the tail of its present page queue. * * The page queues must be locked. */ @@ -1344,11 +1345,12 @@ vm_page_requeue(vm_page_t m) int queue = VM_PAGE_GETQUEUE(m); struct vpgqueues *vpq; - if (queue != PQ_NONE) { - vpq = &vm_page_queues[queue]; - TAILQ_REMOVE(&vpq->pl, m, pageq); - TAILQ_INSERT_TAIL(&vpq->pl, m, pageq); - } + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT(queue != PQ_NONE, + ("vm_page_requeue: page %p is not queued", m)); + vpq = &vm_page_queues[queue]; + TAILQ_REMOVE(&vpq->pl, m, pageq); + TAILQ_INSERT_TAIL(&vpq->pl, m, pageq); } /* Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/vm/vm_page.h Thu Jun 10 16:56:35 2010 (r208990) @@ -219,6 +219,9 @@ extern struct vpglocks pa_lock[]; * pte mappings, nor can they be removed from their objects via * the object, and such pages are also not on any PQ queue. * + * PG_REFERENCED may be cleared only if the object containing the page is + * locked. + * * PG_WRITEABLE is set exclusively on managed pages by pmap_enter(). When it * does so, the page must be VPO_BUSY. */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Jun 10 16:45:30 2010 (r208989) +++ head/sys/vm/vm_pageout.c Thu Jun 10 16:56:35 2010 (r208990) @@ -547,21 +547,17 @@ vm_pageout_flush(vm_page_t *mc, int coun /* * vm_pageout_object_deactivate_pages * - * deactivate enough pages to satisfy the inactive target - * requirements or if vm_page_proc_limit is set, then - * deactivate all of the pages in the object and its - * backing_objects. + * Deactivate enough pages to satisfy the inactive target + * requirements. * * The object and map must be locked. */ static void -vm_pageout_object_deactivate_pages(pmap, first_object, desired) - pmap_t pmap; - vm_object_t first_object; - long desired; +vm_pageout_object_deactivate_pages(pmap_t pmap, vm_object_t first_object, + long desired) { vm_object_t backing_object, object; - vm_page_t p, next; + vm_page_t p; int actcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); @@ -579,61 +575,57 @@ vm_pageout_object_deactivate_pages(pmap, if (object->shadow_count > 1) remove_mode = 1; /* - * scan the objects entire memory queue + * Scan the object's entire memory queue. */ - p = TAILQ_FIRST(&object->memq); - while (p != NULL) { + TAILQ_FOREACH(p, &object->memq, listq) { if (pmap_resident_count(pmap) <= desired) goto unlock_return; - next = TAILQ_NEXT(p, listq); - if ((p->oflags & VPO_BUSY) != 0 || p->busy != 0) { - p = next; + if ((p->oflags & VPO_BUSY) != 0 || p->busy != 0) continue; - } + PCPU_INC(cnt.v_pdpages); vm_page_lock(p); - vm_page_lock_queues(); - cnt.v_pdpages++; - if (p->wire_count != 0 || - p->hold_count != 0 || + if (p->wire_count != 0 || p->hold_count != 0 || !pmap_page_exists_quick(pmap, p)) { - vm_page_unlock_queues(); vm_page_unlock(p); - p = next; continue; } actcount = pmap_ts_referenced(p); - if (actcount) { - vm_page_flag_set(p, PG_REFERENCED); - } else if (p->flags & PG_REFERENCED) { - actcount = 1; + if ((p->flags & PG_REFERENCED) != 0) { + if (actcount == 0) + actcount = 1; + vm_page_lock_queues(); + vm_page_flag_clear(p, PG_REFERENCED); + vm_page_unlock_queues(); } - if ((p->queue != PQ_ACTIVE) && - (p->flags & PG_REFERENCED)) { + if (p->queue != PQ_ACTIVE && actcount != 0) { vm_page_activate(p); p->act_count += actcount; - vm_page_flag_clear(p, PG_REFERENCED); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 17:04:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 496C91065672; Thu, 10 Jun 2010 17:04:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3874F8FC24; Thu, 10 Jun 2010 17:04:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AH42gc010709; Thu, 10 Jun 2010 17:04:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AH42QB010707; Thu, 10 Jun 2010 17:04:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006101704.o5AH42QB010707@svn.freebsd.org> From: Alexander Motin Date: Thu, 10 Jun 2010 17:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208991 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 17:04:02 -0000 Author: mav Date: Thu Jun 10 17:04:01 2010 New Revision: 208991 URL: http://svn.freebsd.org/changeset/base/208991 Log: Do not disable edge-triggered interrupts before migration. DELAY() with interrupt disabled highly probable causes interrupt loss. Modified: head/sys/x86/x86/io_apic.c Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Thu Jun 10 16:56:35 2010 (r208990) +++ head/sys/x86/x86/io_apic.c Thu Jun 10 17:04:01 2010 (r208991) @@ -356,7 +356,7 @@ ioapic_assign_cpu(struct intsrc *isrc, u * extra DELAY() to avoid being stuck in a non-EOI'd state. */ mtx_lock_spin(&icu_lock); - if (!intpin->io_masked) { + if (!intpin->io_masked && !intpin->io_edgetrigger) { ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), intpin->io_lowreg | IOART_INTMSET); DELAY(100); From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 17:49:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9C05106566C; Thu, 10 Jun 2010 17:49:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9D8D8FC13; Thu, 10 Jun 2010 17:49:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AHnaGu020795; Thu, 10 Jun 2010 17:49:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AHnaFQ020793; Thu, 10 Jun 2010 17:49:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201006101749.o5AHnaFQ020793@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 10 Jun 2010 17:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208992 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 17:49:36 -0000 Author: trasz Date: Thu Jun 10 17:49:36 2010 New Revision: 208992 URL: http://svn.freebsd.org/changeset/base/208992 Log: Untangle g_print_bio(), silencing Coverity. Found with: Coverity Prevent CID: 3566, 3567 Modified: head/sys/geom/geom_io.c Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Thu Jun 10 17:04:01 2010 (r208991) +++ head/sys/geom/geom_io.c Thu Jun 10 17:49:36 2010 (r208992) @@ -779,19 +779,18 @@ g_print_bio(struct bio *bp) return; case BIO_READ: cmd = "READ"; + break; case BIO_WRITE: - if (cmd == NULL) - cmd = "WRITE"; + cmd = "WRITE"; + break; case BIO_DELETE: - if (cmd == NULL) - cmd = "DELETE"; - printf("%s[%s(offset=%jd, length=%jd)]", pname, cmd, - (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length); - return; + cmd = "DELETE"; + break; default: cmd = "UNKNOWN"; printf("%s[%s()]", pname, cmd); return; } - /* NOTREACHED */ + printf("%s[%s(offset=%jd, length=%jd)]", pname, cmd, + (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length); } From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 17:53:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEDD31065676; Thu, 10 Jun 2010 17:53:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD12B8FC14; Thu, 10 Jun 2010 17:53:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AHrZcX021741; Thu, 10 Jun 2010 17:53:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AHrZE6021738; Thu, 10 Jun 2010 17:53:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201006101753.o5AHrZE6021738@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 10 Jun 2010 17:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208993 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 17:53:36 -0000 Author: yongari Date: Thu Jun 10 17:53:35 2010 New Revision: 208993 URL: http://svn.freebsd.org/changeset/base/208993 Log: MFC r208862: Fix a bug introduced in r199011. When bge(4) reuses loaded RX buffers it should also reinitialize RX descriptors otherwise some stale data could be passed to controller. This could end up with mbuf double free or unexpected NULL pointer dereference in upper stack. To fix the issue, save loaded buffer's length and reinitialize RX descriptors with the saved value whenever bge(4) reuses the loaded RX buffers. While I'm here, increase the number of RX buffers to 512 from 256. This simplifies RX buffer handling as well as giving more RX buffers. Controller supports just fixed number of RX buffers (i.e. 512) and bge(4) used to rely on hope that our CPU is fast enough to keep up with the controller. With this change, bge(4) will use 1MB for RX buffers but I don't think it would cause problems in these days. Reported by: marcel Tested by: marcel Approved by: re (bz) Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Thu Jun 10 17:49:36 2010 (r208992) +++ stable/8/sys/dev/bge/if_bge.c Thu Jun 10 17:53:35 2010 (r208993) @@ -400,6 +400,8 @@ static void bge_setpromisc(struct bge_so static void bge_setmulti(struct bge_softc *); static void bge_setvlan(struct bge_softc *); +static __inline void bge_rxreuse_std(struct bge_softc *, int); +static __inline void bge_rxreuse_jumbo(struct bge_softc *, int); static int bge_newbuf_std(struct bge_softc *, int); static int bge_newbuf_jumbo(struct bge_softc *, int); static int bge_init_rx_ring_std(struct bge_softc *); @@ -949,6 +951,7 @@ bge_newbuf_std(struct bge_softc *sc, int sc->bge_cdata.bge_rx_std_dmamap[i] = sc->bge_cdata.bge_rx_std_sparemap; sc->bge_cdata.bge_rx_std_sparemap = map; sc->bge_cdata.bge_rx_std_chain[i] = m; + sc->bge_cdata.bge_rx_std_seglen[i] = segs[0].ds_len; r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); @@ -1006,6 +1009,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, i sc->bge_cdata.bge_rx_jumbo_sparemap; sc->bge_cdata.bge_rx_jumbo_sparemap = map; sc->bge_cdata.bge_rx_jumbo_chain[i] = m; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = 0; + /* * Fill in the extended RX buffer descriptor. */ @@ -1018,18 +1026,22 @@ bge_newbuf_jumbo(struct bge_softc *sc, i r->bge_addr3.bge_addr_lo = BGE_ADDR_LO(segs[3].ds_addr); r->bge_addr3.bge_addr_hi = BGE_ADDR_HI(segs[3].ds_addr); r->bge_len3 = segs[3].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = segs[3].ds_len; case 3: r->bge_addr2.bge_addr_lo = BGE_ADDR_LO(segs[2].ds_addr); r->bge_addr2.bge_addr_hi = BGE_ADDR_HI(segs[2].ds_addr); r->bge_len2 = segs[2].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = segs[2].ds_len; case 2: r->bge_addr1.bge_addr_lo = BGE_ADDR_LO(segs[1].ds_addr); r->bge_addr1.bge_addr_hi = BGE_ADDR_HI(segs[1].ds_addr); r->bge_len1 = segs[1].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = segs[1].ds_len; case 1: r->bge_addr0.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr0.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_len0 = segs[0].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = segs[0].ds_len; break; default: panic("%s: %d segments\n", __func__, nsegs); @@ -1041,12 +1053,6 @@ bge_newbuf_jumbo(struct bge_softc *sc, i return (0); } -/* - * The standard receive ring has 512 entries in it. At 2K per mbuf cluster, - * that's 1MB or memory, which is a lot. For now, we fill only the first - * 256 ring entries and hope that our CPU is fast enough to keep up with - * the NIC. - */ static int bge_init_rx_ring_std(struct bge_softc *sc) { @@ -1054,7 +1060,7 @@ bge_init_rx_ring_std(struct bge_softc *s bzero(sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); sc->bge_std = 0; - for (i = 0; i < BGE_SSLOTS; i++) { + for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if ((error = bge_newbuf_std(sc, i)) != 0) return (error); BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); @@ -1063,8 +1069,8 @@ bge_init_rx_ring_std(struct bge_softc *s bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_std = i - 1; - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); + sc->bge_std = 0; + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, BGE_STD_RX_RING_CNT - 1); return (0); } @@ -1106,14 +1112,14 @@ bge_init_rx_ring_jumbo(struct bge_softc bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_jumbo = i - 1; + sc->bge_jumbo = 0; rcb = &sc->bge_ldata.bge_info.bge_jumbo_rx_rcb; rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, BGE_JUMBO_RX_RING_CNT - 1); return (0); } @@ -3299,6 +3305,33 @@ bge_reset(struct bge_softc *sc) return(0); } +static __inline void +bge_rxreuse_std(struct bge_softc *sc, int i) +{ + struct bge_rx_bd *r; + + r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; + r->bge_flags = BGE_RXBDFLAG_END; + r->bge_len = sc->bge_cdata.bge_rx_std_seglen[i]; + r->bge_idx = i; + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); +} + +static __inline void +bge_rxreuse_jumbo(struct bge_softc *sc, int i) +{ + struct bge_extrx_bd *r; + + r = &sc->bge_ldata.bge_rx_jumbo_ring[sc->bge_jumbo]; + r->bge_flags = BGE_RXBDFLAG_JUMBO_RING | BGE_RXBDFLAG_END; + r->bge_len0 = sc->bge_cdata.bge_rx_jumbo_seglen[i][0]; + r->bge_len1 = sc->bge_cdata.bge_rx_jumbo_seglen[i][1]; + r->bge_len2 = sc->bge_cdata.bge_rx_jumbo_seglen[i][2]; + r->bge_len3 = sc->bge_cdata.bge_rx_jumbo_seglen[i][3]; + r->bge_idx = i; + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); +} + /* * Frame reception handling. This is called if there's a frame * on the receive return list. @@ -3362,24 +3395,24 @@ bge_rxeof(struct bge_softc *sc, uint16_t jumbocnt++; m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); continue; } if (bge_newbuf_jumbo(sc, rxidx) != 0) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); ifp->if_iqdrops++; continue; } BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); } else { stdcnt++; + m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); continue; } - m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (bge_newbuf_std(sc, rxidx) != 0) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); ifp->if_iqdrops++; continue; } Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Thu Jun 10 17:49:36 2010 (r208992) +++ stable/8/sys/dev/bge/if_bgereg.h Thu Jun 10 17:53:35 2010 (r208993) @@ -2561,6 +2561,8 @@ struct bge_chain_data { struct mbuf *bge_tx_chain[BGE_TX_RING_CNT]; struct mbuf *bge_rx_std_chain[BGE_STD_RX_RING_CNT]; struct mbuf *bge_rx_jumbo_chain[BGE_JUMBO_RX_RING_CNT]; + int bge_rx_std_seglen[BGE_STD_RX_RING_CNT]; + int bge_rx_jumbo_seglen[BGE_JUMBO_RX_RING_CNT][4]; }; struct bge_dmamap_arg { From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 17:59:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 606C1106566B; Thu, 10 Jun 2010 17:59:47 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 507AC8FC18; Thu, 10 Jun 2010 17:59:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AHxlki023134; Thu, 10 Jun 2010 17:59:47 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AHxlZT023131; Thu, 10 Jun 2010 17:59:47 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201006101759.o5AHxlZT023131@svn.freebsd.org> From: Alexander Kabaev Date: Thu, 10 Jun 2010 17:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208994 - in head/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 17:59:47 -0000 Author: kan Date: Thu Jun 10 17:59:47 2010 New Revision: 208994 URL: http://svn.freebsd.org/changeset/base/208994 Log: Do not require pos parameter to be zero in MAP_ANONYMOUS mmap requests in Linux emulation layer. Linux seems to only require that pos is page-aligned, but otherwise ignores it. Default FreeBSD mmap parameter checking is too strict to allow some Linux binaries to run. tsMuxeR is one example of such a binary. Discussed with: jhb MFC after: 1 week Modified: head/sys/amd64/linux32/linux32_machdep.c head/sys/i386/linux/linux_machdep.c Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Thu Jun 10 17:53:35 2010 (r208993) +++ head/sys/amd64/linux32/linux32_machdep.c Thu Jun 10 17:59:47 2010 (r208994) @@ -835,9 +835,13 @@ linux_mmap_common(struct thread *td, l_u bsd_args.flags |= MAP_PRIVATE; if (flags & LINUX_MAP_FIXED) bsd_args.flags |= MAP_FIXED; - if (flags & LINUX_MAP_ANON) + if (flags & LINUX_MAP_ANON) { + /* Enforce pos to be on page boundary, then ignore. */ + if ((pos & PAGE_MASK) != 0) + return (EINVAL); + pos = 0; bsd_args.flags |= MAP_ANON; - else + } else bsd_args.flags |= MAP_NOSYNC; if (flags & LINUX_MAP_GROWSDOWN) bsd_args.flags |= MAP_STACK; Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Thu Jun 10 17:53:35 2010 (r208993) +++ head/sys/i386/linux/linux_machdep.c Thu Jun 10 17:59:47 2010 (r208994) @@ -667,9 +667,13 @@ linux_mmap_common(struct thread *td, l_u bsd_args.flags |= MAP_PRIVATE; if (flags & LINUX_MAP_FIXED) bsd_args.flags |= MAP_FIXED; - if (flags & LINUX_MAP_ANON) + if (flags & LINUX_MAP_ANON) { + /* Enforce pos to be on page boundary, then ignore. */ + if ((pos & PAGE_MASK) != 0) + return (EINVAL); + pos = 0; bsd_args.flags |= MAP_ANON; - else + } else bsd_args.flags |= MAP_NOSYNC; if (flags & LINUX_MAP_GROWSDOWN) bsd_args.flags |= MAP_STACK; From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 18:04:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB9141065676; Thu, 10 Jun 2010 18:04:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99DD48FC1A; Thu, 10 Jun 2010 18:04:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AI4Poi024262; Thu, 10 Jun 2010 18:04:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AI4PEX024259; Thu, 10 Jun 2010 18:04:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201006101804.o5AI4PEX024259@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 10 Jun 2010 18:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208995 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 18:04:25 -0000 Author: yongari Date: Thu Jun 10 18:04:25 2010 New Revision: 208995 URL: http://svn.freebsd.org/changeset/base/208995 Log: MFC r208862: Fix a bug introduced in r199011. When bge(4) reuses loaded RX buffers it should also reinitialize RX descriptors otherwise some stale data could be passed to controller. This could end up with mbuf double free or unexpected NULL pointer dereference in upper stack. To fix the issue, save loaded buffer's length and reinitialize RX descriptors with the saved value whenever bge(4) reuses the loaded RX buffers. While I'm here, increase the number of RX buffers to 512 from 256. This simplifies RX buffer handling as well as giving more RX buffers. Controller supports just fixed number of RX buffers (i.e. 512) and bge(4) used to rely on hope that our CPU is fast enough to keep up with the controller. With this change, bge(4) will use 1MB for RX buffers but I don't think it would cause problems in these days. Reported by: marcel Tested by: marcel Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jun 10 17:59:47 2010 (r208994) +++ stable/7/sys/dev/bge/if_bge.c Thu Jun 10 18:04:25 2010 (r208995) @@ -400,6 +400,8 @@ static void bge_setpromisc(struct bge_so static void bge_setmulti(struct bge_softc *); static void bge_setvlan(struct bge_softc *); +static __inline void bge_rxreuse_std(struct bge_softc *, int); +static __inline void bge_rxreuse_jumbo(struct bge_softc *, int); static int bge_newbuf_std(struct bge_softc *, int); static int bge_newbuf_jumbo(struct bge_softc *, int); static int bge_init_rx_ring_std(struct bge_softc *); @@ -949,6 +951,7 @@ bge_newbuf_std(struct bge_softc *sc, int sc->bge_cdata.bge_rx_std_dmamap[i] = sc->bge_cdata.bge_rx_std_sparemap; sc->bge_cdata.bge_rx_std_sparemap = map; sc->bge_cdata.bge_rx_std_chain[i] = m; + sc->bge_cdata.bge_rx_std_seglen[i] = segs[0].ds_len; r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); @@ -1006,6 +1009,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, i sc->bge_cdata.bge_rx_jumbo_sparemap; sc->bge_cdata.bge_rx_jumbo_sparemap = map; sc->bge_cdata.bge_rx_jumbo_chain[i] = m; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = 0; + /* * Fill in the extended RX buffer descriptor. */ @@ -1018,18 +1026,22 @@ bge_newbuf_jumbo(struct bge_softc *sc, i r->bge_addr3.bge_addr_lo = BGE_ADDR_LO(segs[3].ds_addr); r->bge_addr3.bge_addr_hi = BGE_ADDR_HI(segs[3].ds_addr); r->bge_len3 = segs[3].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = segs[3].ds_len; case 3: r->bge_addr2.bge_addr_lo = BGE_ADDR_LO(segs[2].ds_addr); r->bge_addr2.bge_addr_hi = BGE_ADDR_HI(segs[2].ds_addr); r->bge_len2 = segs[2].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = segs[2].ds_len; case 2: r->bge_addr1.bge_addr_lo = BGE_ADDR_LO(segs[1].ds_addr); r->bge_addr1.bge_addr_hi = BGE_ADDR_HI(segs[1].ds_addr); r->bge_len1 = segs[1].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = segs[1].ds_len; case 1: r->bge_addr0.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr0.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_len0 = segs[0].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = segs[0].ds_len; break; default: panic("%s: %d segments\n", __func__, nsegs); @@ -1041,12 +1053,6 @@ bge_newbuf_jumbo(struct bge_softc *sc, i return (0); } -/* - * The standard receive ring has 512 entries in it. At 2K per mbuf cluster, - * that's 1MB or memory, which is a lot. For now, we fill only the first - * 256 ring entries and hope that our CPU is fast enough to keep up with - * the NIC. - */ static int bge_init_rx_ring_std(struct bge_softc *sc) { @@ -1054,7 +1060,7 @@ bge_init_rx_ring_std(struct bge_softc *s bzero(sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); sc->bge_std = 0; - for (i = 0; i < BGE_SSLOTS; i++) { + for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if ((error = bge_newbuf_std(sc, i)) != 0) return (error); BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); @@ -1063,8 +1069,8 @@ bge_init_rx_ring_std(struct bge_softc *s bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_std = i - 1; - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); + sc->bge_std = 0; + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, BGE_STD_RX_RING_CNT - 1); return (0); } @@ -1106,14 +1112,14 @@ bge_init_rx_ring_jumbo(struct bge_softc bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_jumbo = i - 1; + sc->bge_jumbo = 0; rcb = &sc->bge_ldata.bge_info.bge_jumbo_rx_rcb; rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, BGE_JUMBO_RX_RING_CNT - 1); return (0); } @@ -3299,6 +3305,33 @@ bge_reset(struct bge_softc *sc) return(0); } +static __inline void +bge_rxreuse_std(struct bge_softc *sc, int i) +{ + struct bge_rx_bd *r; + + r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; + r->bge_flags = BGE_RXBDFLAG_END; + r->bge_len = sc->bge_cdata.bge_rx_std_seglen[i]; + r->bge_idx = i; + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); +} + +static __inline void +bge_rxreuse_jumbo(struct bge_softc *sc, int i) +{ + struct bge_extrx_bd *r; + + r = &sc->bge_ldata.bge_rx_jumbo_ring[sc->bge_jumbo]; + r->bge_flags = BGE_RXBDFLAG_JUMBO_RING | BGE_RXBDFLAG_END; + r->bge_len0 = sc->bge_cdata.bge_rx_jumbo_seglen[i][0]; + r->bge_len1 = sc->bge_cdata.bge_rx_jumbo_seglen[i][1]; + r->bge_len2 = sc->bge_cdata.bge_rx_jumbo_seglen[i][2]; + r->bge_len3 = sc->bge_cdata.bge_rx_jumbo_seglen[i][3]; + r->bge_idx = i; + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); +} + /* * Frame reception handling. This is called if there's a frame * on the receive return list. @@ -3362,24 +3395,24 @@ bge_rxeof(struct bge_softc *sc, uint16_t jumbocnt++; m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); continue; } if (bge_newbuf_jumbo(sc, rxidx) != 0) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); ifp->if_iqdrops++; continue; } BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); } else { stdcnt++; + m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); continue; } - m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (bge_newbuf_std(sc, rxidx) != 0) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); ifp->if_iqdrops++; continue; } Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Thu Jun 10 17:59:47 2010 (r208994) +++ stable/7/sys/dev/bge/if_bgereg.h Thu Jun 10 18:04:25 2010 (r208995) @@ -2561,6 +2561,8 @@ struct bge_chain_data { struct mbuf *bge_tx_chain[BGE_TX_RING_CNT]; struct mbuf *bge_rx_std_chain[BGE_STD_RX_RING_CNT]; struct mbuf *bge_rx_jumbo_chain[BGE_JUMBO_RX_RING_CNT]; + int bge_rx_std_seglen[BGE_STD_RX_RING_CNT]; + int bge_rx_jumbo_seglen[BGE_JUMBO_RX_RING_CNT][4]; }; struct bge_dmamap_arg { From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 19:11:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42ADC1065677; Thu, 10 Jun 2010 19:11:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 310258FC18; Thu, 10 Jun 2010 19:11:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AJB15P038921; Thu, 10 Jun 2010 19:11:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AJB1ak038919; Thu, 10 Jun 2010 19:11:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006101911.o5AJB1ak038919@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 10 Jun 2010 19:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208996 - stable/8/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 19:11:01 -0000 Author: nwhitehorn Date: Thu Jun 10 19:11:00 2010 New Revision: 208996 URL: http://svn.freebsd.org/changeset/base/208996 Log: MFC r208835: Make sure that interrupt sense settings set after interrupts are enabled are respected. This fixes loading the Apple onboard audio driver (snd_ai2s) as a module after boot, which would previously cause a panic. PR: powerpc/146888 Approved by: re (kensmith) Modified: stable/8/sys/powerpc/powerpc/intr_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- stable/8/sys/powerpc/powerpc/intr_machdep.c Thu Jun 10 18:04:25 2010 (r208995) +++ stable/8/sys/powerpc/powerpc/intr_machdep.c Thu Jun 10 19:11:00 2010 (r208996) @@ -164,6 +164,7 @@ intr_lookup(u_int irq) i->trig = INTR_TRIGGER_CONFORM; i->pol = INTR_POLARITY_CONFORM; i->irq = irq; + i->pic = NULL; i->vector = -1; mtx_lock(&intr_table_lock); @@ -325,6 +326,11 @@ powerpc_setup_intr(const char *name, u_i if (!cold) { error = powerpc_map_irq(i); + + if (!error && (i->trig != INTR_TRIGGER_CONFORM || + i->pol != INTR_POLARITY_CONFORM)) + PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); + if (!error && enable) PIC_ENABLE(i->pic, i->intline, i->vector); } @@ -350,7 +356,7 @@ powerpc_config_intr(int irq, enum intr_t i->trig = trig; i->pol = pol; - if (!cold) + if (!cold && i->pic != NULL) PIC_CONFIG(i->pic, i->intline, trig, pol); return (0); From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 19:38:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 071761065673; Thu, 10 Jun 2010 19:38:08 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EABB08FC14; Thu, 10 Jun 2010 19:38:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AJc7mj044901; Thu, 10 Jun 2010 19:38:07 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AJc7CT044899; Thu, 10 Jun 2010 19:38:07 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006101938.o5AJc7CT044899@svn.freebsd.org> From: Matt Jacob Date: Thu, 10 Jun 2010 19:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208997 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 19:38:08 -0000 Author: mjacob Date: Thu Jun 10 19:38:07 2010 New Revision: 208997 URL: http://svn.freebsd.org/changeset/base/208997 Log: Don't pass a buffer directly as a printflike format string. Found by: clang MFC after: 1 month Modified: head/sys/dev/isp/isp_library.c Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Thu Jun 10 19:11:00 2010 (r208996) +++ head/sys/dev/isp/isp_library.c Thu Jun 10 19:38:07 2010 (r208997) @@ -344,7 +344,7 @@ isp_print_qentry(ispsoftc_t *isp, const for (j = 0; j < (QENTRY_LEN >> 2); j++) { ISP_SNPRINTF(buf, TBA, "%s %02x", buf, ptr[amt++] & 0xff); } - isp_prt(isp, ISP_LOGALL, buf); + isp_prt(isp, ISP_LOGALL, "%s", buf); } } From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 19:58:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3202106564A; Thu, 10 Jun 2010 19:58:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C112A8FC12; Thu, 10 Jun 2010 19:58:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AJwsvP049555; Thu, 10 Jun 2010 19:58:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AJwsQp049554; Thu, 10 Jun 2010 19:58:54 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006101958.o5AJwsQp049554@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 10 Jun 2010 19:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208998 - in stable/8/release: ia64 picobsd/floppy.tree/sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 19:58:54 -0000 Author: marcel Date: Thu Jun 10 19:58:54 2010 New Revision: 208998 URL: http://svn.freebsd.org/changeset/base/208998 Log: MFC rev 208622: The EFI system partition used to make the CD image bootable is running out of space. Bump it up... Approved by: re (kensmith) Modified: stable/8/release/ia64/mkisoimages.sh Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) Modified: stable/8/release/ia64/mkisoimages.sh ============================================================================== --- stable/8/release/ia64/mkisoimages.sh Thu Jun 10 19:38:07 2010 (r208997) +++ stable/8/release/ia64/mkisoimages.sh Thu Jun 10 19:58:54 2010 (r208998) @@ -67,7 +67,7 @@ EFIPART=efipart.sys # To create a bootable CD under EFI, the boot image should be an EFI # system partition. if [ $bootable = yes ]; then - EFISZ=40960 + EFISZ=65536 MNT=/mnt dd if=/dev/zero of=$BASE/$EFIPART count=$EFISZ md=`mdconfig -a -t vnode -f $BASE/$EFIPART` From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 19:59:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C02C21065672; Thu, 10 Jun 2010 19:59:23 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB6348FC22; Thu, 10 Jun 2010 19:59:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AJxNgU049732; Thu, 10 Jun 2010 19:59:23 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AJxNWw049731; Thu, 10 Jun 2010 19:59:23 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006101959.o5AJxNWw049731@svn.freebsd.org> From: Roman Divacky Date: Thu, 10 Jun 2010 19:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208999 - in head/contrib/llvm: Xcode cmake projects tools/clang/INPUTS tools/clang/clang.xcodeproj tools/clang/win32 unittests win32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 19:59:23 -0000 Author: rdivacky Date: Thu Jun 10 19:59:23 2010 New Revision: 208999 URL: http://svn.freebsd.org/changeset/base/208999 Log: Remove Xcode cmake win32 projects unittests from LLVM and clang.xcodeproj INPUTS win32 from clang. Requested by: jkim Approved by: ed (mentor) Deleted: head/contrib/llvm/Xcode/ head/contrib/llvm/cmake/ head/contrib/llvm/projects/ head/contrib/llvm/tools/clang/INPUTS/ head/contrib/llvm/tools/clang/clang.xcodeproj/ head/contrib/llvm/tools/clang/win32/ head/contrib/llvm/unittests/ head/contrib/llvm/win32/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:01:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAA6F1065673; Thu, 10 Jun 2010 20:01:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9956F8FC19; Thu, 10 Jun 2010 20:01:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AK1XAF050283; Thu, 10 Jun 2010 20:01:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AK1Xaw050281; Thu, 10 Jun 2010 20:01:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102001.o5AK1Xaw050281@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209000 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:01:33 -0000 Author: jhb Date: Thu Jun 10 20:01:33 2010 New Revision: 209000 URL: http://svn.freebsd.org/changeset/base/209000 Log: MFC 208925: The lock associated with the /dev/apm knote is already held, so use KNOTE_LOCKED() instead of KNOTE_UNLOCKED(). Approved by: re (kib) Modified: stable/8/sys/dev/acpica/acpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Thu Jun 10 19:59:23 2010 (r208999) +++ stable/8/sys/dev/acpica/acpi.c Thu Jun 10 20:01:33 2010 (r209000) @@ -2356,7 +2356,7 @@ acpi_ReqSleepState(struct acpi_softc *sc clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) { selwakeuppri(&clone->sel_read, PZERO); - KNOTE_UNLOCKED(&clone->sel_read.si_note, 0); + KNOTE_LOCKED(&clone->sel_read.si_note, 0); } } #endif From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:02:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6222C1065678; Thu, 10 Jun 2010 20:02:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50D358FC1B; Thu, 10 Jun 2010 20:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AK2DMF050459; Thu, 10 Jun 2010 20:02:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AK2D3V050457; Thu, 10 Jun 2010 20:02:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102002.o5AK2D3V050457@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209001 - stable/7/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:02:13 -0000 Author: jhb Date: Thu Jun 10 20:02:13 2010 New Revision: 209001 URL: http://svn.freebsd.org/changeset/base/209001 Log: MFC 208925: The lock associated with the /dev/apm knote is already held, so use KNOTE_LOCKED() instead of KNOTE_UNLOCKED(). Modified: stable/7/sys/dev/acpica/acpi.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/acpica/acpi.c ============================================================================== --- stable/7/sys/dev/acpica/acpi.c Thu Jun 10 20:01:33 2010 (r209000) +++ stable/7/sys/dev/acpica/acpi.c Thu Jun 10 20:02:13 2010 (r209001) @@ -2258,7 +2258,7 @@ acpi_ReqSleepState(struct acpi_softc *sc clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) { selwakeuppri(&clone->sel_read, PZERO); - KNOTE_UNLOCKED(&clone->sel_read.si_note, 0); + KNOTE_LOCKED(&clone->sel_read.si_note, 0); } } From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:04:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1214A1065675; Thu, 10 Jun 2010 20:04:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0117B8FC1B; Thu, 10 Jun 2010 20:04:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AK4iAH051079; Thu, 10 Jun 2010 20:04:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AK4i4m051077; Thu, 10 Jun 2010 20:04:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102004.o5AK4i4m051077@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209002 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:04:45 -0000 Author: jhb Date: Thu Jun 10 20:04:44 2010 New Revision: 209002 URL: http://svn.freebsd.org/changeset/base/209002 Log: MFC 208912: Fix a sign bug that caused adaptive spinning in sx_xlock() to not work properly. Approved by: re (bz) Modified: stable/8/sys/kern/kern_sx.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/kern_sx.c ============================================================================== --- stable/8/sys/kern/kern_sx.c Thu Jun 10 20:02:13 2010 (r209001) +++ stable/8/sys/kern/kern_sx.c Thu Jun 10 20:04:44 2010 (r209002) @@ -508,7 +508,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t * running or the state of the lock changes. */ x = sx->sx_lock; - if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) != 0) { + if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0) { if ((x & SX_LOCK_SHARED) == 0) { x = SX_OWNER(x); owner = (struct thread *)x; From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:13:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2100F106564A; Thu, 10 Jun 2010 20:13:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F2FE8FC0C; Thu, 10 Jun 2010 20:13:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKD3nJ052991; Thu, 10 Jun 2010 20:13:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKD3mu052989; Thu, 10 Jun 2010 20:13:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102013.o5AKD3mu052989@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209003 - stable/8/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:13:04 -0000 Author: jhb Date: Thu Jun 10 20:13:03 2010 New Revision: 209003 URL: http://svn.freebsd.org/changeset/base/209003 Log: MFC 208603,208605: More gracefully handle stale file handles and attributes when opening a file via NFS. Specifically, to satisfy close-to-open-consistency, the NFS client always performs at least one RPC on a file during an open(2) to see if the file has changed. Normally this RPC is an ACCESS or GETATTR RPC that is forced by flushing a file's attribute cache during nfs_open() and then requesting new attributes. However, if the file is noticed to be stale during nfs_open(), the only recourse is to fail the open(2) call with ESTALE. On the other hand, if the ACCESS or GETATTR RPC is sent during nfs_lookup(), then the NFS client can fall back to a LOOKUP RPC to obtain the new file handle in the case that a file has been replaced. This change causes the NFS client to flush the attribute cache during nfs_lookup() when validating a name cache hit if the attributes fetched during nfs_lookup() can be reused in nfs_open(). This allows the client to open a replaced file via the new file handle the first time that it notices a replaced file rather than failing with ESTALE in some cases. Approved by: re (kib) Modified: stable/8/sys/nfsclient/nfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vnops.c Thu Jun 10 20:04:44 2010 (r209002) +++ stable/8/sys/nfsclient/nfs_vnops.c Thu Jun 10 20:13:03 2010 (r209003) @@ -932,7 +932,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct mbuf *mreq, *mrep, *md, *mb; long len; nfsfh_t *fhp; - struct nfsnode *np; + struct nfsnode *np, *newnp; int error = 0, attrflag, fhsize, ltype; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; @@ -958,10 +958,27 @@ nfs_lookup(struct vop_lookup_args *ap) * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback * to doing a lookup RPC. + * + * To better handle stale file handles and attributes, + * clear the attribute cache of this node if it is a + * leaf component, part of an open() call, and not + * locally modified before fetching the attributes. + * This should allow stale file handles to be detected + * here where we can fall back to a LOOKUP RPC to + * recover rather than having nfs_open() detect the + * stale file handle and failing open(2) with ESTALE. */ newvp = *vpp; - if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred) - && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { + newnp = VTONFS(newvp); + if ((cnp->cn_flags & (ISLASTCN | ISOPEN)) == + (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { + mtx_lock(&newnp->n_mtx); + newnp->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); + mtx_unlock(&newnp->n_mtx); + } + if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && + vattr.va_ctime.tv_sec == newnp->n_ctime) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:13:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 176891065768; Thu, 10 Jun 2010 20:13:10 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49C848FC16; Thu, 10 Jun 2010 20:13:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKDAhH053059; Thu, 10 Jun 2010 20:13:10 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKDA56053057; Thu, 10 Jun 2010 20:13:10 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201006102013.o5AKDA56053057@svn.freebsd.org> From: Randi Harper Date: Thu, 10 Jun 2010 20:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209004 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:13:11 -0000 Author: randi Date: Thu Jun 10 20:13:10 2010 New Revision: 209004 URL: http://svn.freebsd.org/changeset/base/209004 Log: Fix uninitialized variables that cause a crash when the network is initialized and sysinstall is not running as init. Submitted by: Nick Mills Approved by: cperciva (mentor) MFC after: 3 days Modified: head/usr.sbin/sysinstall/tcpip.c Modified: head/usr.sbin/sysinstall/tcpip.c ============================================================================== --- head/usr.sbin/sysinstall/tcpip.c Thu Jun 10 20:13:03 2010 (r209003) +++ head/usr.sbin/sysinstall/tcpip.c Thu Jun 10 20:13:10 2010 (r209004) @@ -732,6 +732,9 @@ tcpDeviceSelect(void) return (NULL); } + devs = deviceFind(NULL, DEVICE_TYPE_NETWORK); + cnt = deviceCount(devs); + if ((!RunningAsInit) && (variable_check("NETWORK_CONFIGURED=NO") != TRUE)) { if (!msgYesNo("Running multi-user, assume that the network is already configured?")) return devs[0]; From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:13:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A1CE1065674; Thu, 10 Jun 2010 20:13:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E6BD8FC13; Thu, 10 Jun 2010 20:13:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKDNrs053159; Thu, 10 Jun 2010 20:13:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKDNGY053157; Thu, 10 Jun 2010 20:13:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102013.o5AKDNGY053157@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209005 - stable/7/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:13:23 -0000 Author: jhb Date: Thu Jun 10 20:13:23 2010 New Revision: 209005 URL: http://svn.freebsd.org/changeset/base/209005 Log: MFC 208603: More gracefully handle stale file handles and attributes when opening a file via NFS. Specifically, to satisfy close-to-open-consistency, the NFS client always performs at least one RPC on a file during an open(2) to see if the file has changed. Normally this RPC is an ACCESS or GETATTR RPC that is forced by flushing a file's attribute cache during nfs_open() and then requesting new attributes. However, if the file is noticed to be stale during nfs_open(), the only recourse is to fail the open(2) call with ESTALE. On the other hand, if the ACCESS or GETATTR RPC is sent during nfs_lookup(), then the NFS client can fall back to a LOOKUP RPC to obtain the new file handle in the case that a file has been replaced. This change causes the NFS client to flush the attribute cache during nfs_lookup() when validating a name cache hit if the attributes fetched during nfs_lookup() can be reused in nfs_open(). This allows the client to open a replaced file via the new file handle the first time that it notices a replaced file rather than failing with ESTALE in some cases. Modified: stable/7/sys/nfsclient/nfs_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/7/sys/nfsclient/nfs_vnops.c Thu Jun 10 20:13:10 2010 (r209004) +++ stable/7/sys/nfsclient/nfs_vnops.c Thu Jun 10 20:13:23 2010 (r209005) @@ -875,7 +875,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct mbuf *mreq, *mrep, *md, *mb; long len; nfsfh_t *fhp; - struct nfsnode *np; + struct nfsnode *np, *newnp; int error = 0, attrflag, fhsize; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; @@ -901,10 +901,26 @@ nfs_lookup(struct vop_lookup_args *ap) * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback * to doing a lookup RPC. + * + * To better handle stale file handles and attributes, + * clear the attribute cache of this node if it is a + * leaf component, part of an open() call, and not + * locally modified before fetching the attributes. + * This should allow stale file handles to be detected + * here where we can fall back to a LOOKUP RPC to + * recover rather than having nfs_open() detect the + * stale file handle and failing open(2) with ESTALE. */ newvp = *vpp; - if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td) - && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { + newnp = VTONFS(newvp); + if ((cnp->cn_flags & (ISLASTCN | ISOPEN)) == + (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { + mtx_lock(&newnp->n_mtx); + newnp->n_attrstamp = 0; + mtx_unlock(&newnp->n_mtx); + } + if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td) == 0 && + vattr.va_ctime.tv_sec == newnp->n_ctime) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:20:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5D031065672; Thu, 10 Jun 2010 20:20:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3EF28FC18; Thu, 10 Jun 2010 20:20:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKKk4i054883; Thu, 10 Jun 2010 20:20:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKKkQc054880; Thu, 10 Jun 2010 20:20:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102020.o5AKKkQc054880@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209007 - stable/8/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:20:47 -0000 Author: rpaulo Date: Thu Jun 10 20:20:46 2010 New Revision: 209007 URL: http://svn.freebsd.org/changeset/base/209007 Log: MFC r208699: Fix resource leaks in ieee80211_ioctl_setchanlist() in case of error. Found with: Coverity Prevent(tm) CID: 4115 Approved by: re (kensmith) Modified: stable/8/sys/net80211/ieee80211_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/net80211/ieee80211_ioctl.c ============================================================================== --- stable/8/sys/net80211/ieee80211_ioctl.c Thu Jun 10 20:15:45 2010 (r209006) +++ stable/8/sys/net80211/ieee80211_ioctl.c Thu Jun 10 20:20:46 2010 (r209007) @@ -1590,8 +1590,10 @@ ieee80211_ioctl_setchanlist(struct ieee8 if (list == NULL) return ENOMEM; error = copyin(ireq->i_data, list, ireq->i_len); - if (error) + if (error) { + free(list, M_TEMP); return error; + } nchan = 0; chanlist = list + ireq->i_len; /* NB: zero'd already */ maxchan = ireq->i_len * NBBY; @@ -1607,8 +1609,10 @@ ieee80211_ioctl_setchanlist(struct ieee8 nchan++; } } - if (nchan == 0) + if (nchan == 0) { + free(list, M_TEMP); return EINVAL; + } if (ic->ic_bsschan != IEEE80211_CHAN_ANYC && /* XXX */ isclr(chanlist, ic->ic_bsschan->ic_ieee)) ic->ic_bsschan = IEEE80211_CHAN_ANYC; From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:23:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09BA11065709; Thu, 10 Jun 2010 20:23:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC1648FC23; Thu, 10 Jun 2010 20:23:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKNK44055502; Thu, 10 Jun 2010 20:23:20 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKNK0A055500; Thu, 10 Jun 2010 20:23:20 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102023.o5AKNK0A055500@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209008 - stable/8/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:23:21 -0000 Author: rpaulo Date: Thu Jun 10 20:23:20 2010 New Revision: 209008 URL: http://svn.freebsd.org/changeset/base/209008 Log: MFC r208703: Fix an off by one in ar9285SetPowerCalTable(). Found with: Coverity Prevent(tm) CID: 3979 Approved by: re (kensmit) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Thu Jun 10 20:20:46 2010 (r209007) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Thu Jun 10 20:23:20 2010 (r209008) @@ -634,7 +634,7 @@ ar9285SetPowerCalTable(struct ath_hal *a OS_REG_WRITE(ah, AR_PHY_TPCRG1, (OS_REG_READ(ah, AR_PHY_TPCRG1) & ~(AR_PHY_TPCRG1_NUM_PD_GAIN | AR_PHY_TPCRG1_PD_GAIN_1 | AR_PHY_TPCRG1_PD_GAIN_2 | AR_PHY_TPCRG1_PD_GAIN_3)) | SM(numXpdGain - 1, AR_PHY_TPCRG1_NUM_PD_GAIN) | SM(xpdGainValues[0], AR_PHY_TPCRG1_PD_GAIN_1 ) | - SM(xpdGainValues[1], AR_PHY_TPCRG1_PD_GAIN_2) | SM(xpdGainValues[2], AR_PHY_TPCRG1_PD_GAIN_3)); + SM(xpdGainValues[1], AR_PHY_TPCRG1_PD_GAIN_2) | SM(0, AR_PHY_TPCRG1_PD_GAIN_3)); for (i = 0; i < AR5416_MAX_CHAINS; i++) { From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:26:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 343981065670; Thu, 10 Jun 2010 20:26:35 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 216578FC0C; Thu, 10 Jun 2010 20:26:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKQZ4L056241; Thu, 10 Jun 2010 20:26:35 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKQYK5056232; Thu, 10 Jun 2010 20:26:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102026.o5AKQYK5056232@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209009 - in stable/8/sys/dev/ath/ath_hal: . ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:26:35 -0000 Author: rpaulo Date: Thu Jun 10 20:26:34 2010 New Revision: 209009 URL: http://svn.freebsd.org/changeset/base/209009 Log: MFC r208711: Bring in a couple of fixes from the Linux ath9k related to chip hangs. While there, try to make the register write pattern look like what's done by ath9k. Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ah.h stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c stable/8/sys/dev/ath/ath_hal/ar5416/ar5416phy.h stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ah.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah.h Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ah.h Thu Jun 10 20:26:34 2010 (r209009) @@ -324,6 +324,7 @@ typedef enum { HAL_INT_RXORN = 0x00000020, HAL_INT_TX = 0x00000040, /* Non-common mapping */ HAL_INT_TXDESC = 0x00000080, + HAL_INT_TIM_TIMER= 0x00000100, HAL_INT_TXURN = 0x00000800, HAL_INT_MIB = 0x00001000, HAL_INT_RXPHY = 0x00004000, Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Thu Jun 10 20:26:34 2010 (r209009) @@ -38,11 +38,8 @@ v4kEepromGet(struct ath_hal *ah, int par int i; switch (param) { - case AR_EEP_NFTHRESH_5: - *(int16_t *)val = pModal[0].noiseFloorThreshCh[0]; - return HAL_OK; case AR_EEP_NFTHRESH_2: - *(int16_t *)val = pModal[1].noiseFloorThreshCh[0]; + *(int16_t *)val = pModal->noiseFloorThreshCh[0]; return HAL_OK; case AR_EEP_MACADDR: /* Get MAC Address */ sum = 0; @@ -67,14 +64,10 @@ v4kEepromGet(struct ath_hal *ah, int par return pBase->opCapFlags; case AR_EEP_RFSILENT: return pBase->rfSilent; - case AR_EEP_OB_5: - return pModal[CHAN_A_IDX].ob; - case AR_EEP_DB_5: - return pModal[CHAN_A_IDX].db; case AR_EEP_OB_2: - return pModal[CHAN_B_IDX].ob; + return pModal->ob; case AR_EEP_DB_2: - return pModal[CHAN_B_IDX].db; + return pModal->db; case AR_EEP_TXMASK: return pBase->txMask; case AR_EEP_RXMASK: @@ -84,11 +77,9 @@ v4kEepromGet(struct ath_hal *ah, int par case AR_EEP_TXGAIN_TYPE: return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ? pBase->txGainType : AR5416_EEP_TXGAIN_ORIG; -#if 0 case AR_EEP_OL_PWRCTRL: HALASSERT(val == AH_NULL); - return pBase->openLoopPwrCntl ? HAL_OK : HAL_EIO; -#endif + return HAL_EIO; case AR_EEP_AMODE: HALASSERT(val == AH_NULL); return pBase->opCapFlags & AR5416_OPFLAGS_11A ? @@ -110,15 +101,11 @@ v4kEepromGet(struct ath_hal *ah, int par case AR_EEP_AES: case AR_EEP_BURST: case AR_EEP_RFKILL: - case AR_EEP_TURBO5DISABLE: case AR_EEP_TURBO2DISABLE: HALASSERT(val == AH_NULL); return HAL_OK; case AR_EEP_ANTGAINMAX_2: - *(int8_t *) val = ee->ee_antennaGainMax[1]; - return HAL_OK; - case AR_EEP_ANTGAINMAX_5: - *(int8_t *) val = ee->ee_antennaGainMax[0]; + *(int8_t *) val = ee->ee_antennaGainMax; return HAL_OK; default: HALASSERT(0); @@ -136,10 +123,7 @@ v4kEepromSet(struct ath_hal *ah, int par switch (param) { case AR_EEP_ANTGAINMAX_2: - ee->ee_antennaGainMax[1] = (int8_t) v; - return HAL_OK; - case AR_EEP_ANTGAINMAX_5: - ee->ee_antennaGainMax[0] = (int8_t) v; + ee->ee_antennaGainMax = (int8_t) v; return HAL_OK; } return HAL_EINVAL; @@ -252,7 +236,7 @@ v4kEepromReadCTLInfo(struct ath_hal *ah, RD_EDGES_POWER *rep = ee->ee_rdEdgesPower; int i, j; - HALASSERT(AR5416_NUM_CTLS <= sizeof(ee->ee_rdEdgesPower)/NUM_EDGES); + HALASSERT(AR5416_4K_NUM_CTLS <= sizeof(ee->ee_rdEdgesPower)/NUM_EDGES); for (i = 0; ee->ee_base.ctlIndex[i] != 0 && i < AR5416_4K_NUM_CTLS; i++) { for (j = 0; j < NUM_EDGES; j ++) { Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Thu Jun 10 20:26:34 2010 (r209009) @@ -23,6 +23,8 @@ #include "ah_eeprom.h" #include "ah_eeprom_v14.h" +#define AR9285_RDEXT_DEFAULT 0x1F + #undef owl_eep_start_loc #ifdef __LINUX_ARM_ARCH__ /* AP71 */ #define owl_eep_start_loc 0 @@ -150,6 +152,6 @@ typedef struct { uint16_t ee_numCtls; RD_EDGES_POWER ee_rdEdgesPower[NUM_EDGES*AR5416_4K_NUM_CTLS]; /* XXX these are dynamically calculated for use by shared code */ - int8_t ee_antennaGainMax[2]; + int8_t ee_antennaGainMax; } HAL_EEPROM_v4k; #endif /* _AH_EEPROM_V4K_H_ */ Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Jun 10 20:26:34 2010 (r209009) @@ -120,6 +120,13 @@ ar5416GetPendingInterrupts(struct ath_ha ahp->ah_intrTxqs |= MS(isr1, AR_ISR_S1_QCU_TXEOL); } + if (AR_SREV_MERLIN(ah) || AR_SREV_KITE(ah)) { + uint32_t isr5; + isr5 = OS_REG_READ(ah, AR_ISR_S5_S); + if (isr5 & AR_ISR_S5_TIM_TIMER) + *masked |= HAL_INT_TIM_TIMER; + } + /* Interrupt Mitigation on AR5416 */ #ifdef AR5416_INT_MITIGATION if (isr & (AR_ISR_RXMINTR | AR_ISR_RXINTM)) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Jun 10 20:26:34 2010 (r209009) @@ -170,7 +170,16 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO OS_REG_WRITE(ah, AR_RSSI_THR, rssiThrReg); OS_MARK(ah, AH_MARK_RESET_LINE, __LINE__); + if (AR_SREV_MERLIN_10_OR_LATER(ah)) + OS_REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE); + if (AR_SREV_KITE(ah)) { + uint32_t val; + val = OS_REG_READ(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS); + val &= ~AR_PHY_RIFS_INIT_DELAY; + OS_REG_WRITE(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS, val); + } + AH5416(ah)->ah_writeIni(ah, chan); /* Setup 11n MAC/Phy mode registers */ @@ -1019,8 +1028,11 @@ ar5416SetResetPowerOn(struct ath_hal *ah /* * RTC reset and clear */ + OS_REG_WRITE(ah, AR_RC, AR_RC_AHB); OS_REG_WRITE(ah, AR_RTC_RESET, 0); OS_DELAY(20); + OS_REG_WRITE(ah, AR_RC, 0); + OS_REG_WRITE(ah, AR_RTC_RESET, 1); /* Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Thu Jun 10 20:26:34 2010 (r209009) @@ -111,6 +111,9 @@ #define AR_PHY_HEAVY_CLIP_ENABLE 0x99E0 +#define AR_PHY_HEAVY_CLIP_FACTOR_RIFS 0x99ec +#define AR_PHY_RIFS_INIT_DELAY 0x03ff0000 + #define AR_PHY_M_SLEEP 0x99f0 /* sleep control registers */ #define AR_PHY_REFCLKDLY 0x99f4 #define AR_PHY_REFCLKPD 0x99f8 Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Thu Jun 10 20:26:34 2010 (r209009) @@ -127,6 +127,7 @@ #define AR_EXTRCCNT 0x8328 /* extension channel rx clear count */ #define AR_SELFGEN_MASK 0x832c /* rx and cal chain masks */ #define AR_PCU_TXBUF_CTRL 0x8340 +#define AR_PCU_MISC_MODE2 0x8344 /* DMA & PCI Registers in PCI space (usable during sleep)*/ #define AR_RC_AHB 0x00000001 /* AHB reset */ @@ -244,6 +245,10 @@ #define AR_ISR_S2_GTT 0x00800000 /* Global transmit timeout */ #define AR_ISR_S2_TSFOOR 0x40000000 /* RX TSF out of range */ +#define AR_ISR_S5 0x0098 +#define AR_ISR_S5_S 0x00d8 +#define AR_ISR_S5_TIM_TIMER 0x00000010 + #define AR_INTR_SPURIOUS 0xffffffff #define AR_INTR_RTC_IRQ 0x00000001 /* rtc in shutdown state */ #define AR_INTR_MAC_IRQ 0x00000002 /* pending mac interrupt */ @@ -495,6 +500,8 @@ #define AR_PCU_CLEAR_VMF 0x01000000 /* clear vmf mode (fast cc)*/ #define AR_PCU_CLEAR_BA_VALID 0x04000000 /* clear ba state */ +#define AR_PCU_MISC_MODE2_HWWAR1 0x00100000 + /* GPIO Interrupt */ #define AR_INTR_GPIO 0x3FF00000 /* gpio interrupted */ #define AR_INTR_GPIO_S 20 @@ -521,6 +528,8 @@ #define AR_GPIO_INTR_POL_VAL 0x1FFF #define AR_GPIO_INTR_POL_VAL_S 0 +#define AR_GPIO_JTAG_DISABLE 0x00020000 + #define AR_2040_JOINED_RX_CLEAR 0x00000001 /* use ctl + ext rx_clear for cca */ #define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Thu Jun 10 20:26:34 2010 (r209009) @@ -316,6 +316,16 @@ ar9285WriteIni(struct ath_hal *ah, const regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_common, 1, regWrites); + OS_REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); + + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + uint32_t val; + val = OS_REG_READ(ah, AR_PCU_MISC_MODE2) & + (~AR_PCU_MISC_MODE2_HWWAR1); + OS_REG_WRITE(ah, AR_PCU_MISC_MODE2, val); + OS_REG_WRITE(ah, 0x9800 + (651 << 2), 0x11); + } + } /* From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:28:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B65B1065678; Thu, 10 Jun 2010 20:28:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184438FC21; Thu, 10 Jun 2010 20:28:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKSgOc056740; Thu, 10 Jun 2010 20:28:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKSgUU056738; Thu, 10 Jun 2010 20:28:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102028.o5AKSgUU056738@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209010 - stable/8/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:28:43 -0000 Author: rpaulo Date: Thu Jun 10 20:28:42 2010 New Revision: 209010 URL: http://svn.freebsd.org/changeset/base/209010 Log: MFC r208712: Rewrite ar9285SetBoardValues() to match what ath9k does and fix out of bounds reads. Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Thu Jun 10 20:26:34 2010 (r209009) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Thu Jun 10 20:28:42 2010 (r209010) @@ -245,107 +245,60 @@ ar9285SetBoardValues(struct ath_hal *ah, const HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; const struct ar5416eeprom_4k *eep = &ee->ee_base; const MODAL_EEP4K_HEADER *pModal; - int i, regChainOffset; - uint8_t txRxAttenLocal; /* workaround for eeprom versions <= 14.2 */ + uint8_t txRxAttenLocal = 23; HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); pModal = &eep->modalHeader; - /* NB: workaround for eeprom versions <= 14.2 */ - txRxAttenLocal = 23; - OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon); - for (i = 0; i < AR5416_4K_MAX_CHAINS; i++) { - if (AR_SREV_MERLIN(ah)) { - if (i >= 2) break; - } - if (AR_SREV_OWL_20_OR_LATER(ah) && - (AH5416(ah)->ah_rx_chainmask == 0x5 || - AH5416(ah)->ah_tx_chainmask == 0x5) && i != 0) { - /* Regs are swapped from chain 2 to 1 for 5416 2_0 with - * only chains 0 and 2 populated - */ - regChainOffset = (i == 1) ? 0x2000 : 0x1000; - } else { - regChainOffset = i * 0x1000; - } - - OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset, pModal->antCtrlChain[i]); - OS_REG_WRITE(ah, AR_PHY_TIMING_CTRL4 + regChainOffset, - (OS_REG_READ(ah, AR_PHY_TIMING_CTRL4 + regChainOffset) & + OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, pModal->antCtrlChain[0]); + OS_REG_WRITE(ah, AR_PHY_TIMING_CTRL4, + (OS_REG_READ(ah, AR_PHY_TIMING_CTRL4) & ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | - SM(pModal->iqCalICh[i], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | - SM(pModal->iqCalQCh[i], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); - - /* - * Large signal upgrade. - * XXX update - */ + SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | + SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); - if ((i == 0) || AR_SREV_OWL_20_OR_LATER(ah)) { - OS_REG_WRITE(ah, AR_PHY_RXGAIN + regChainOffset, - (OS_REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & ~AR_PHY_RXGAIN_TXRX_ATTEN) | - SM(IS_EEP_MINOR_V3(ah) ? pModal->txRxAttenCh[i] : txRxAttenLocal, - AR_PHY_RXGAIN_TXRX_ATTEN)); - - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | - SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); - } - } - - OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, pModal->switchSettling); - OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC, pModal->adcDesiredSize); - OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_PGA, pModal->pgaDesiredSize); - OS_REG_WRITE(ah, AR_PHY_RF_CTL4, - SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAA_OFF) - | SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAB_OFF) - | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAA_ON) - | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAB_ON)); - - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON, pModal->txEndToRxOn); - - OS_REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62, - pModal->thresh62); - OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, AR_PHY_EXT_CCA0_THRESH62, - pModal->thresh62); - - /* Minor Version Specific application */ - if (IS_EEP_MINOR_V2(ah)) { - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_DATA_START, pModal->txFrameToDataStart); - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_PA_ON, pModal->txFrameToPaOn); - } - if (IS_EEP_MINOR_V3(ah)) { if (IEEE80211_IS_CHAN_HT40(chan)) { /* Overwrite switch settling with HT40 value */ - OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, pModal->swSettleHt40); + OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, + pModal->swSettleHt40); } - - if ((AR_SREV_OWL_20_OR_LATER(ah)) && - ( AH5416(ah)->ah_rx_chainmask == 0x5 || AH5416(ah)->ah_tx_chainmask == 0x5)){ - /* Reg Offsets are swapped for logical mapping */ - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM(pModal->bswMargin[2], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM(pModal->bswAtten[2], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM(pModal->bswMargin[1], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM(pModal->bswAtten[1], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); - } else { - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM(pModal->bswMargin[1], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM(pModal->bswAtten[1], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM(pModal->bswMargin[2],AR_PHY_GAIN_2GHZ_BSW_MARGIN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM(pModal->bswAtten[2], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); - } - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_MARGIN, pModal->bswMargin[0]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_ATTEN, pModal->bswAtten[0]); - } + txRxAttenLocal = pModal->txRxAttenCh[0]; + + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, + pModal->bswMargin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN1_DB, + pModal->bswAtten[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, + pModal->xatten2Margin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN2_DB, + pModal->xatten2Db[0]); + + /* block 1 has the same values as block 0 */ + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, pModal->bswMargin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN1_DB, pModal->bswAtten[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, pModal->xatten2Margin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN2_DB, pModal->xatten2Db[0]); + + } + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN, + AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN, + AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); + + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, + AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, + AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); + + if (AR_SREV_KITE_11(ah)) + OS_REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14)); + return AH_TRUE; } From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:34:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11C57106566B; Thu, 10 Jun 2010 20:34:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F40288FC12; Thu, 10 Jun 2010 20:34:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKYMLo058083; Thu, 10 Jun 2010 20:34:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKYMXX058081; Thu, 10 Jun 2010 20:34:22 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102034.o5AKYMXX058081@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209011 - stable/8/sys/dev/ath/ath_hal/ar5211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:34:23 -0000 Author: rpaulo Date: Thu Jun 10 20:34:22 2010 New Revision: 209011 URL: http://svn.freebsd.org/changeset/base/209011 Log: MFC r208644: Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. While there, fix 'const static' typo. Submitted by: Arnaud Lacombe Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Jun 10 20:28:42 2010 (r209010) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Jun 10 20:34:22 2010 (r209011) @@ -46,7 +46,7 @@ typedef struct { } CHAN_INFO_2GHZ; #define CI_2GHZ_INDEX_CORRECTION 19 -const static CHAN_INFO_2GHZ chan2GHzData[] = { +static const CHAN_INFO_2GHZ chan2GHzData[] = { { 1, 0x46, 96 }, /* 2312 -19 */ { 1, 0x46, 97 }, /* 2317 -18 */ { 1, 0x46, 98 }, /* 2322 -17 */ @@ -926,9 +926,10 @@ ar5211IsNfGood(struct ath_hal *ah, struc if (!getNoiseFloorThresh(ah, chan, &nfThresh)) return AH_FALSE; - if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) + if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: NF did not complete in calibration window\n", __func__); + } nf = ar5211GetNoiseFloor(ah); if (nf > nfThresh) { HALDEBUG(ah, HAL_DEBUG_ANY, From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:36:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 406DA106564A; Thu, 10 Jun 2010 20:36:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E7C28FC1C; Thu, 10 Jun 2010 20:36:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKaVIb058661; Thu, 10 Jun 2010 20:36:31 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKaVVY058659; Thu, 10 Jun 2010 20:36:31 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102036.o5AKaVVY058659@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209012 - stable/8/sys/dev/ath/ath_hal/ar5210 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:36:31 -0000 Author: rpaulo Date: Thu Jun 10 20:36:30 2010 New Revision: 209012 URL: http://svn.freebsd.org/changeset/base/209012 Log: MFC r208643: Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. Submitted by: Arnaud Lacombe Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Thu Jun 10 20:34:22 2010 (r209011) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Thu Jun 10 20:36:30 2010 (r209012) @@ -526,9 +526,10 @@ ar5210PerCalibrationN(struct ath_hal *ah /* AGC calibration (this was added to make the NF threshold check work) */ OS_REG_WRITE(ah, AR_PHY_AGCCTL, OS_REG_READ(ah, AR_PHY_AGCCTL) | AR_PHY_AGC_CAL); - if (!ath_hal_wait(ah, AR_PHY_AGCCTL, AR_PHY_AGC_CAL, 0)) + if (!ath_hal_wait(ah, AR_PHY_AGCCTL, AR_PHY_AGC_CAL, 0)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: AGC calibration timeout\n", __func__); + } /* Rewrite our AGC values we stored off earlier (return AGC to normal operation) */ OS_REG_WRITE(ah, 0x9858, reg9858); From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:40:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29E82106566C; Thu, 10 Jun 2010 20:40:39 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 192E08FC18; Thu, 10 Jun 2010 20:40:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKeclg059654; Thu, 10 Jun 2010 20:40:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKec9w059652; Thu, 10 Jun 2010 20:40:38 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102040.o5AKec9w059652@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209013 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:40:39 -0000 Author: rpaulo Date: Thu Jun 10 20:40:38 2010 New Revision: 209013 URL: http://svn.freebsd.org/changeset/base/209013 Log: Add missing braces. Submitted by: sam MFC after: 3 days Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Jun 10 20:36:30 2010 (r209012) +++ head/sys/net80211/ieee80211_hwmp.c Thu Jun 10 20:40:38 2010 (r209013) @@ -707,9 +707,10 @@ hwmp_recv_preq(struct ieee80211vap *vap, rtorig = ieee80211_mesh_rt_find(vap, preq->preq_origaddr); if (rtorig == NULL) rtorig = ieee80211_mesh_rt_add(vap, preq->preq_origaddr); - if (rtorig == NULL) + if (rtorig == NULL) { /* XXX stat */ return; + } hrorig = IEEE80211_MESH_ROUTE_PRIV(rtorig, struct ieee80211_hwmp_route); /* * Sequence number validation. From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:51:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C41E91065676; Thu, 10 Jun 2010 20:51:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFC8E8FC0C; Thu, 10 Jun 2010 20:51:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKpDaA062091; Thu, 10 Jun 2010 20:51:13 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKpDfY062053; Thu, 10 Jun 2010 20:51:13 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102051.o5AKpDfY062053@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209014 - in stable/8/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5312 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:51:16 -0000 Author: rpaulo Date: Thu Jun 10 20:51:13 2010 New Revision: 209014 URL: http://svn.freebsd.org/changeset/base/209014 Log: MFC r204644: Replace Id keyword with FreeBSD keyword and set the svn props correctly. No functional change. Approved by: re (bz) Modified: stable/8/sys/dev/ath/ath_hal/ah_debug.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_decode.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_devid.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_eeprom.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_eeprom_v3.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_soc.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_power.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210desc.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210phy.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210reg.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_power.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211desc.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211phy.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211reg.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/boss.ini (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.ini (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212desc.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212phy.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5311reg.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_power.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312phy.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312reg.h (contents, props changed) Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ah_debug.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_debug.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_debug.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_debug.h,v 1.1 2008/10/12 16:44:34 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_DEBUG_H_ #define _ATH_AH_DEBUG_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_decode.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_decode.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_decode.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_decode.h,v 1.4 2008/11/10 04:08:00 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_DECODE_H_ #define _ATH_AH_DECODE_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_devid.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_devid.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_devid.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_devid.h,v 1.4 2008/10/06 18:32:46 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_DEVID_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom.h,v 1.11 2008/11/27 22:32:48 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_EEPROM_H_ #define _ATH_AH_EEPROM_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v1.c,v 1.1 2008/11/11 02:40:11 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v1.h,v 1.1 2008/11/11 02:40:11 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_EEPROM_V1_H_ #define _ATH_AH_EEPROM_V1_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v3.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v3.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v3.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v3.h,v 1.2 2008/11/10 04:08:00 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_EEPROM_V3_H_ #define _ATH_AH_EEPROM_V3_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_soc.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_soc.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_soc.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_soc.h,v 1.4 2008/11/10 04:08:00 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_SOC_H_ #define _ATH_AH_SOC_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210_beacon.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210_keycache.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_power.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210_power.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210_recv.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210desc.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210desc.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210desc.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210desc.h,v 1.5 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5210DESC_H #define _DEV_ATH_AR5210DESC_H Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210phy.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210phy.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210phy.h,v 1.4 2008/11/10 01:19:37 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5210PHY_H #define _DEV_ATH_AR5210PHY_H Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210reg.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210reg.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210reg.h,v 1.4 2008/11/10 01:19:37 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5210REG_H #define _DEV_ATH_AR5210REG_H Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5k_0007.ini,v 1.2 2008/11/10 01:19:37 sam Exp $ + * $FreeBSD$ */ /* crete register init */ Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211_beacon.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211_keycache.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_power.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211_power.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211_recv.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211desc.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211desc.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211desc.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211desc.h,v 1.5 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5211DESC_H #define _DEV_ATH_AR5211DESC_H Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211phy.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211phy.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211phy.h,v 1.4 2008/11/10 01:19:38 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5211PHY_H #define _DEV_ATH_AR5211PHY_H Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211reg.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211reg.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211reg.h,v 1.4 2008/11/10 01:19:38 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5211REG_H #define _DEV_ATH_AR5211REG_H Modified: stable/8/sys/dev/ath/ath_hal/ar5211/boss.ini ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/boss.ini Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/boss.ini Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: boss.ini,v 1.3 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ /* Auto Generated PCI Register Writes. Created: 09/12/02 */ Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.ini ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.ini Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.ini Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212.ini,v 1.3 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ /* Auto Generated PCI Register Writes. Created: 09/01/04 */ Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_beacon.c,v 1.6 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_eeprom.c,v 1.6 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_keycache.c,v 1.4 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212desc.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212desc.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212desc.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212desc.h,v 1.4 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AR5212_DESC_H_ #define _ATH_AR5212_DESC_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212phy.h,v 1.7 2008/11/19 21:23:01 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5212PHY_H_ #define _DEV_ATH_AR5212PHY_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5311reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5311reg.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5311reg.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5311reg.h,v 1.3 2008/10/06 18:32:50 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5311REG_H_ #define _DEV_ATH_AR5311REG_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_eeprom.c,v 1.4 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_interrupts.c,v 1.2 2008/11/10 01:19:39 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_misc.c,v 1.4 2008/11/22 07:40:15 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_power.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_power.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_power.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_power.c,v 1.4 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312phy.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312phy.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312phy.h,v 1.3 2008/10/06 18:32:50 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5312PHY_H_ #define _DEV_ATH_AR5312PHY_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312reg.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312reg.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312reg.h,v 1.4 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5312REG_H_ #define _DEV_ATH_AR5312REG_H_ From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:54:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA5401065678; Thu, 10 Jun 2010 20:54:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF4468FC17; Thu, 10 Jun 2010 20:54:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKsrni062950; Thu, 10 Jun 2010 20:54:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKsrsJ062948; Thu, 10 Jun 2010 20:54:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102054.o5AKsrsJ062948@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209015 - stable/8/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:54:54 -0000 Author: rpaulo Date: Thu Jun 10 20:54:53 2010 New Revision: 209015 URL: http://svn.freebsd.org/changeset/base/209015 Log: MFC r208642: Don't shadow the global variable 'version'. Submitted by: Arnaud Lacombe Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c Thu Jun 10 20:51:13 2010 (r209014) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c Thu Jun 10 20:54:53 2010 (r209015) @@ -112,7 +112,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a { HAL_EEPROM_v1 *ee = AH_PRIVATE(ah)->ah_eeprom; uint16_t athvals[AR_EEPROM_ATHEROS_MAX]; /* XXX off stack */ - uint16_t protect, version, eeval; + uint16_t protect, eeprom_version, eeval; uint32_t sum; int i, loc; @@ -138,18 +138,18 @@ ath_hal_v1EepromAttach(struct ath_hal *a HALDEBUG(ah, HAL_DEBUG_ATTACH, "EEPROM protect 0x%x\n", protect); /* XXX check proper access before continuing */ - if (!ath_hal_eepromRead(ah, AR_EEPROM_VERSION, &version)) { + if (!ath_hal_eepromRead(ah, AR_EEPROM_VERSION, &eeprom_version)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unable to read EEPROM version\n", __func__); return HAL_EEREAD; } - if (((version>>12) & 0xf) != 1) { + if (((eeprom_version>>12) & 0xf) != 1) { /* * This code only groks the version 1 EEPROM layout. */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unsupported EEPROM version 0x%x found\n", - __func__, version); + __func__, eeprom_version); return HAL_EEVERSION; } @@ -183,7 +183,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a return HAL_ENOMEM; } - ee->ee_version = version; + ee->ee_version = eeprom_version; ee->ee_protect = protect; ee->ee_antenna = athvals[2]; ee->ee_biasCurrents = athvals[3]; @@ -243,7 +243,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a } AH_PRIVATE(ah)->ah_eeprom = ee; - AH_PRIVATE(ah)->ah_eeversion = version; + AH_PRIVATE(ah)->ah_eeversion = eeprom_version; AH_PRIVATE(ah)->ah_eepromDetach = v1EepromDetach; AH_PRIVATE(ah)->ah_eepromGet = v1EepromGet; AH_PRIVATE(ah)->ah_eepromSet = v1EepromSet; From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:58:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681A71065675; Thu, 10 Jun 2010 20:58:34 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 572B28FC17; Thu, 10 Jun 2010 20:58:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKwYqF063823; Thu, 10 Jun 2010 20:58:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKwYma063821; Thu, 10 Jun 2010 20:58:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102058.o5AKwYma063821@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209016 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:58:34 -0000 Author: rpaulo Date: Thu Jun 10 20:58:34 2010 New Revision: 209016 URL: http://svn.freebsd.org/changeset/base/209016 Log: Some odd APs send beacons on the same TX queue as non-beacons. This breaks 802.11 duplicate detection. Upon looking at the standard, we discover that 802.11-2007 says: "A receiving QoS STA is also required to keep only the most recent cache entry per
triple, storing only the most recently received fragment number for that triple. A receiving STA may omit tuples obtained from broadcast/multicast or ATIM frames from the cache." To fix this, we just disable duplicate detection for multicast/broadcast frames. Reviewed by: sam MFC after: 4 weeks Obtained from: DragonFly Modified: head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu Jun 10 20:54:53 2010 (r209015) +++ head/sys/net80211/ieee80211_sta.c Thu Jun 10 20:58:34 2010 (r209016) @@ -584,7 +584,7 @@ sta_input(struct ieee80211_node *ni, str } IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; - if (HAS_SEQ(type)) { + if (HAS_SEQ(type) !IEEE80211_IS_MULTICAST(wh->i_addr1)) { uint8_t tid = ieee80211_gettid(wh); if (IEEE80211_QOS_HAS_SEQ(wh) && TID_TO_WME_AC(tid) >= WME_AC_VI) From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 20:59:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61BC5106564A; Thu, 10 Jun 2010 20:59:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5072C8FC19; Thu, 10 Jun 2010 20:59:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKxSlX064094; Thu, 10 Jun 2010 20:59:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKxS1O064092; Thu, 10 Jun 2010 20:59:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006102059.o5AKxS1O064092@svn.freebsd.org> From: Xin LI Date: Thu, 10 Jun 2010 20:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209017 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:59:28 -0000 Author: delphij Date: Thu Jun 10 20:59:28 2010 New Revision: 209017 URL: http://svn.freebsd.org/changeset/base/209017 Log: Several style fixes as prompted by bde@. While I'm there, loosen the st_nlink check and fix grammar for 1 extra links. Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Thu Jun 10 20:58:34 2010 (r209016) +++ head/usr.bin/gzip/gzip.c Thu Jun 10 20:59:28 2010 (r209017) @@ -65,10 +65,6 @@ __RCSID("$FreeBSD$"); #include #include -#ifndef PRIdOFF -#define PRIdOFF PRId64 -#endif - /* what type of file are we dealing with */ enum filetype { FT_GZIP, @@ -1221,46 +1217,46 @@ file_compress(char *file, char *outfile, in = open(file, O_RDONLY); if (in == -1) { maybe_warn("can't open %s", file); - return -1; + return (-1); } #ifndef SMALL if (fstat(in, &isb) != 0) { maybe_warn("couldn't stat: %s", file); close(in); - return -1; + return (-1); } #endif if (cflag == 0) { #ifndef SMALL - if (isb.st_nlink != 1 && fflag == 0) { - maybe_warnx("%s has %d other link%s -- " - "skipping", file, isb.st_nlink - 1, - isb.st_nlink == 1 ? "" : "s"); + if (isb.st_nlink > 1 && fflag == 0) { + maybe_warnx("%s has %d other link%s -- skipping", + file, isb.st_nlink - 1, + (isb.st_nlink - 1) == 1 ? "" : "s"); close(in); - return -1; + return (-1); } - if (fflag == 0 && (suff = check_suffix(file, 0)) - && suff->zipped[0] != 0) { + if (fflag == 0 && (suff = check_suffix(file, 0)) && + suff->zipped[0] != 0) { maybe_warnx("%s already has %s suffix -- unchanged", - file, suff->zipped); + file, suff->zipped); close(in); - return -1; + return (-1); } #endif /* Add (usually) .gz to filename */ if ((size_t)snprintf(outfile, outsize, "%s%s", - file, suffixes[0].zipped) >= outsize) + file, suffixes[0].zipped) >= outsize) memcpy(outfile + outsize - suffixes[0].ziplen - 1, - suffixes[0].zipped, suffixes[0].ziplen + 1); + suffixes[0].zipped, suffixes[0].ziplen + 1); #ifndef SMALL if (check_outfile(outfile) == 0) { close(in); - return -1; + return (-1); } #endif } @@ -1270,7 +1266,7 @@ file_compress(char *file, char *outfile, if (out == -1) { maybe_warn("could not create output: %s", outfile); fclose(stdin); - return -1; + return (-1); } #ifndef SMALL remove_file = outfile; @@ -1290,7 +1286,7 @@ file_compress(char *file, char *outfile, * has the expected size. */ if (cflag != 0) - return insize == -1 ? -1 : size; + return (insize == -1 ? -1 : size); #ifndef SMALL if (fstat(out, &osb) != 0) { @@ -1299,9 +1295,8 @@ file_compress(char *file, char *outfile, } if (osb.st_size != size) { - maybe_warnx("output file: %s wrong size (%" PRIdOFF - " != %" PRIdOFF "), deleting", - outfile, osb.st_size, size); + maybe_warnx("output file: %s wrong size (%ju != %ju), deleting", + outfile, (uintmax_t)osb.st_size, (uintmax_t)size); goto bad_outfile; } @@ -1313,7 +1308,7 @@ file_compress(char *file, char *outfile, /* output is good, ok to delete input */ unlink_input(file, &isb); - return size; + return (size); #ifndef SMALL bad_outfile: @@ -1322,7 +1317,7 @@ file_compress(char *file, char *outfile, maybe_warnx("leaving original %s", file); unlink(outfile); - return size; + return (size); #endif } @@ -1570,9 +1565,8 @@ file_uncompress(char *file, char *outfil return -1; } if (osb.st_size != size) { - maybe_warnx("stat gave different size: %" PRIdOFF - " != %" PRIdOFF " (leaving original)", - size, osb.st_size); + maybe_warnx("stat gave different size: %ju != %ju (leaving original)", + (uintmax_t)size, (uintmax_t)osb.st_size); close(ofd); unlink(outfile); return -1; From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 22:46:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 090DF1065672; Thu, 10 Jun 2010 22:46:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB9A68FC1E; Thu, 10 Jun 2010 22:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AMkC8V087949; Thu, 10 Jun 2010 22:46:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AMkCMp087947; Thu, 10 Jun 2010 22:46:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006102246.o5AMkCMp087947@svn.freebsd.org> From: Xin LI Date: Thu, 10 Jun 2010 22:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209020 - stable/7/bin/pax X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 22:46:13 -0000 Author: delphij Date: Thu Jun 10 22:46:12 2010 New Revision: 209020 URL: http://svn.freebsd.org/changeset/base/209020 Log: MFC r205940: Remove unused files. PR: bin/38256 Deleted: stable/7/bin/pax/cpio.1 stable/7/bin/pax/tar.1 Modified: stable/7/bin/pax/Makefile Directory Properties: stable/7/bin/pax/ (props changed) Modified: stable/7/bin/pax/Makefile ============================================================================== --- stable/7/bin/pax/Makefile Thu Jun 10 21:56:14 2010 (r209019) +++ stable/7/bin/pax/Makefile Thu Jun 10 22:46:12 2010 (r209020) @@ -29,9 +29,6 @@ PROG= pax SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \ gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c -#XXX NOTYET -#MAN= pax.1 tar.1 cpio.1 -#LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio .if ${MACHINE_ARCH} == "arm" WARNS?= 3 From owner-svn-src-all@FreeBSD.ORG Thu Jun 10 22:47:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94D3F1065672; Thu, 10 Jun 2010 22:47:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8397E8FC15; Thu, 10 Jun 2010 22:47:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AMl40E088205; Thu, 10 Jun 2010 22:47:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AMl4SA088203; Thu, 10 Jun 2010 22:47:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006102247.o5AMl4SA088203@svn.freebsd.org> From: Xin LI Date: Thu, 10 Jun 2010 22:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209021 - stable/6/bin/pax X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 22:47:04 -0000 Author: delphij Date: Thu Jun 10 22:47:04 2010 New Revision: 209021 URL: http://svn.freebsd.org/changeset/base/209021 Log: MFC r205940: Remove unused files. PR: bin/38256 Deleted: stable/6/bin/pax/cpio.1 stable/6/bin/pax/tar.1 Modified: stable/6/bin/pax/Makefile Directory Properties: stable/6/bin/pax/ (props changed) Modified: stable/6/bin/pax/Makefile ============================================================================== --- stable/6/bin/pax/Makefile Thu Jun 10 22:46:12 2010 (r209020) +++ stable/6/bin/pax/Makefile Thu Jun 10 22:47:04 2010 (r209021) @@ -29,9 +29,6 @@ PROG= pax SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \ gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c -#XXX NOTYET -#MAN= pax.1 tar.1 cpio.1 -#LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio .if ${MACHINE_ARCH} == "arm" WARNS?= 3 From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 01:32:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE80B1065670; Fri, 11 Jun 2010 01:32:42 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E2C48FC0A; Fri, 11 Jun 2010 01:32:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B1WgWR025647; Fri, 11 Jun 2010 01:32:42 GMT (envelope-from avatar@svn.freebsd.org) Received: (from avatar@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B1WgV4025645; Fri, 11 Jun 2010 01:32:42 GMT (envelope-from avatar@svn.freebsd.org) Message-Id: <201006110132.o5B1WgV4025645@svn.freebsd.org> From: Tai-hwa Liang Date: Fri, 11 Jun 2010 01:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209022 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 01:32:42 -0000 Author: avatar Date: Fri Jun 11 01:32:42 2010 New Revision: 209022 URL: http://svn.freebsd.org/changeset/base/209022 Log: Fixing compilation bustage by adding the missing && back. Modified: head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu Jun 10 22:47:04 2010 (r209021) +++ head/sys/net80211/ieee80211_sta.c Fri Jun 11 01:32:42 2010 (r209022) @@ -584,7 +584,7 @@ sta_input(struct ieee80211_node *ni, str } IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; - if (HAS_SEQ(type) !IEEE80211_IS_MULTICAST(wh->i_addr1)) { + if (HAS_SEQ(type) && !IEEE80211_IS_MULTICAST(wh->i_addr1)) { uint8_t tid = ieee80211_gettid(wh); if (IEEE80211_QOS_HAS_SEQ(wh) && TID_TO_WME_AC(tid) >= WME_AC_VI) From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 01:46:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B52106566B; Fri, 11 Jun 2010 01:46:35 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id A0D478FC12; Fri, 11 Jun 2010 01:46:34 +0000 (UTC) Received: from ur.gsoft.com.au (Ur.gsoft.com.au [203.31.81.44]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id o5B1kPQQ062423 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 11 Jun 2010 11:16:30 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <201006102034.o5AKYMXX058081@svn.freebsd.org> Date: Fri, 11 Jun 2010 11:16:24 +0930 Content-Transfer-Encoding: quoted-printable Message-Id: <3BE36947-BCB4-4A6D-9040-873CFD144F3B@gsoft.com.au> References: <201006102034.o5AKYMXX058081@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1078) X-Spam-Score: -2.51 () ALL_TRUSTED,BAYES_00,T_RP_MATCHES_RCVD X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r209011 - stable/8/sys/dev/ath/ath_hal/ar5211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 01:46:35 -0000 On 11/06/2010, at 6:04, Rui Paulo wrote: > Log: > MFC r208644: > Due to the way HALDEBUG() is defined, we need to add curly brackets > when using it as a sole if clause instruction. > While there, fix 'const static' typo. Why not fix HALDEBUG? ie wrap it in do { } while (0) Although that said when I looked at HALDEBUG on 8.0 it was defined as a = function so it is a non issue there. HAL_DEBUG is different but I can't actually find where that is defined. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 02:43:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 014691065678; Fri, 11 Jun 2010 02:43:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAA568FC0A; Fri, 11 Jun 2010 02:43:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B2hacm041453; Fri, 11 Jun 2010 02:43:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B2ha7H041451; Fri, 11 Jun 2010 02:43:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006110243.o5B2ha7H041451@svn.freebsd.org> From: Warner Losh Date: Fri, 11 Jun 2010 02:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209024 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 02:43:37 -0000 Author: imp Date: Fri Jun 11 02:43:36 2010 New Revision: 209024 URL: http://svn.freebsd.org/changeset/base/209024 Log: Merge from tbemd branch: Introduce MACHINE_CPUARCH. Many different MACHINE_ARCHs will be built from one MACHINE_CPUARCH. This will allow us to move to a more standard MACHINE_ARCH for mips and arm which exist in many different endian variants, and for powerpc where both 32 and 64 bit binaries are generated from the same sources. Reviewed by: arch@ (mostly silence though) Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Jun 11 02:09:18 2010 (r209023) +++ head/share/mk/sys.mk Fri Jun 11 02:43:36 2010 (r209024) @@ -4,6 +4,18 @@ unix ?= We run FreeBSD, not UNIX. .FreeBSD ?= true +.if !defined(%POSIX) +# +# MACHINE_CPUARCH defines a collection of MACHINE_ARCH. Machines with +# the same MACHINE_ARCH can run reach-other's binaries, so it +# necessarily has word size and endian swizzled in. However, support +# files for these machines often are shared amongst all combinations +# of size and/or endian. This is called MACHINE_CPU in NetBSD, but +# that's used for something different in FreeBSD. +# +MACHINE_CPUARCH=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/} +.endif + # If the special target .POSIX appears (without prerequisites or # commands) before the first noncomment line in the makefile, make shall # process the makefile as specified by the Posix 1003.2 specification. @@ -35,7 +47,7 @@ CC ?= c89 CFLAGS ?= -O .else CC ?= cc -.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips" +.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" CFLAGS ?= -O -pipe .else CFLAGS ?= -O2 -pipe From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 02:50:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A898106564A; Fri, 11 Jun 2010 02:50:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7BB8FC16; Fri, 11 Jun 2010 02:50:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B2os54043140; Fri, 11 Jun 2010 02:50:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B2osKq043139; Fri, 11 Jun 2010 02:50:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006110250.o5B2osKq043139@svn.freebsd.org> From: Warner Losh Date: Fri, 11 Jun 2010 02:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209025 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 02:50:54 -0000 Author: imp Date: Fri Jun 11 02:50:53 2010 New Revision: 209025 URL: http://svn.freebsd.org/changeset/base/209025 Log: Merge from tbemd Enhance Makefile.inc processing, when asked for, to include the most specific (MACHINE specific) to least specific (MACHINE_CPUARCH). Reviewed by: arch@ (mostly silence though) Added: - copied unchanged from r209024, user/imp/tbemd/share/mk/bsd.arch.inc.mk Directory Properties: head/share/mk/bsd.arch.inc.mk (props changed) Copied: head/share/mk/bsd.arch.inc.mk (from r209024, user/imp/tbemd/share/mk/bsd.arch.inc.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.arch.inc.mk Fri Jun 11 02:50:53 2010 (r209025, copy of r209024, user/imp/tbemd/share/mk/bsd.arch.inc.mk) @@ -0,0 +1,11 @@ +# +# Include the arch-specific Makefile.inc.$ARCH. We go from most specific +# to least specific, stopping after we get a hit. +# +.if exists(${.CURDIR}/Makefile.${MACHINE}) +.include "Makefile.${MACHINE}" +.elif exists(${.CURDIR}/Makefile.${MACHINE_ARCH}) +.include "Makefile.${MACHINE_ARCH}" +.elif exists(${.CURDIR}/Makefile.${MACHINE_CPUARCH}) +.include "Makefile.${MACHINE_CPUARCH}" +.endif From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 03:00:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 756A210656CB; Fri, 11 Jun 2010 03:00:35 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F1A78FC15; Fri, 11 Jun 2010 03:00:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B30YGB045390; Fri, 11 Jun 2010 03:00:34 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B30X9q045387; Fri, 11 Jun 2010 03:00:33 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006110300.o5B30X9q045387@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 11 Jun 2010 03:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 03:00:35 -0000 Author: marcel Date: Fri Jun 11 03:00:32 2010 New Revision: 209026 URL: http://svn.freebsd.org/changeset/base/209026 Log: Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) in particular, do not handle deferred DMA map load operations at all. Any error, and especially EINPROGRESS, is treated as a hard error and typically abort the current operation. The fact that the busdma code queues the load operation for when resources (i.e. bounce buffers in this particular case) are available makes this especially problematic. Bounce buffering, unlike what the PR synopsis would suggest, works fine. While on the subject, properly implement swi_vm(). PR: 147502 MFC after: 1 week Modified: head/sys/ia64/ia64/busdma_machdep.c head/sys/ia64/ia64/vm_machdep.c head/sys/ia64/include/md_var.h Modified: head/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- head/sys/ia64/ia64/busdma_machdep.c Fri Jun 11 02:50:53 2010 (r209025) +++ head/sys/ia64/ia64/busdma_machdep.c Fri Jun 11 03:00:32 2010 (r209026) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define MAX_BPAGES 256 +#define MAX_BPAGES 1024 struct bus_dma_tag { bus_dma_tag_t parent; @@ -77,7 +77,7 @@ struct bounce_page { STAILQ_ENTRY(bounce_page) links; }; -int busdma_swi_pending; +u_int busdma_swi_pending; static struct mtx bounce_lock; static STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; Modified: head/sys/ia64/ia64/vm_machdep.c ============================================================================== --- head/sys/ia64/ia64/vm_machdep.c Fri Jun 11 02:50:53 2010 (r209025) +++ head/sys/ia64/ia64/vm_machdep.c Fri Jun 11 03:00:32 2010 (r209026) @@ -378,9 +378,8 @@ sf_buf_free(struct sf_buf *sf) */ void swi_vm(void *dummy) -{ -#if 0 +{ + if (busdma_swi_pending != 0) busdma_swi(); -#endif } Modified: head/sys/ia64/include/md_var.h ============================================================================== --- head/sys/ia64/include/md_var.h Fri Jun 11 02:50:53 2010 (r209025) +++ head/sys/ia64/include/md_var.h Fri Jun 11 03:00:32 2010 (r209026) @@ -75,6 +75,7 @@ struct ia64_init_return { extern uint64_t ia64_lapic_addr; extern long Maxmem; +extern u_int busdma_swi_pending; void busdma_swi(void); int copyout_regstack(struct thread *, uint64_t *, uint64_t *); From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 03:13:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3A43106564A; Fri, 11 Jun 2010 03:13:21 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A16B98FC0A; Fri, 11 Jun 2010 03:13:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B3DKrn048456; Fri, 11 Jun 2010 03:13:20 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B3DKhQ048446; Fri, 11 Jun 2010 03:13:20 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006110313.o5B3DKhQ048446@svn.freebsd.org> From: Randall Stewart Date: Fri, 11 Jun 2010 03:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209028 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 03:13:21 -0000 Author: rrs Date: Fri Jun 11 03:13:19 2010 New Revision: 209028 URL: http://svn.freebsd.org/changeset/base/209028 Log: MFC: Fix a number of bugs and race conditions. r208160: Bring back of the iterator thread. It now properly handles VNETS having only one thread. The old timer based code was full of LOR's and other issues. r208852: Cleanup bug. Basically when an un-accepted socket was hanging on a closed listener, we would leak the inp never cleaning it up r208853: Enhance the use under invarients of the audit for locks function and fix a bug where a close collision with a cookie being processed would cause a crash. r208854: Use the proper increment macros when working with the sent_queue_retran_cnt r208855: Align comments properly, Fix a bug where we were NOT looking at the resend markings for control chunks and also not decrementing the retran count which caused extra calls to retransmission. Alos add a valid no locks call to the output routine. r208856: Spacing issues in auth/bsd addr. r208857: Get rid of a windows ifdef that somehow leaked in r208863: Missing error leg returns in some failure cases r208864: LOR fix between the iterator and sctp_inpcb_close r208874: Don't call the sctp_inpcb_free from abort an association since you don't know what locks you hold and a timer will take care of the situation when the gone flag is set r208875: sctp_inpcb_free bug - a socket under the right situation could get stuck (from the accept queue) and never start the proper cleanup timer) r208876: Further enhance invariant lock validation, Fix a bug where a closed socket and a INIT-ACK could collide and cause a crash r208878: Clear up another bug in sctp_inpcb_free where we would end up due to a race in freeing hit a destroy of a contended lock. r208879: Optimize the cleanup and make some additional fixes in the sysctl code so that it won't reference a GONE INP and crash us r208883 & r208891: Fix so we don't open a hole between a sock lock and a call to socantrcvmore.. we could before hit a race that would kill the socket underneath us leading to a crash r208897: CUM-ACK calculation was messed up. So basically large message got broken from the original NR_sack integration. r208902: Make sure that we don't move a bit to the NR array that is behind the cum-ack r208952: Use both bit maps to calculte the cum-ack. r208953: Fix bug having to do with freeing an sctp_inpcb_free(). 1) make sure not to remove the flag until you get the lock again. 2) make sure all log_closing calls hold the lock. 3) Release all the locks when everthing is done and call callout_drain not callout_stop.. r208970: Fix some places on user allocation of a new sctp_inpcb where we run out of resource that we make sure to NULL the so_pcb pointer. Approved by: re - (bz@freebsd.org) Modified: stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_bsd_addr.h stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_lock_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_auth.c Fri Jun 11 03:13:19 2010 (r209028) @@ -895,9 +895,9 @@ static inline int sctp_get_hmac_block_len(uint16_t hmac_algo) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: #ifdef HAVE_SHA224 - case SCTP_AUTH_HMAC_ID_SHA224: + case SCTP_AUTH_HMAC_ID_SHA224: #endif return (64); #ifdef HAVE_SHA2 @@ -918,7 +918,7 @@ static void sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t * ctx) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Init(&ctx->sha1); break; #ifdef HAVE_SHA224 @@ -948,7 +948,7 @@ sctp_hmac_update(uint16_t hmac_algo, sct uint8_t * text, uint32_t textlen) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Update(&ctx->sha1, text, textlen); break; #ifdef HAVE_SHA224 @@ -978,7 +978,7 @@ sctp_hmac_final(uint16_t hmac_algo, sctp uint8_t * digest) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Final(digest, &ctx->sha1); break; #ifdef HAVE_SHA224 Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Jun 11 03:13:19 2010 (r209028) @@ -49,16 +49,6 @@ __FBSDID("$FreeBSD$"); #include /* Declare all of our malloc named types */ - -/* Note to Michael/Peter for mac-os, - * I think mac has this too since I - * do see the M_PCB type, so I - * will also put in the mac file the - * MALLOC_DECLARE. If this does not - * work for mac uncomment the defines for - * the strings that we use in Panda, I put - * them in comments in the mac-os file. - */ MALLOC_DEFINE(SCTP_M_MAP, "sctp_map", "sctp asoc map descriptor"); MALLOC_DEFINE(SCTP_M_STRMI, "sctp_stri", "sctp stream in array"); MALLOC_DEFINE(SCTP_M_STRMO, "sctp_stro", "sctp stream out array"); @@ -79,47 +69,77 @@ MALLOC_DEFINE(SCTP_M_MVRF, "sctp_mvrf", MALLOC_DEFINE(SCTP_M_ITER, "sctp_iter", "sctp iterator control"); MALLOC_DEFINE(SCTP_M_SOCKOPT, "sctp_socko", "sctp socket option"); -#if defined(SCTP_USE_THREAD_BASED_ITERATOR) +/* Global NON-VNET structure that controls the iterator */ +struct iterator_control sctp_it_ctl; +static int __sctp_thread_based_iterator_started = 0; + + +static void +sctp_cleanup_itqueue(void) +{ + struct sctp_iterator *it; + + while ((it = TAILQ_FIRST(&sctp_it_ctl.iteratorhead)) != NULL) { + if (it->function_atend != NULL) { + (*it->function_atend) (it->pointer, it->val); + } + TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); + SCTP_FREE(it, SCTP_M_ITER); + } +} + + void sctp_wakeup_iterator(void) { - wakeup(&SCTP_BASE_INFO(iterator_running)); + wakeup(&sctp_it_ctl.iterator_running); } static void sctp_iterator_thread(void *v) { - CURVNET_SET((struct vnet *)v); SCTP_IPI_ITERATOR_WQ_LOCK(); - SCTP_BASE_INFO(iterator_running) = 0; while (1) { - msleep(&SCTP_BASE_INFO(iterator_running), - &SCTP_BASE_INFO(ipi_iterator_wq_mtx), + msleep(&sctp_it_ctl.iterator_running, + &sctp_it_ctl.ipi_iterator_wq_mtx, 0, "waiting_for_work", 0); - if (SCTP_BASE_INFO(threads_must_exit)) { + if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_MUST_EXIT) { SCTP_IPI_ITERATOR_WQ_DESTROY(); + SCTP_ITERATOR_LOCK_DESTROY(); + sctp_cleanup_itqueue(); + __sctp_thread_based_iterator_started = 0; kthread_exit(); } sctp_iterator_worker(); } - CURVNET_RESTORE(); } void sctp_startup_iterator(void) { + if (__sctp_thread_based_iterator_started) { + /* You only get one */ + return; + } + /* init the iterator head */ + __sctp_thread_based_iterator_started = 1; + sctp_it_ctl.iterator_running = 0; + sctp_it_ctl.iterator_flags = 0; + sctp_it_ctl.cur_it = NULL; + SCTP_ITERATOR_LOCK_INIT(); + SCTP_IPI_ITERATOR_WQ_INIT(); + TAILQ_INIT(&sctp_it_ctl.iteratorhead); + int ret; ret = kproc_create(sctp_iterator_thread, - (void *)curvnet, - &SCTP_BASE_INFO(thread_proc), + (void *)NULL, + &sctp_it_ctl.thread_proc, RFPROC, SCTP_KTHREAD_PAGES, SCTP_KTRHEAD_NAME); } -#endif - #ifdef INET6 void Modified: stable/8/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.h Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_bsd_addr.h Fri Jun 11 03:13:19 2010 (r209028) @@ -37,12 +37,11 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) -#if defined(SCTP_USE_THREAD_BASED_ITERATOR) +extern struct iterator_control sctp_it_ctl; void sctp_wakeup_iterator(void); void sctp_startup_iterator(void); -#endif #ifdef INET6 void sctp_gather_internal_ifa_flags(struct sctp_ifa *ifa); Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_constants.h Fri Jun 11 03:13:19 2010 (r209028) @@ -87,10 +87,6 @@ __FBSDID("$FreeBSD$"); /* #define SCTP_AUDITING_ENABLED 1 used for debug/auditing */ #define SCTP_AUDIT_SIZE 256 -/* temporary disabled since it does not work with VNET. */ -#if 0 -#define SCTP_USE_THREAD_BASED_ITERATOR 1 -#endif #define SCTP_KTRHEAD_NAME "sctp_iterator" #define SCTP_KTHREAD_PAGES 0 @@ -572,7 +568,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_TIMER_TYPE_EVENTWAKE 13 #define SCTP_TIMER_TYPE_STRRESET 14 #define SCTP_TIMER_TYPE_INPKILL 15 -#define SCTP_TIMER_TYPE_ITERATOR 16 #define SCTP_TIMER_TYPE_EARLYFR 17 #define SCTP_TIMER_TYPE_ASOCKILL 18 #define SCTP_TIMER_TYPE_ADDR_WQ 19 @@ -899,7 +894,7 @@ __FBSDID("$FreeBSD$"); /* third argument */ #define SCTP_CALLED_DIRECTLY_NOCMPSET 0 #define SCTP_CALLED_AFTER_CMPSET_OFCLOSE 1 - +#define SCTP_CALLED_FROM_INPKILL_TIMER 2 /* second argument */ #define SCTP_FREE_SHOULD_USE_ABORT 1 #define SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE 0 Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_indata.c Fri Jun 11 03:13:19 2010 (r209028) @@ -289,12 +289,20 @@ sctp_build_ctl_cchunk(struct sctp_inpcb static void sctp_mark_non_revokable(struct sctp_association *asoc, uint32_t tsn) { - uint32_t gap, i; + uint32_t gap, i, cumackp1; int fnd = 0; if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { return; } + cumackp1 = asoc->cumulative_tsn + 1; + if (compare_with_wrap(cumackp1, tsn, MAX_TSN)) { + /* + * this tsn is behind the cum ack and thus we don't need to + * worry about it being moved from one to the other. + */ + return; + } SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn); if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { printf("gap:%x tsn:%x\n", gap, tsn); @@ -2245,15 +2253,19 @@ sctp_slide_mapping_arrays(struct sctp_tc /* * Now we also need to check the mapping array in a couple of ways. * 1) Did we move the cum-ack point? + * + * When you first glance at this you might think that all entries that + * make up the postion of the cum-ack would be in the nr-mapping + * array only.. i.e. things up to the cum-ack are always + * deliverable. Thats true with one exception, when its a fragmented + * message we may not deliver the data until some threshold (or all + * of it) is in place. So we must OR the nr_mapping_array and + * mapping_array to get a true picture of the cum-ack. */ struct sctp_association *asoc; int at; + uint8_t val; int slide_from, slide_end, lgap, distance; - - /* EY nr_mapping array variables */ - /* int nr_at; */ - /* int nr_last_all_ones = 0; */ - /* int nr_slide_from, nr_slide_end, nr_lgap, nr_distance; */ uint32_t old_cumack, old_base, old_highest, highest_tsn; asoc = &stcb->asoc; @@ -2268,11 +2280,12 @@ sctp_slide_mapping_arrays(struct sctp_tc */ at = 0; for (slide_from = 0; slide_from < stcb->asoc.mapping_array_size; slide_from++) { - if (asoc->nr_mapping_array[slide_from] == 0xff) { + val = asoc->nr_mapping_array[slide_from] | asoc->mapping_array[slide_from]; + if (val == 0xff) { at += 8; } else { /* there is a 0 bit */ - at += sctp_map_lookup_tab[asoc->nr_mapping_array[slide_from]]; + at += sctp_map_lookup_tab[val]; break; } } @@ -3849,7 +3862,8 @@ sctp_window_probe_recovery(struct sctp_t sctp_total_flight_decrease(stcb, tp1); /* Now mark for resend */ tp1->sent = SCTP_DATAGRAM_RESEND; - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP, tp1->whoTo->flight_size, @@ -4262,7 +4276,7 @@ again: sctp_flight_size_increase(tp1); sctp_total_flight_increase(stcb, tp1); } else if (tp1->sent == SCTP_DATAGRAM_RESEND) { - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); } } } @@ -5263,7 +5277,7 @@ again: sctp_flight_size_increase(tp1); sctp_total_flight_increase(stcb, tp1); } else if (tp1->sent == SCTP_DATAGRAM_RESEND) { - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); } } } Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_input.c Fri Jun 11 03:13:19 2010 (r209028) @@ -3067,7 +3067,7 @@ process_chunk_drop(struct sctp_tcb *stcb struct sctp_nets *net, uint8_t flg) { switch (desc->chunk_type) { - case SCTP_DATA: + case SCTP_DATA: /* find the tsn to resend (possibly */ { uint32_t tsn; @@ -4534,7 +4534,8 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else { - if (locked_tcb) { + if (locked_tcb != stcb) { + /* Very unlikely */ SCTP_TCB_UNLOCK(locked_tcb); } *offset = length; @@ -4861,6 +4862,10 @@ process_control_chunks: } else { if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ + abend: + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } *offset = length; return (NULL); } @@ -4908,6 +4913,11 @@ process_control_chunks: if (linp) { SCTP_ASOC_CREATE_LOCK(linp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { + SCTP_ASOC_CREATE_UNLOCK(linp); + goto abend; + } } if (netp) { ret_buf = @@ -5408,16 +5418,25 @@ sctp_process_ecn_marked_b(struct sctp_tc } #ifdef INVARIANTS -static void -sctp_validate_no_locks(struct sctp_inpcb *inp) +#ifdef __GNUC__ +__attribute__((noinline)) +#endif + void + sctp_validate_no_locks(struct sctp_inpcb *inp) { - struct sctp_tcb *stcb; + struct sctp_tcb *lstcb; - LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { - if (mtx_owned(&stcb->tcb_mtx)) { + LIST_FOREACH(lstcb, &inp->sctp_asoc_list, sctp_tcblist) { + if (mtx_owned(&lstcb->tcb_mtx)) { panic("Own lock on stcb at return from input"); } } + if (mtx_owned(&inp->inp_create_mtx)) { + panic("Own create lock on inp"); + } + if (mtx_owned(&inp->inp_mtx)) { + panic("Own inp lock on inp"); + } } #endif Modified: stable/8/sys/netinet/sctp_lock_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_lock_bsd.h Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_lock_bsd.h Fri Jun 11 03:13:19 2010 (r209028) @@ -107,42 +107,36 @@ extern int sctp_logoff_stuff; #define SCTP_INP_INFO_WUNLOCK() rw_wunlock(&SCTP_BASE_INFO(ipi_ep_mtx)) -#define SCTP_IPI_ADDR_INIT() \ +#define SCTP_IPI_ADDR_INIT() \ rw_init(&SCTP_BASE_INFO(ipi_addr_mtx), "sctp-addr") - #define SCTP_IPI_ADDR_DESTROY() do { \ if(rw_wowned(&SCTP_BASE_INFO(ipi_addr_mtx))) { \ rw_wunlock(&SCTP_BASE_INFO(ipi_addr_mtx)); \ } \ rw_destroy(&SCTP_BASE_INFO(ipi_addr_mtx)); \ } while (0) - - - #define SCTP_IPI_ADDR_RLOCK() do { \ rw_rlock(&SCTP_BASE_INFO(ipi_addr_mtx)); \ } while (0) - #define SCTP_IPI_ADDR_WLOCK() do { \ rw_wlock(&SCTP_BASE_INFO(ipi_addr_mtx)); \ } while (0) - #define SCTP_IPI_ADDR_RUNLOCK() rw_runlock(&SCTP_BASE_INFO(ipi_addr_mtx)) #define SCTP_IPI_ADDR_WUNLOCK() rw_wunlock(&SCTP_BASE_INFO(ipi_addr_mtx)) #define SCTP_IPI_ITERATOR_WQ_INIT() \ - mtx_init(&SCTP_BASE_INFO(ipi_iterator_wq_mtx), "sctp-it-wq", "sctp_it_wq", MTX_DEF) + mtx_init(&sctp_it_ctl.ipi_iterator_wq_mtx, "sctp-it-wq", "sctp_it_wq", MTX_DEF) #define SCTP_IPI_ITERATOR_WQ_DESTROY() \ - mtx_destroy(&SCTP_BASE_INFO(ipi_iterator_wq_mtx)) + mtx_destroy(&sctp_it_ctl.ipi_iterator_wq_mtx) #define SCTP_IPI_ITERATOR_WQ_LOCK() do { \ - mtx_lock(&SCTP_BASE_INFO(ipi_iterator_wq_mtx)); \ + mtx_lock(&sctp_it_ctl.ipi_iterator_wq_mtx); \ } while (0) -#define SCTP_IPI_ITERATOR_WQ_UNLOCK() mtx_unlock(&SCTP_BASE_INFO(ipi_iterator_wq_mtx)) +#define SCTP_IPI_ITERATOR_WQ_UNLOCK() mtx_unlock(&sctp_it_ctl.ipi_iterator_wq_mtx) #define SCTP_IP_PKTLOG_INIT() \ @@ -191,6 +185,13 @@ extern int sctp_logoff_stuff; #define SCTP_INP_LOCK_DESTROY(_inp) \ mtx_destroy(&(_inp)->inp_mtx) +#define SCTP_INP_LOCK_CONTENDED(_inp) ((_inp)->inp_mtx.mtx_lock & MTX_CONTESTED) + +#define SCTP_INP_READ_CONTENDED(_inp) ((_inp)->inp_rdata_mtx.mtx_lock & MTX_CONTESTED) + +#define SCTP_ASOC_CREATE_LOCK_CONTENDED(_inp) ((_inp)->inp_create_mtx.mtx_lock & MTX_CONTESTED) + + #define SCTP_ASOC_CREATE_LOCK_DESTROY(_inp) \ mtx_destroy(&(_inp)->inp_create_mtx) @@ -300,25 +301,45 @@ extern int sctp_logoff_stuff; #endif #define SCTP_ITERATOR_LOCK_INIT() \ - mtx_init(&SCTP_BASE_INFO(it_mtx), "sctp-it", "iterator", MTX_DEF) + mtx_init(&sctp_it_ctl.it_mtx, "sctp-it", "iterator", MTX_DEF) #ifdef INVARIANTS #define SCTP_ITERATOR_LOCK() \ do { \ - if (mtx_owned(&SCTP_BASE_INFO(it_mtx))) \ + if (mtx_owned(&sctp_it_ctl.it_mtx)) \ panic("Iterator Lock"); \ - mtx_lock(&SCTP_BASE_INFO(it_mtx)); \ + mtx_lock(&sctp_it_ctl.it_mtx); \ } while (0) #else #define SCTP_ITERATOR_LOCK() \ do { \ - mtx_lock(&SCTP_BASE_INFO(it_mtx)); \ + mtx_lock(&sctp_it_ctl.it_mtx); \ } while (0) #endif -#define SCTP_ITERATOR_UNLOCK() mtx_unlock(&SCTP_BASE_INFO(it_mtx)) -#define SCTP_ITERATOR_LOCK_DESTROY() mtx_destroy(&SCTP_BASE_INFO(it_mtx)) +#define SCTP_ITERATOR_UNLOCK() mtx_unlock(&sctp_it_ctl.it_mtx) +#define SCTP_ITERATOR_LOCK_DESTROY() mtx_destroy(&sctp_it_ctl.it_mtx) + + +#define SCTP_WQ_ADDR_INIT() do { \ + mtx_init(&SCTP_BASE_INFO(wq_addr_mtx), "sctp-addr-wq","sctp_addr_wq",MTX_DEF); \ + } while (0) + +#define SCTP_WQ_ADDR_DESTROY() do { \ + if(mtx_owned(&SCTP_BASE_INFO(wq_addr_mtx))) { \ + mtx_unlock(&SCTP_BASE_INFO(wq_addr_mtx)); \ + } \ + mtx_destroy(&SCTP_BASE_INFO(wq_addr_mtx)); \ + } while (0) + +#define SCTP_WQ_ADDR_LOCK() do { \ + mtx_lock(&SCTP_BASE_INFO(wq_addr_mtx)); \ +} while (0) +#define SCTP_WQ_ADDR_UNLOCK() do { \ + mtx_unlock(&SCTP_BASE_INFO(wq_addr_mtx)); \ +} while (0) + #define SCTP_INCR_EP_COUNT() \ Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_output.c Fri Jun 11 03:13:19 2010 (r209028) @@ -3053,32 +3053,32 @@ sctp_source_address_selection(struct sct * it out * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz * For V4 - *------------------------------------------ + * ------------------------------------------ * source * dest * result * ----------------------------------------- * Private * Global * NAT * ----------------------------------------- * Private * Private * No problem * ----------------------------------------- - * Global * Private * Huh, How will this work? + * Global * Private * Huh, How will this work? * ----------------------------------------- - * Global * Global * No Problem - *------------------------------------------ + * Global * Global * No Problem + *------------------------------------------ * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz * For V6 - *------------------------------------------ + *------------------------------------------ * source * dest * result * ----------------------------------------- * Linklocal * Global * * ----------------------------------------- * Linklocal * Linklocal * No problem * ----------------------------------------- - * Global * Linklocal * Huh, How will this work? + * Global * Linklocal * Huh, How will this work? * ----------------------------------------- - * Global * Global * No Problem - *------------------------------------------ + * Global * Global * No Problem + *------------------------------------------ * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz - * + * * And then we add to that what happens if there are multiple addresses * assigned to an interface. Remember the ifa on a ifn is a linked * list of addresses. So one interface can have more than one IP @@ -3091,13 +3091,13 @@ sctp_source_address_selection(struct sct * Decisions: * * - count the number of addresses on the interface. - * - if it is one, no problem except case . - * For we will assume a NAT out there. + * - if it is one, no problem except case . + * For we will assume a NAT out there. * - if there are more than one, then we need to worry about scope P * or G. We should prefer G -> G and P -> P if possible. * Then as a secondary fall back to mixed types G->P being a last * ditch one. - * - The above all works for bound all, but bound specific we need to + * - The above all works for bound all, but bound specific we need to * use the same concept but instead only consider the bound * addresses. If the bound set is NOT assigned to the interface then * we must use rotation amongst the bound addresses.. @@ -8913,6 +8913,9 @@ sctp_chunk_retransmission(struct sctp_in if ((chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) || (chk->rec.chunk_id.id == SCTP_STREAM_RESET) || (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN)) { + if (chk->sent != SCTP_DATAGRAM_RESEND) { + continue; + } if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { if (chk != asoc->str_reset) { /* @@ -8973,7 +8976,7 @@ sctp_chunk_retransmission(struct sctp_in /* (void)SCTP_GETTIME_TIMEVAL(&chk->whoTo->last_sent_time); */ *cnt_out += 1; chk->sent = SCTP_DATAGRAM_SENT; - /* sctp_ucount_decr(asoc->sent_queue_retran_cnt); */ + sctp_ucount_decr(stcb->asoc.sent_queue_retran_cnt); if (fwd_tsn == 0) { return (0); } else { @@ -13427,6 +13430,13 @@ out_unlocked: } } #endif +#ifdef INVARIANTS + if (inp) { + sctp_validate_no_locks(inp); + } else { + printf("Warning - inp is NULL so cant validate locks\n"); + } +#endif if (top) { sctp_m_freem(top); } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_pcb.c Fri Jun 11 03:13:19 2010 (r209028) @@ -692,13 +692,11 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = sctp_ifap; wi->action = SCTP_ADD_IP_ADDRESS; - SCTP_IPI_ITERATOR_WQ_LOCK(); - /* - * Should this really be a tailq? As it is we will process - * the newest first :-0 - */ + + SCTP_WQ_ADDR_LOCK(); LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_IPI_ITERATOR_WQ_UNLOCK(); + SCTP_WQ_ADDR_UNLOCK(); + sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, (struct sctp_tcb *)NULL, @@ -806,13 +804,13 @@ out_now: (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = sctp_ifap; wi->action = SCTP_DEL_IP_ADDRESS; - SCTP_IPI_ITERATOR_WQ_LOCK(); + SCTP_WQ_ADDR_LOCK(); /* * Should this really be a tailq? As it is we will process * the newest first :-0 */ LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_IPI_ITERATOR_WQ_UNLOCK(); + SCTP_WQ_ADDR_UNLOCK(); sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, @@ -2298,7 +2296,7 @@ sctp_inpcb_alloc(struct socket *so, uint if (inp->sctp_asocidhash == NULL) { SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_INP_INFO_WUNLOCK(); - return error; + return (ENOBUFS); } #ifdef IPSEC { @@ -2340,6 +2338,7 @@ sctp_inpcb_alloc(struct socket *so, uint * in protosw */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EOPNOTSUPP); + so->so_pcb = NULL; SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (EOPNOTSUPP); } @@ -2358,6 +2357,7 @@ sctp_inpcb_alloc(struct socket *so, uint if (inp->sctp_tcbhash == NULL) { SCTP_PRINTF("Out of SCTP-INPCB->hashinit - no resources\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOBUFS); + so->so_pcb = NULL; SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (ENOBUFS); } @@ -3017,57 +3017,68 @@ continue_anyway: static void -sctp_iterator_inp_being_freed(struct sctp_inpcb *inp, struct sctp_inpcb *inp_next) +sctp_iterator_inp_being_freed(struct sctp_inpcb *inp) { - struct sctp_iterator *it; + struct sctp_iterator *it, *nit; /* * We enter with the only the ITERATOR_LOCK in place and a write * lock on the inp_info stuff. */ - + it = sctp_it_ctl.cur_it; + if (it && (it->vn != curvnet)) { + /* Its not looking at our VNET */ + return; + } + if (it && (it->inp == inp)) { + /* + * This is tricky and we hold the iterator lock, but when it + * returns and gets the lock (when we release it) the + * iterator will try to operate on inp. We need to stop that + * from happening. But of course the iterator has a + * reference on the stcb and inp. We can mark it and it will + * stop. + * + * If its a single iterator situation, we set the end iterator + * flag. Otherwise we set the iterator to go to the next + * inp. + * + */ + if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { + sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT; + } else { + sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_INP; + } + } /* - * Go through all iterators, we must do this since it is possible - * that some iterator does NOT have the lock, but is waiting for it. - * And the one that had the lock has either moved in the last - * iteration or we just cleared it above. We need to find all of - * those guys. The list of iterators should never be very big - * though. - */ - TAILQ_FOREACH(it, &SCTP_BASE_INFO(iteratorhead), sctp_nxt_itr) { - if (it == inp->inp_starting_point_for_iterator) - /* skip this guy, he's special */ + * Now go through and remove any single reference to our inp that + * may be still pending on the list + */ + SCTP_IPI_ITERATOR_WQ_LOCK(); + it = TAILQ_FIRST(&sctp_it_ctl.iteratorhead); + while (it) { + nit = TAILQ_NEXT(it, sctp_nxt_itr); + if (it->vn != curvnet) { + it = nit; continue; + } if (it->inp == inp) { - /* - * This is tricky and we DON'T lock the iterator. - * Reason is he's running but waiting for me since - * inp->inp_starting_point_for_iterator has the lock - * on me (the guy above we skipped). This tells us - * its is not running but waiting for - * inp->inp_starting_point_for_iterator to be - * released by the guy that does have our INP in a - * lock. - */ + /* This one points to me is it inp specific? */ if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { - it->inp = NULL; - it->stcb = NULL; + /* Remove and free this one */ + TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, + it, sctp_nxt_itr); + if (it->function_atend != NULL) { + (*it->function_atend) (it->pointer, it->val); + } + SCTP_FREE(it, SCTP_M_ITER); } else { - /* set him up to do the next guy not me */ - it->inp = inp_next; - it->stcb = NULL; + it->inp = LIST_NEXT(it->inp, sctp_list); } } + it = nit; } - it = inp->inp_starting_point_for_iterator; - if (it) { - if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { - it->inp = NULL; - } else { - it->inp = inp_next; - } - it->stcb = NULL; - } + SCTP_IPI_ITERATOR_WQ_UNLOCK(); } /* release sctp_inpcb unbind the port */ @@ -3083,12 +3094,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, * all associations. d) finally the ep itself. */ struct sctp_pcb *m; - struct sctp_inpcb *inp_save; struct sctp_tcb *asoc, *nasoc; struct sctp_laddr *laddr, *nladdr; struct inpcb *ip_pcb; struct socket *so; - + int being_refed = 0; struct sctp_queued_to_read *sq; @@ -3099,12 +3109,21 @@ sctp_inpcb_free(struct sctp_inpcb *inp, #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 0); #endif - SCTP_ITERATOR_LOCK(); + if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { + /* + * Once we are in we can remove the flag from = 1 is only + * passed from the actual closing routines that are called + * via the sockets layer. + */ + SCTP_ITERATOR_LOCK(); + /* mark any iterators on the list or being processed */ + sctp_iterator_inp_being_freed(inp); + SCTP_ITERATOR_UNLOCK(); + } so = inp->sctp_socket; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { /* been here before.. eeks.. get out of here */ SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 1); #endif @@ -3114,19 +3133,15 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(inp); - /* First time through we have the socket lock, after that no more. */ if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { - /* - * Once we are in we can remove the flag from = 1 is only - * passed from the actual closing routines that are called - * via the sockets layer. - */ inp->sctp_flags &= ~SCTP_PCB_FLAGS_CLOSE_IP; /* socket is gone, so no more wakeups allowed */ inp->sctp_flags |= SCTP_PCB_FLAGS_DONT_WAKE; inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEINPUT; inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEOUTPUT; + } + /* First time through we have the socket lock, after that no more. */ sctp_timer_stop(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL, SCTP_FROM_SCTP_PCB + SCTP_LOC_1); @@ -3152,8 +3167,17 @@ sctp_inpcb_free(struct sctp_inpcb *inp, nasoc = LIST_NEXT(asoc, sctp_tcblist); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { /* Skip guys being freed */ - /* asoc->sctp_socket = NULL; FIXME MT */ cnt_in_sd++; + if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { + /* + * Special case - we did not start a + * kill timer on the asoc due to it + * was not closed. So go ahead and + * start it now. + */ + asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); + } SCTP_TCB_UNLOCK(asoc); continue; } @@ -3314,14 +3338,13 @@ sctp_inpcb_free(struct sctp_inpcb *inp, } /* now is there some left in our SHUTDOWN state? */ if (cnt_in_sd) { - SCTP_INP_WUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 2); #endif inp->sctp_socket = NULL; + SCTP_INP_WUNLOCK(inp); + SCTP_ASOC_CREATE_UNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); return; } } @@ -3344,6 +3367,10 @@ sctp_inpcb_free(struct sctp_inpcb *inp, asoc = nasoc) { nasoc = LIST_NEXT(asoc, sctp_tcblist); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { + asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); + } cnt++; continue; } @@ -3392,38 +3419,62 @@ sctp_inpcb_free(struct sctp_inpcb *inp, if (cnt) { /* Ok we have someone out there that will kill us */ (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); - SCTP_INP_WUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 3); #endif + SCTP_INP_WUNLOCK(inp); + SCTP_ASOC_CREATE_UNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); return; } - if ((inp->refcount) || (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP)) { + if (SCTP_INP_LOCK_CONTENDED(inp)) + being_refed++; + if (SCTP_INP_READ_CONTENDED(inp)) + being_refed++; + if (SCTP_ASOC_CREATE_LOCK_CONTENDED(inp)) + being_refed++; + + if ((inp->refcount) || + (being_refed) || + (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP)) { (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); +#ifdef SCTP_LOG_CLOSING + sctp_log_closing(inp, NULL, 4); +#endif sctp_timer_start(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL); SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); -#ifdef SCTP_LOG_CLOSING - sctp_log_closing(inp, NULL, 4); -#endif return; } - (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); inp->sctp_ep.signature_change.type = 0; inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_ALLGONE; + /* + * Remove it from the list .. last thing we need a lock for. + */ + LIST_REMOVE(inp, sctp_list); + SCTP_INP_WUNLOCK(inp); + SCTP_ASOC_CREATE_UNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); + /* + * Now we release all locks. Since this INP cannot be found anymore + * except possbily by the kill timer that might be running. We call + * the drain function here. It should hit the case were it sees the + * ACTIVE flag cleared and exit out freeing us to proceed and + * destroy everything. + */ + if (from != SCTP_CALLED_FROM_INPKILL_TIMER) { + (void)SCTP_OS_TIMER_STOP_DRAIN(&inp->sctp_ep.signature_change.timer); + } else { + /* Probably un-needed */ + (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); + } #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 5); #endif - (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); - inp->sctp_ep.signature_change.type = SCTP_TIMER_TYPE_NONE; - /* Clear the read queue */ + if ((inp->sctp_asocidhash) != NULL) { SCTP_HASH_FREE(inp->sctp_asocidhash, inp->hashasocidmark); inp->sctp_asocidhash = NULL; @@ -3494,11 +3545,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, shared_key = LIST_FIRST(&inp->sctp_ep.shared_keys); } - inp_save = LIST_NEXT(inp, sctp_list); - LIST_REMOVE(inp, sctp_list); - - /* fix any iterators only after out of the list */ - sctp_iterator_inp_being_freed(inp, inp_save); /* * if we have an address list the following will free the list of * ifaddr's that are set into this ep. Again macro limitations here, @@ -3531,8 +3577,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_LOCK_DESTROY(inp); SCTP_INP_READ_DESTROY(inp); SCTP_ASOC_CREATE_LOCK_DESTROY(inp); - SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_DECR_EP_COUNT(); } @@ -4581,8 +4625,12 @@ sctp_free_assoc(struct sctp_inpcb *inp, * Someone holds a reference OR the socket is unaccepted * yet. */ - if (stcb->asoc.refcnt) + if ((stcb->asoc.refcnt) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { + stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); + } SCTP_TCB_UNLOCK(stcb); if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) @@ -4645,8 +4693,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, SS_ISCONFIRMING | SS_ISCONNECTED); } - SOCK_UNLOCK(so); - socantrcvmore(so); + socantrcvmore_locked(so); sctp_sowwakeup(inp, so); sctp_sorwakeup(inp, so); SCTP_SOWAKEUP(so); @@ -5436,8 +5483,6 @@ sctp_pcb_init() /* init the empty list of (All) Endpoints */ LIST_INIT(&SCTP_BASE_INFO(listhead)); - /* init the iterator head */ - TAILQ_INIT(&SCTP_BASE_INFO(iteratorhead)); /* init the hash table of endpoints */ TUNABLE_INT_FETCH("net.inet.sctp.tcbhashsize", &SCTP_BASE_SYSCTL(sctp_hashtblsize)); @@ -5500,16 +5545,15 @@ sctp_pcb_init() /* Master Lock INIT for info structure */ SCTP_INP_INFO_LOCK_INIT(); SCTP_STATLOG_INIT_LOCK(); - SCTP_ITERATOR_LOCK_INIT(); SCTP_IPI_COUNT_INIT(); SCTP_IPI_ADDR_INIT(); - SCTP_IPI_ITERATOR_WQ_INIT(); #ifdef SCTP_PACKET_LOGGING SCTP_IP_PKTLOG_INIT(); #endif LIST_INIT(&SCTP_BASE_INFO(addr_wq)); + SCTP_WQ_ADDR_INIT(); /* not sure if we need all the counts */ SCTP_BASE_INFO(ipi_count_ep) = 0; /* assoc/tcb zone info */ @@ -5537,11 +5581,7 @@ sctp_pcb_init() LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 03:54:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2F54106566C; Fri, 11 Jun 2010 03:54:00 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2A5D8FC1F; Fri, 11 Jun 2010 03:54:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B3s044057709; Fri, 11 Jun 2010 03:54:00 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B3s0Bh057705; Fri, 11 Jun 2010 03:54:00 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006110354.o5B3s0Bh057705@svn.freebsd.org> From: Randall Stewart Date: Fri, 11 Jun 2010 03:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209029 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 03:54:00 -0000 Author: rrs Date: Fri Jun 11 03:54:00 2010 New Revision: 209029 URL: http://svn.freebsd.org/changeset/base/209029 Log: 3 Fixes - a) There was a case where a ICMP message could cause us to return leaving a stuck lock on an stcb. b) The iterator needed some tweaks to fix its lock ordering. c) The ITERATOR_LOCK is no longer needed in the freeing of a stcb. Now that the timer based one is gone we don't have a multiple resume situation. Add to that that there was somewhere a path out of the freeing of an assoc that did NOT release the iterator_lock.. it was time to clean this old code up and in the process fix the lock bug. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Jun 11 03:13:19 2010 (r209028) +++ head/sys/netinet/sctp_pcb.c Fri Jun 11 03:54:00 2010 (r209029) @@ -3075,6 +3075,11 @@ sctp_iterator_inp_being_freed(struct sct } else { it->inp = LIST_NEXT(it->inp, sctp_list); } + /* + * When its put in the refcnt is incremented so decr + * it + */ + SCTP_INP_DECR_REF(inp); } it = nit; } @@ -4428,38 +4433,6 @@ sctp_add_vtag_to_timewait(uint32_t tag, } -static void -sctp_iterator_asoc_being_freed(struct sctp_inpcb *inp, struct sctp_tcb *stcb) -{ - struct sctp_iterator *it; - - /* - * Unlock the tcb lock we do this so we avoid a dead lock scenario - * where the iterator is waiting on the TCB lock and the TCB lock is - * waiting on the iterator lock. - */ - it = stcb->asoc.stcb_starting_point_for_iterator; - if (it == NULL) { - return; - } - if (it->inp != stcb->sctp_ep) { - /* hmm, focused on the wrong one? */ - return; - } - if (it->stcb != stcb) { - return; - } - it->stcb = LIST_NEXT(stcb, sctp_tcblist); - if (it->stcb == NULL) { - /* done with all asoc's in this assoc */ - if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { - it->inp = NULL; - } else { - it->inp = LIST_NEXT(inp, sctp_list); - } - } -} - /*- * Free the association after un-hashing the remote port. This @@ -4665,7 +4638,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, SCTP_TCB_UNLOCK(stcb); - SCTP_ITERATOR_LOCK(); SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(inp); SCTP_TCB_LOCK(stcb); @@ -4704,7 +4676,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, * Make it invalid too, that way if its about to run it will abort * and return. */ - sctp_iterator_asoc_being_freed(inp, stcb); /* re-increment the lock */ if (from_inpcbfree == SCTP_NORMAL_PROC) { atomic_add_int(&stcb->asoc.refcnt, -1); @@ -4721,7 +4692,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (from_inpcbfree == SCTP_NORMAL_PROC) { SCTP_INP_INCR_REF(inp); SCTP_INP_WUNLOCK(inp); - SCTP_ITERATOR_UNLOCK(); } /* pull from vtag hash */ LIST_REMOVE(stcb, sctp_asocs); @@ -6694,20 +6664,22 @@ sctp_initiate_iterator(inp_func inpf, it->no_chunk_output = chunk_output_off; it->vn = curvnet; if (s_inp) { + /* Assume lock is held here */ it->inp = s_inp; + SCTP_INP_INCR_REF(it->inp); it->iterator_flags = SCTP_ITERATOR_DO_SINGLE_INP; } else { SCTP_INP_INFO_RLOCK(); it->inp = LIST_FIRST(&SCTP_BASE_INFO(listhead)); - + if (it->inp) { + SCTP_INP_INCR_REF(it->inp); + } SCTP_INP_INFO_RUNLOCK(); it->iterator_flags = SCTP_ITERATOR_DO_ALL_INP; } SCTP_IPI_ITERATOR_WQ_LOCK(); - if (it->inp) { - SCTP_INP_INCR_REF(it->inp); - } + TAILQ_INSERT_TAIL(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); if (sctp_it_ctl.iterator_running == 0) { sctp_wakeup_iterator(); Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Jun 11 03:13:19 2010 (r209028) +++ head/sys/netinet/sctp_usrreq.c Fri Jun 11 03:54:00 2010 (r209029) @@ -402,6 +402,9 @@ sctp_ctlinput(cmd, sa, vip) SCTP_INP_DECR_REF(inp); SCTP_INP_WUNLOCK(inp); } + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } } } return; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Jun 11 03:13:19 2010 (r209028) +++ head/sys/netinet/sctputil.c Fri Jun 11 03:54:00 2010 (r209029) @@ -1255,15 +1255,20 @@ sctp_iterator_work(struct sctp_iterator { int iteration_count = 0; int inp_skip = 0; + int first_in = 1; + struct sctp_inpcb *tinp; + SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); if (it->inp) { + SCTP_INP_RLOCK(it->inp); SCTP_INP_DECR_REF(it->inp); } if (it->inp == NULL) { /* iterator is complete */ done_with_iterator: SCTP_ITERATOR_UNLOCK(); + SCTP_INP_INFO_RUNLOCK(); if (it->function_atend != NULL) { (*it->function_atend) (it->pointer, it->val); } @@ -1271,7 +1276,11 @@ done_with_iterator: return; } select_a_new_ep: - SCTP_INP_RLOCK(it->inp); + if (first_in) { + first_in = 0; + } else { + SCTP_INP_RLOCK(it->inp); + } while (((it->pcb_flags) && ((it->inp->sctp_flags & it->pcb_flags) != it->pcb_flags)) || ((it->pcb_features) && @@ -1281,8 +1290,9 @@ select_a_new_ep: SCTP_INP_RUNLOCK(it->inp); goto done_with_iterator; } - SCTP_INP_RUNLOCK(it->inp); + tinp = it->inp; it->inp = LIST_NEXT(it->inp, sctp_list); + SCTP_INP_RUNLOCK(tinp); if (it->inp == NULL) { goto done_with_iterator; } @@ -1323,6 +1333,8 @@ select_a_new_ep: SCTP_INP_INCR_REF(it->inp); SCTP_INP_RUNLOCK(it->inp); SCTP_ITERATOR_UNLOCK(); + SCTP_INP_INFO_RUNLOCK(); + SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); if (sctp_it_ctl.iterator_flags) { /* We won't be staying here */ @@ -1382,9 +1394,7 @@ no_stcb: if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { it->inp = NULL; } else { - SCTP_INP_INFO_RLOCK(); it->inp = LIST_NEXT(it->inp, sctp_list); - SCTP_INP_INFO_RUNLOCK(); } if (it->inp == NULL) { goto done_with_iterator; From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 04:38:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17927106567B; Fri, 11 Jun 2010 04:38:15 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 073968FC0C; Fri, 11 Jun 2010 04:38:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B4cELh067555; Fri, 11 Jun 2010 04:38:14 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B4cEdN067553; Fri, 11 Jun 2010 04:38:14 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201006110438.o5B4cEdN067553@svn.freebsd.org> From: Alexander Kabaev Date: Fri, 11 Jun 2010 04:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209030 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 04:38:15 -0000 Author: kan Date: Fri Jun 11 04:38:14 2010 New Revision: 209030 URL: http://svn.freebsd.org/changeset/base/209030 Log: In dtrace lexer, do not unput token if it is EOF. This is harmless with OpenSolaris fex and yacc, but with FreeBSD causes '\xff' symbol to be physically put into input buffer, causing subsequent syntax error. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Fri Jun 11 03:54:00 2010 (r209029) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Fri Jun 11 04:38:14 2010 (r209030) @@ -811,7 +811,8 @@ id_or_type(const char *s) longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); } - unput(c0); + if (c0 != EOF) + unput(c0); return (ttok); } From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 06:03:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5BE0106564A; Fri, 11 Jun 2010 06:03:47 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A40F88FC25; Fri, 11 Jun 2010 06:03:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B63lMr086470; Fri, 11 Jun 2010 06:03:47 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B63lIh086455; Fri, 11 Jun 2010 06:03:47 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006110603.o5B63lIh086455@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 06:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209031 - in head: lib/libarchive share/man/man4 share/man/man9 usr.sbin/service X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 06:03:47 -0000 Author: uqs Date: Fri Jun 11 06:03:47 2010 New Revision: 209031 URL: http://svn.freebsd.org/changeset/base/209031 Log: mdoc nitpicking: the title argument shall be uppercase Modified: head/lib/libarchive/archive_entry.3 head/lib/libarchive/archive_read.3 head/lib/libarchive/archive_read_disk.3 head/lib/libarchive/archive_util.3 head/lib/libarchive/archive_write.3 head/lib/libarchive/archive_write_disk.3 head/lib/libarchive/libarchive-formats.5 head/lib/libarchive/tar.5 head/share/man/man4/textdump.4 head/share/man/man9/bus_generic_new_pass.9 head/share/man/man9/bus_set_pass.9 head/share/man/man9/insmntque.9 head/share/man/man9/vfs_mountedfrom.9 head/usr.sbin/service/service.8 Modified: head/lib/libarchive/archive_entry.3 ============================================================================== --- head/lib/libarchive/archive_entry.3 Fri Jun 11 04:38:14 2010 (r209030) +++ head/lib/libarchive/archive_entry.3 Fri Jun 11 06:03:47 2010 (r209031) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd May 12, 2008 -.Dt archive_entry 3 +.Dt ARCHIVE_ENTRY 3 .Os .Sh NAME .Nm archive_entry_acl_add_entry , Modified: head/lib/libarchive/archive_read.3 ============================================================================== --- head/lib/libarchive/archive_read.3 Fri Jun 11 04:38:14 2010 (r209030) +++ head/lib/libarchive/archive_read.3 Fri Jun 11 06:03:47 2010 (r209031) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 13, 2009 -.Dt archive_read 3 +.Dt ARCHIVE_READ 3 .Os .Sh NAME .Nm archive_read_new , Modified: head/lib/libarchive/archive_read_disk.3 ============================================================================== --- head/lib/libarchive/archive_read_disk.3 Fri Jun 11 04:38:14 2010 (r209030) +++ head/lib/libarchive/archive_read_disk.3 Fri Jun 11 06:03:47 2010 (r209031) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd March 10, 2009 -.Dt archive_read_disk 3 +.Dt ARCHIVE_READ_DISK 3 .Os .Sh NAME .Nm archive_read_disk_new , Modified: head/lib/libarchive/archive_util.3 ============================================================================== --- head/lib/libarchive/archive_util.3 Fri Jun 11 04:38:14 2010 (r209030) +++ head/lib/libarchive/archive_util.3 Fri Jun 11 06:03:47 2010 (r209031) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd January 8, 2005 -.Dt archive_util 3 +.Dt ARCHIVE_UTIL 3 .Os .Sh NAME .Nm archive_clear_error , Modified: head/lib/libarchive/archive_write.3 ============================================================================== --- head/lib/libarchive/archive_write.3 Fri Jun 11 04:38:14 2010 (r209030) +++ head/lib/libarchive/archive_write.3 Fri Jun 11 06:03:47 2010 (r209031) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd May 11, 2008 -.Dt archive_write 3 +.Dt ARCHIVE_WRITE 3 .Os .Sh NAME .Nm archive_write_new , Modified: head/lib/libarchive/archive_write_disk.3 ============================================================================== --- head/lib/libarchive/archive_write_disk.3 Fri Jun 11 04:38:14 2010 (r209030) +++ head/lib/libarchive/archive_write_disk.3 Fri Jun 11 06:03:47 2010 (r209031) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd August 5, 2008 -.Dt archive_write_disk 3 +.Dt ARCHIVE_WRITE_DISK 3 .Os .Sh NAME .Nm archive_write_disk_new , Modified: head/lib/libarchive/libarchive-formats.5 ============================================================================== --- head/lib/libarchive/libarchive-formats.5 Fri Jun 11 04:38:14 2010 (r209030) +++ head/lib/libarchive/libarchive-formats.5 Fri Jun 11 06:03:47 2010 (r209031) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd December 27, 2009 -.Dt libarchive-formats 5 +.Dt LIBARCHIVE-FORMATS 5 .Os .Sh NAME .Nm libarchive-formats Modified: head/lib/libarchive/tar.5 ============================================================================== --- head/lib/libarchive/tar.5 Fri Jun 11 04:38:14 2010 (r209030) +++ head/lib/libarchive/tar.5 Fri Jun 11 06:03:47 2010 (r209031) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd December 27, 2009 -.Dt tar 5 +.Dt TAR 5 .Os .Sh NAME .Nm tar Modified: head/share/man/man4/textdump.4 ============================================================================== --- head/share/man/man4/textdump.4 Fri Jun 11 04:38:14 2010 (r209030) +++ head/share/man/man4/textdump.4 Fri Jun 11 06:03:47 2010 (r209031) @@ -28,7 +28,7 @@ .\" $FreeBSD$ .\" .Dd December 24, 2008 -.Dt textdump 4 +.Dt TEXTDUMP 4 .Os .Sh NAME .Nm textdump Modified: head/share/man/man9/bus_generic_new_pass.9 ============================================================================== --- head/share/man/man9/bus_generic_new_pass.9 Fri Jun 11 04:38:14 2010 (r209030) +++ head/share/man/man9/bus_generic_new_pass.9 Fri Jun 11 06:03:47 2010 (r209031) @@ -28,7 +28,7 @@ .\" $FreeBSD$ .\" .Dd June 8, 2009 -.Dt bus_generic_new_pass 9 +.Dt BUS_GENERIC_NEW_PASS 9 .Os .Sh NAME .Nm bus_generic_new_pass Modified: head/share/man/man9/bus_set_pass.9 ============================================================================== --- head/share/man/man9/bus_set_pass.9 Fri Jun 11 04:38:14 2010 (r209030) +++ head/share/man/man9/bus_set_pass.9 Fri Jun 11 06:03:47 2010 (r209031) @@ -28,7 +28,7 @@ .\" $FreeBSD$ .\" .Dd June 8, 2009 -.Dt bus_set_pass 9 +.Dt BUS_SET_PASS 9 .Os .Sh NAME .Nm bus_set_pass Modified: head/share/man/man9/insmntque.9 ============================================================================== --- head/share/man/man9/insmntque.9 Fri Jun 11 04:38:14 2010 (r209030) +++ head/share/man/man9/insmntque.9 Fri Jun 11 06:03:47 2010 (r209031) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .Dd September 8, 2008 -.Dt insmntque 9 +.Dt INSMNTQUE 9 .Os .Sh NAME .Nm insmntque , Modified: head/share/man/man9/vfs_mountedfrom.9 ============================================================================== --- head/share/man/man9/vfs_mountedfrom.9 Fri Jun 11 04:38:14 2010 (r209030) +++ head/share/man/man9/vfs_mountedfrom.9 Fri Jun 11 06:03:47 2010 (r209031) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .Dd February 25, 2008 -.Dt vfs_mountedfrom 9 +.Dt VFS_MOUNTEDFROM 9 .Os .Sh NAME .Nm vfs_mountedfrom Modified: head/usr.sbin/service/service.8 ============================================================================== --- head/usr.sbin/service/service.8 Fri Jun 11 04:38:14 2010 (r209030) +++ head/usr.sbin/service/service.8 Fri Jun 11 06:03:47 2010 (r209031) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd December 26, 2009 -.Dt service 8 +.Dt SERVICE 8 .Os .Sh NAME .Nm service From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 06:03:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97A52106566C; Fri, 11 Jun 2010 06:03:54 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 878178FC15; Fri, 11 Jun 2010 06:03:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B63sdF086507; Fri, 11 Jun 2010 06:03:54 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B63slR086505; Fri, 11 Jun 2010 06:03:54 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006110603.o5B63slR086505@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 06:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209032 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 06:03:54 -0000 Author: uqs Date: Fri Jun 11 06:03:54 2010 New Revision: 209032 URL: http://svn.freebsd.org/changeset/base/209032 Log: mdoc: stop abusing -column lists and use .Bl -tag instead Modified: head/lib/libc/gen/getcap.3 Modified: head/lib/libc/gen/getcap.3 ============================================================================== --- head/lib/libc/gen/getcap.3 Fri Jun 11 06:03:47 2010 (r209031) +++ head/lib/libc/gen/getcap.3 Fri Jun 11 06:03:54 2010 (r209032) @@ -305,15 +305,21 @@ giving four names that can be used to ac .Pp The remaining non-empty capabilities describe a set of (name, value) bindings, consisting of a names optionally followed by a typed value: -.Bl -column "nameTvalue" -.It name Ta "typeless [boolean] capability" +.Pp +.Bl -tag -width "nameTvalue" -compact +.It name +typeless [boolean] capability .Em name No "is present [true]" -.It name Ns Em \&T Ns value Ta capability +.It name Ns Em \&T Ns value +capability .Pq Em name , \&T has value .Em value -.It name@ Ta "no capability" Em name No exists -.It name Ns Em T Ns \&@ Ta capability +.It name@ +no capability +.Em name No exists +.It name Ns Em T Ns \&@ +capability .Pq Em name , T does not exist .El @@ -436,28 +442,24 @@ Two types are predefined by .Fn cgetnum and .Fn cgetstr : -.Bl -column "nameXnumber" -.Sm off -.It Em name No \&# Em number Ta numeric -.Sm on -capability +.Pp +.Bl -tag -width "nameXnumber" -compact +.It Em name Ns \&# Ns Em number +numeric capability .Em name has value .Em number -.Sm off -.It Em name No = Em string Ta "string capability" -.Sm on +.It Em name Ns = Ns Em string +string capability .Em name has value .Em string -.Sm off -.It Em name No \&#@ Ta "the numeric capability" -.Sm on +.It Em name Ns \&#@ +the numeric capability .Em name does not exist -.Sm off -.It Em name No \&=@ Ta "the string capability" -.Sm on +.It Em name Ns \&=@ +the string capability .Em name does not exist .El From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 06:04:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B7210657A4; Fri, 11 Jun 2010 06:04:00 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C49E88FC22; Fri, 11 Jun 2010 06:04:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B64050086573; Fri, 11 Jun 2010 06:04:00 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B640qR086571; Fri, 11 Jun 2010 06:04:00 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006110604.o5B640qR086571@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 06:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209033 - head/share/man/man1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 06:04:04 -0000 Author: uqs Date: Fri Jun 11 06:04:00 2010 New Revision: 209033 URL: http://svn.freebsd.org/changeset/base/209033 Log: Remove Xo/Xc in It, which is not yet supported by mdocml but can be worked around trivially in this case. Modified: head/share/man/man1/builtin.1 Modified: head/share/man/man1/builtin.1 ============================================================================== --- head/share/man/man1/builtin.1 Fri Jun 11 06:03:54 2010 (r209032) +++ head/share/man/man1/builtin.1 Fri Jun 11 06:04:00 2010 (r209033) @@ -193,9 +193,7 @@ under do exist externally, but are implemented as scripts using a builtin command of the same name. .Bl -column ".Ic uncomplete" ".Em External" ".Xr csh 1" ".Xr sh 1" -offset indent -.It Xo -.Em "Command External" Ta Xr csh 1 Ta Xr sh 1 -.Xc +.It Em Command Ta Em External Ta Xr csh 1 Ta Xr sh 1 .It Ic \&! Ta \&No Ta \&No Ta Yes .It Ic % Ta \&No Ta Yes Ta \&No .It Ic \&. Ta \&No Ta \&No Ta Yes From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 06:04:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A36D10656C4; Fri, 11 Jun 2010 06:04:08 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 304B68FC0C; Fri, 11 Jun 2010 06:04:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B6482d086647; Fri, 11 Jun 2010 06:04:08 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B648QY086641; Fri, 11 Jun 2010 06:04:08 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006110604.o5B648QY086641@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 06:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209034 - in head: bin/getfacl share/man/man4 share/termcap usr.sbin/nfscbd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 06:04:08 -0000 Author: uqs Date: Fri Jun 11 06:04:07 2010 New Revision: 209034 URL: http://svn.freebsd.org/changeset/base/209034 Log: More mdoc nitpicking to improve compatibility to mdocml - .Nd in section NAME is not optional - .Ed was missing - "indent" is not a flag, but a literal argument for -offset - stop switching font sizes for acronyms - use .Brq instead of rolling our own Modified: head/bin/getfacl/getfacl.1 head/share/man/man4/ae.4 head/share/man/man4/io.4 head/share/termcap/termcap.5 head/usr.sbin/nfscbd/nfscbd.8 Modified: head/bin/getfacl/getfacl.1 ============================================================================== --- head/bin/getfacl/getfacl.1 Fri Jun 11 06:04:00 2010 (r209033) +++ head/bin/getfacl/getfacl.1 Fri Jun 11 06:04:07 2010 (r209034) @@ -48,7 +48,7 @@ the specified file(s) to standard output If the .Xr getconf 1 utility indicates that -.Eq { } Va _POSIX_ACL_EXTENDED +.Brq Va _POSIX_ACL_EXTENDED is not in effect for a .Ar file then the standard discretionary access permissions are interpreted as Modified: head/share/man/man4/ae.4 ============================================================================== --- head/share/man/man4/ae.4 Fri Jun 11 06:04:00 2010 (r209033) +++ head/share/man/man4/ae.4 Fri Jun 11 06:04:07 2010 (r209034) @@ -41,7 +41,7 @@ kernel configuration file: Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : -.Bd -literal -offset -indent +.Bd -literal -offset indent if_ae_load="YES" .Ed .Sh DESCRIPTION Modified: head/share/man/man4/io.4 ============================================================================== --- head/share/man/man4/io.4 Fri Jun 11 06:04:00 2010 (r209033) +++ head/share/man/man4/io.4 Fri Jun 11 06:04:07 2010 (r209034) @@ -40,7 +40,6 @@ .In sys/ioctl.h .In dev/io/iodev.h .In machine/iodev.h -.Pp .Bd -literal struct iodev_pio_req { u_int access; @@ -48,6 +47,7 @@ struct iodev_pio_req { u_int width; u_int val; }; +.Ed .Sh DESCRIPTION The special file .Pa /dev/io Modified: head/share/termcap/termcap.5 ============================================================================== --- head/share/termcap/termcap.5 Fri Jun 11 06:04:00 2010 (r209033) +++ head/share/termcap/termcap.5 Fri Jun 11 06:04:07 2010 (r209034) @@ -1038,7 +1038,7 @@ and the Lear Siegler .Tn ADM Ns \-3 is described as .Bd -literal -offset indent -l3\||\|adm3\||\|3\||\|LSI \s-1ADM\s0-3:\e +l3\||\|adm3\||\|3\||\|LSI ADM-3:\e :am:bl=^G:cl=^Z:co#80:cr=^M:do=^J:le=^H:li#24:sf=^J: .Ed .Ss Parameterized Strings Modified: head/usr.sbin/nfscbd/nfscbd.8 ============================================================================== --- head/usr.sbin/nfscbd/nfscbd.8 Fri Jun 11 06:04:00 2010 (r209033) +++ head/usr.sbin/nfscbd/nfscbd.8 Fri Jun 11 06:04:07 2010 (r209034) @@ -29,6 +29,7 @@ .Os .Sh NAME .Nm nfscbd +.Nd .Tn NFSv4 client side callback daemon .Sh SYNOPSIS From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 06:04:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA53410657DE; Fri, 11 Jun 2010 06:04:14 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA4E38FC1E; Fri, 11 Jun 2010 06:04:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B64Ekr086715; Fri, 11 Jun 2010 06:04:14 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B64EBT086713; Fri, 11 Jun 2010 06:04:14 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006110604.o5B64EBT086713@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 06:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209035 - head/usr.bin/hexdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 06:04:14 -0000 Author: uqs Date: Fri Jun 11 06:04:14 2010 New Revision: 209035 URL: http://svn.freebsd.org/changeset/base/209035 Log: Use same table markup as in hexdump.1 Modified: head/usr.bin/hexdump/od.1 Modified: head/usr.bin/hexdump/od.1 ============================================================================== --- head/usr.bin/hexdump/od.1 Fri Jun 11 06:04:07 2010 (r209034) +++ head/usr.bin/hexdump/od.1 Fri Jun 11 06:04:14 2010 (r209035) @@ -150,12 +150,12 @@ Named characters .Pq Tn ASCII . Control characters are displayed using the following names: .Bl -column "000 NUL" "001 SOH" "002 STX" "003 ETX" "004 EOT" "005 ENQ" -.It "000 NUL 001 SOH 002 STX 003 ETX 004 EOT 005 ENQ" -.It "006 ACK 007 BEL 008 BS 009 HT 00a NL 00b VT" -.It "00c FF 00d CR 00e SO 00f SI 010 DLE 011 DC1" -.It "012 DC2 013 DC3 014 DC4 015 NAK 016 SYN 017 ETB" -.It "018 CAN 019 EM 01a SUB 01b ESC 01c FS 01d GS" -.It "01e RS 01f US 020 SP 07f DEL" +.It 000 NUL 001 SOH 002 STX 003 ETX 004 EOT 005 ENQ +.It 006 ACK 007 BEL 008 BS 009 HT 00A NL 00B VT +.It 00C FF 00D CR 00E SO 00F SI 010 DLE 011 DC1 +.It 012 DC2 013 DC3 014 DC4 015 NAK 016 SYN 017 ETB +.It 018 CAN 019 EM 01A SUB 01B ESC 01C FS 01D GS +.It 01E RS 01F US 020 SP 07F DEL .El .It Cm c Characters in the default character set. From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 06:11:05 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC1C21065677; Fri, 11 Jun 2010 06:11:05 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8352C8FC1F; Fri, 11 Jun 2010 06:11:05 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o5B6B4Xo023124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jun 2010 08:11:04 +0200 (CEST) (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o5B6B4Hx023123; Fri, 11 Jun 2010 08:11:04 +0200 (CEST) (envelope-from uqs@FreeBSD.org) Date: Fri, 11 Jun 2010 08:11:04 +0200 From: Ulrich Spoerlein To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20100611061104.GG39829@acme.spoerlein.net> Mail-Followup-To: Ulrich Spoerlein , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201006110603.o5B63lIh086455@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201006110603.o5B63lIh086455@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: svn commit: r209031 - in head: lib/libarchive share/man/man4 share/man/man9 usr.sbin/service X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 06:11:06 -0000 On Fri, 11.06.2010 at 06:03:47 +0000, Ulrich Spoerlein wrote: > Author: uqs > Date: Fri Jun 11 06:03:47 2010 > New Revision: 209031 > URL: http://svn.freebsd.org/changeset/base/209031 > > Log: > mdoc nitpicking: the title argument shall be uppercase Libarchive parts were approved by kientzle@ Uli From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 07:50:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F14A5106564A; Fri, 11 Jun 2010 07:50:20 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id A83608FC19; Fri, 11 Jun 2010 07:50:20 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id B024811B84F; Fri, 11 Jun 2010 02:50:19 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id IQKODBH7A5DV; Fri, 11 Jun 2010 02:50:19 -0500 Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <3BE36947-BCB4-4A6D-9040-873CFD144F3B@gsoft.com.au> Date: Fri, 11 Jun 2010 08:50:16 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <7E348ECC-5F60-4788-99F5-4B8D88E3AF65@freebsd.org> References: <201006102034.o5AKYMXX058081@svn.freebsd.org> <3BE36947-BCB4-4A6D-9040-873CFD144F3B@gsoft.com.au> To: "Daniel O'Connor" X-Mailer: Apple Mail (2.1078) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: SPOOFED: Re: svn commit: r209011 - stable/8/sys/dev/ath/ath_hal/ar5211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 07:50:21 -0000 On 11 Jun 2010, at 02:46, Daniel O'Connor wrote: >=20 > On 11/06/2010, at 6:04, Rui Paulo wrote: >> Log: >> MFC r208644: >> Due to the way HALDEBUG() is defined, we need to add curly brackets >> when using it as a sole if clause instruction. >> While there, fix 'const static' typo. >=20 > Why not fix HALDEBUG? ie wrap it in do { } while (0) >=20 > Although that said when I looked at HALDEBUG on 8.0 it was defined as = a function so it is a non issue there. >=20 > HAL_DEBUG is different but I can't actually find where that is = defined. There's actually no problem in the code. This was to shut up a compiler = warning on NetBSD. I probably should've said that in the commit log. Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 07:53:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 734B9106564A; Fri, 11 Jun 2010 07:53:52 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 2D65F8FC18; Fri, 11 Jun 2010 07:53:51 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id 0418011B99E; Fri, 11 Jun 2010 02:53:51 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id HCL2XB5RBDMC; Fri, 11 Jun 2010 02:53:50 -0500 Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <201006110132.o5B1WgV4025645@svn.freebsd.org> Date: Fri, 11 Jun 2010 08:53:47 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006110132.o5B1WgV4025645@svn.freebsd.org> To: Tai-hwa Liang X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209022 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 07:53:52 -0000 On 11 Jun 2010, at 02:32, Tai-hwa Liang wrote: > Author: avatar > Date: Fri Jun 11 01:32:42 2010 > New Revision: 209022 > URL: http://svn.freebsd.org/changeset/base/209022 >=20 > Log: > Fixing compilation bustage by adding the missing && back. >=20 > Modified: > head/sys/net80211/ieee80211_sta.c >=20 > Modified: head/sys/net80211/ieee80211_sta.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/net80211/ieee80211_sta.c Thu Jun 10 22:47:04 2010 = (r209021) > +++ head/sys/net80211/ieee80211_sta.c Fri Jun 11 01:32:42 2010 = (r209022) > @@ -584,7 +584,7 @@ sta_input(struct ieee80211_node *ni, str > } > IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); > ni->ni_noise =3D nf; > - if (HAS_SEQ(type) !IEEE80211_IS_MULTICAST(wh->i_addr1)) = { > + if (HAS_SEQ(type) && = !IEEE80211_IS_MULTICAST(wh->i_addr1)) { > uint8_t tid =3D ieee80211_gettid(wh); > if (IEEE80211_QOS_HAS_SEQ(wh) && > TID_TO_WME_AC(tid) >=3D WME_AC_VI) Oops, thanks! Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 08:31:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF700106564A; Fri, 11 Jun 2010 08:31:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 63D498FC1A; Fri, 11 Jun 2010 08:31:41 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5B8Vc7T078615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jun 2010 11:31:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5B8VbER003817; Fri, 11 Jun 2010 11:31:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5B8Vbf6003816; Fri, 11 Jun 2010 11:31:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 11 Jun 2010 11:31:37 +0300 From: Kostik Belousov To: Alexander Motin Message-ID: <20100611083137.GA2401@deviant.kiev.zoral.com.ua> References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <201006101614.o5AGE5Zh099383@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208988 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 08:31:43 -0000 --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 10, 2010 at 04:14:05PM +0000, Alexander Motin wrote: > Author: mav > Date: Thu Jun 10 16:14:05 2010 > New Revision: 208988 > URL: http://svn.freebsd.org/changeset/base/208988 >=20 > Log: > Store interrupt trap frame into struct thread. It allows interrupt hand= ler > to obtain both trap frame and opaque argument submitted on registrction. > After kernel and all drivers get used to it, legacy hack can be removed. > =20 > Reviewed by: jhb@ Just curious, why td_frame is not enough for your usage ? I believe td_frame is currently set only by traps and syscalls, and copied on forks. --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwR9GkACgkQC3+MBN1Mb4iy+ACcCZKvwPsSqr4y/acsHAD4vtQY 6YMAn1e+wcpAw//Nhm9ewVT+6VOl+G4p =Z2kk -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c-- From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 09:10:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7B121065675; Fri, 11 Jun 2010 09:10:09 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id B20E78FC13; Fri, 11 Jun 2010 09:10:08 +0000 (UTC) Received: by fxm7 with SMTP id 7so616594fxm.13 for ; Fri, 11 Jun 2010 02:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=pYYpPgkr+ji5PU0IPLZGAPf+4PN7cTHQgg1OXoGdrro=; b=KyyAMGGUNxA4Fke8phdQpWL7oGxcHDzWj3QCrWXB3RDXsJLYsamFR0f0sucJgJRI8L /AIAXvR+i6q/9Ak7fu80KRH1WwvoiYSh9NaBAA826aWivguZI7i0bXwHx5qS11IijLmG LUjuLfrEszlJI4i7kXfuMgpCAfHQYC6pDz3tw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=i6k7ieJ3A8nepwmPDjRO86WxE9VZeC637Je8pzDLYFw8wmxTrlzBGmvT/a4hhKtMbt 59k8Ajto+j+iqpcvmRt7gKCPaS3NXaiYGNh8hCpdOORg0K6IpoRap2P4zoY2Z/dHStdB wS5JJpnWstBO22JrE7u0pts4/UAL+Z20RSiMA= Received: by 10.223.99.212 with SMTP id v20mr1514920fan.44.1276247406908; Fri, 11 Jun 2010 02:10:06 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 2sm4202153faf.15.2010.06.11.02.10.05 (version=SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 02:10:06 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C11FD57.2000400@FreeBSD.org> Date: Fri, 11 Jun 2010 12:09:43 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Kostik Belousov References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> <20100611083137.GA2401@deviant.kiev.zoral.com.ua> In-Reply-To: <20100611083137.GA2401@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208988 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 09:10:10 -0000 Kostik Belousov wrote: > On Thu, Jun 10, 2010 at 04:14:05PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Thu Jun 10 16:14:05 2010 >> New Revision: 208988 >> URL: http://svn.freebsd.org/changeset/base/208988 >> >> Log: >> Store interrupt trap frame into struct thread. It allows interrupt handler >> to obtain both trap frame and opaque argument submitted on registrction. >> After kernel and all drivers get used to it, legacy hack can be removed. >> >> Reviewed by: jhb@ > Just curious, why td_frame is not enough for your usage ? I believe td_frame > is currently set only by traps and syscalls, and copied on forks. I've seen that field, but I have no idea how it is used. I see a lot of usage places and not sure that none of them called inside interrupt filter. I didn't want to break something unexpected. If you sure - it is easy to change. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 09:27:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72555106566B; Fri, 11 Jun 2010 09:27:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DD52C8FC08; Fri, 11 Jun 2010 09:27:16 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5B9R96g083425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jun 2010 12:27:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5B9R9wK092045; Fri, 11 Jun 2010 12:27:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5B9R9Cj092044; Fri, 11 Jun 2010 12:27:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 11 Jun 2010 12:27:09 +0300 From: Kostik Belousov To: Alexander Motin Message-ID: <20100611092709.GG2401@deviant.kiev.zoral.com.ua> References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> <20100611083137.GA2401@deviant.kiev.zoral.com.ua> <4C11FD57.2000400@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="L1c6L/cjZjI9d0Eq" Content-Disposition: inline In-Reply-To: <4C11FD57.2000400@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208988 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 09:27:17 -0000 --L1c6L/cjZjI9d0Eq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 11, 2010 at 12:09:43PM +0300, Alexander Motin wrote: > Kostik Belousov wrote: > > On Thu, Jun 10, 2010 at 04:14:05PM +0000, Alexander Motin wrote: > >> Author: mav > >> Date: Thu Jun 10 16:14:05 2010 > >> New Revision: 208988 > >> URL: http://svn.freebsd.org/changeset/base/208988 > >> > >> Log: > >> Store interrupt trap frame into struct thread. It allows interrupt h= andler > >> to obtain both trap frame and opaque argument submitted on registrct= ion. > >> After kernel and all drivers get used to it, legacy hack can be remo= ved. > >> =20 > >> Reviewed by: jhb@ > > Just curious, why td_frame is not enough for your usage ? I believe td_= frame > > is currently set only by traps and syscalls, and copied on forks. Correction: and ast(). >=20 > I've seen that field, but I have no idea how it is used. I see a lot of > usage places and not sure that none of them called inside interrupt > filter. I didn't want to break something unexpected. If you sure - it is > easy to change. I believe it is safe to use it in a way that you intended to use td_intr_frame. In the current code, interrupt handler cannot rely on the content of td_frame, your save/restore brackets should do the right thing. --L1c6L/cjZjI9d0Eq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwSAW0ACgkQC3+MBN1Mb4i6tQCfciXOdas8KQmC0W60lnF7GUNf 2A0An1bkq+dl2HBh5fGDiPlzDVnOstbZ =5w3x -----END PGP SIGNATURE----- --L1c6L/cjZjI9d0Eq-- From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 09:27:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8951065695; Fri, 11 Jun 2010 09:27:34 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 133DF8FC1E; Fri, 11 Jun 2010 09:27:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B9RX6h032243; Fri, 11 Jun 2010 09:27:33 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B9RXju032240; Fri, 11 Jun 2010 09:27:33 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201006110927.o5B9RXju032240@svn.freebsd.org> From: Ivan Voras Date: Fri, 11 Jun 2010 09:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209037 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 09:27:34 -0000 Author: ivoras Date: Fri Jun 11 09:27:33 2010 New Revision: 209037 URL: http://svn.freebsd.org/changeset/base/209037 Log: In another move to join with the age of the Fruitbat, increase SYSV shared resources defaults beyond absolute minimums. The new values are chosen mostly by magic. They are still fairly small and will need increasing for large installations (especially SHMMAX). However, they are now enough to e.g. start PostgreSQL installations with ~~300 users and nearly 512 MB of shared buffers. Reviewed by: A short discussion on hackers@ Modified: head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Fri Jun 11 08:13:26 2010 (r209036) +++ head/sys/kern/sysv_sem.c Fri Jun 11 09:27:33 2010 (r209037) @@ -133,16 +133,16 @@ struct sem_undo { * Configuration parameters */ #ifndef SEMMNI -#define SEMMNI 10 /* # of semaphore identifiers */ +#define SEMMNI 50 /* # of semaphore identifiers */ #endif #ifndef SEMMNS -#define SEMMNS 60 /* # of semaphores in system */ +#define SEMMNS 340 /* # of semaphores in system */ #endif #ifndef SEMUME -#define SEMUME 10 /* max # of undo entries per process */ +#define SEMUME 50 /* max # of undo entries per process */ #endif #ifndef SEMMNU -#define SEMMNU 30 /* # of undo structures in system */ +#define SEMMNU 150 /* # of undo structures in system */ #endif /* shouldn't need tuning */ Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Fri Jun 11 08:13:26 2010 (r209036) +++ head/sys/kern/sysv_shm.c Fri Jun 11 09:27:33 2010 (r209037) @@ -133,7 +133,7 @@ static int sysctl_shmsegs(SYSCTL_HANDLER * Tuneable values. */ #ifndef SHMMAXPGS -#define SHMMAXPGS 8192 /* Note: sysv shared memory is swap backed. */ +#define SHMMAXPGS 131072 /* Note: sysv shared memory is swap backed. */ #endif #ifndef SHMMAX #define SHMMAX (SHMMAXPGS*PAGE_SIZE) From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 11:24:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27516106567B; Fri, 11 Jun 2010 11:24:24 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 164788FC1D; Fri, 11 Jun 2010 11:24:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BBONKE059828; Fri, 11 Jun 2010 11:24:23 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BBON50059826; Fri, 11 Jun 2010 11:24:23 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006111124.o5BBON50059826@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 11:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209038 - stable/8/usr.bin/mail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 11:24:24 -0000 Author: uqs Date: Fri Jun 11 11:24:23 2010 New Revision: 209038 URL: http://svn.freebsd.org/changeset/base/209038 Log: MFC r208592: mail(1) misses addresses when replying to all There's a parsing error for fields where addresses are not separated by space. This is often produced by MS Outlook. PR: bin/131861 Submitted by: Pete French Tested by: Pete French Reviewed by: mikeh Approved by: re (kib) Modified: stable/8/usr.bin/mail/util.c Directory Properties: stable/8/usr.bin/mail/ (props changed) Modified: stable/8/usr.bin/mail/util.c ============================================================================== --- stable/8/usr.bin/mail/util.c Fri Jun 11 09:27:33 2010 (r209037) +++ stable/8/usr.bin/mail/util.c Fri Jun 11 11:24:23 2010 (r209038) @@ -496,10 +496,11 @@ skin(name) *cp2++ = ' '; } *cp2++ = c; - if (c == ',' && *cp == ' ' && !gotlt) { + if (c == ',' && !gotlt && + (*cp == ' ' || *cp == '"' || *cp == '<')) { *cp2++ = ' '; - while (*++cp == ' ') - ; + while (*cp == ' ') + cp++; lastsp = 0; bufend = cp2; } From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 12:25:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D2581065674; Fri, 11 Jun 2010 12:25:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1DFD88FC1D; Fri, 11 Jun 2010 12:25:02 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id C3CC046BC5; Fri, 11 Jun 2010 08:25:01 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 13E638A04E; Fri, 11 Jun 2010 08:25:01 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Date: Fri, 11 Jun 2010 07:51:40 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006110300.o5B30X9q045387@svn.freebsd.org> In-Reply-To: <201006110300.o5B30X9q045387@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201006110751.40735.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 08:25:01 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 12:25:03 -0000 On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: > Author: marcel > Date: Fri Jun 11 03:00:32 2010 > New Revision: 209026 > URL: http://svn.freebsd.org/changeset/base/209026 > > Log: > Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) > in particular, do not handle deferred DMA map load operations at all. > Any error, and especially EINPROGRESS, is treated as a hard error and > typically abort the current operation. The fact that the busdma code > queues the load operation for when resources (i.e. bounce buffers in > this particular case) are available makes this especially problematic. > Bounce buffering, unlike what the PR synopsis would suggest, works > fine. > > While on the subject, properly implement swi_vm(). NIC drivers do not handle deferred load operations at all (note that bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce BUS_DMA_NOWAIT). It is common practice to just drop the packet in that case. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 12:25:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 130851065677; Fri, 11 Jun 2010 12:25:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D64CB8FC1F; Fri, 11 Jun 2010 12:25:04 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 86F3E46C2B; Fri, 11 Jun 2010 08:25:04 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BBE878A050; Fri, 11 Jun 2010 08:25:03 -0400 (EDT) From: John Baldwin To: Kostik Belousov Date: Fri, 11 Jun 2010 08:10:40 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> <20100611083137.GA2401@deviant.kiev.zoral.com.ua> In-Reply-To: <20100611083137.GA2401@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201006110810.40295.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 08:25:03 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208988 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 12:25:05 -0000 On Friday 11 June 2010 4:31:37 am Kostik Belousov wrote: > On Thu, Jun 10, 2010 at 04:14:05PM +0000, Alexander Motin wrote: > > Author: mav > > Date: Thu Jun 10 16:14:05 2010 > > New Revision: 208988 > > URL: http://svn.freebsd.org/changeset/base/208988 > > > > Log: > > Store interrupt trap frame into struct thread. It allows interrupt handler > > to obtain both trap frame and opaque argument submitted on registrction. > > After kernel and all drivers get used to it, legacy hack can be removed. > > > > Reviewed by: jhb@ > Just curious, why td_frame is not enough for your usage ? I believe td_frame > is currently set only by traps and syscalls, and copied on forks. td_frame is not set on a nested interrupt. Thus, if you use td_frame and get an interrupt while in a syscall, statclock() would account the time as a user tick instead of a system tick. Put another way, td_frame always references the user --> system trapframe, but td_intr_frame will reference the most recent trapframe on the stack. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 12:42:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 430FE1065670; Fri, 11 Jun 2010 12:42:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 9165E8FC0C; Fri, 11 Jun 2010 12:41:56 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5BCfobU003624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jun 2010 15:41:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5BCfnhF016755; Fri, 11 Jun 2010 15:41:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5BCfnPc016754; Fri, 11 Jun 2010 15:41:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 11 Jun 2010 15:41:49 +0300 From: Kostik Belousov To: John Baldwin Message-ID: <20100611124149.GD13238@deviant.kiev.zoral.com.ua> References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> <20100611083137.GA2401@deviant.kiev.zoral.com.ua> <201006110810.40295.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+KJYzRxRHjYqLGl5" Content-Disposition: inline In-Reply-To: <201006110810.40295.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208988 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 12:42:01 -0000 --+KJYzRxRHjYqLGl5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 11, 2010 at 08:10:40AM -0400, John Baldwin wrote: > On Friday 11 June 2010 4:31:37 am Kostik Belousov wrote: > > On Thu, Jun 10, 2010 at 04:14:05PM +0000, Alexander Motin wrote: > > > Author: mav > > > Date: Thu Jun 10 16:14:05 2010 > > > New Revision: 208988 > > > URL: http://svn.freebsd.org/changeset/base/208988 > > >=20 > > > Log: > > > Store interrupt trap frame into struct thread. It allows interrupt= =20 > handler > > > to obtain both trap frame and opaque argument submitted on registrc= tion. > > > After kernel and all drivers get used to it, legacy hack can be rem= oved. > > > =20 > > > Reviewed by: jhb@ > > Just curious, why td_frame is not enough for your usage ? I believe td_= frame > > is currently set only by traps and syscalls, and copied on forks. >=20 > td_frame is not set on a nested interrupt. Thus, if you use td_frame and= get=20 > an interrupt while in a syscall, statclock() would account the time as a = user=20 > tick instead of a system tick. >=20 > Put another way, td_frame always references the user --> system > trapframe, but td_intr_frame will reference the most recent trapframe > on the stack. I mean, save old td_frame on the interrupt, and assign interrupt trap frame to td_frame. I.e., do what r208988, but replace td_intr_frame with td_frame. --+KJYzRxRHjYqLGl5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwSLw0ACgkQC3+MBN1Mb4h/hQCgpq03ZshL4q58ZdboSfkPaGch qy8An0R+cwZEllslx7aZWH8YYxixfcdq =9wgW -----END PGP SIGNATURE----- --+KJYzRxRHjYqLGl5-- From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 12:58:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EF59106566C; Fri, 11 Jun 2010 12:58:29 +0000 (UTC) (envelope-from ashish@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E4038FC12; Fri, 11 Jun 2010 12:58:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BCwTEP080841; Fri, 11 Jun 2010 12:58:29 GMT (envelope-from ashish@svn.freebsd.org) Received: (from ashish@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BCwTdB080839; Fri, 11 Jun 2010 12:58:29 GMT (envelope-from ashish@svn.freebsd.org) Message-Id: <201006111258.o5BCwTdB080839@svn.freebsd.org> From: Ashish SHUKLA Date: Fri, 11 Jun 2010 12:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209039 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 12:58:29 -0000 Author: ashish (ports committer) Date: Fri Jun 11 12:58:29 2010 New Revision: 209039 URL: http://svn.freebsd.org/changeset/base/209039 Log: Add myself to the committers graph. Approved by: pgj (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Fri Jun 11 11:24:23 2010 (r209038) +++ head/share/misc/committers-ports.dot Fri Jun 11 12:58:29 2010 (r209039) @@ -51,6 +51,7 @@ amdmi3 [label="Dmitry Marakasov\namdmi3@ anray [label="Andrey Slusar\nanray@FreeBSD.org\n2005/12/11"] araujo [label="Marcelo Araujo\naraujo@FreeBSD.org\n2007/04/26"] arved [label="Tilman Linneweh\narved@FreeBSD.org\n2002/10/15"] +ashish [label="Ashish SHUKLA\nashish@FreeBSD.org\n2010/06/10"] avilla [label="Alberto Villa\navilla@FreeBSD.org\n2010/01/24"] avl [label="Alexander Logvinov\navl@FreeBSD.org\n2009/05/27"] az [label="Andrej Zverev\naz@FreeBSD.org\n2005/10/03"] @@ -322,6 +323,7 @@ pav -> josef pav -> kwm pav -> mnag +pgj -> ashish pgj -> jacula philip -> koitsu @@ -347,6 +349,7 @@ stas -> araujo steve -> netchild +tabthorpe -> ashish tabthorpe -> avilla tabthorpe -> avl tabthorpe -> fluffy From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 13:44:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E60781065672; Fri, 11 Jun 2010 13:44:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B48F78FC1D; Fri, 11 Jun 2010 13:44:52 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5159146C3A; Fri, 11 Jun 2010 09:44:52 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9CFBB8A03C; Fri, 11 Jun 2010 09:44:51 -0400 (EDT) From: John Baldwin To: Kostik Belousov Date: Fri, 11 Jun 2010 09:43:02 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> <201006110810.40295.jhb@freebsd.org> <20100611124149.GD13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100611124149.GD13238@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201006110943.02539.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 09:44:51 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208988 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 13:44:53 -0000 On Friday 11 June 2010 8:41:49 am Kostik Belousov wrote: > On Fri, Jun 11, 2010 at 08:10:40AM -0400, John Baldwin wrote: > > On Friday 11 June 2010 4:31:37 am Kostik Belousov wrote: > > > On Thu, Jun 10, 2010 at 04:14:05PM +0000, Alexander Motin wrote: > > > > Author: mav > > > > Date: Thu Jun 10 16:14:05 2010 > > > > New Revision: 208988 > > > > URL: http://svn.freebsd.org/changeset/base/208988 > > > > > > > > Log: > > > > Store interrupt trap frame into struct thread. It allows interrupt > > handler > > > > to obtain both trap frame and opaque argument submitted on registrction. > > > > After kernel and all drivers get used to it, legacy hack can be removed. > > > > > > > > Reviewed by: jhb@ > > > Just curious, why td_frame is not enough for your usage ? I believe td_frame > > > is currently set only by traps and syscalls, and copied on forks. > > > > td_frame is not set on a nested interrupt. Thus, if you use td_frame and get > > an interrupt while in a syscall, statclock() would account the time as a user > > tick instead of a system tick. > > > > Put another way, td_frame always references the user --> system > > trapframe, but td_intr_frame will reference the most recent trapframe > > on the stack. > > I mean, save old td_frame on the interrupt, and assign interrupt trap > frame to td_frame. I.e., do what r208988, but replace td_intr_frame > with td_frame. Hmmm, I had thought there were reasons that was not safe, but after looking it may be safe to do this. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 14:06:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FB3910656D4; Fri, 11 Jun 2010 14:06:35 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6A48FC24; Fri, 11 Jun 2010 14:06:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BE6Zoa096073; Fri, 11 Jun 2010 14:06:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BE6ZAP096069; Fri, 11 Jun 2010 14:06:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006111406.o5BE6ZAP096069@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 11 Jun 2010 14:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209042 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 14:06:35 -0000 Author: nwhitehorn Date: Fri Jun 11 14:06:35 2010 New Revision: 209042 URL: http://svn.freebsd.org/changeset/base/209042 Log: MFC r208870: Some revisions of the Serverworks K2 SATA controller have a data corruption bug where if an ATA command is issued before DMA is started, data will become available to the controller before it knows what to do with it. This results in either data corruption or a controller crash. This patch remedies the problem by adopting the workaround employed by Linux and Darwin: starting the DMA engine prior to sending the ATA command. Reviewed by: mav Approved by: re (kib) Modified: stable/8/sys/dev/ata/ata-all.h stable/8/sys/dev/ata/ata-lowlevel.c stable/8/sys/dev/ata/chipsets/ata-serverworks.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ata/ata-all.h ============================================================================== --- stable/8/sys/dev/ata/ata-all.h Fri Jun 11 14:05:34 2010 (r209041) +++ stable/8/sys/dev/ata/ata-all.h Fri Jun 11 14:06:35 2010 (r209042) @@ -564,6 +564,7 @@ struct ata_channel { #define ATA_CHECKS_CABLE 0x20 #define ATA_NO_ATAPI_DMA 0x40 #define ATA_SATA 0x80 +#define ATA_DMA_BEFORE_CMD 0x100 int pm_level; /* power management level */ int devices; /* what is present */ Modified: stable/8/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/8/sys/dev/ata/ata-lowlevel.c Fri Jun 11 14:05:34 2010 (r209041) +++ stable/8/sys/dev/ata/ata-lowlevel.c Fri Jun 11 14:06:35 2010 (r209042) @@ -141,6 +141,14 @@ ata_begin_transaction(struct ata_request goto begin_finished; } + /* start DMA engine if necessary */ + if ((ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { + device_printf(request->parent, "error starting DMA\n"); + request->result = EIO; + goto begin_finished; + } + /* issue command */ if (ch->hw.command(request)) { device_printf(request->parent, "error issuing %s command\n", @@ -150,7 +158,8 @@ ata_begin_transaction(struct ata_request } /* start DMA engine */ - if (ch->dma.start && ch->dma.start(request)) { + if (!(ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { device_printf(request->parent, "error starting DMA\n"); request->result = EIO; goto begin_finished; Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 11 14:05:34 2010 (r209041) +++ stable/8/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 11 14:06:35 2010 (r209042) @@ -241,6 +241,16 @@ ata_serverworks_ch_attach(device_t dev) ATA_OUTL(ctlr->r_res2, ch_offset + 0x88, 0); ATA_OUTL(ctlr->r_res2, ch_offset + 0x80, ATA_INL(ctlr->r_res2, ch_offset + 0x80) & ~0x00040000); + + /* + * Some controllers have a bug where they will send the command + * to the drive before seeing a DMA start, and then can begin + * receiving data before the DMA start arrives. The controller + * will then become confused and either corrupt the data or crash. + * Remedy this by starting DMA before sending the drive command. + */ + + ch->flags |= ATA_DMA_BEFORE_CMD; } /* chip does not reliably do 64K DMA transfers */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 14:10:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3327106566B; Fri, 11 Jun 2010 14:10:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 905B98FC12; Fri, 11 Jun 2010 14:10:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BEAKk4097032; Fri, 11 Jun 2010 14:10:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BEAKWm097029; Fri, 11 Jun 2010 14:10:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006111410.o5BEAKWm097029@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 11 Jun 2010 14:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209044 - in stable/8/sys: dev/ata/chipsets powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 14:10:20 -0000 Author: nwhitehorn Date: Fri Jun 11 14:10:20 2010 New Revision: 209044 URL: http://svn.freebsd.org/changeset/base/209044 Log: MFC r208162, 208836, 208837: Program the K2 SATA controller's interrupt to be level-triggered low, and respect the edge/level settings in the device tree. OpenPIC on powerpc sets interrupts to be level high by default. On Apple interrupt controllers, all level interrupts are low regardless of programming except interrupt 0, used by K2 SATA on some Apple systems, with the result that the K2 SATA IRQ is misconfigured. Pending review of changes to this default, work around this by changing the programming of the K2 SATA interrupt to level low. Approved by: re (kib) Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c stable/8/sys/powerpc/ofw/ofw_pcibus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 11 14:09:49 2010 (r209043) +++ stable/8/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 11 14:10:20 2010 (r209044) @@ -221,9 +221,9 @@ ata_serverworks_ch_attach(device_t dev) #ifdef __powerpc__ ch->hw.status = ata_serverworks_status; - /* Make sure that our interrupt is edge triggered */ + /* Make sure that our interrupt is level low */ powerpc_config_intr(bus_get_resource_start(device_get_parent(dev), - SYS_RES_IRQ, 0), INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH); + SYS_RES_IRQ, 0), INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); #endif if (ctlr->chip->chipid == ATA_K2) { Modified: stable/8/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/8/sys/powerpc/ofw/ofw_pcibus.c Fri Jun 11 14:09:49 2010 (r209043) +++ stable/8/sys/powerpc/ofw/ofw_pcibus.c Fri Jun 11 14:10:20 2010 (r209044) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -192,20 +193,36 @@ ofw_pcibus_enum_devtree(device_t dev, u_ pci_add_child(dev, (struct pci_devinfo *)dinfo); /* - * Some devices don't have an intpin set, but do have - * interrupts. These are fully specified, and set in the + * Some devices don't have an intpin set, but do have + * interrupts. These are fully specified, and set in the * interrupts property, so add that value to the device's * resource list. - */ - if (dinfo->opd_dinfo.cfg.intpin == 0) { - ofw_pci_intr_t intr; + */ + if (dinfo->opd_dinfo.cfg.intpin == 0) { + ofw_pci_intr_t intr[2]; + phandle_t iparent; + int icells; if (OF_getprop(child, "interrupts", &intr, sizeof(intr)) > 0) { - resource_list_add(&dinfo->opd_dinfo.resources, - SYS_RES_IRQ, 0, intr, intr, 1); + iparent = 0; + icells = 1; + OF_getprop(child, "interrupt-parent", &iparent, + sizeof(iparent)); + OF_getprop(iparent, "#interrupt-cells", &icells, + sizeof(icells)); + + if (iparent != 0 && icells > 1) { + powerpc_config_intr(intr[0], + (intr[1] & 1) ? INTR_TRIGGER_LEVEL : + INTR_TRIGGER_EDGE, + INTR_POLARITY_HIGH); + } + + resource_list_add(&dinfo->opd_dinfo.resources, + SYS_RES_IRQ, 0, intr[0], intr[0], 1); } - } + } } } From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 15:09:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8540106566B; Fri, 11 Jun 2010 15:09:41 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id B18588FC15; Fri, 11 Jun 2010 15:09:41 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id CE7862F88; Fri, 11 Jun 2010 11:04:29 -0400 (EDT) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id 26A3A2F30; Fri, 11 Jun 2010 11:04:29 -0400 (EDT) Received: from mweb2.acsu.buffalo.edu (mweb2.acsu.buffalo.edu [128.205.5.239]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id 1704C2EDF; Fri, 11 Jun 2010 11:04:29 -0400 (EDT) Received: from [128.205.32.76] (bauer.cse.Buffalo.EDU [128.205.32.76]) by mweb2.acsu.buffalo.edu (Postfix) with ESMTP id BB8EE207A9; Fri, 11 Jun 2010 11:04:28 -0400 (EDT) From: Ken Smith To: Martin Matuska In-Reply-To: <201005180959.o4I9xAsu012265@svn.freebsd.org> References: <201005180959.o4I9xAsu012265@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-wJv6dOEKbrDWguRSifwQ" Date: Fri, 11 Jun 2010 11:04:28 -0400 Message-ID: <1276268668.89354.38.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r208258 - in stable/8: contrib/top etc/mtree lib lib/liblzma lib/libusb share/mk usr.bin usr.bin/less usr.bin/lzmainfo usr.bin/xz usr.bin/xzdec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:09:42 -0000 --=-wJv6dOEKbrDWguRSifwQ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Tue, 2010-05-18 at 09:59 +0000, Martin Matuska wrote: > Author: mm > Date: Tue May 18 09:59:09 2010 > New Revision: 208258 > URL: http://svn.freebsd.org/changeset/base/208258 >=20 > Log: > MFC r207842, r207844, r208099: > =20 > MFC r207842: > Import of liblzma, xz, xzdec, lzmainfo from vendor branch > Add support for xz and lzma to lesspipe.sh (xzless, lzless) > =20 > MFC r207844: > Add two public headers missing in r207842 > Adjust CFLAGS for lzmainfo, xz, xzdec > =20 > MFC r208099: > Add versioned symbols to liblzma > Use default SHLIB_MAJOR. > =20 > Approved by: delphij (mentor) >=20 xz on sparc64 appears to be broken. Some time between 8.1-BETA1 and now the libpng (required for release builds because it's part of the "docproj" port set) shifted from fetching a .bz2 file to fetching a .xz file. Uncompressing the file works fine on amd64 and i386 architectures but fails on sparc64. I haven't had time to dig into why it's busted but I figured I should at least let others know about it right away. Is it possible some knob related to big endian versus little endian isn't being handled quite right? --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-wJv6dOEKbrDWguRSifwQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAkwSUHEACgkQ/G14VSmup/bUNQCfbn+2DrdyJmtHafjZqpynTq6p JswAnA6D4bp2CRCQhbksUNNTb0cc1iul =1RJ2 -----END PGP SIGNATURE----- --=-wJv6dOEKbrDWguRSifwQ-- From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 15:21:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5DDD1065672; Fri, 11 Jun 2010 15:21:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4A5E8FC23; Fri, 11 Jun 2010 15:21:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BFLCg2012871; Fri, 11 Jun 2010 15:21:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BFLCoM012869; Fri, 11 Jun 2010 15:21:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201006111521.o5BFLCoM012869@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 11 Jun 2010 15:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209046 - stable/8/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:21:13 -0000 Author: trasz Date: Fri Jun 11 15:21:12 2010 New Revision: 209046 URL: http://svn.freebsd.org/changeset/base/209046 Log: Fix usage of uninitialized variable. Found with: Coverity Prevent CID: 7517 Approved by: re (kib) Modified: stable/8/lib/libc/posix1e/acl_strip.c Modified: stable/8/lib/libc/posix1e/acl_strip.c ============================================================================== --- stable/8/lib/libc/posix1e/acl_strip.c Fri Jun 11 14:11:24 2010 (r209045) +++ stable/8/lib/libc/posix1e/acl_strip.c Fri Jun 11 15:21:12 2010 (r209046) @@ -46,7 +46,7 @@ static acl_t _nfs4_acl_strip_np(const acl_t aclp, int recalculate_mask) { acl_t newacl; - mode_t mode; + mode_t mode = 0; newacl = acl_init(ACL_MAX_ENTRIES); if (newacl == NULL) { From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 15:24:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86DEC1065670; Fri, 11 Jun 2010 15:24:04 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5B0CE8FC08; Fri, 11 Jun 2010 15:24:02 +0000 (UTC) Received: by bwz2 with SMTP id 2so539042bwz.13 for ; Fri, 11 Jun 2010 08:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=Ts+DbTHIWy7C2OYN435r1T3A4xQh4czPlSURZXNMggA=; b=cZx/b5i3lPnDHWiWsn/MnWaFd250JgIvHoO8V+8MtmCGyOp2p9QqnmpP7O7u6f6xEG TWFkmB/ROXgji79eKBY423qqYwIJrPkqi3/0HdH9QGU7e2iH2ukOovEuKgYUkPh+CtsF 43Xc4kGt4Aa1lG8hUrlSAseGr53S26N5BnRZY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=cVUixopY8kv6ksvSJyPY9OR0iq7BOjYypg+r2mlMTr2Hn6zmXwuxesuezIwhzRjToJ yPsLpXMacs2qkX0icJPjf29V9kVA9Ahzj4bwBtH8jvhxezuX9k5nu3ZE8PFNQR5A/4sh eWaA6eLZjiOT7WyIwD51cyCNf+ft2WqLaPdm4= Received: by 10.204.83.228 with SMTP id g36mr1415180bkl.133.1276269840649; Fri, 11 Jun 2010 08:24:00 -0700 (PDT) Received: from enapierala.wheel.pl (58.wheelsystems.com [83.12.187.58]) by mx.google.com with ESMTPS id v14sm5389203bkz.8.2010.06.11.08.23.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 08:23:59 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <201006111521.o5BFLCoM012869@svn.freebsd.org> Date: Fri, 11 Jun 2010 17:23:40 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006111521.o5BFLCoM012869@svn.freebsd.org> To: Edward Tomasz Napierala X-Mailer: Apple Mail (2.1078) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r209046 - stable/8/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:24:04 -0000 Wiadomo=B6=E6 napisana przez Edward Tomasz Napierala w dniu 2010-06-11, = o godz. 17:21: > Author: trasz > Date: Fri Jun 11 15:21:12 2010 > New Revision: 209046 > URL: http://svn.freebsd.org/changeset/base/209046 >=20 > Log: MFC r208784: > Fix usage of uninitialized variable. >=20 > Found with: Coverity Prevent > CID: 7517 > Approved by: re (kib) >=20 > Modified: > stable/8/lib/libc/posix1e/acl_strip.c [..] -- If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 15:26:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D5011065674; Fri, 11 Jun 2010 15:26:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC1E8FC17; Fri, 11 Jun 2010 15:26:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BFQFLj014015; Fri, 11 Jun 2010 15:26:15 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BFQFN8014013; Fri, 11 Jun 2010 15:26:15 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201006111526.o5BFQFN8014013@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 11 Jun 2010 15:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209047 - stable/8/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:26:16 -0000 Author: trasz Date: Fri Jun 11 15:26:15 2010 New Revision: 209047 URL: http://svn.freebsd.org/changeset/base/209047 Log: MFC r208811: Don't use pointer to 64 bit value (id_t) to point to 32 bit value (uid_t). Found with: Coverity Prevent CID: 7466, 7467 Approved by: re (kib) Modified: stable/8/lib/libc/posix1e/acl_to_text_nfs4.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/posix1e/acl_to_text_nfs4.c ============================================================================== --- stable/8/lib/libc/posix1e/acl_to_text_nfs4.c Fri Jun 11 15:21:12 2010 (r209046) +++ stable/8/lib/libc/posix1e/acl_to_text_nfs4.c Fri Jun 11 15:26:15 2010 (r209047) @@ -50,7 +50,7 @@ format_who(char *str, size_t size, const acl_tag_t tag; struct passwd *pwd; struct group *grp; - id_t *id; + uid_t *id; error = acl_get_tag_type(entry, &tag); if (error) @@ -62,7 +62,7 @@ format_who(char *str, size_t size, const break; case ACL_USER: - id = (id_t *)acl_get_qualifier(entry); + id = (uid_t *)acl_get_qualifier(entry); if (id == NULL) return (-1); /* XXX: Thread-unsafe. */ @@ -81,7 +81,7 @@ format_who(char *str, size_t size, const break; case ACL_GROUP: - id = (id_t *)acl_get_qualifier(entry); + id = (uid_t *)acl_get_qualifier(entry); if (id == NULL) return (-1); /* XXX: Thread-unsafe. */ @@ -141,7 +141,7 @@ format_additional_id(char *str, size_t s { int error; acl_tag_t tag; - id_t *id; + uid_t *id; error = acl_get_tag_type(entry, &tag); if (error) @@ -155,7 +155,7 @@ format_additional_id(char *str, size_t s break; default: - id = (id_t *)acl_get_qualifier(entry); + id = (uid_t *)acl_get_qualifier(entry); if (id == NULL) return (-1); snprintf(str, size, ":%d", (unsigned int)*id); From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 15:28:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C8F01065674; Fri, 11 Jun 2010 15:28:29 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 492138FC19; Fri, 11 Jun 2010 15:28:29 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L3U00B00WBG2U00@smtpauth1.wiscmail.wisc.edu>; Fri, 11 Jun 2010 10:28:28 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.74.68]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L3U00005WBEXJ40@smtpauth1.wiscmail.wisc.edu>; Fri, 11 Jun 2010 10:28:27 -0500 (CDT) Date: Fri, 11 Jun 2010 10:28:26 -0500 From: Nathan Whitehorn In-reply-to: <1276268668.89354.38.camel@bauer.cse.buffalo.edu> To: Ken Smith Message-id: <4C12561A.4060707@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.74.68 X-Spam-PmxInfo: Server=avs-11, Version=5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.6.11.152114, SenderIP=76.210.74.68 References: <201005180959.o4I9xAsu012265@svn.freebsd.org> <1276268668.89354.38.camel@bauer.cse.buffalo.edu> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100407 Thunderbird/3.0.4 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Martin Matuska Subject: Re: svn commit: r208258 - in stable/8: contrib/top etc/mtree lib lib/liblzma lib/libusb share/mk usr.bin usr.bin/less usr.bin/lzmainfo usr.bin/xz usr.bin/xzdec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:28:29 -0000 On 06/11/10 10:04, Ken Smith wrote: > On Tue, 2010-05-18 at 09:59 +0000, Martin Matuska wrote: > >> Author: mm >> Date: Tue May 18 09:59:09 2010 >> New Revision: 208258 >> URL: http://svn.freebsd.org/changeset/base/208258 >> >> Log: >> MFC r207842, r207844, r208099: >> >> MFC r207842: >> Import of liblzma, xz, xzdec, lzmainfo from vendor branch >> Add support for xz and lzma to lesspipe.sh (xzless, lzless) >> >> MFC r207844: >> Add two public headers missing in r207842 >> Adjust CFLAGS for lzmainfo, xz, xzdec >> >> MFC r208099: >> Add versioned symbols to liblzma >> Use default SHLIB_MAJOR. >> >> Approved by: delphij (mentor) >> >> > xz on sparc64 appears to be broken. Some time between 8.1-BETA1 > and now the libpng (required for release builds because it's part > of the "docproj" port set) shifted from fetching a .bz2 file to > fetching a .xz file. Uncompressing the file works fine on amd64 > and i386 architectures but fails on sparc64. > > I haven't had time to dig into why it's busted but I figured I > should at least let others know about it right away. Is it > possible some knob related to big endian versus little endian > isn't being handled quite right? > This is at least also true on powerpc (both 32 and 64 bit), so it is almost certainly an endian issue. -Nathan From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 15:35:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58447106566B; Fri, 11 Jun 2010 15:35:33 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 214988FC0A; Fri, 11 Jun 2010 15:35:32 +0000 (UTC) MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_rDOR3eg50bTzTJBUsFfZug)" Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L3U00B0CWN8OM00@smtpauth3.wiscmail.wisc.edu>; Fri, 11 Jun 2010 10:35:32 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.74.68]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L3U0079BWN0JF50@smtpauth3.wiscmail.wisc.edu>; Fri, 11 Jun 2010 10:35:26 -0500 (CDT) Date: Fri, 11 Jun 2010 10:35:24 -0500 From: Nathan Whitehorn In-reply-to: <4C12561A.4060707@freebsd.org> To: Ken Smith Message-id: <4C1257BC.8030702@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.74.68 X-Spam-PmxInfo: Server=avs-14, Version=5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.6.11.152715, SenderIP=76.210.74.68 References: <201005180959.o4I9xAsu012265@svn.freebsd.org> <1276268668.89354.38.camel@bauer.cse.buffalo.edu> <4C12561A.4060707@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100407 Thunderbird/3.0.4 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Martin Matuska Subject: Re: svn commit: r208258 - in stable/8: contrib/top etc/mtree lib lib/liblzma lib/libusb share/mk usr.bin usr.bin/less usr.bin/lzmainfo usr.bin/xz usr.bin/xzdec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:35:33 -0000 This is a multi-part message in MIME format. --Boundary_(ID_rDOR3eg50bTzTJBUsFfZug) Content-type: text/plain; CHARSET=US-ASCII; format=flowed Content-transfer-encoding: 7BIT On 06/11/10 10:28, Nathan Whitehorn wrote: > On 06/11/10 10:04, Ken Smith wrote: >> On Tue, 2010-05-18 at 09:59 +0000, Martin Matuska wrote: >>> Author: mm >>> Date: Tue May 18 09:59:09 2010 >>> New Revision: 208258 >>> URL: http://svn.freebsd.org/changeset/base/208258 >>> >>> Log: >>> MFC r207842, r207844, r208099: >>> >>> MFC r207842: >>> Import of liblzma, xz, xzdec, lzmainfo from vendor branch >>> Add support for xz and lzma to lesspipe.sh (xzless, lzless) >>> >>> MFC r207844: >>> Add two public headers missing in r207842 >>> Adjust CFLAGS for lzmainfo, xz, xzdec >>> >>> MFC r208099: >>> Add versioned symbols to liblzma >>> Use default SHLIB_MAJOR. >>> >>> Approved by: delphij (mentor) >>> >> xz on sparc64 appears to be broken. Some time between 8.1-BETA1 >> and now the libpng (required for release builds because it's part >> of the "docproj" port set) shifted from fetching a .bz2 file to >> fetching a .xz file. Uncompressing the file works fine on amd64 >> and i386 architectures but fails on sparc64. >> >> I haven't had time to dig into why it's busted but I figured I >> should at least let others know about it right away. Is it >> possible some knob related to big endian versus little endian >> isn't being handled quite right? > > This is at least also true on powerpc (both 32 and 64 bit), so it is > almost certainly an endian issue. I've attached a patch to the liblzma config.h that makes xz work, at least on powerpc. -Nathan --Boundary_(ID_rDOR3eg50bTzTJBUsFfZug) Content-type: text/plain; name=lzma-patch.diff Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=lzma-patch.diff Index: config.h =================================================================== --- config.h (revision 209045) +++ config.h (working copy) @@ -84,12 +84,6 @@ # define __EXTENSIONS__ 1 #endif #define VERSION "4.999.9beta" -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ +#if BYTE_ORDER == BIG_ENDIAN # define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif #endif --Boundary_(ID_rDOR3eg50bTzTJBUsFfZug)-- From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 15:49:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C5A91065670; Fri, 11 Jun 2010 15:49:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 099E88FC0C; Fri, 11 Jun 2010 15:49:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BFndke019275; Fri, 11 Jun 2010 15:49:39 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BFndXX019262; Fri, 11 Jun 2010 15:49:39 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006111549.o5BFndXX019262@svn.freebsd.org> From: Alan Cox Date: Fri, 11 Jun 2010 15:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209048 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:49:40 -0000 Author: alc Date: Fri Jun 11 15:49:39 2010 New Revision: 209048 URL: http://svn.freebsd.org/changeset/base/209048 Log: Relax one of the new assertions in pmap_enter() a little. Specifically, allow pmap_enter() to be performed on an unmanaged page that doesn't have VPO_BUSY set. Having VPO_BUSY set really only matters for managed pages. (See, for example, pmap_remove_write().) Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/sun4v/sun4v/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/amd64/amd64/pmap.c Fri Jun 11 15:49:39 2010 (r209048) @@ -3138,7 +3138,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%lx)", va)); - KASSERT((m->oflags & VPO_BUSY) != 0, + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0, ("pmap_enter: page %p is not busy", m)); mpte = NULL; Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/arm/arm/pmap.c Fri Jun 11 15:49:39 2010 (r209048) @@ -3326,7 +3326,8 @@ pmap_enter_locked(pmap_t pmap, vm_offset pa = systempage.pv_pa; m = NULL; } else { - KASSERT((m->oflags & VPO_BUSY) != 0 || (flags & M_NOWAIT) != 0, + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0 || (flags & M_NOWAIT) != 0, ("pmap_enter_locked: page %p is not busy", m)); pa = VM_PAGE_TO_PHYS(m); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/i386/i386/pmap.c Fri Jun 11 15:49:39 2010 (r209048) @@ -3267,7 +3267,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)", va)); - KASSERT((m->oflags & VPO_BUSY) != 0, + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0, ("pmap_enter: page %p is not busy", m)); mpte = NULL; Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/i386/xen/pmap.c Fri Jun 11 15:49:39 2010 (r209048) @@ -2673,7 +2673,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)", va)); - KASSERT((m->oflags & VPO_BUSY) != 0, + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0, ("pmap_enter: page %p is not busy", m)); mpte = NULL; Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/ia64/ia64/pmap.c Fri Jun 11 15:49:39 2010 (r209048) @@ -1498,7 +1498,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, va &= ~PAGE_MASK; KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); - KASSERT((m->oflags & VPO_BUSY) != 0, + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0, ("pmap_enter: page %p is not busy", m)); /* Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/mips/mips/pmap.c Fri Jun 11 15:49:39 2010 (r209048) @@ -1748,7 +1748,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, va &= ~PAGE_MASK; KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); - KASSERT((m->oflags & VPO_BUSY) != 0, + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0, ("pmap_enter: page %p is not busy", m)); mpte = NULL; Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/powerpc/aim/mmu_oea.c Fri Jun 11 15:49:39 2010 (r209048) @@ -1102,7 +1102,8 @@ moea_enter_locked(pmap_t pmap, vm_offset if (pmap_bootstrapped) mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - KASSERT((m->oflags & VPO_BUSY) != 0 || VM_OBJECT_LOCKED(m->object), + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0 || VM_OBJECT_LOCKED(m->object), ("moea_enter_locked: page %p is not busy", m)); /* XXX change the pvo head for fake pages */ Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Jun 11 15:49:39 2010 (r209048) @@ -1235,7 +1235,8 @@ moea64_enter_locked(pmap_t pmap, vm_offs if (pmap_bootstrapped) mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - KASSERT((m->oflags & VPO_BUSY) != 0 || VM_OBJECT_LOCKED(m->object), + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0 || VM_OBJECT_LOCKED(m->object), ("moea64_enter_locked: page %p is not busy", m)); /* XXX change the pvo head for fake pages */ Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/powerpc/booke/pmap.c Fri Jun 11 15:49:39 2010 (r209048) @@ -1558,7 +1558,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t KASSERT((va <= VM_MAXUSER_ADDRESS), ("mmu_booke_enter_locked: user pmap, non user va")); } - KASSERT((m->oflags & VPO_BUSY) != 0 || VM_OBJECT_LOCKED(m->object), + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0 || VM_OBJECT_LOCKED(m->object), ("mmu_booke_enter_locked: page %p is not busy", m)); PMAP_LOCK_ASSERT(pmap, MA_OWNED); Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/sparc64/sparc64/pmap.c Fri Jun 11 15:49:39 2010 (r209048) @@ -1351,7 +1351,8 @@ pmap_enter_locked(pmap_t pm, vm_offset_t mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pm, MA_OWNED); - KASSERT((m->oflags & VPO_BUSY) != 0 || VM_OBJECT_LOCKED(m->object), + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0 || VM_OBJECT_LOCKED(m->object), ("pmap_enter_locked: page %p is not busy", m)); PMAP_STATS_INC(pmap_nenter); pa = VM_PAGE_TO_PHYS(m); Modified: head/sys/sun4v/sun4v/pmap.c ============================================================================== --- head/sys/sun4v/sun4v/pmap.c Fri Jun 11 15:26:15 2010 (r209047) +++ head/sys/sun4v/sun4v/pmap.c Fri Jun 11 15:49:39 2010 (r209048) @@ -1084,7 +1084,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t om; int invlva; - KASSERT((m->oflags & VPO_BUSY) != 0, + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0, ("pmap_enter: page %p is not busy", m)); if (pmap->pm_context) DPRINTF("pmap_enter(va=%lx, pa=0x%lx, prot=%x)\n", va, From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 15:55:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B01551065675; Fri, 11 Jun 2010 15:55:18 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF1E8FC18; Fri, 11 Jun 2010 15:55:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BFtIgG020560; Fri, 11 Jun 2010 15:55:18 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BFtI2W020558; Fri, 11 Jun 2010 15:55:18 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006111555.o5BFtI2W020558@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 15:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209049 - stable/8/bin/pax X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:55:18 -0000 Author: uqs Date: Fri Jun 11 15:55:18 2010 New Revision: 209049 URL: http://svn.freebsd.org/changeset/base/209049 Log: iMFC r208484: Fix back references in substitute command for pax(1) pax(1) was trying to copy the back-referenced data from the match pattern, not the matched data. Approved by: re (kib) Modified: stable/8/bin/pax/pat_rep.c Directory Properties: stable/8/bin/pax/ (props changed) Modified: stable/8/bin/pax/pat_rep.c ============================================================================== --- stable/8/bin/pax/pat_rep.c Fri Jun 11 15:49:39 2010 (r209048) +++ stable/8/bin/pax/pat_rep.c Fri Jun 11 15:55:18 2010 (r209049) @@ -76,7 +76,7 @@ static char * range_match(char *, int); #ifdef NET2_REGEX static int resub(regexp *, char *, char *, char *); #else -static int resub(regex_t *, regmatch_t *, char *, char *, char *); +static int resub(regex_t *, regmatch_t *, char *, char *, char *, char *); #endif /* @@ -929,7 +929,7 @@ rep_name(char *name, int *nlen, int prnt # ifdef NET2_REGEX if ((res = resub(pt->rcmp,pt->nstr,outpt,endpt)) < 0) { # else - if ((res = resub(&(pt->rcmp),pm,pt->nstr,outpt,endpt)) + if ((res = resub(&(pt->rcmp),pm,inpt,pt->nstr,outpt,endpt)) < 0) { # endif if (prnt) @@ -1071,7 +1071,7 @@ resub(regexp *prog, char *src, char *des */ static int -resub(regex_t *rp, regmatch_t *pm, char *src, char *dest, +resub(regex_t *rp, regmatch_t *pm, char *orig, char *src, char *dest, char *destend) { char *spt; @@ -1121,7 +1121,7 @@ resub(regex_t *rp, regmatch_t *pm, char */ if (len > (destend - dpt)) len = destend - dpt; - if (l_strncpy(dpt, src + pmpt->rm_so, len) != len) + if (l_strncpy(dpt, orig + pmpt->rm_so, len) != len) return(-1); dpt += len; } From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 15:56:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F36A1065674; Fri, 11 Jun 2010 15:56:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EE3D8FC29; Fri, 11 Jun 2010 15:56:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BFuIe5020828; Fri, 11 Jun 2010 15:56:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BFuIEi020826; Fri, 11 Jun 2010 15:56:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006111556.o5BFuIEi020826@svn.freebsd.org> From: John Baldwin Date: Fri, 11 Jun 2010 15:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209050 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:56:18 -0000 Author: jhb Date: Fri Jun 11 15:56:18 2010 New Revision: 209050 URL: http://svn.freebsd.org/changeset/base/209050 Log: Add helper macros to iterate over available CPUs in the system. CPU_FOREACH(i) iterates over the CPU IDs of all available CPUs. The CPU_FIRST() and CPU_NEXT(i) macros can also be used to iterate over available CPU IDs. CPU_NEXT(i) wraps around to CPU_FIRST() rather than returning some sort of terminator. Requested by: rwatson Reviewed by: attilio Modified: head/sys/sys/smp.h Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Fri Jun 11 15:55:18 2010 (r209049) +++ head/sys/sys/smp.h Fri Jun 11 15:56:18 2010 (r209050) @@ -91,6 +91,44 @@ extern cpumask_t all_cpus; */ #define CPU_ABSENT(x_cpu) ((all_cpus & (1 << (x_cpu))) == 0) +/* + * Macros to iterate over non-absent CPUs. CPU_FOREACH() takes an + * integer iterator and iterates over the available set of CPUs. + * CPU_FIRST() returns the id of the first non-absent CPU. CPU_NEXT() + * returns the id of the next non-absent CPU. It will wrap back to + * CPU_FIRST() once the end of the list is reached. The iterators are + * currently implemented via inline functions. + */ +#define CPU_FOREACH(i) \ + for ((i) = 0; (i) <= mp_maxid; (i)++) \ + if (!CPU_ABSENT((i))) + +static __inline int +cpu_first(void) +{ + int i; + + for (i = 0;; i++) + if (!CPU_ABSENT(i)) + return (i); +} + +static __inline int +cpu_next(int i) +{ + + for (;;) { + i++; + if (i > mp_maxid) + i = 0; + if (!CPU_ABSENT(i)) + return (i); + } +} + +#define CPU_FIRST() cpu_first() +#define CPU_NEXT(i) cpu_next((i)) + #ifdef SMP /* * Machine dependent functions used to initialize MP support. From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 16:12:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75D43106564A; Fri, 11 Jun 2010 16:12:10 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 2B1ED8FC0A; Fri, 11 Jun 2010 16:12:09 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5BGC55k039477; Fri, 11 Jun 2010 10:12:06 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <201006110751.40735.jhb@freebsd.org> Date: Fri, 11 Jun 2010 10:12:05 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> To: John Baldwin , Marcel Moolenaar X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 16:12:10 -0000 On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: > On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: >> Author: marcel >> Date: Fri Jun 11 03:00:32 2010 >> New Revision: 209026 >> URL: http://svn.freebsd.org/changeset/base/209026 >>=20 >> Log: >> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) >> in particular, do not handle deferred DMA map load operations at all. >> Any error, and especially EINPROGRESS, is treated as a hard error and >> typically abort the current operation. The fact that the busdma code >> queues the load operation for when resources (i.e. bounce buffers in >> this particular case) are available makes this especially = problematic. >> Bounce buffering, unlike what the PR synopsis would suggest, works >> fine. >>=20 >> While on the subject, properly implement swi_vm(). >=20 > NIC drivers do not handle deferred load operations at all (note that=20= > bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce = BUS_DMA_NOWAIT). > It is common practice to just drop the packet in that case. >=20 Yes, long ago when network drivers started being converted to busdma, it = was agreed that EINPROGRESS simply doesn't make sense for them. Any = platform that winds up making extensive use of bounce buffers for = network hardware is going to perform poorly no matter what, and should = hopefully have some sort of IOMMU that can be used instead. Scott From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:02:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 215B6106566C; Fri, 11 Jun 2010 17:02:58 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 112448FC18; Fri, 11 Jun 2010 17:02:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BH2vvx035617; Fri, 11 Jun 2010 17:02:57 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BH2vUE035614; Fri, 11 Jun 2010 17:02:57 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006111702.o5BH2vUE035614@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 17:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209051 - in head/sbin: camcontrol gvinum X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:02:58 -0000 Author: uqs Date: Fri Jun 11 17:02:57 2010 New Revision: 209051 URL: http://svn.freebsd.org/changeset/base/209051 Log: Initialize variables before usage. Found by: clang static analyzer Found by: Coverity Prevent[tm] (CID 7736, 7760) Modified: head/sbin/camcontrol/modeedit.c head/sbin/gvinum/gvinum.c Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Fri Jun 11 15:56:18 2010 (r209050) +++ head/sbin/camcontrol/modeedit.c Fri Jun 11 17:02:57 2010 (r209051) @@ -394,6 +394,7 @@ load_format(const char *pagedb_path, int SLIST_INIT(&namelist); + c = '\0'; depth = 0; lineno = 0; found = 0; Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Fri Jun 11 15:56:18 2010 (r209050) +++ head/sbin/gvinum/gvinum.c Fri Jun 11 17:02:57 2010 (r209051) @@ -644,6 +644,7 @@ gvinum_detach(int argc, char **argv) struct gctl_req *req; int flags, i; + flags = 0; optreset = 1; optind = 1; while ((i = getopt(argc, argv, "f")) != -1) { From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:03:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B572106567C; Fri, 11 Jun 2010 17:03:04 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBD958FC14; Fri, 11 Jun 2010 17:03:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BH346u035688; Fri, 11 Jun 2010 17:03:04 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BH34I0035684; Fri, 11 Jun 2010 17:03:04 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006111703.o5BH34I0035684@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 17:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209052 - in head/sbin: ccdconfig gbde iscontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:03:05 -0000 Author: uqs Date: Fri Jun 11 17:03:04 2010 New Revision: 209052 URL: http://svn.freebsd.org/changeset/base/209052 Log: Remove dead variable assignments Found by: clang static analyzer Verified by: md5(1) Modified: head/sbin/ccdconfig/ccdconfig.c head/sbin/gbde/gbde.c head/sbin/iscontrol/config.c Modified: head/sbin/ccdconfig/ccdconfig.c ============================================================================== --- head/sbin/ccdconfig/ccdconfig.c Fri Jun 11 17:02:57 2010 (r209051) +++ head/sbin/ccdconfig/ccdconfig.c Fri Jun 11 17:03:04 2010 (r209052) @@ -177,11 +177,10 @@ do_single(int argc, char **argv, int act */ if (action == CCD_UNCONFIG || action == CCD_UNCONFIGALL) { ex = 0; - for (i = 0; argc != 0; ) { + for (; argc != 0;) { cp = *argv++; --argc; if ((ccd = resolve_ccdname(cp)) < 0) { warnx("invalid ccd name: %s", cp); - i = 1; continue; } grq = gctl_get_handle(); Modified: head/sbin/gbde/gbde.c ============================================================================== --- head/sbin/gbde/gbde.c Fri Jun 11 17:02:57 2010 (r209051) +++ head/sbin/gbde/gbde.c Fri Jun 11 17:03:04 2010 (r209052) @@ -750,7 +750,7 @@ main(int argc, char **argv) if (argc < 3) usage(); - if ((i = modfind("g_bde")) < 0) { + if (modfind("g_bde") < 0) { /* need to load the gbde module */ if (kldload(GBDEMOD) < 0 || modfind("g_bde") < 0) err(1, GBDEMOD ": Kernel module not available"); Modified: head/sbin/iscontrol/config.c ============================================================================== --- head/sbin/iscontrol/config.c Fri Jun 11 17:02:57 2010 (r209051) +++ head/sbin/iscontrol/config.c Fri Jun 11 17:03:04 2010 (r209052) @@ -249,7 +249,6 @@ getConfig(FILE *fd, char *key, char **Ar switch(state) { case 0: if((p = strchr(lp, '{')) != NULL) { - n = 0; while((--p > lp) && *p && isspace(*p)); n = p - lp; if(len && strncmp(lp, key, MAX(n, len)) == 0) From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:03:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2168106564A; Fri, 11 Jun 2010 17:03:26 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D195C8FC20; Fri, 11 Jun 2010 17:03:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BH3Qj9035793; Fri, 11 Jun 2010 17:03:26 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BH3Qrx035790; Fri, 11 Jun 2010 17:03:26 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201006111703.o5BH3Qrx035790@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 11 Jun 2010 17:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209053 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:03:27 -0000 Author: mdf Date: Fri Jun 11 17:03:26 2010 New Revision: 209053 URL: http://svn.freebsd.org/changeset/base/209053 Log: Add INVARIANTS checking that numfreebufs values are sane. Also add a per-buf flag to catch if a buf is double-counted in the free count. This code was useful to debug an instance where a local patch at Isilon was incorrectly managing numfreebufs for a new buf state. Reviewed by: jeff Approved by: zml (mentor) Modified: head/sys/kern/vfs_bio.c head/sys/sys/buf.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Jun 11 17:03:04 2010 (r209052) +++ head/sys/kern/vfs_bio.c Fri Jun 11 17:03:26 2010 (r209053) @@ -393,10 +393,16 @@ runningbufwakeup(struct buf *bp) */ static __inline void -bufcountwakeup(void) +bufcountwakeup(struct buf *bp) { + int old; - atomic_add_int(&numfreebuffers, 1); + KASSERT((bp->b_vflags & BV_INFREECNT) == 0, + ("buf %p already counted as free", bp)); + bp->b_vflags |= BV_INFREECNT; + old = atomic_fetchadd_int(&numfreebuffers, 1); + KASSERT(old >= 0 && old < nbuf, + ("numfreebuffers climbed to %d", old + 1)); mtx_lock(&nblock); if (needsbuffer) { needsbuffer &= ~VFS_BIO_NEED_ANY; @@ -592,7 +598,7 @@ bufinit(void) bp->b_rcred = NOCRED; bp->b_wcred = NOCRED; bp->b_qindex = QUEUE_EMPTY; - bp->b_vflags = 0; + bp->b_vflags = BV_INFREECNT; /* buf is counted as free */ bp->b_xflags = 0; LIST_INIT(&bp->b_dep); BUF_LOCKINIT(bp); @@ -686,6 +692,7 @@ bfreekva(struct buf *bp) void bremfree(struct buf *bp) { + int old; CTR3(KTR_BUF, "bremfree(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); KASSERT((bp->b_flags & B_REMFREE) == 0, @@ -696,8 +703,13 @@ bremfree(struct buf *bp) bp->b_flags |= B_REMFREE; /* Fixup numfreebuffers count. */ - if ((bp->b_flags & B_INVAL) || (bp->b_flags & B_DELWRI) == 0) - atomic_subtract_int(&numfreebuffers, 1); + if ((bp->b_flags & B_INVAL) || (bp->b_flags & B_DELWRI) == 0) { + KASSERT((bp->b_vflags & BV_INFREECNT) != 0, + ("buf %p not counted in numfreebuffers", bp)); + bp->b_vflags &= ~BV_INFREECNT; + old = atomic_fetchadd_int(&numfreebuffers, -1); + KASSERT(old > 0, ("numfreebuffers dropped to %d", old - 1)); + } } /* @@ -723,6 +735,8 @@ bremfreef(struct buf *bp) static void bremfreel(struct buf *bp) { + int old; + CTR3(KTR_BUF, "bremfreel(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); KASSERT(bp->b_qindex != QUEUE_NONE, @@ -745,8 +759,13 @@ bremfreel(struct buf *bp) * delayed-write, the buffer was free and we must decrement * numfreebuffers. */ - if ((bp->b_flags & B_INVAL) || (bp->b_flags & B_DELWRI) == 0) - atomic_subtract_int(&numfreebuffers, 1); + if ((bp->b_flags & B_INVAL) || (bp->b_flags & B_DELWRI) == 0) { + KASSERT((bp->b_vflags & BV_INFREECNT) != 0, + ("buf %p not counted in numfreebuffers", bp)); + bp->b_vflags &= ~BV_INFREECNT; + old = atomic_fetchadd_int(&numfreebuffers, -1); + KASSERT(old > 0, ("numfreebuffers dropped to %d", old - 1)); + } } @@ -1448,7 +1467,7 @@ brelse(struct buf *bp) */ if (!(bp->b_flags & B_DELWRI)) - bufcountwakeup(); + bufcountwakeup(bp); /* * Something we can maybe free or reuse @@ -1537,7 +1556,7 @@ bqrelse(struct buf *bp) mtx_unlock(&bqlock); if ((bp->b_flags & B_INVAL) || !(bp->b_flags & B_DELWRI)) - bufcountwakeup(); + bufcountwakeup(bp); /* * Something we can maybe free or reuse. @@ -1916,6 +1935,8 @@ restart: bp->b_flags = 0; bp->b_ioflags = 0; bp->b_xflags = 0; + KASSERT((bp->b_vflags & BV_INFREECNT) == 0, + ("buf %p still counted as free?", bp)); bp->b_vflags = 0; bp->b_vp = NULL; bp->b_blkno = bp->b_lblkno = 0; @@ -4103,4 +4124,27 @@ DB_SHOW_COMMAND(vnodebufs, db_show_vnode db_printf("\n"); } } + +DB_COMMAND(countfreebufs, db_coundfreebufs) +{ + struct buf *bp; + int i, used = 0, nfree = 0; + + if (have_addr) { + db_printf("usage: countfreebufs\n"); + return; + } + + for (i = 0; i < nbuf; i++) { + bp = &buf[i]; + if ((bp->b_vflags & BV_INFREECNT) != 0) + nfree++; + else + used++; + } + + db_printf("Counted %d free, %d used (%d tot)\n", nfree, used, + nfree + used); + db_printf("numfreebuffers is %d\n", numfreebuffers); +} #endif /* DDB */ Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri Jun 11 17:03:04 2010 (r209052) +++ head/sys/sys/buf.h Fri Jun 11 17:03:26 2010 (r209053) @@ -247,6 +247,7 @@ struct buf { #define BV_SCANNED 0x00000001 /* VOP_FSYNC funcs mark written bufs */ #define BV_BKGRDINPROG 0x00000002 /* Background write in progress */ #define BV_BKGRDWAIT 0x00000004 /* Background write waiting */ +#define BV_INFREECNT 0x80000000 /* buf is counted in numfreebufs */ #ifdef _KERNEL /* From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:05:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BBF1106567D; Fri, 11 Jun 2010 17:05:01 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA618FC14; Fri, 11 Jun 2010 17:05:01 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp025.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3V00IM60RPUQ70@asmtp025.mac.com>; Fri, 11 Jun 2010 10:04:38 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006110108 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-11_02:2010-02-06, 2010-06-11, 2010-06-11 signatures=0 From: Marcel Moolenaar In-reply-to: <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> Date: Fri, 11 Jun 2010 10:04:36 -0700 Message-id: <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> To: Scott Long X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:05:01 -0000 On Jun 11, 2010, at 9:12 AM, Scott Long wrote: > On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: >> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: >>> Author: marcel >>> Date: Fri Jun 11 03:00:32 2010 >>> New Revision: 209026 >>> URL: http://svn.freebsd.org/changeset/base/209026 >>> >>> Log: >>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) >>> in particular, do not handle deferred DMA map load operations at all. >>> Any error, and especially EINPROGRESS, is treated as a hard error and >>> typically abort the current operation. The fact that the busdma code >>> queues the load operation for when resources (i.e. bounce buffers in >>> this particular case) are available makes this especially problematic. >>> Bounce buffering, unlike what the PR synopsis would suggest, works >>> fine. >>> >>> While on the subject, properly implement swi_vm(). >> >> NIC drivers do not handle deferred load operations at all (note that >> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce BUS_DMA_NOWAIT). >> It is common practice to just drop the packet in that case. >> > > Yes, long ago when network drivers started being converted to busdma, it was agreed that EINPROGRESS simply doesn't make sense for them. Any platform that winds up making extensive use of bounce buffers for network hardware is going to perform poorly no matter what, and should hopefully have some sort of IOMMU that can be used instead. Unfortunately things aren't as simple as is presented. For one, bge(4) wedges as soon as the platform runs out of bounce buffers when they're needed. The box needs to be reset in order to get the interface back. I pick any implementation that remains functional over a mis-optimized one that breaks. Deferred load operations are more performance optimal than failure is. Also: the kernel does nothing to guarantee maximum availability of DMA-able memory under load, so bounce buffers (or use of I/O MMUs for that matter) are a reality. Here too the performance argument doesn't necessarily hold because the kernel may be busy with more than just sending and receiving packets and the need to defer load operations is very appropriate. If the alternative is just dropped packets, I'm fine with that too, but I for one cannot say that *not* filling a H/W ring with buffers is not going to wedge the hardware in some cases. Plus: SGI Altix does not have any DMA-able memory for 32-bit hardware. The need for an I/O MMU is absolute and since there are typically less mapping registers than packets on a ring, the need for deferred operation seems quite acceptable if the alternative is, again, failure to operate. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:05:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC791065693; Fri, 11 Jun 2010 17:05:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5D7438FC23; Fri, 11 Jun 2010 17:05:05 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 0EE8C46C7A; Fri, 11 Jun 2010 13:05:05 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 522288A050; Fri, 11 Jun 2010 13:05:04 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 11 Jun 2010 13:04:49 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006111556.o5BFuIEi020826@svn.freebsd.org> In-Reply-To: <201006111556.o5BFuIEi020826@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201006111304.49966.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 13:05:04 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r209050 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:05:05 -0000 On Friday 11 June 2010 11:56:18 am John Baldwin wrote: > Author: jhb > Date: Fri Jun 11 15:56:18 2010 > New Revision: 209050 > URL: http://svn.freebsd.org/changeset/base/209050 > > Log: > Add helper macros to iterate over available CPUs in the system. > CPU_FOREACH(i) iterates over the CPU IDs of all available CPUs. The > CPU_FIRST() and CPU_NEXT(i) macros can also be used to iterate over > available CPU IDs. CPU_NEXT(i) wraps around to CPU_FIRST() rather than > returning some sort of terminator. The intended use case for CPU_FIRST() and CPU_NEXT() is to use it to do things like this: u_int hash[64]; int i, j; j = CPU_FIRST(); for (i = 0; i < 64; i++) { hash[i] = j; j = CPU_NEXT(j); } If the auto-wrapping semantics of CPU_NEXT() is too odd, we could make it return NOCPU when it hits the end of the list instead perhaps and use some other macro to provide the current CPU_NEXT()-like behavior. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:21:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD4AC106564A; Fri, 11 Jun 2010 17:21:28 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id A4D4B8FC1C; Fri, 11 Jun 2010 17:21:28 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5BHLOdH039802; Fri, 11 Jun 2010 11:21:24 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> Date: Fri, 11 Jun 2010 11:21:24 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:21:29 -0000 On Jun 11, 2010, at 11:04 AM, Marcel Moolenaar wrote: >=20 > On Jun 11, 2010, at 9:12 AM, Scott Long wrote: >=20 >> On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: >>> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: >>>> Author: marcel >>>> Date: Fri Jun 11 03:00:32 2010 >>>> New Revision: 209026 >>>> URL: http://svn.freebsd.org/changeset/base/209026 >>>>=20 >>>> Log: >>>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, = bge(4) >>>> in particular, do not handle deferred DMA map load operations at = all. >>>> Any error, and especially EINPROGRESS, is treated as a hard error = and >>>> typically abort the current operation. The fact that the busdma = code >>>> queues the load operation for when resources (i.e. bounce buffers = in >>>> this particular case) are available makes this especially = problematic. >>>> Bounce buffering, unlike what the PR synopsis would suggest, works >>>> fine. >>>>=20 >>>> While on the subject, properly implement swi_vm(). >>>=20 >>> NIC drivers do not handle deferred load operations at all (note that=20= >>> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce = BUS_DMA_NOWAIT). >>> It is common practice to just drop the packet in that case. >>>=20 >>=20 >> Yes, long ago when network drivers started being converted to busdma, = it was agreed that EINPROGRESS simply doesn't make sense for them. Any = platform that winds up making extensive use of bounce buffers for = network hardware is going to perform poorly no matter what, and should = hopefully have some sort of IOMMU that can be used instead. >=20 > Unfortunately things aren't as simple as is presented. >=20 > For one, bge(4) wedges as soon as the platform runs out of bounce > buffers when they're needed. The box needs to be reset in order to > get the interface back. I pick any implementation that remains > functional over a mis-optimized one that breaks. Deferred load > operations are more performance optimal than failure is. >=20 This sounds like a bug in the bge driver. I don't see if through casual = inspection, but the driver should be able to either drop the mbuf = entirely, or requeue it on the ifq and then restart the ifq later. > Also: the kernel does nothing to guarantee maximum availability > of DMA-able memory under load, so bounce buffers (or use of I/O > MMUs for that matter) are a reality. Here too the performance > argument doesn't necessarily hold because the kernel may be > busy with more than just sending and receiving packets and the > need to defer load operations is very appropriate. If the > alternative is just dropped packets, I'm fine with that too, > but I for one cannot say that *not* filling a H/W ring with > buffers is not going to wedge the hardware in some cases. >=20 > Plus: SGI Altix does not have any DMA-able memory for 32-bit > hardware. The need for an I/O MMU is absolute and since there > are typically less mapping registers than packets on a ring, > the need for deferred operation seems quite acceptable if the > alternative is, again, failure to operate. >=20 I'm not against you upping the bounce buffer limit for a particular = platform, but it's still unclear to me if (given bug-free drivers) it's = worth the effort to defer a load rather than just drop the packet and = let the stack retry it. One question that would be good to answer is = wether the failed load is happening in the RX to TX path. Scott From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:28:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BB5B106566C; Fri, 11 Jun 2010 17:28:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 481018FC14; Fri, 11 Jun 2010 17:28:33 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id CB62046B8E; Fri, 11 Jun 2010 13:28:32 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E33DE8A03C; Fri, 11 Jun 2010 13:28:30 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Date: Fri, 11 Jun 2010 13:28:07 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006110300.o5B30X9q045387@svn.freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> In-Reply-To: <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006111328.07875.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 13:28:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:28:33 -0000 On Friday 11 June 2010 1:04:36 pm Marcel Moolenaar wrote: > > On Jun 11, 2010, at 9:12 AM, Scott Long wrote: > > > On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: > >> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: > >>> Author: marcel > >>> Date: Fri Jun 11 03:00:32 2010 > >>> New Revision: 209026 > >>> URL: http://svn.freebsd.org/changeset/base/209026 > >>> > >>> Log: > >>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) > >>> in particular, do not handle deferred DMA map load operations at all. > >>> Any error, and especially EINPROGRESS, is treated as a hard error and > >>> typically abort the current operation. The fact that the busdma code > >>> queues the load operation for when resources (i.e. bounce buffers in > >>> this particular case) are available makes this especially problematic. > >>> Bounce buffering, unlike what the PR synopsis would suggest, works > >>> fine. > >>> > >>> While on the subject, properly implement swi_vm(). > >> > >> NIC drivers do not handle deferred load operations at all (note that > >> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce BUS_DMA_NOWAIT). > >> It is common practice to just drop the packet in that case. > >> > > > > Yes, long ago when network drivers started being converted to busdma, it was agreed that EINPROGRESS simply doesn't make sense for them. Any platform that winds up making extensive use of bounce buffers for network hardware is going to perform poorly no matter what, and should hopefully have some sort of IOMMU that can be used instead. > > Unfortunately things aren't as simple as is presented. > > For one, bge(4) wedges as soon as the platform runs out of bounce > buffers when they're needed. The box needs to be reset in order to > get the interface back. I pick any implementation that remains > functional over a mis-optimized one that breaks. Deferred load > operations are more performance optimal than failure is. > > Also: the kernel does nothing to guarantee maximum availability > of DMA-able memory under load, so bounce buffers (or use of I/O > MMUs for that matter) are a reality. Here too the performance > argument doesn't necessarily hold because the kernel may be > busy with more than just sending and receiving packets and the > need to defer load operations is very appropriate. If the > alternative is just dropped packets, I'm fine with that too, > but I for one cannot say that *not* filling a H/W ring with > buffers is not going to wedge the hardware in some cases. > > Plus: SGI Altix does not have any DMA-able memory for 32-bit > hardware. The need for an I/O MMU is absolute and since there > are typically less mapping registers than packets on a ring, > the need for deferred operation seems quite acceptable if the > alternative is, again, failure to operate. I think in this case since you have already accepted the cost of copying the data via bounce buffers, you would be better off allocating slabs of memory via bus_dmamem_alloc() such that you can fit multiple receive buffers into a single IOMMU entry and then copying received packet data out into an mbuf that gets passed up the stack during rx interrupt handling. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:31:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A18091065675; Fri, 11 Jun 2010 17:31:20 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 561F78FC12; Fri, 11 Jun 2010 17:31:19 +0000 (UTC) Received: by pwj1 with SMTP id 1so912819pwj.13 for ; Fri, 11 Jun 2010 10:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=rGSK5aDI+Bk3OaBpqSEPh1NmkyEj3FDVt9UYhpxMCFg=; b=Ns/3mrMaSBMxBQCGQfA+7GeXf/vzvdp7iSK9eG0Gxvp0CMBm+K2h4Sab689ymZK+lw y/mRVyQrTE0shlrIUhoNflkHS2GYT2tR+/4kKcmqRL4VxhdHgUZaLsPucHngnV8DH9bm jkvwnWiTqJyNry66d2My+B/7wnDN9FunrrAAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=UbWsg/94CVGqmJuEA7+vXO3nOQ2tquUSALOOajS9A30Ze2+zpstjPqjcatA+4nBB0d QVCkIgIE7hEFoQkuQL6MNcdH9nXCVLsrUe5O7CWLAkIHEiEhKbV4L8WzJJk9ywP9sHPk FKwk0QbTH2eyxsoJAnce/rnggos9IS8v2ilrc= Received: by 10.115.39.17 with SMTP id r17mr1722182waj.40.1276277479497; Fri, 11 Jun 2010 10:31:19 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 33sm15827302wad.20.2010.06.11.10.31.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 10:31:18 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 11 Jun 2010 10:29:57 -0700 From: Pyun YongHyeon Date: Fri, 11 Jun 2010 10:29:57 -0700 To: Scott Long Message-ID: <20100611172957.GB13776@michelle.cdnetworks.com> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:31:20 -0000 On Fri, Jun 11, 2010 at 11:21:24AM -0600, Scott Long wrote: > On Jun 11, 2010, at 11:04 AM, Marcel Moolenaar wrote: > > > > On Jun 11, 2010, at 9:12 AM, Scott Long wrote: > > > >> On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: > >>> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: > >>>> Author: marcel > >>>> Date: Fri Jun 11 03:00:32 2010 > >>>> New Revision: 209026 > >>>> URL: http://svn.freebsd.org/changeset/base/209026 > >>>> > >>>> Log: > >>>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) > >>>> in particular, do not handle deferred DMA map load operations at all. > >>>> Any error, and especially EINPROGRESS, is treated as a hard error and > >>>> typically abort the current operation. The fact that the busdma code > >>>> queues the load operation for when resources (i.e. bounce buffers in > >>>> this particular case) are available makes this especially problematic. > >>>> Bounce buffering, unlike what the PR synopsis would suggest, works > >>>> fine. > >>>> > >>>> While on the subject, properly implement swi_vm(). > >>> > >>> NIC drivers do not handle deferred load operations at all (note that > >>> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce BUS_DMA_NOWAIT). > >>> It is common practice to just drop the packet in that case. > >>> > >> > >> Yes, long ago when network drivers started being converted to busdma, it was agreed that EINPROGRESS simply doesn't make sense for them. Any platform that winds up making extensive use of bounce buffers for network hardware is going to perform poorly no matter what, and should hopefully have some sort of IOMMU that can be used instead. > > > > Unfortunately things aren't as simple as is presented. > > > > For one, bge(4) wedges as soon as the platform runs out of bounce > > buffers when they're needed. The box needs to be reset in order to > > get the interface back. I pick any implementation that remains > > functional over a mis-optimized one that breaks. Deferred load > > operations are more performance optimal than failure is. > > > > This sounds like a bug in the bge driver. I don't see if through casual inspection, but the driver should be able to either drop the mbuf entirely, or requeue it on the ifq and then restart the ifq later. > For TX path, bge(4) requeues the TX frame in case of bus_dmamap_load_mbuf_sg(9) failure. For RX path, bge(4) drops received frame and reuses previously loaded RX buffer. If bus_dmamap_load_mbuf_sg(9) always returns EINPROGRESS, bge(4) could not send/receive frames though. > > Also: the kernel does nothing to guarantee maximum availability > > of DMA-able memory under load, so bounce buffers (or use of I/O > > MMUs for that matter) are a reality. Here too the performance > > argument doesn't necessarily hold because the kernel may be > > busy with more than just sending and receiving packets and the > > need to defer load operations is very appropriate. If the > > alternative is just dropped packets, I'm fine with that too, > > but I for one cannot say that *not* filling a H/W ring with > > buffers is not going to wedge the hardware in some cases. > > > > Plus: SGI Altix does not have any DMA-able memory for 32-bit > > hardware. The need for an I/O MMU is absolute and since there > > are typically less mapping registers than packets on a ring, > > the need for deferred operation seems quite acceptable if the > > alternative is, again, failure to operate. > > > > I'm not against you upping the bounce buffer limit for a particular platform, but it's still unclear to me if (given bug-free drivers) it's worth the effort to defer a load rather than just drop the packet and let the stack retry it. One question that would be good to answer is wether the failed load is happening in the RX to TX path. > > Scott > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:32:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBBC5106566C; Fri, 11 Jun 2010 17:32:51 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98]) by mx1.freebsd.org (Postfix) with ESMTP id 9C49E8FC20; Fri, 11 Jun 2010 17:32:51 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3V00DRJ22QWR40@asmtp023.mac.com>; Fri, 11 Jun 2010 10:32:51 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006110109 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-11_02:2010-02-06, 2010-06-11, 2010-06-11 signatures=0 From: Marcel Moolenaar In-reply-to: Date: Fri, 11 Jun 2010 10:32:49 -0700 Message-id: <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> To: Scott Long X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:32:52 -0000 On Jun 11, 2010, at 10:21 AM, Scott Long wrote: > On Jun 11, 2010, at 11:04 AM, Marcel Moolenaar wrote: >> >> On Jun 11, 2010, at 9:12 AM, Scott Long wrote: >> >>> On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: >>>> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: >>>>> Author: marcel >>>>> Date: Fri Jun 11 03:00:32 2010 >>>>> New Revision: 209026 >>>>> URL: http://svn.freebsd.org/changeset/base/209026 >>>>> >>>>> Log: >>>>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) >>>>> in particular, do not handle deferred DMA map load operations at all. >>>>> Any error, and especially EINPROGRESS, is treated as a hard error and >>>>> typically abort the current operation. The fact that the busdma code >>>>> queues the load operation for when resources (i.e. bounce buffers in >>>>> this particular case) are available makes this especially problematic. >>>>> Bounce buffering, unlike what the PR synopsis would suggest, works >>>>> fine. >>>>> >>>>> While on the subject, properly implement swi_vm(). >>>> >>>> NIC drivers do not handle deferred load operations at all (note that >>>> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce BUS_DMA_NOWAIT). >>>> It is common practice to just drop the packet in that case. >>>> >>> >>> Yes, long ago when network drivers started being converted to busdma, it was agreed that EINPROGRESS simply doesn't make sense for them. Any platform that winds up making extensive use of bounce buffers for network hardware is going to perform poorly no matter what, and should hopefully have some sort of IOMMU that can be used instead. >> >> Unfortunately things aren't as simple as is presented. >> >> For one, bge(4) wedges as soon as the platform runs out of bounce >> buffers when they're needed. The box needs to be reset in order to >> get the interface back. I pick any implementation that remains >> functional over a mis-optimized one that breaks. Deferred load >> operations are more performance optimal than failure is. >> > > This sounds like a bug in the bge driver. I don't see if through casual inspection, but the driver should be able to either drop the mbuf entirely, or requeue it on the ifq and then restart the ifq later. > >> Also: the kernel does nothing to guarantee maximum availability >> of DMA-able memory under load, so bounce buffers (or use of I/O >> MMUs for that matter) are a reality. Here too the performance >> argument doesn't necessarily hold because the kernel may be >> busy with more than just sending and receiving packets and the >> need to defer load operations is very appropriate. If the >> alternative is just dropped packets, I'm fine with that too, >> but I for one cannot say that *not* filling a H/W ring with >> buffers is not going to wedge the hardware in some cases. >> >> Plus: SGI Altix does not have any DMA-able memory for 32-bit >> hardware. The need for an I/O MMU is absolute and since there >> are typically less mapping registers than packets on a ring, >> the need for deferred operation seems quite acceptable if the >> alternative is, again, failure to operate. >> > > I'm not against you upping the bounce buffer limit for a particular platform, but it's still unclear to me if (given bug-free drivers) it's worth the effort to defer a load rather than just drop the packet and let the stack retry it. One question that would be good to answer is wether the failed load is happening in the RX to TX path. RX path I believe. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:37:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4823A1065672; Fri, 11 Jun 2010 17:37:40 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id D453D8FC1A; Fri, 11 Jun 2010 17:37:39 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5BHbaLB039896; Fri, 11 Jun 2010 11:37:36 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> Date: Fri, 11 Jun 2010 11:37:36 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:37:40 -0000 On Jun 11, 2010, at 11:32 AM, Marcel Moolenaar wrote: >=20 > On Jun 11, 2010, at 10:21 AM, Scott Long wrote: >=20 >> On Jun 11, 2010, at 11:04 AM, Marcel Moolenaar wrote: >>>=20 >>> On Jun 11, 2010, at 9:12 AM, Scott Long wrote: >>>=20 >>>> On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: >>>>> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: >>>>>> Author: marcel >>>>>> Date: Fri Jun 11 03:00:32 2010 >>>>>> New Revision: 209026 >>>>>> URL: http://svn.freebsd.org/changeset/base/209026 >>>>>>=20 >>>>>> Log: >>>>>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, = bge(4) >>>>>> in particular, do not handle deferred DMA map load operations at = all. >>>>>> Any error, and especially EINPROGRESS, is treated as a hard error = and >>>>>> typically abort the current operation. The fact that the busdma = code >>>>>> queues the load operation for when resources (i.e. bounce buffers = in >>>>>> this particular case) are available makes this especially = problematic. >>>>>> Bounce buffering, unlike what the PR synopsis would suggest, = works >>>>>> fine. >>>>>>=20 >>>>>> While on the subject, properly implement swi_vm(). >>>>>=20 >>>>> NIC drivers do not handle deferred load operations at all (note = that=20 >>>>> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce = BUS_DMA_NOWAIT). >>>>> It is common practice to just drop the packet in that case. >>>>>=20 >>>>=20 >>>> Yes, long ago when network drivers started being converted to = busdma, it was agreed that EINPROGRESS simply doesn't make sense for = them. Any platform that winds up making extensive use of bounce buffers = for network hardware is going to perform poorly no matter what, and = should hopefully have some sort of IOMMU that can be used instead. >>>=20 >>> Unfortunately things aren't as simple as is presented. >>>=20 >>> For one, bge(4) wedges as soon as the platform runs out of bounce >>> buffers when they're needed. The box needs to be reset in order to >>> get the interface back. I pick any implementation that remains >>> functional over a mis-optimized one that breaks. Deferred load >>> operations are more performance optimal than failure is. >>>=20 >>=20 >> This sounds like a bug in the bge driver. I don't see if through = casual inspection, but the driver should be able to either drop the mbuf = entirely, or requeue it on the ifq and then restart the ifq later. >>=20 >>> Also: the kernel does nothing to guarantee maximum availability >>> of DMA-able memory under load, so bounce buffers (or use of I/O >>> MMUs for that matter) are a reality. Here too the performance >>> argument doesn't necessarily hold because the kernel may be >>> busy with more than just sending and receiving packets and the >>> need to defer load operations is very appropriate. If the >>> alternative is just dropped packets, I'm fine with that too, >>> but I for one cannot say that *not* filling a H/W ring with >>> buffers is not going to wedge the hardware in some cases. >>>=20 >>> Plus: SGI Altix does not have any DMA-able memory for 32-bit >>> hardware. The need for an I/O MMU is absolute and since there >>> are typically less mapping registers than packets on a ring, >>> the need for deferred operation seems quite acceptable if the >>> alternative is, again, failure to operate. >>>=20 >>=20 >> I'm not against you upping the bounce buffer limit for a particular = platform, but it's still unclear to me if (given bug-free drivers) it's = worth the effort to defer a load rather than just drop the packet and = let the stack retry it. One question that would be good to answer is = wether the failed load is happening in the RX to TX path. >=20 > RX path I believe. >=20 I'm not clear why you even need bounce buffers for RX. The chip = supports 64bit addresses with no boundary or alignment restrictions. Scott From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:38:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 594821065673; Fri, 11 Jun 2010 17:38:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4885C8FC0A; Fri, 11 Jun 2010 17:38:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BHcO02043512; Fri, 11 Jun 2010 17:38:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BHcOTQ043510; Fri, 11 Jun 2010 17:38:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006111738.o5BHcOTQ043510@svn.freebsd.org> From: Xin LI Date: Fri, 11 Jun 2010 17:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209054 - stable/8/bin/pax X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:38:24 -0000 Author: delphij Date: Fri Jun 11 17:38:24 2010 New Revision: 209054 URL: http://svn.freebsd.org/changeset/base/209054 Log: MFC r205940: Remove unused files. PR: bin/38256 Approved by: re (kib) Deleted: stable/8/bin/pax/cpio.1 stable/8/bin/pax/tar.1 Modified: stable/8/bin/pax/Makefile Directory Properties: stable/8/bin/pax/ (props changed) Modified: stable/8/bin/pax/Makefile ============================================================================== --- stable/8/bin/pax/Makefile Fri Jun 11 17:03:26 2010 (r209053) +++ stable/8/bin/pax/Makefile Fri Jun 11 17:38:24 2010 (r209054) @@ -29,9 +29,6 @@ PROG= pax SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \ gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c -#XXX NOTYET -#MAN= pax.1 tar.1 cpio.1 -#LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio .if ${MACHINE_ARCH} == "arm" WARNS?= 3 From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:43:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23B4D1065670; Fri, 11 Jun 2010 17:43:00 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id C8CC48FC1C; Fri, 11 Jun 2010 17:42:59 +0000 (UTC) Received: by pwj1 with SMTP id 1so925527pwj.13 for ; Fri, 11 Jun 2010 10:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=eYrfFAMC0z01LkLv17aV3RUhJk7DYEePOrzjTP6bRLo=; b=m0XebXJVAyCrCK3MA2Ru5LMgIE1bYats3YLVerwzg389+bp13z9NDLFGnFWUHsvcsR 63yGU2YJNb7Oa+3AzqYPs3Rmv33YQynp9bmwdjC93I8HmxSrMiOzELOFPQ7Z9R6A/iUJ 9sCDWnmOFxajD8ztU+p34GAIY9TAZ5NhHIqXc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=aS+P3XSX2gfzy7UPKtCdHdCnBR9owVOMWtu0FYvXgCSfONjOF1pe8jd0Qpfq+JLRlP K7Yubj3MkmPPL0C719NYAXJq7GTvf3h41vFasAtSThrMzHNrx3w//bo/JBAtby0uwzLs TV5qaeL+EVxtTvgusbjt0ikuZTfKSb+8MdKuw= Received: by 10.141.187.20 with SMTP id o20mr1677897rvp.13.1276278179112; Fri, 11 Jun 2010 10:42:59 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id f20sm1425323rvb.3.2010.06.11.10.42.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 10:42:58 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 11 Jun 2010 10:41:37 -0700 From: Pyun YongHyeon Date: Fri, 11 Jun 2010 10:41:37 -0700 To: Scott Long Message-ID: <20100611174137.GC13776@michelle.cdnetworks.com> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:43:00 -0000 On Fri, Jun 11, 2010 at 11:37:36AM -0600, Scott Long wrote: > On Jun 11, 2010, at 11:32 AM, Marcel Moolenaar wrote: > > > > On Jun 11, 2010, at 10:21 AM, Scott Long wrote: > > > >> On Jun 11, 2010, at 11:04 AM, Marcel Moolenaar wrote: > >>> > >>> On Jun 11, 2010, at 9:12 AM, Scott Long wrote: > >>> > >>>> On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: > >>>>> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: > >>>>>> Author: marcel > >>>>>> Date: Fri Jun 11 03:00:32 2010 > >>>>>> New Revision: 209026 > >>>>>> URL: http://svn.freebsd.org/changeset/base/209026 > >>>>>> > >>>>>> Log: > >>>>>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) > >>>>>> in particular, do not handle deferred DMA map load operations at all. > >>>>>> Any error, and especially EINPROGRESS, is treated as a hard error and > >>>>>> typically abort the current operation. The fact that the busdma code > >>>>>> queues the load operation for when resources (i.e. bounce buffers in > >>>>>> this particular case) are available makes this especially problematic. > >>>>>> Bounce buffering, unlike what the PR synopsis would suggest, works > >>>>>> fine. > >>>>>> > >>>>>> While on the subject, properly implement swi_vm(). > >>>>> > >>>>> NIC drivers do not handle deferred load operations at all (note that > >>>>> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce BUS_DMA_NOWAIT). > >>>>> It is common practice to just drop the packet in that case. > >>>>> > >>>> > >>>> Yes, long ago when network drivers started being converted to busdma, it was agreed that EINPROGRESS simply doesn't make sense for them. Any platform that winds up making extensive use of bounce buffers for network hardware is going to perform poorly no matter what, and should hopefully have some sort of IOMMU that can be used instead. > >>> > >>> Unfortunately things aren't as simple as is presented. > >>> > >>> For one, bge(4) wedges as soon as the platform runs out of bounce > >>> buffers when they're needed. The box needs to be reset in order to > >>> get the interface back. I pick any implementation that remains > >>> functional over a mis-optimized one that breaks. Deferred load > >>> operations are more performance optimal than failure is. > >>> > >> > >> This sounds like a bug in the bge driver. I don't see if through casual inspection, but the driver should be able to either drop the mbuf entirely, or requeue it on the ifq and then restart the ifq later. > >> > >>> Also: the kernel does nothing to guarantee maximum availability > >>> of DMA-able memory under load, so bounce buffers (or use of I/O > >>> MMUs for that matter) are a reality. Here too the performance > >>> argument doesn't necessarily hold because the kernel may be > >>> busy with more than just sending and receiving packets and the > >>> need to defer load operations is very appropriate. If the > >>> alternative is just dropped packets, I'm fine with that too, > >>> but I for one cannot say that *not* filling a H/W ring with > >>> buffers is not going to wedge the hardware in some cases. > >>> > >>> Plus: SGI Altix does not have any DMA-able memory for 32-bit > >>> hardware. The need for an I/O MMU is absolute and since there > >>> are typically less mapping registers than packets on a ring, > >>> the need for deferred operation seems quite acceptable if the > >>> alternative is, again, failure to operate. > >>> > >> > >> I'm not against you upping the bounce buffer limit for a particular platform, but it's still unclear to me if (given bug-free drivers) it's worth the effort to defer a load rather than just drop the packet and let the stack retry it. One question that would be good to answer is wether the failed load is happening in the RX to TX path. > > > > RX path I believe. > > > > I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. > Some controllers have 4G boundary bug so bge(4) restricts dma address space. > Scott > > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:44:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ACB8106566B; Fri, 11 Jun 2010 17:44:43 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id B9AA38FC13; Fri, 11 Jun 2010 17:44:42 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5BHidN1039948; Fri, 11 Jun 2010 11:44:39 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <20100611174137.GC13776@michelle.cdnetworks.com> Date: Fri, 11 Jun 2010 11:44:39 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <20100611174137.GC13776@michelle.cdnetworks.com> To: pyunyh@gmail.com X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:44:43 -0000 On Jun 11, 2010, at 11:41 AM, Pyun YongHyeon wrote: > On Fri, Jun 11, 2010 at 11:37:36AM -0600, Scott Long wrote: >> On Jun 11, 2010, at 11:32 AM, Marcel Moolenaar wrote: >>>=20 >>> On Jun 11, 2010, at 10:21 AM, Scott Long wrote: >>>=20 >>>> On Jun 11, 2010, at 11:04 AM, Marcel Moolenaar wrote: >>>>>=20 >>>>> On Jun 11, 2010, at 9:12 AM, Scott Long wrote: >>>>>=20 >>>>>> On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: >>>>>>> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: >>>>>>>> Author: marcel >>>>>>>> Date: Fri Jun 11 03:00:32 2010 >>>>>>>> New Revision: 209026 >>>>>>>> URL: http://svn.freebsd.org/changeset/base/209026 >>>>>>>>=20 >>>>>>>> Log: >>>>>>>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, = bge(4) >>>>>>>> in particular, do not handle deferred DMA map load operations = at all. >>>>>>>> Any error, and especially EINPROGRESS, is treated as a hard = error and >>>>>>>> typically abort the current operation. The fact that the busdma = code >>>>>>>> queues the load operation for when resources (i.e. bounce = buffers in >>>>>>>> this particular case) are available makes this especially = problematic. >>>>>>>> Bounce buffering, unlike what the PR synopsis would suggest, = works >>>>>>>> fine. >>>>>>>>=20 >>>>>>>> While on the subject, properly implement swi_vm(). >>>>>>>=20 >>>>>>> NIC drivers do not handle deferred load operations at all (note = that=20 >>>>>>> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce = BUS_DMA_NOWAIT). >>>>>>> It is common practice to just drop the packet in that case. >>>>>>>=20 >>>>>>=20 >>>>>> Yes, long ago when network drivers started being converted to = busdma, it was agreed that EINPROGRESS simply doesn't make sense for = them. Any platform that winds up making extensive use of bounce buffers = for network hardware is going to perform poorly no matter what, and = should hopefully have some sort of IOMMU that can be used instead. >>>>>=20 >>>>> Unfortunately things aren't as simple as is presented. >>>>>=20 >>>>> For one, bge(4) wedges as soon as the platform runs out of bounce >>>>> buffers when they're needed. The box needs to be reset in order to >>>>> get the interface back. I pick any implementation that remains >>>>> functional over a mis-optimized one that breaks. Deferred load >>>>> operations are more performance optimal than failure is. >>>>>=20 >>>>=20 >>>> This sounds like a bug in the bge driver. I don't see if through = casual inspection, but the driver should be able to either drop the mbuf = entirely, or requeue it on the ifq and then restart the ifq later. >>>>=20 >>>>> Also: the kernel does nothing to guarantee maximum availability >>>>> of DMA-able memory under load, so bounce buffers (or use of I/O >>>>> MMUs for that matter) are a reality. Here too the performance >>>>> argument doesn't necessarily hold because the kernel may be >>>>> busy with more than just sending and receiving packets and the >>>>> need to defer load operations is very appropriate. If the >>>>> alternative is just dropped packets, I'm fine with that too, >>>>> but I for one cannot say that *not* filling a H/W ring with >>>>> buffers is not going to wedge the hardware in some cases. >>>>>=20 >>>>> Plus: SGI Altix does not have any DMA-able memory for 32-bit >>>>> hardware. The need for an I/O MMU is absolute and since there >>>>> are typically less mapping registers than packets on a ring, >>>>> the need for deferred operation seems quite acceptable if the >>>>> alternative is, again, failure to operate. >>>>>=20 >>>>=20 >>>> I'm not against you upping the bounce buffer limit for a particular = platform, but it's still unclear to me if (given bug-free drivers) it's = worth the effort to defer a load rather than just drop the packet and = let the stack retry it. One question that would be good to answer is = wether the failed load is happening in the RX to TX path. >>>=20 >>> RX path I believe. >>>=20 >>=20 >> I'm not clear why you even need bounce buffers for RX. The chip = supports 64bit addresses with no boundary or alignment restrictions. >>=20 >=20 > Some controllers have 4G boundary bug so bge(4) restricts dma > address space. That limitation should be reflected in the boundary attribute of the = tag, not the lowaddr/highaddr attributes. Scott From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:44:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C606A1065676; Fri, 11 Jun 2010 17:44:59 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id A51E68FC14; Fri, 11 Jun 2010 17:44:59 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3V00JMV2MYIK50@asmtp029.mac.com>; Fri, 11 Jun 2010 10:44:59 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006110112 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-11_02:2010-02-06, 2010-06-11, 2010-06-11 signatures=0 From: Marcel Moolenaar In-reply-to: <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> Date: Fri, 11 Jun 2010 10:44:57 -0700 Message-id: <53158C9B-C9E1-4C47-B361-83C76181721A@mac.com> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> To: Scott Long X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:44:59 -0000 On Jun 11, 2010, at 10:37 AM, Scott Long wrote: > > I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. As per: /* * All controllers that are not 5755 or higher have 4GB * boundary DMA bug. * Whenever an address crosses a multiple of the 4GB boundary * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA * state machine will lockup and cause the device to hang. */ if (BGE_IS_5755_PLUS(sc) == 0) sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; and: lowaddr = BUS_SPACE_MAXADDR; if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) lowaddr = BGE_DMA_MAXADDR; if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) lowaddr = BUS_SPACE_MAXADDR_32BIT; /* * Allocate the parent bus DMA tag appropriate for PCI. */ error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:47:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BA35106566B; Fri, 11 Jun 2010 17:47:47 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 341308FC13; Fri, 11 Jun 2010 17:47:46 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5BHli3H039968; Fri, 11 Jun 2010 11:47:44 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <53158C9B-C9E1-4C47-B361-83C76181721A@mac.com> Date: Fri, 11 Jun 2010 11:47:44 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <896621F6-4BAF-43D4-9D97-29B4EF34C080@samsco.org> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <53158C9B-C9E1-4C47-B361-83C76181721A@mac.com> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:47:47 -0000 On Jun 11, 2010, at 11:44 AM, Marcel Moolenaar wrote: >=20 > On Jun 11, 2010, at 10:37 AM, Scott Long wrote: >>=20 >> I'm not clear why you even need bounce buffers for RX. The chip = supports 64bit addresses with no boundary or alignment restrictions. >=20 > As per: > /* > * All controllers that are not 5755 or higher have 4GB > * boundary DMA bug. > * Whenever an address crosses a multiple of the 4GB boundary > * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition > * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA > * state machine will lockup and cause the device to hang. > */ > if (BGE_IS_5755_PLUS(sc) =3D=3D 0) > sc->bge_flags |=3D BGE_FLAG_4G_BNDRY_BUG; >=20 > and: > lowaddr =3D BUS_SPACE_MAXADDR; > if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) !=3D 0) > lowaddr =3D BGE_DMA_MAXADDR; > if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) !=3D 0) > lowaddr =3D BUS_SPACE_MAXADDR_32BIT; > /* > * Allocate the parent bus DMA tag appropriate for PCI. > */ > error =3D bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), > 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, > NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, > 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); >=20 >=20 Noted in previous email. If this restriction is put in the boundary = attribute, then you'll only bounce the very rare case of an mbuf = straddling a 4G boundary. Scott From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:51:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1D6A1065670; Fri, 11 Jun 2010 17:51:38 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6506C8FC1D; Fri, 11 Jun 2010 17:51:38 +0000 (UTC) Received: by pvb32 with SMTP id 32so932098pvb.13 for ; Fri, 11 Jun 2010 10:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=w4Gn4PfAfWUMwt9QCqL1H5GYSnsL42N7sRSGypSkQMM=; b=DpEvOski0fnzoiNKx7fgy+rOoFDgMjvNriPM8JKN/6rDi1J1q4VU/GfKsAJkzjj4Ux zUSAVru+EUqMVUryCiLWHYDC9QqJPeqljtuSL+IW88S7hP8YMbl4ZI2k3/Z8PbNcF8Ar tQc//nu0CnYiVJLogX3PW9D6pqIhgWVOIwaUQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=hqFIQlT1hfZtM1RGqv/XSjpytYZJVX+4HjtNzogSQtlZxye/XQyvfExQLc09K0Jhqe BFWSJ7aIXGxOPwAEXUguVGA0Y4wiuUu+PSAev4iqcc3WbZQaf/ZFNbkWnoqoT/7gCYtQ qv2e1r3bhJlUlz2uXUxvqxF2WCANoilLQNiK0= Received: by 10.140.57.15 with SMTP id f15mr1679250rva.56.1276278697830; Fri, 11 Jun 2010 10:51:37 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id d14sm1431973rva.6.2010.06.11.10.51.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 10:51:37 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 11 Jun 2010 10:50:16 -0700 From: Pyun YongHyeon Date: Fri, 11 Jun 2010 10:50:16 -0700 To: Scott Long Message-ID: <20100611175016.GD13776@michelle.cdnetworks.com> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <20100611174137.GC13776@michelle.cdnetworks.com> <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:51:38 -0000 On Fri, Jun 11, 2010 at 11:44:39AM -0600, Scott Long wrote: > On Jun 11, 2010, at 11:41 AM, Pyun YongHyeon wrote: > > On Fri, Jun 11, 2010 at 11:37:36AM -0600, Scott Long wrote: > >> On Jun 11, 2010, at 11:32 AM, Marcel Moolenaar wrote: > >>> > >>> On Jun 11, 2010, at 10:21 AM, Scott Long wrote: > >>> > >>>> On Jun 11, 2010, at 11:04 AM, Marcel Moolenaar wrote: > >>>>> > >>>>> On Jun 11, 2010, at 9:12 AM, Scott Long wrote: > >>>>> > >>>>>> On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: > >>>>>>> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: > >>>>>>>> Author: marcel > >>>>>>>> Date: Fri Jun 11 03:00:32 2010 > >>>>>>>> New Revision: 209026 > >>>>>>>> URL: http://svn.freebsd.org/changeset/base/209026 > >>>>>>>> > >>>>>>>> Log: > >>>>>>>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) > >>>>>>>> in particular, do not handle deferred DMA map load operations at all. > >>>>>>>> Any error, and especially EINPROGRESS, is treated as a hard error and > >>>>>>>> typically abort the current operation. The fact that the busdma code > >>>>>>>> queues the load operation for when resources (i.e. bounce buffers in > >>>>>>>> this particular case) are available makes this especially problematic. > >>>>>>>> Bounce buffering, unlike what the PR synopsis would suggest, works > >>>>>>>> fine. > >>>>>>>> > >>>>>>>> While on the subject, properly implement swi_vm(). > >>>>>>> > >>>>>>> NIC drivers do not handle deferred load operations at all (note that > >>>>>>> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce BUS_DMA_NOWAIT). > >>>>>>> It is common practice to just drop the packet in that case. > >>>>>>> > >>>>>> > >>>>>> Yes, long ago when network drivers started being converted to busdma, it was agreed that EINPROGRESS simply doesn't make sense for them. Any platform that winds up making extensive use of bounce buffers for network hardware is going to perform poorly no matter what, and should hopefully have some sort of IOMMU that can be used instead. > >>>>> > >>>>> Unfortunately things aren't as simple as is presented. > >>>>> > >>>>> For one, bge(4) wedges as soon as the platform runs out of bounce > >>>>> buffers when they're needed. The box needs to be reset in order to > >>>>> get the interface back. I pick any implementation that remains > >>>>> functional over a mis-optimized one that breaks. Deferred load > >>>>> operations are more performance optimal than failure is. > >>>>> > >>>> > >>>> This sounds like a bug in the bge driver. I don't see if through casual inspection, but the driver should be able to either drop the mbuf entirely, or requeue it on the ifq and then restart the ifq later. > >>>> > >>>>> Also: the kernel does nothing to guarantee maximum availability > >>>>> of DMA-able memory under load, so bounce buffers (or use of I/O > >>>>> MMUs for that matter) are a reality. Here too the performance > >>>>> argument doesn't necessarily hold because the kernel may be > >>>>> busy with more than just sending and receiving packets and the > >>>>> need to defer load operations is very appropriate. If the > >>>>> alternative is just dropped packets, I'm fine with that too, > >>>>> but I for one cannot say that *not* filling a H/W ring with > >>>>> buffers is not going to wedge the hardware in some cases. > >>>>> > >>>>> Plus: SGI Altix does not have any DMA-able memory for 32-bit > >>>>> hardware. The need for an I/O MMU is absolute and since there > >>>>> are typically less mapping registers than packets on a ring, > >>>>> the need for deferred operation seems quite acceptable if the > >>>>> alternative is, again, failure to operate. > >>>>> > >>>> > >>>> I'm not against you upping the bounce buffer limit for a particular platform, but it's still unclear to me if (given bug-free drivers) it's worth the effort to defer a load rather than just drop the packet and let the stack retry it. One question that would be good to answer is wether the failed load is happening in the RX to TX path. > >>> > >>> RX path I believe. > >>> > >> > >> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. > >> > > > > Some controllers have 4G boundary bug so bge(4) restricts dma > > address space. > > That limitation should be reflected in the boundary attribute of the tag, not the lowaddr/highaddr attributes. > Yes, but that needed more code. And I don't have these buggy controllers so I chose more simple way that would work even though it may be inefficient. > Scott > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:53:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27C51106566B; Fri, 11 Jun 2010 17:53:19 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 060228FC0A; Fri, 11 Jun 2010 17:53:19 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3V00J2W30MIK60@asmtp029.mac.com>; Fri, 11 Jun 2010 10:53:12 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006110114 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-11_02:2010-02-06, 2010-06-11, 2010-06-11 signatures=0 From: Marcel Moolenaar In-reply-to: <896621F6-4BAF-43D4-9D97-29B4EF34C080@samsco.org> Date: Fri, 11 Jun 2010 10:53:10 -0700 Message-id: References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <53158C9B-C9E1-4C47-B361-83C76181721A@mac.com> <896621F6-4BAF-43D4-9D97-29B4EF34C080@samsco.org> To: Scott Long X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:53:19 -0000 On Jun 11, 2010, at 10:47 AM, Scott Long wrote: > On Jun 11, 2010, at 11:44 AM, Marcel Moolenaar wrote: >> >> On Jun 11, 2010, at 10:37 AM, Scott Long wrote: >>> >>> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. >> >> As per: >> /* >> * All controllers that are not 5755 or higher have 4GB >> * boundary DMA bug. >> * Whenever an address crosses a multiple of the 4GB boundary >> * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition >> * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA >> * state machine will lockup and cause the device to hang. >> */ >> if (BGE_IS_5755_PLUS(sc) == 0) >> sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; >> >> and: >> lowaddr = BUS_SPACE_MAXADDR; >> if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) >> lowaddr = BGE_DMA_MAXADDR; >> if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) >> lowaddr = BUS_SPACE_MAXADDR_32BIT; >> /* >> * Allocate the parent bus DMA tag appropriate for PCI. >> */ >> error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), >> 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, >> NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, >> 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); >> >> > > Noted in previous email. If this restriction is put in the boundary attribute, then you'll only bounce the very rare case of an mbuf straddling a 4G boundary. I agree with you, but I was just giving the facts. I don't even know if we attempted to use the boundary argument before but problems forced us to resort to this. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:55:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0157E1065672; Fri, 11 Jun 2010 17:55:11 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 8A89E8FC1F; Fri, 11 Jun 2010 17:55:10 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5BHt7pP040012; Fri, 11 Jun 2010 11:55:07 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: Date: Fri, 11 Jun 2010 11:55:07 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <648FCAFD-6264-4613-BBCB-F813A7C0A849@samsco.org> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <53158C9B-C9E1-4C47-B361-83C76181721A@mac.com> <896621F6-4BAF-43D4-9D97-29B4EF34C080@samsco.org> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:55:11 -0000 On Jun 11, 2010, at 11:53 AM, Marcel Moolenaar wrote: >=20 > On Jun 11, 2010, at 10:47 AM, Scott Long wrote: >=20 >> On Jun 11, 2010, at 11:44 AM, Marcel Moolenaar wrote: >>>=20 >>> On Jun 11, 2010, at 10:37 AM, Scott Long wrote: >>>>=20 >>>> I'm not clear why you even need bounce buffers for RX. The chip = supports 64bit addresses with no boundary or alignment restrictions. >>>=20 >>> As per: >>> /* >>> * All controllers that are not 5755 or higher have 4GB >>> * boundary DMA bug. >>> * Whenever an address crosses a multiple of the 4GB boundary >>> * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition >>> * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA >>> * state machine will lockup and cause the device to hang. >>> */ >>> if (BGE_IS_5755_PLUS(sc) =3D=3D 0) >>> sc->bge_flags |=3D BGE_FLAG_4G_BNDRY_BUG; >>>=20 >>> and: >>> lowaddr =3D BUS_SPACE_MAXADDR; >>> if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) !=3D 0) >>> lowaddr =3D BGE_DMA_MAXADDR; >>> if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) !=3D 0) >>> lowaddr =3D BUS_SPACE_MAXADDR_32BIT; >>> /* >>> * Allocate the parent bus DMA tag appropriate for PCI. >>> */ >>> error =3D bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), >>> 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, >>> NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, >>> 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); >>>=20 >>>=20 >>=20 >> Noted in previous email. If this restriction is put in the boundary = attribute, then you'll only bounce the very rare case of an mbuf = straddling a 4G boundary. >=20 > I agree with you, but I was just giving the facts. I don't even > know if we attempted to use the boundary argument before but > problems forced us to resort to this. >=20 Thanks to the design limitation of PCIe, the 4GB boundary is a common = restriction and should work fine in FreeBSD. Scott From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:05:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 030451065679; Fri, 11 Jun 2010 18:05:42 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id A94228FC13; Fri, 11 Jun 2010 18:05:41 +0000 (UTC) Received: by pwj1 with SMTP id 1so949866pwj.13 for ; Fri, 11 Jun 2010 11:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=cGkdzfGoDoljGSfLrNiQnBh0ZozF6OseBw6rFXRscg4=; b=NY7CW2X0391dPawOgOAAOpl6FEPLF5FZHJhpHkwQARzxrm4rIHDqVSCw7MOAXORZ2z d3BsrILb0tErBEPzB9I3TZHkU0pDgm8xnp9HiB98G42WUgOwWZJ7xuTatawUrdBz8Xyw oAGf0DBwOK/thqZWQwY7XmiDmiQuzHUzJH3Uw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=cLxCOoJ0qfGVt+apfW6svqtQWEsqFWNO6qaVQQtn+GbKkC/IoTFaOkJ8QB+m41yMOc P7WFARMsFKRJ4/DTNHq4jR481Q7td8rnD4Zwoqv1+8E9JKk+by4shfYzwcPynDLWg1BX jgkooUQE/2xnyq1s2p6XjyyCai/Zc/qUHNhn8= Received: by 10.115.81.33 with SMTP id i33mr1754233wal.46.1276279540786; Fri, 11 Jun 2010 11:05:40 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id n29sm16248732wae.4.2010.06.11.11.05.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 11:05:40 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 11 Jun 2010 11:04:19 -0700 From: Pyun YongHyeon Date: Fri, 11 Jun 2010 11:04:19 -0700 To: Scott Long Message-ID: <20100611180419.GF13776@michelle.cdnetworks.com> References: <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <53158C9B-C9E1-4C47-B361-83C76181721A@mac.com> <896621F6-4BAF-43D4-9D97-29B4EF34C080@samsco.org> <648FCAFD-6264-4613-BBCB-F813A7C0A849@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <648FCAFD-6264-4613-BBCB-F813A7C0A849@samsco.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:05:42 -0000 On Fri, Jun 11, 2010 at 11:55:07AM -0600, Scott Long wrote: > On Jun 11, 2010, at 11:53 AM, Marcel Moolenaar wrote: > > > > On Jun 11, 2010, at 10:47 AM, Scott Long wrote: > > > >> On Jun 11, 2010, at 11:44 AM, Marcel Moolenaar wrote: > >>> > >>> On Jun 11, 2010, at 10:37 AM, Scott Long wrote: > >>>> > >>>> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. > >>> > >>> As per: > >>> /* > >>> * All controllers that are not 5755 or higher have 4GB > >>> * boundary DMA bug. > >>> * Whenever an address crosses a multiple of the 4GB boundary > >>> * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition > >>> * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA > >>> * state machine will lockup and cause the device to hang. > >>> */ > >>> if (BGE_IS_5755_PLUS(sc) == 0) > >>> sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; > >>> > >>> and: > >>> lowaddr = BUS_SPACE_MAXADDR; > >>> if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) > >>> lowaddr = BGE_DMA_MAXADDR; > >>> if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) > >>> lowaddr = BUS_SPACE_MAXADDR_32BIT; > >>> /* > >>> * Allocate the parent bus DMA tag appropriate for PCI. > >>> */ > >>> error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), > >>> 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, > >>> NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, > >>> 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); > >>> > >>> > >> > >> Noted in previous email. If this restriction is put in the boundary attribute, then you'll only bounce the very rare case of an mbuf straddling a 4G boundary. > > > > I agree with you, but I was just giving the facts. I don't even > > know if we attempted to use the boundary argument before but > > problems forced us to resort to this. > > > > Thanks to the design limitation of PCIe, the 4GB boundary is a common restriction and should work fine in FreeBSD. I guess many PCIe drivers in tree do not explicitly set 4GB boundary restriction. Isn't it better to set it automatically with bus_get_dma_tag(9)? > > Scott > > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:06:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 279C6106566B; Fri, 11 Jun 2010 18:06:18 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 044508FC25; Fri, 11 Jun 2010 18:06:17 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3V00IPQ3M67I80@asmtp029.mac.com>; Fri, 11 Jun 2010 11:06:08 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006110116 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-11_02:2010-02-06, 2010-06-11, 2010-06-11 signatures=0 From: Marcel Moolenaar In-reply-to: <20100611175016.GD13776@michelle.cdnetworks.com> Date: Fri, 11 Jun 2010 11:06:06 -0700 Message-id: <59E450BB-1E79-440E-AF82-B78E1E8FE334@mac.com> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <20100611174137.GC13776@michelle.cdnetworks.com> <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> <20100611175016.GD13776@michelle.cdnetworks.com> To: pyunyh@gmail.com X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:06:18 -0000 On Jun 11, 2010, at 10:50 AM, Pyun YongHyeon wrote: >>>> >>>> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. >>>> >>> >>> Some controllers have 4G boundary bug so bge(4) restricts dma >>> address space. >> >> That limitation should be reflected in the boundary attribute of the tag, not the lowaddr/highaddr attributes. >> > > Yes, but that needed more code. And I don't have these buggy > controllers so I chose more simple way that would work even though > it may be inefficient. Do you happen to know if one or both of the hardware I have access to is the "buggy" hardware? bge0@pci0:32:2:0: class=0x020000 card=0x12a4103c chip=0x164514e4 rev=0x15 hdr=0x00 vendor = 'Broadcom Corporation' device = 'broadtcomBCM5701 Gigabit Ethernet (BCM5701)' class = network subclass = ethernet bar [10] = type Memory, range 64, base 0x90800000, size 65536, enabled cap 07[40] = PCI-X 64-bit supports 133MHz, 512 burst read, 1 split transaction cap 01[48] = powerspec 2 supports D0 D3 current D0 cap 03[50] = VPD cap 05[58] = MSI supports 8 messages, 64 bit bge0@pci0:1:2:0: class=0x020000 card=0x1311103c chip=0x164814e4 rev=0x10 hdr=0x00 vendor = 'Broadcom Corporation' device = 'NetXtreme Dual Gigabit Adapter (BCM5704)' class = network subclass = ethernet bar [10] = type Memory, range 64, base 0xa0450000, size 65536, enabled cap 07[40] = PCI-X 64-bit supports 133MHz, 2048 burst read, 1 split transaction cap 01[48] = powerspec 2 supports D0 D3 current D0 cap 03[50] = VPD cap 05[58] = MSI supports 8 messages, 64 bit -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:09:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9A6A1065702; Fri, 11 Jun 2010 18:09:46 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5AFDE8FC2B; Fri, 11 Jun 2010 18:09:46 +0000 (UTC) Received: by pwj1 with SMTP id 1so954115pwj.13 for ; Fri, 11 Jun 2010 11:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=R1UWyhAmDL1I3ZHrBxloxdQmcJJ12G4bP6V1vY1EVf0=; b=plCwSTuGwBTpQw+VB7sGwW44h8fezwmvBiHbRgQZLPRUmStfcrqt+uDmyPVOPgKmGU yInYVEb6FzCWWzaqk3U8B8A8B5OfR1uui12fTxBEwkcElBO/dcBsvL07FEK12YIv0l9Y TVR7HEvZx4TlBZ2nq0vvtd1TxLv7EWrFPjKAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=QYIs4CNzekXqC82e4kvG2DNGCztg7294ptvzGiG9u6YkfvpICoJ4nuauIrpNLt5+r4 OxJFtuzmYRE6g+GMVhSA+O7+SSoT+69yBzz6t6smDLlAE8UbQdROSKU5dy8JdPOxqq+A Kh6l3UQKAfPCSsTH8AtdmbKnEENWHLEdEoP2k= Received: by 10.115.134.11 with SMTP id l11mr1733252wan.160.1276279785791; Fri, 11 Jun 2010 11:09:45 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id c22sm16199193wam.18.2010.06.11.11.09.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 11:09:45 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 11 Jun 2010 11:08:24 -0700 From: Pyun YongHyeon Date: Fri, 11 Jun 2010 11:08:24 -0700 To: Marcel Moolenaar Message-ID: <20100611180824.GG13776@michelle.cdnetworks.com> References: <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <20100611174137.GC13776@michelle.cdnetworks.com> <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> <20100611175016.GD13776@michelle.cdnetworks.com> <59E450BB-1E79-440E-AF82-B78E1E8FE334@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59E450BB-1E79-440E-AF82-B78E1E8FE334@mac.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:09:46 -0000 On Fri, Jun 11, 2010 at 11:06:06AM -0700, Marcel Moolenaar wrote: > > On Jun 11, 2010, at 10:50 AM, Pyun YongHyeon wrote: > > >>>> > >>>> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. > >>>> > >>> > >>> Some controllers have 4G boundary bug so bge(4) restricts dma > >>> address space. > >> > >> That limitation should be reflected in the boundary attribute of the tag, not the lowaddr/highaddr attributes. > >> > > > > Yes, but that needed more code. And I don't have these buggy > > controllers so I chose more simple way that would work even though > > it may be inefficient. > > Do you happen to know if one or both of the hardware I have access to > is the "buggy" hardware? > Yes, both devices below can not handle 4GB boundary crossing in DMA state machine. > bge0@pci0:32:2:0: class=0x020000 card=0x12a4103c chip=0x164514e4 rev=0x15 hdr=0x00 > vendor = 'Broadcom Corporation' > device = 'broadtcomBCM5701 Gigabit Ethernet (BCM5701)' > class = network > subclass = ethernet > bar [10] = type Memory, range 64, base 0x90800000, size 65536, enabled > cap 07[40] = PCI-X 64-bit supports 133MHz, 512 burst read, 1 split transaction > cap 01[48] = powerspec 2 supports D0 D3 current D0 > cap 03[50] = VPD > cap 05[58] = MSI supports 8 messages, 64 bit > > bge0@pci0:1:2:0: class=0x020000 card=0x1311103c chip=0x164814e4 rev=0x10 hdr=0x00 > vendor = 'Broadcom Corporation' > device = 'NetXtreme Dual Gigabit Adapter (BCM5704)' > class = network > subclass = ethernet > bar [10] = type Memory, range 64, base 0xa0450000, size 65536, enabled > cap 07[40] = PCI-X 64-bit supports 133MHz, 2048 burst read, 1 split transaction > cap 01[48] = powerspec 2 supports D0 D3 current D0 > cap 03[50] = VPD > cap 05[58] = MSI supports 8 messages, 64 bit > > -- > Marcel Moolenaar > xcllnt@mac.com > > > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:13:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F029E1065679; Fri, 11 Jun 2010 18:13:43 +0000 (UTC) (envelope-from julian@elischer.org) Received: from out-0.mx.aerioconnect.net (outx.internet-mail-service.net [216.240.47.247]) by mx1.freebsd.org (Postfix) with ESMTP id C6B898FC08; Fri, 11 Jun 2010 18:13:43 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id o5BIDf3X025057; Fri, 11 Jun 2010 11:13:41 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 5E2992D6016; Fri, 11 Jun 2010 11:13:40 -0700 (PDT) Message-ID: <4C127CED.90208@elischer.org> Date: Fri, 11 Jun 2010 11:14:05 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: John Baldwin References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> <201006110810.40295.jhb@freebsd.org> <20100611124149.GD13238@deviant.kiev.zoral.com.ua> <201006110943.02539.jhb@freebsd.org> In-Reply-To: <201006110943.02539.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: Kostik Belousov , svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208988 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:13:44 -0000 On 6/11/10 6:43 AM, John Baldwin wrote: > On Friday 11 June 2010 8:41:49 am Kostik Belousov wrote: >> On Fri, Jun 11, 2010 at 08:10:40AM -0400, John Baldwin wrote: >>> On Friday 11 June 2010 4:31:37 am Kostik Belousov wrote: >>>> On Thu, Jun 10, 2010 at 04:14:05PM +0000, Alexander Motin wrote: >>>>> Author: mav >>>>> Date: Thu Jun 10 16:14:05 2010 >>>>> New Revision: 208988 >>>>> URL: http://svn.freebsd.org/changeset/base/208988 >>>>> >>>>> Log: >>>>> Store interrupt trap frame into struct thread. It allows interrupt >>> handler >>>>> to obtain both trap frame and opaque argument submitted on registrction. >>>>> After kernel and all drivers get used to it, legacy hack can be removed. >>>>> >>>>> Reviewed by: jhb@ >>>> Just curious, why td_frame is not enough for your usage ? I believe td_frame >>>> is currently set only by traps and syscalls, and copied on forks. >>> >>> td_frame is not set on a nested interrupt. Thus, if you use td_frame and get >>> an interrupt while in a syscall, statclock() would account the time as a user >>> tick instead of a system tick. >>> >>> Put another way, td_frame always references the user --> system >>> trapframe, but td_intr_frame will reference the most recent trapframe >>> on the stack. >> >> I mean, save old td_frame on the interrupt, and assign interrupt trap >> frame to td_frame. I.e., do what r208988, but replace td_intr_frame >> with td_frame. > > Hmmm, I had thought there were reasons that was not safe, but after looking > it may be safe to do this. > I THINK it is OK but make sure you add good comments everywhere. From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:19:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AE8F1065672; Fri, 11 Jun 2010 18:19:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B13A8FC18; Fri, 11 Jun 2010 18:19:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BIJNb2052601; Fri, 11 Jun 2010 18:19:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BIJNDS052599; Fri, 11 Jun 2010 18:19:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006111819.o5BIJNDS052599@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 11 Jun 2010 18:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209055 - head/sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:19:23 -0000 Author: jkim Date: Fri Jun 11 18:19:23 2010 New Revision: 209055 URL: http://svn.freebsd.org/changeset/base/209055 Log: Fix a possible dereference of null pointer. Found by: clang static analyzer Found by: Coverity Prevent[tm] (CID 3423) Modified: head/sys/dev/acpi_support/acpi_hp.c Modified: head/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- head/sys/dev/acpi_support/acpi_hp.c Fri Jun 11 17:38:24 2010 (r209054) +++ head/sys/dev/acpi_support/acpi_hp.c Fri Jun 11 18:19:23 2010 (r209055) @@ -905,7 +905,7 @@ acpi_hp_get_cmi_block(device_t wmi_dev, return (-EINVAL); } obj = out.Pointer; - if (!obj && obj->Type != ACPI_TYPE_PACKAGE) { + if (!obj || obj->Type != ACPI_TYPE_PACKAGE) { acpi_hp_free_buffer(&out); return (-EINVAL); } From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:19:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D75F41065679; Fri, 11 Jun 2010 18:19:53 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 6D7898FC08; Fri, 11 Jun 2010 18:19:53 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5BIJoBv040125; Fri, 11 Jun 2010 12:19:50 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <20100611180419.GF13776@michelle.cdnetworks.com> Date: Fri, 11 Jun 2010 12:19:50 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <8A03951E-6569-4486-B652-A4B7F5F8B12D@samsco.org> References: <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <53158C9B-C9E1-4C47-B361-83C76181721A@mac.com> <896621F6-4BAF-43D4-9D97-29B4EF34C080@samsco.org> <648FCAFD-6264-4613-BBCB-F813A7C0A849@samsco.org> <20100611180419.GF13776@michelle.cdnetworks.com> To: pyunyh@gmail.com X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:19:54 -0000 On Jun 11, 2010, at 12:04 PM, Pyun YongHyeon wrote: > On Fri, Jun 11, 2010 at 11:55:07AM -0600, Scott Long wrote: >> On Jun 11, 2010, at 11:53 AM, Marcel Moolenaar wrote: >>>=20 >>> On Jun 11, 2010, at 10:47 AM, Scott Long wrote: >>>=20 >>>> On Jun 11, 2010, at 11:44 AM, Marcel Moolenaar wrote: >>>>>=20 >>>>> On Jun 11, 2010, at 10:37 AM, Scott Long wrote: >>>>>>=20 >>>>>> I'm not clear why you even need bounce buffers for RX. The chip = supports 64bit addresses with no boundary or alignment restrictions. >>>>>=20 >>>>> As per: >>>>> /* >>>>> * All controllers that are not 5755 or higher have 4GB >>>>> * boundary DMA bug. >>>>> * Whenever an address crosses a multiple of the 4GB boundary >>>>> * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition >>>>> * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA >>>>> * state machine will lockup and cause the device to hang. >>>>> */ >>>>> if (BGE_IS_5755_PLUS(sc) =3D=3D 0) >>>>> sc->bge_flags |=3D BGE_FLAG_4G_BNDRY_BUG; >>>>>=20 >>>>> and: >>>>> lowaddr =3D BUS_SPACE_MAXADDR; >>>>> if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) !=3D 0) >>>>> lowaddr =3D BGE_DMA_MAXADDR; >>>>> if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) !=3D 0) >>>>> lowaddr =3D BUS_SPACE_MAXADDR_32BIT; >>>>> /* >>>>> * Allocate the parent bus DMA tag appropriate for PCI. >>>>> */ >>>>> error =3D bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), >>>>> 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, >>>>> NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, >>>>> 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); >>>>>=20 >>>>>=20 >>>>=20 >>>> Noted in previous email. If this restriction is put in the = boundary attribute, then you'll only bounce the very rare case of an = mbuf straddling a 4G boundary. >>>=20 >>> I agree with you, but I was just giving the facts. I don't even >>> know if we attempted to use the boundary argument before but >>> problems forced us to resort to this. >>>=20 >>=20 >> Thanks to the design limitation of PCIe, the 4GB boundary is a common = restriction and should work fine in FreeBSD. >=20 > I guess many PCIe drivers in tree do not explicitly set 4GB > boundary restriction. Isn't it better to set it automatically with > bus_get_dma_tag(9)? That was exactly the intention of introducing bus_get_dma_tag() and = having it inherit attributes from the parent bus. Scott From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:20:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A232F106566C; Fri, 11 Jun 2010 18:20:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92B1C8FC23; Fri, 11 Jun 2010 18:20:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BIKuOo052983; Fri, 11 Jun 2010 18:20:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BIKuFG052981; Fri, 11 Jun 2010 18:20:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006111820.o5BIKuFG052981@svn.freebsd.org> From: Andriy Gapon Date: Fri, 11 Jun 2010 18:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209056 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:20:56 -0000 Author: avg Date: Fri Jun 11 18:20:56 2010 New Revision: 209056 URL: http://svn.freebsd.org/changeset/base/209056 Log: vnode.h: expand debug macros to non-empty void statements when DEBUG_VFS_LOCKS is disabled MFC after: 2 weeks Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Jun 11 18:19:23 2010 (r209055) +++ head/sys/sys/vnode.h Fri Jun 11 18:20:56 2010 (r209056) @@ -524,17 +524,17 @@ void assert_vop_unlocked(struct vnode *v #else /* !DEBUG_VFS_LOCKS */ -#define ASSERT_VI_LOCKED(vp, str) -#define ASSERT_VI_UNLOCKED(vp, str) -#define ASSERT_VOP_ELOCKED(vp, str) +#define ASSERT_VI_LOCKED(vp, str) ((void)0) +#define ASSERT_VI_UNLOCKED(vp, str) ((void)0) +#define ASSERT_VOP_ELOCKED(vp, str) ((void)0) #if 0 #define ASSERT_VOP_ELOCKED_OTHER(vp, str) #endif -#define ASSERT_VOP_LOCKED(vp, str) +#define ASSERT_VOP_LOCKED(vp, str) ((void)0) #if 0 #define ASSERT_VOP_SLOCKED(vp, str) #endif -#define ASSERT_VOP_UNLOCKED(vp, str) +#define ASSERT_VOP_UNLOCKED(vp, str) ((void)0) #endif /* DEBUG_VFS_LOCKS */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:21:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A25D3106566B; Fri, 11 Jun 2010 18:21:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 70D168FC1E; Fri, 11 Jun 2010 18:21:27 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id EFAFD46BC1; Fri, 11 Jun 2010 14:21:26 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 37B5B8A03C; Fri, 11 Jun 2010 14:21:26 -0400 (EDT) From: John Baldwin To: pyunyh@gmail.com Date: Fri, 11 Jun 2010 14:20:46 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006110300.o5B30X9q045387@svn.freebsd.org> <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> <20100611175016.GD13776@michelle.cdnetworks.com> In-Reply-To: <20100611175016.GD13776@michelle.cdnetworks.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006111420.46919.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 14:21:26 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Scott Long , Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:21:27 -0000 On Friday 11 June 2010 1:50:16 pm Pyun YongHyeon wrote: > On Fri, Jun 11, 2010 at 11:44:39AM -0600, Scott Long wrote: > > On Jun 11, 2010, at 11:41 AM, Pyun YongHyeon wrote: > > > On Fri, Jun 11, 2010 at 11:37:36AM -0600, Scott Long wrote: > > >> On Jun 11, 2010, at 11:32 AM, Marcel Moolenaar wrote: > > >>> > > >>> On Jun 11, 2010, at 10:21 AM, Scott Long wrote: > > >>> > > >>>> On Jun 11, 2010, at 11:04 AM, Marcel Moolenaar wrote: > > >>>>> > > >>>>> On Jun 11, 2010, at 9:12 AM, Scott Long wrote: > > >>>>> > > >>>>>> On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: > > >>>>>>> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: > > >>>>>>>> Author: marcel > > >>>>>>>> Date: Fri Jun 11 03:00:32 2010 > > >>>>>>>> New Revision: 209026 > > >>>>>>>> URL: http://svn.freebsd.org/changeset/base/209026 > > >>>>>>>> > > >>>>>>>> Log: > > >>>>>>>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) > > >>>>>>>> in particular, do not handle deferred DMA map load operations at all. > > >>>>>>>> Any error, and especially EINPROGRESS, is treated as a hard error and > > >>>>>>>> typically abort the current operation. The fact that the busdma code > > >>>>>>>> queues the load operation for when resources (i.e. bounce buffers in > > >>>>>>>> this particular case) are available makes this especially problematic. > > >>>>>>>> Bounce buffering, unlike what the PR synopsis would suggest, works > > >>>>>>>> fine. > > >>>>>>>> > > >>>>>>>> While on the subject, properly implement swi_vm(). > > >>>>>>> > > >>>>>>> NIC drivers do not handle deferred load operations at all (note that > > >>>>>>> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce BUS_DMA_NOWAIT). > > >>>>>>> It is common practice to just drop the packet in that case. > > >>>>>>> > > >>>>>> > > >>>>>> Yes, long ago when network drivers started being converted to busdma, it was agreed that EINPROGRESS simply doesn't make sense for them. Any platform that winds up making extensive use of bounce buffers for network hardware is going to perform poorly no matter what, and should hopefully have some sort of IOMMU that can be used instead. > > >>>>> > > >>>>> Unfortunately things aren't as simple as is presented. > > >>>>> > > >>>>> For one, bge(4) wedges as soon as the platform runs out of bounce > > >>>>> buffers when they're needed. The box needs to be reset in order to > > >>>>> get the interface back. I pick any implementation that remains > > >>>>> functional over a mis-optimized one that breaks. Deferred load > > >>>>> operations are more performance optimal than failure is. > > >>>>> > > >>>> > > >>>> This sounds like a bug in the bge driver. I don't see if through casual inspection, but the driver should be able to either drop the mbuf entirely, or requeue it on the ifq and then restart the ifq later. > > >>>> > > >>>>> Also: the kernel does nothing to guarantee maximum availability > > >>>>> of DMA-able memory under load, so bounce buffers (or use of I/O > > >>>>> MMUs for that matter) are a reality. Here too the performance > > >>>>> argument doesn't necessarily hold because the kernel may be > > >>>>> busy with more than just sending and receiving packets and the > > >>>>> need to defer load operations is very appropriate. If the > > >>>>> alternative is just dropped packets, I'm fine with that too, > > >>>>> but I for one cannot say that *not* filling a H/W ring with > > >>>>> buffers is not going to wedge the hardware in some cases. > > >>>>> > > >>>>> Plus: SGI Altix does not have any DMA-able memory for 32-bit > > >>>>> hardware. The need for an I/O MMU is absolute and since there > > >>>>> are typically less mapping registers than packets on a ring, > > >>>>> the need for deferred operation seems quite acceptable if the > > >>>>> alternative is, again, failure to operate. > > >>>>> > > >>>> > > >>>> I'm not against you upping the bounce buffer limit for a particular platform, but it's still unclear to me if (given bug-free drivers) it's worth the effort to defer a load rather than just drop the packet and let the stack retry it. One question that would be good to answer is wether the failed load is happening in the RX to TX path. > > >>> > > >>> RX path I believe. > > >>> > > >> > > >> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. > > >> > > > > > > Some controllers have 4G boundary bug so bge(4) restricts dma > > > address space. > > > > That limitation should be reflected in the boundary attribute of the tag, not the lowaddr/highaddr attributes. > > > > Yes, but that needed more code. And I don't have these buggy > controllers so I chose more simple way that would work even though > it may be inefficient. You can just use a 2GB boundary as a workaround. Look at what the twa(4) driver does to enforce a 4GB boundary for an example. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:26:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 026651065678; Fri, 11 Jun 2010 18:26:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6B1A8FC14; Fri, 11 Jun 2010 18:26:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BIQrxU054322; Fri, 11 Jun 2010 18:26:53 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BIQrj1054320; Fri, 11 Jun 2010 18:26:53 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006111826.o5BIQrj1054320@svn.freebsd.org> From: Andriy Gapon Date: Fri, 11 Jun 2010 18:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209057 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:26:54 -0000 Author: avg Date: Fri Jun 11 18:26:53 2010 New Revision: 209057 URL: http://svn.freebsd.org/changeset/base/209057 Log: ffs_softdep: change K&R in function defintions to ANSI prototypes Apparently it's bad when we first have an ANSI prototype in function declaration, but then use K&R in its defintion. Complaint from: clang MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Jun 11 18:20:56 2010 (r209056) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Jun 11 18:26:53 2010 (r209057) @@ -3251,12 +3251,8 @@ newjmvref(dp, ino, oldoff, newoff) * the jsegdep when we're done. */ static struct jremref * -newjremref(dirrem, dp, ip, diroff, nlink) - struct dirrem *dirrem; - struct inode *dp; - struct inode *ip; - off_t diroff; - nlink_t nlink; +newjremref(struct dirrem *dirrem, struct inode *dp, struct inode *ip, + off_t diroff, nlink_t nlink) { struct jremref *jremref; @@ -3271,13 +3267,8 @@ newjremref(dirrem, dp, ip, diroff, nlink } static inline void -newinoref(inoref, ino, parent, diroff, nlink, mode) - struct inoref *inoref; - ino_t ino; - ino_t parent; - off_t diroff; - nlink_t nlink; - uint16_t mode; +newinoref(struct inoref *inoref, ino_t ino, ino_t parent, off_t diroff, + nlink_t nlink, uint16_t mode) { inoref->if_jsegdep = newjsegdep(&inoref->if_list); @@ -3296,12 +3287,8 @@ newinoref(inoref, ino, parent, diroff, n * to have the correct FMT. */ static struct jaddref * -newjaddref(dp, ino, diroff, nlink, mode) - struct inode *dp; - ino_t ino; - off_t diroff; - int16_t nlink; - uint16_t mode; +newjaddref(struct inode *dp, ino_t ino, off_t diroff, int16_t nlink, + uint16_t mode) { struct jaddref *jaddref; From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:32:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE15A1065672; Fri, 11 Jun 2010 18:32:11 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 65D368FC23; Fri, 11 Jun 2010 18:32:11 +0000 (UTC) Received: by pxi7 with SMTP id 7so955418pxi.13 for ; Fri, 11 Jun 2010 11:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=3azxshxMsz9bco9cJaRJ/oAgYUzXVkBfhsOywZZsfs4=; b=HaMeAKSa6y0SdzzHpYBOnUf/2cvhCp057tW/s/3gAjt6WcWH2eXpZkgXCqUz3buBAb vy0AlziG/hIFNVaZAqWg6Dper4tiPyiR0Mcoe0lJ2tVR+sDLpqxkvwCey+StDyiHus/s bUa6Bt5y/Gir920Qikp2MWYt/wNvca4Ob7wdM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ol1Yub3xG8oMnuLum+X65axSVtbMqYKhIASA2HZ01NwuAvCL1bWmZ32f6G9Hjbna+E N08+6l90+SqXXR4OimwGNd6jtfRgFaShsnpv+WBgUDZl3afDkCTFUsaMAWOM6WqEV8xv qdPCkNtNvfZ7TdmNJUN5QJiPyCPCfbZPh7Lyo= Received: by 10.114.54.28 with SMTP id c28mr1750793waa.169.1276281130591; Fri, 11 Jun 2010 11:32:10 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id n32sm16394141wae.22.2010.06.11.11.32.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 11:32:10 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 11 Jun 2010 11:30:49 -0700 From: Pyun YongHyeon Date: Fri, 11 Jun 2010 11:30:49 -0700 To: John Baldwin Message-ID: <20100611183049.GH13776@michelle.cdnetworks.com> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> <20100611175016.GD13776@michelle.cdnetworks.com> <201006111420.46919.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201006111420.46919.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Scott Long , Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:32:13 -0000 On Fri, Jun 11, 2010 at 02:20:46PM -0400, John Baldwin wrote: > On Friday 11 June 2010 1:50:16 pm Pyun YongHyeon wrote: > > On Fri, Jun 11, 2010 at 11:44:39AM -0600, Scott Long wrote: > > > On Jun 11, 2010, at 11:41 AM, Pyun YongHyeon wrote: > > > > On Fri, Jun 11, 2010 at 11:37:36AM -0600, Scott Long wrote: > > > >> On Jun 11, 2010, at 11:32 AM, Marcel Moolenaar wrote: > > > >>> > > > >>> On Jun 11, 2010, at 10:21 AM, Scott Long wrote: > > > >>> > > > >>>> On Jun 11, 2010, at 11:04 AM, Marcel Moolenaar wrote: > > > >>>>> > > > >>>>> On Jun 11, 2010, at 9:12 AM, Scott Long wrote: > > > >>>>> > > > >>>>>> On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: > > > >>>>>>> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: > > > >>>>>>>> Author: marcel > > > >>>>>>>> Date: Fri Jun 11 03:00:32 2010 > > > >>>>>>>> New Revision: 209026 > > > >>>>>>>> URL: http://svn.freebsd.org/changeset/base/209026 > > > >>>>>>>> > > > >>>>>>>> Log: > > > >>>>>>>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, > bge(4) > > > >>>>>>>> in particular, do not handle deferred DMA map load operations at > all. > > > >>>>>>>> Any error, and especially EINPROGRESS, is treated as a hard error > and > > > >>>>>>>> typically abort the current operation. The fact that the busdma > code > > > >>>>>>>> queues the load operation for when resources (i.e. bounce buffers > in > > > >>>>>>>> this particular case) are available makes this especially > problematic. > > > >>>>>>>> Bounce buffering, unlike what the PR synopsis would suggest, > works > > > >>>>>>>> fine. > > > >>>>>>>> > > > >>>>>>>> While on the subject, properly implement swi_vm(). > > > >>>>>>> > > > >>>>>>> NIC drivers do not handle deferred load operations at all (note > that > > > >>>>>>> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce > BUS_DMA_NOWAIT). > > > >>>>>>> It is common practice to just drop the packet in that case. > > > >>>>>>> > > > >>>>>> > > > >>>>>> Yes, long ago when network drivers started being converted to > busdma, it was agreed that EINPROGRESS simply doesn't make sense for them. > Any platform that winds up making extensive use of bounce buffers for network > hardware is going to perform poorly no matter what, and should hopefully have > some sort of IOMMU that can be used instead. > > > >>>>> > > > >>>>> Unfortunately things aren't as simple as is presented. > > > >>>>> > > > >>>>> For one, bge(4) wedges as soon as the platform runs out of bounce > > > >>>>> buffers when they're needed. The box needs to be reset in order to > > > >>>>> get the interface back. I pick any implementation that remains > > > >>>>> functional over a mis-optimized one that breaks. Deferred load > > > >>>>> operations are more performance optimal than failure is. > > > >>>>> > > > >>>> > > > >>>> This sounds like a bug in the bge driver. I don't see if through > casual inspection, but the driver should be able to either drop the mbuf > entirely, or requeue it on the ifq and then restart the ifq later. > > > >>>> > > > >>>>> Also: the kernel does nothing to guarantee maximum availability > > > >>>>> of DMA-able memory under load, so bounce buffers (or use of I/O > > > >>>>> MMUs for that matter) are a reality. Here too the performance > > > >>>>> argument doesn't necessarily hold because the kernel may be > > > >>>>> busy with more than just sending and receiving packets and the > > > >>>>> need to defer load operations is very appropriate. If the > > > >>>>> alternative is just dropped packets, I'm fine with that too, > > > >>>>> but I for one cannot say that *not* filling a H/W ring with > > > >>>>> buffers is not going to wedge the hardware in some cases. > > > >>>>> > > > >>>>> Plus: SGI Altix does not have any DMA-able memory for 32-bit > > > >>>>> hardware. The need for an I/O MMU is absolute and since there > > > >>>>> are typically less mapping registers than packets on a ring, > > > >>>>> the need for deferred operation seems quite acceptable if the > > > >>>>> alternative is, again, failure to operate. > > > >>>>> > > > >>>> > > > >>>> I'm not against you upping the bounce buffer limit for a particular > platform, but it's still unclear to me if (given bug-free drivers) it's worth > the effort to defer a load rather than just drop the packet and let the stack > retry it. One question that would be good to answer is wether the failed load > is happening in the RX to TX path. > > > >>> > > > >>> RX path I believe. > > > >>> > > > >> > > > >> I'm not clear why you even need bounce buffers for RX. The chip > supports 64bit addresses with no boundary or alignment restrictions. > > > >> > > > > > > > > Some controllers have 4G boundary bug so bge(4) restricts dma > > > > address space. > > > > > > That limitation should be reflected in the boundary attribute of the tag, > not the lowaddr/highaddr attributes. > > > > > > > Yes, but that needed more code. And I don't have these buggy > > controllers so I chose more simple way that would work even though > > it may be inefficient. > > You can just use a 2GB boundary as a workaround. Look at what the twa(4) > driver does to enforce a 4GB boundary for an example. > I vaguely remember the problem was DMA memory allocated with bus_dmamem_alloc(9) does not honor boundary argument so bge(4) had to ensure the allocated memory is within 4GB. > -- > John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:36:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E0EC106566B; Fri, 11 Jun 2010 18:36:20 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id C03038FC24; Fri, 11 Jun 2010 18:36:19 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5BIaGHB040216; Fri, 11 Jun 2010 12:36:16 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <20100611183049.GH13776@michelle.cdnetworks.com> Date: Fri, 11 Jun 2010 12:36:16 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <9CACE2BA-ACA1-44B5-A325-20F5A12BE187@samsco.org> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> <20100611175016.GD13776@michelle.cdnetworks.com> <201006111420.46919.jhb@freebsd.org> <20100611183049.GH13776@michelle.cdnetworks.com> To: pyunyh@gmail.com X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:36:20 -0000 On Jun 11, 2010, at 12:30 PM, Pyun YongHyeon wrote: > On Fri, Jun 11, 2010 at 02:20:46PM -0400, John Baldwin wrote: >>>>>>=20 >>>>>> I'm not clear why you even need bounce buffers for RX. The chip=20= >> supports 64bit addresses with no boundary or alignment restrictions. >>>>>>=20 >>>>>=20 >>>>> Some controllers have 4G boundary bug so bge(4) restricts dma >>>>> address space. >>>>=20 >>>> That limitation should be reflected in the boundary attribute of = the tag,=20 >> not the lowaddr/highaddr attributes. >>>>=20 >>>=20 >>> Yes, but that needed more code. And I don't have these buggy >>> controllers so I chose more simple way that would work even though >>> it may be inefficient. >>=20 >> You can just use a 2GB boundary as a workaround. Look at what the = twa(4)=20 >> driver does to enforce a 4GB boundary for an example. >>=20 >=20 > I vaguely remember the problem was DMA memory allocated with > bus_dmamem_alloc(9) does not honor boundary argument so bge(4) had > to ensure the allocated memory is within 4GB. That might be true, in which case you should set the restriction on the = child tags that need it, not the parent tag. Scott From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:43:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D2A21065675; Fri, 11 Jun 2010 18:43:56 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3EC8FC16; Fri, 11 Jun 2010 18:43:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BIhunc058074; Fri, 11 Jun 2010 18:43:56 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BIhup9058072; Fri, 11 Jun 2010 18:43:56 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201006111843.o5BIhup9058072@svn.freebsd.org> From: Bruce Cran Date: Fri, 11 Jun 2010 18:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209058 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:43:56 -0000 Author: brucec Date: Fri Jun 11 18:43:55 2010 New Revision: 209058 URL: http://svn.freebsd.org/changeset/base/209058 Log: sctp_recvmsg returns the number of bytes received, not sent. Approved by: rrs (mentor) MFC after: 1 month Modified: head/lib/libc/net/sctp_recvmsg.3 Modified: head/lib/libc/net/sctp_recvmsg.3 ============================================================================== --- head/lib/libc/net/sctp_recvmsg.3 Fri Jun 11 18:26:53 2010 (r209057) +++ head/lib/libc/net/sctp_recvmsg.3 Fri Jun 11 18:43:55 2010 (r209058) @@ -238,7 +238,7 @@ The field is not used by .Fn sctp_recvmsg . .Sh RETURN VALUES -The call returns the number of characters sent, or -1 +The call returns the number of bytes received, or -1 if an error occurred. .Sh ERRORS The From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:46:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E559106564A; Fri, 11 Jun 2010 18:46:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA408FC18; Fri, 11 Jun 2010 18:46:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BIkYSt058707; Fri, 11 Jun 2010 18:46:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BIkY8E058680; Fri, 11 Jun 2010 18:46:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006111846.o5BIkY8E058680@svn.freebsd.org> From: John Baldwin Date: Fri, 11 Jun 2010 18:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209059 - in head/sys: amd64/acpica amd64/amd64 cddl/contrib/opensolaris/uts/common/dtrace cddl/dev/cyclic cddl/dev/dtrace cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 compat/linprocfs de... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:46:35 -0000 Author: jhb Date: Fri Jun 11 18:46:34 2010 New Revision: 209059 URL: http://svn.freebsd.org/changeset/base/209059 Log: Update several places that iterate over CPUs to use CPU_FOREACH(). Modified: head/sys/amd64/acpica/madt.c head/sys/amd64/amd64/legacy.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/cyclic/cyclic.c head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/dtrace_debug.c head/sys/cddl/dev/dtrace/dtrace_load.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c head/sys/compat/linprocfs/linprocfs.c head/sys/dev/acpica/acpi_cpu.c head/sys/i386/acpica/madt.c head/sys/i386/i386/legacy.c head/sys/i386/i386/mp_machdep.c head/sys/kern/kern_clock.c head/sys/kern/kern_switch.c head/sys/kern/kern_timeout.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_lock.c head/sys/kern/subr_pcpu.c head/sys/kern/subr_smp.c head/sys/net/flowtable.c head/sys/net/if_epair.c head/sys/net/netisr.c head/sys/vm/uma_core.c head/sys/x86/x86/mca.c Modified: head/sys/amd64/acpica/madt.c ============================================================================== --- head/sys/amd64/acpica/madt.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/amd64/acpica/madt.c Fri Jun 11 18:46:34 2010 (r209059) @@ -557,9 +557,7 @@ madt_set_ids(void *dummy) if (madt == NULL) return; - for (i = 0; i < MAXCPU; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); KASSERT(pc != NULL, ("no pcpu data for CPU %u", i)); la = &lapics[pc->pc_apic_id]; Modified: head/sys/amd64/amd64/legacy.c ============================================================================== --- head/sys/amd64/amd64/legacy.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/amd64/amd64/legacy.c Fri Jun 11 18:46:34 2010 (r209059) @@ -269,12 +269,11 @@ cpu_identify(driver_t *driver, device_t * so that these devices are attached after the Host-PCI * bridges (which are added at order 100). */ - for (i = 0; i <= mp_maxid; i++) - if (!CPU_ABSENT(i)) { - child = BUS_ADD_CHILD(parent, 150, "cpu", i); - if (child == NULL) - panic("legacy_attach cpu"); - } + CPU_FOREACH(i) { + child = BUS_ADD_CHILD(parent, 150, "cpu", i); + if (child == NULL) + panic("legacy_attach cpu"); + } } static device_t Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jun 11 18:46:34 2010 (r209059) @@ -10583,8 +10583,6 @@ dtrace_buffer_alloc(dtrace_buffer_t *buf { #if defined(sun) cpu_t *cp; -#else - struct pcpu *cp; #endif dtrace_buffer_t *buf; @@ -10672,10 +10670,7 @@ err: #endif ASSERT(MUTEX_HELD(&dtrace_lock)); - for (i = 0; i <= mp_maxid; i++) { - if ((cp = pcpu_find(i)) == NULL) - continue; - + CPU_FOREACH(i) { if (cpu != DTRACE_CPUALL && cpu != i) continue; @@ -10715,10 +10710,7 @@ err: * Error allocating memory, so free the buffers that were * allocated before the failed allocation. */ - for (i = 0; i <= mp_maxid; i++) { - if ((cp = pcpu_find(i)) == NULL) - continue; - + CPU_FOREACH(i) { if (cpu != DTRACE_CPUALL && cpu != i) continue; @@ -12621,10 +12613,10 @@ dtrace_dstate_init(dtrace_dstate_t *dsta maxper = (limit - (uintptr_t)start) / NCPU; maxper = (maxper / dstate->dtds_chunksize) * dstate->dtds_chunksize; - for (i = 0; i < NCPU; i++) { #if !defined(sun) - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { +#else + for (i = 0; i < NCPU; i++) { #endif dstate->dtds_percpu[i].dtdsc_free = dvar = start; Modified: head/sys/cddl/dev/cyclic/cyclic.c ============================================================================== --- head/sys/cddl/dev/cyclic/cyclic.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/cddl/dev/cyclic/cyclic.c Fri Jun 11 18:46:34 2010 (r209059) @@ -1344,10 +1344,7 @@ cyclic_uninit(void) cpu_t *c; int id; - for (id = 0; id <= mp_maxid; id++) { - if (pcpu_find(id) == NULL) - continue; - + CPU_FOREACH(id) { c = &solaris_cpu[id]; if (c->cpu_cyclic == NULL) Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Jun 11 18:46:34 2010 (r209059) @@ -439,13 +439,10 @@ dtrace_gethrtime_init(void *arg) /* The current CPU is the reference one. */ tsc_skew[curcpu] = 0; - for (i = 0; i <= mp_maxid; i++) { + CPU_FOREACH(i) { if (i == curcpu) continue; - if (pcpu_find(i) == NULL) - continue; - map = 0; map |= (1 << curcpu); map |= (1 << i); Modified: head/sys/cddl/dev/dtrace/dtrace_debug.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_debug.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/cddl/dev/dtrace/dtrace_debug.c Fri Jun 11 18:46:34 2010 (r209059) @@ -108,10 +108,7 @@ dtrace_debug_init(void *dummy) int i; struct dtrace_debug_data *d; - for (i = 0; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) - continue; - + CPU_FOREACH(i) { d = &dtrace_debug_data[i]; if (d->first == NULL) { @@ -134,10 +131,7 @@ dtrace_debug_output(void) struct dtrace_debug_data *d; uintptr_t count; - for (i = 0; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) - continue; - + CPU_FOREACH(i) { dtrace_debug_lock(i); d = &dtrace_debug_data[i]; Modified: head/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_load.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/cddl/dev/dtrace/dtrace_load.c Fri Jun 11 18:46:34 2010 (r209059) @@ -30,8 +30,8 @@ dtrace_ap_start(void *dummy) mutex_enter(&cpu_lock); /* Setup the rest of the CPUs. */ - for (i = 1; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) + CPU_FOREACH(i) { + if (i == 0) continue; (void) dtrace_cpu_setup(CPU_CONFIG, i); Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Fri Jun 11 18:46:34 2010 (r209059) @@ -439,13 +439,10 @@ dtrace_gethrtime_init(void *arg) /* The current CPU is the reference one. */ tsc_skew[curcpu] = 0; - for (i = 0; i <= mp_maxid; i++) { + CPU_FOREACH(i) { if (i == curcpu) continue; - if (pcpu_find(i) == NULL) - continue; - map = 0; map |= (1 << curcpu); map |= (1 << i); Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/compat/linprocfs/linprocfs.c Fri Jun 11 18:46:34 2010 (r209059) @@ -468,9 +468,7 @@ linprocfs_dostat(PFS_FILL_ARGS) T2J(cp_time[CP_NICE]), T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/), T2J(cp_time[CP_IDLE])); - for (i = 0; i <= mp_maxid; ++i) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pcpu = pcpu_find(i); cp = pcpu->pc_cp_time; sbuf_printf(sb, "cpu%d %ld %ld %ld %ld\n", i, Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/dev/acpica/acpi_cpu.c Fri Jun 11 18:46:34 2010 (r209059) @@ -445,9 +445,7 @@ acpi_pcpu_get_id(uint32_t idx, uint32_t KASSERT(acpi_id != NULL, ("Null acpi_id")); KASSERT(cpu_id != NULL, ("Null cpu_id")); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pcpu_data = pcpu_find(i); KASSERT(pcpu_data != NULL, ("no pcpu data for %d", i)); if (idx-- == 0) { Modified: head/sys/i386/acpica/madt.c ============================================================================== --- head/sys/i386/acpica/madt.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/i386/acpica/madt.c Fri Jun 11 18:46:34 2010 (r209059) @@ -557,9 +557,7 @@ madt_set_ids(void *dummy) if (madt == NULL) return; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); KASSERT(pc != NULL, ("no pcpu data for CPU %u", i)); la = &lapics[pc->pc_apic_id]; Modified: head/sys/i386/i386/legacy.c ============================================================================== --- head/sys/i386/i386/legacy.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/i386/i386/legacy.c Fri Jun 11 18:46:34 2010 (r209059) @@ -290,12 +290,11 @@ cpu_identify(driver_t *driver, device_t * so that these devices are attached after the Host-PCI * bridges (which are added at order 100). */ - for (i = 0; i <= mp_maxid; i++) - if (!CPU_ABSENT(i)) { - child = BUS_ADD_CHILD(parent, 150, "cpu", i); - if (child == NULL) - panic("legacy_attach cpu"); - } + CPU_FOREACH(i) { + child = BUS_ADD_CHILD(parent, 150, "cpu", i); + if (child == NULL) + panic("legacy_attach cpu"); + } } static device_t Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/i386/i386/mp_machdep.c Fri Jun 11 18:46:34 2010 (r209059) @@ -1573,9 +1573,7 @@ mp_ipi_intrcnt(void *dummy) char buf[64]; int i; - for (i = 0; i < mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { snprintf(buf, sizeof(buf), "cpu%d: invltlb", i); intrcnt_add(buf, &ipi_invltlb_counts[i]); snprintf(buf, sizeof(buf), "cpu%d: invlrng", i); Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/kern/kern_clock.c Fri Jun 11 18:46:34 2010 (r209059) @@ -318,9 +318,7 @@ read_cpu_time(long *cp_time) /* Sum up global cp_time[]. */ bzero(cp_time, sizeof(long) * CPUSTATES); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); for (j = 0; j < CPUSTATES; j++) cp_time[j] += pc->pc_cp_time[j]; Modified: head/sys/kern/kern_switch.c ============================================================================== --- head/sys/kern/kern_switch.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/kern/kern_switch.c Fri Jun 11 18:46:34 2010 (r209059) @@ -133,9 +133,7 @@ sysctl_stats_reset(SYSCTL_HANDLER_ARGS) if (p == oidp || p->oid_arg1 == NULL) continue; counter = (uintptr_t)p->oid_arg1; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { *(long *)(dpcpu_off[i] + counter) = 0; } } Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/kern/kern_timeout.c Fri Jun 11 18:46:34 2010 (r209059) @@ -228,11 +228,9 @@ start_softclock(void *dummy) panic("died while creating standard software ithreads"); cc->cc_cookie = softclock_ih; #ifdef SMP - for (cpu = 0; cpu <= mp_maxid; cpu++) { + CPU_FOREACH(cpu) { if (cpu == timeout_cpu) continue; - if (CPU_ABSENT(cpu)) - continue; cc = CC_CPU(cpu); if (swi_add(NULL, "clock", softclock, cc, SWI_CLOCK, INTR_MPSAFE, &cc->cc_cookie)) Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/kern/sched_4bsd.c Fri Jun 11 18:46:34 2010 (r209059) @@ -1190,9 +1190,7 @@ sched_pickcpu(struct thread *td) best = td->td_lastcpu; else best = NOCPU; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { if (!THREAD_CAN_SCHED(td, cpu)) continue; @@ -1627,9 +1625,7 @@ sched_affinity(struct thread *td) */ ts = td->td_sched; ts->ts_flags &= ~TSF_AFFINITY; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { if (!THREAD_CAN_SCHED(td, cpu)) { ts->ts_flags |= TSF_AFFINITY; break; Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/kern/sched_ule.c Fri Jun 11 18:46:34 2010 (r209059) @@ -1254,9 +1254,7 @@ sched_setup_smp(void) int i; cpu_top = smp_topo(); - for (i = 0; i < MAXCPU; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { tdq = TDQ_CPU(i); tdq_setup(tdq); tdq->tdq_cg = smp_topo_find(cpu_top, i); @@ -2485,7 +2483,7 @@ sched_load(void) int i; total = 0; - for (i = 0; i <= mp_maxid; i++) + CPU_FOREACH(i) total += TDQ_CPU(i)->tdq_sysload; return (total); #else Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/kern/subr_lock.c Fri Jun 11 18:46:34 2010 (r209059) @@ -256,9 +256,7 @@ lock_prof_idle(void) td = curthread; thread_lock(td); - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { sched_bind(td, cpu); } sched_unbind(td); Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/kern/subr_pcpu.c Fri Jun 11 18:46:34 2010 (r209059) @@ -317,9 +317,7 @@ DB_SHOW_COMMAND(dpcpu_off, db_show_dpcpu { int id; - for (id = 0; id <= mp_maxid; id++) { - if (CPU_ABSENT(id)) - continue; + CPU_FOREACH(id) { db_printf("dpcpu_off[%2d] = 0x%jx (+ DPCPU_START = %p)\n", id, (uintmax_t)dpcpu_off[id], (void *)(uintptr_t)(dpcpu_off[id] + DPCPU_START)); Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/kern/subr_smp.c Fri Jun 11 18:46:34 2010 (r209059) @@ -395,9 +395,10 @@ smp_rendezvous_cpus(cpumask_t map, return; } - for (i = 0; i <= mp_maxid; i++) - if (((1 << i) & map) != 0 && !CPU_ABSENT(i)) + CPU_FOREACH(i) { + if (((1 << i) & map) != 0) ncpus++; + } if (ncpus == 0) panic("ncpus is 0 with map=0x%x", map); Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/net/flowtable.c Fri Jun 11 18:46:34 2010 (r209059) @@ -328,9 +328,7 @@ flowtable_show_stats(struct sbuf *sb, st if (ft->ft_flags & FL_PCPU) { bzero(&fs, sizeof(fs)); pfs = &fs; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pfs->ft_collisions += ft->ft_stats[i].ft_collisions; pfs->ft_allocated += ft->ft_stats[i].ft_allocated; pfs->ft_misses += ft->ft_stats[i].ft_misses; @@ -1495,10 +1493,7 @@ flowtable_route_flush(struct flowtable * int i; if (ft->ft_flags & FL_PCPU) { - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; - + CPU_FOREACH(i) { if (smp_started == 1) { thread_lock(curthread); sched_bind(curthread, i); @@ -1527,10 +1522,7 @@ flowtable_clean_vnet(void) ft = V_flow_list_head; while (ft != NULL) { if (ft->ft_flags & FL_PCPU) { - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; - + CPU_FOREACH(i) { if (smp_started == 1) { thread_lock(curthread); sched_bind(curthread, i); @@ -1799,9 +1791,7 @@ flowtable_show_vnet(void) while (ft != NULL) { printf("name: %s\n", ft->ft_name); if (ft->ft_flags & FL_PCPU) { - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { flowtable_show(ft, i); } } else { Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/net/if_epair.c Fri Jun 11 18:46:34 2010 (r209059) @@ -189,10 +189,7 @@ epair_dpcpu_init(void) struct eid_list *s; u_int cpuid; - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; - + CPU_FOREACH(cpuid) { epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); /* Initialize per-cpu lock. */ @@ -217,10 +214,7 @@ epair_dpcpu_detach(void) struct epair_dpcpu *epair_dpcpu; u_int cpuid; - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; - + CPU_FOREACH(cpuid) { epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); /* Destroy per-cpu lock. */ @@ -330,10 +324,7 @@ epair_remove_ifp_from_draining(struct if struct epair_ifp_drain *elm, *tvar; u_int cpuid; - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; - + CPU_FOREACH(cpuid) { epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); EPAIR_LOCK(epair_dpcpu); STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list, Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/net/netisr.c Fri Jun 11 18:46:34 2010 (r209059) @@ -339,9 +339,7 @@ netisr_register(const struct netisr_hand } else netisr_proto[proto].np_qlimit = nhp->nh_qlimit; netisr_proto[proto].np_policy = nhp->nh_policy; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; bzero(npwp, sizeof(*npwp)); npwp->nw_qlimit = netisr_proto[proto].np_qlimit; @@ -373,9 +371,7 @@ netisr_clearqdrops(const struct netisr_h ("%s(%u): protocol not registered for %s", __func__, proto, name)); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; npwp->nw_qdrops = 0; } @@ -408,9 +404,7 @@ netisr_getqdrops(const struct netisr_han ("%s(%u): protocol not registered for %s", __func__, proto, name)); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; *qdropp += npwp->nw_qdrops; } @@ -474,9 +468,7 @@ netisr_setqlimit(const struct netisr_han name)); netisr_proto[proto].np_qlimit = qlimit; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; npwp->nw_qlimit = qlimit; } @@ -540,9 +532,7 @@ netisr_unregister(const struct netisr_ha netisr_proto[proto].np_m2cpuid = NULL; netisr_proto[proto].np_qlimit = 0; netisr_proto[proto].np_policy = 0; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; netisr_drain_proto(npwp); bzero(npwp, sizeof(*npwp)); @@ -1136,9 +1126,7 @@ sysctl_netisr_workstream(SYSCTL_HANDLER_ M_ZERO | M_WAITOK); counter = 0; NETISR_RLOCK(&tracker); - for (cpuid = 0; cpuid < MAXCPU; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; + CPU_FOREACH(cpuid) { nwsp = DPCPU_ID_PTR(cpuid, nws); if (nwsp->nws_intr_event == NULL) continue; @@ -1192,9 +1180,7 @@ sysctl_netisr_work(SYSCTL_HANDLER_ARGS) M_TEMP, M_ZERO | M_WAITOK); counter = 0; NETISR_RLOCK(&tracker); - for (cpuid = 0; cpuid < MAXCPU; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; + CPU_FOREACH(cpuid) { nwsp = DPCPU_ID_PTR(cpuid, nws); if (nwsp->nws_intr_event == NULL) continue; @@ -1243,9 +1229,7 @@ DB_SHOW_COMMAND(netisr, db_show_netisr) db_printf("%3s %6s %5s %5s %5s %8s %8s %8s %8s\n", "CPU", "Proto", "Len", "WMark", "Max", "Disp", "HDisp", "Drop", "Queue"); - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; + CPU_FOREACH(cpuid) { nwsp = DPCPU_ID_PTR(cpuid, nws); if (nwsp->nws_intr_event == NULL) continue; Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/vm/uma_core.c Fri Jun 11 18:46:34 2010 (r209059) @@ -620,9 +620,7 @@ cache_drain(uma_zone_t zone) * it is used elsewhere. Should the tear-down path be made special * there in some form? */ - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { cache = &zone->uz_cpu[cpu]; bucket_drain(zone, cache->uc_allocbucket); bucket_drain(zone, cache->uc_freebucket); @@ -3075,9 +3073,7 @@ uma_print_zone(uma_zone_t zone) zone->uz_name, zone, zone->uz_size, zone->uz_flags); LIST_FOREACH(kl, &zone->uz_kegs, kl_link) uma_print_keg(kl->kl_keg); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { cache = &zone->uz_cpu[i]; printf("CPU %d Cache:\n", i); cache_print(cache); @@ -3106,9 +3102,7 @@ uma_zone_sumstat(uma_zone_t z, int *cach allocs = frees = 0; cachefree = 0; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { cache = &z->uz_cpu[cpu]; if (cache->uc_allocbucket != NULL) cachefree += cache->uc_allocbucket->ub_cnt; Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Fri Jun 11 18:43:55 2010 (r209058) +++ head/sys/x86/x86/mca.c Fri Jun 11 18:46:34 2010 (r209059) @@ -558,7 +558,7 @@ mca_scan(enum scan_mode mode) * If this is a bank this CPU monitors via CMCI, * update the threshold. */ - if (PCPU_GET(cmci_mask) & (1 << i)) + if (PCPU_GET(cmci_mask) & 1 << i) cmci_update(mode, i, valid, &rec); #endif } @@ -580,9 +580,7 @@ mca_scan_cpus(void *context, int pending td = curthread; count = 0; thread_lock(td); - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { sched_bind(td, cpu); thread_unlock(td); count += mca_scan(POLLED); From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:49:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F4031065678; Fri, 11 Jun 2010 18:49:20 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99]) by mx1.freebsd.org (Postfix) with ESMTP id DC5228FC2F; Fri, 11 Jun 2010 18:49:19 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp024.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3V0062B5M2T540@asmtp024.mac.com>; Fri, 11 Jun 2010 11:49:15 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006110124 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-11_02:2010-02-06, 2010-06-11, 2010-06-11 signatures=0 From: Marcel Moolenaar In-reply-to: <20100611180824.GG13776@michelle.cdnetworks.com> Date: Fri, 11 Jun 2010 11:49:14 -0700 Message-id: References: <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <20100611174137.GC13776@michelle.cdnetworks.com> <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> <20100611175016.GD13776@michelle.cdnetworks.com> <59E450BB-1E79-440E-AF82-B78E1E8FE334@mac.com> <20100611180824.GG13776@michelle.cdnetworks.com> To: pyunyh@gmail.com X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:49:20 -0000 On Jun 11, 2010, at 11:08 AM, Pyun YongHyeon wrote: > On Fri, Jun 11, 2010 at 11:06:06AM -0700, Marcel Moolenaar wrote: >> >> On Jun 11, 2010, at 10:50 AM, Pyun YongHyeon wrote: >> >>>>>> >>>>>> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. >>>>>> >>>>> >>>>> Some controllers have 4G boundary bug so bge(4) restricts dma >>>>> address space. >>>> >>>> That limitation should be reflected in the boundary attribute of the tag, not the lowaddr/highaddr attributes. >>>> >>> >>> Yes, but that needed more code. And I don't have these buggy >>> controllers so I chose more simple way that would work even though >>> it may be inefficient. >> >> Do you happen to know if one or both of the hardware I have access to >> is the "buggy" hardware? >> > > Yes, both devices below can not handle 4GB boundary crossing in DMA > state machine. Thanks. I'll keep that in mind. If I have a few cycles I'll patch the kernel to allow 64-bit DMA addresses with a 4G boundary restriction and run that through stress2. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:54:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97B261065675; Fri, 11 Jun 2010 18:54:07 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5588FC1B; Fri, 11 Jun 2010 18:54:07 +0000 (UTC) Received: by pwj1 with SMTP id 1so998773pwj.13 for ; Fri, 11 Jun 2010 11:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=0qi6xuEgjTInUejR2ChjcWy6HSTEan/QNfnH92TVI1I=; b=DP8Y2J/XZ8QxWQWuhfJRJkO632Uu9VPc/Re6squGanw7fKpqUmPSOWGuhGEG5k7ADG nLuYB9iT039SH6FE/mFKcqgmsc1byNy0NxxqxM3SgrXkZerf/4DCeKancbxEiw7RhZ89 pl1S4jQHf3nI2s69uc4ptVdP1aEWmpnpGAP4s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=iulmqlk50+I1M4XRME+cNV1Q1fyvFhsTl6c3U8dL2aPmg0yLLRppO/uKQBuaqRmedD skQjiG2t+qyHcAvu6IiFAscGrW8faYuuwbHwY286gAONxCv6IGppYf6KvAdCTJd2K980 CNwAEATRiTjNkUROZpk7oCqi2nZFBpLv5Jx54= Received: by 10.141.108.21 with SMTP id k21mr1715007rvm.170.1276282446828; Fri, 11 Jun 2010 11:54:06 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id r23sm1486238rvq.0.2010.06.11.11.54.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 11:54:06 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 11 Jun 2010 11:52:45 -0700 From: Pyun YongHyeon Date: Fri, 11 Jun 2010 11:52:45 -0700 To: Marcel Moolenaar Message-ID: <20100611185245.GK13776@michelle.cdnetworks.com> References: <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <20100611174137.GC13776@michelle.cdnetworks.com> <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> <20100611175016.GD13776@michelle.cdnetworks.com> <59E450BB-1E79-440E-AF82-B78E1E8FE334@mac.com> <20100611180824.GG13776@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:54:07 -0000 On Fri, Jun 11, 2010 at 11:49:14AM -0700, Marcel Moolenaar wrote: > > On Jun 11, 2010, at 11:08 AM, Pyun YongHyeon wrote: > > > On Fri, Jun 11, 2010 at 11:06:06AM -0700, Marcel Moolenaar wrote: > >> > >> On Jun 11, 2010, at 10:50 AM, Pyun YongHyeon wrote: > >> > >>>>>> > >>>>>> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. > >>>>>> > >>>>> > >>>>> Some controllers have 4G boundary bug so bge(4) restricts dma > >>>>> address space. > >>>> > >>>> That limitation should be reflected in the boundary attribute of the tag, not the lowaddr/highaddr attributes. > >>>> > >>> > >>> Yes, but that needed more code. And I don't have these buggy > >>> controllers so I chose more simple way that would work even though > >>> it may be inefficient. > >> > >> Do you happen to know if one or both of the hardware I have access to > >> is the "buggy" hardware? > >> > > > > Yes, both devices below can not handle 4GB boundary crossing in DMA > > state machine. > > Thanks. I'll keep that in mind. If I have a few cycles I'll patch the > kernel to allow 64-bit DMA addresses with a 4G boundary restriction > and run that through stress2. > I'll let you know when I have a patch to try on your box. I'm not sure when that could be done though. > -- > Marcel Moolenaar > xcllnt@mac.com > > > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 19:03:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3059106567D; Fri, 11 Jun 2010 19:03:59 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 903178FC14; Fri, 11 Jun 2010 19:03:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BJ3x75062602; Fri, 11 Jun 2010 19:03:59 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BJ3xp1062600; Fri, 11 Jun 2010 19:03:59 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201006111903.o5BJ3xp1062600@svn.freebsd.org> From: Jack F Vogel Date: Fri, 11 Jun 2010 19:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209060 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 19:03:59 -0000 Author: jfv Date: Fri Jun 11 19:03:59 2010 New Revision: 209060 URL: http://svn.freebsd.org/changeset/base/209060 Log: Remove a disable_queue from the beginning of the interrupt handler, automask handles it. Also, add in msix vector descriptions. MFC for 8.1 asap Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Jun 11 18:46:34 2010 (r209059) +++ head/sys/dev/ixgbe/ixgbe.c Fri Jun 11 19:03:59 2010 (r209060) @@ -1365,7 +1365,6 @@ ixgbe_msix_que(void *arg) bool more_tx, more_rx; u32 newitr = 0; - ixgbe_disable_queue(adapter, que->msix); ++que->irqs; more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); @@ -2121,6 +2120,9 @@ ixgbe_allocate_msix(struct adapter *adap device_printf(dev, "Failed to register QUE handler"); return (error); } +#if __FreeBSD_version >= 800504 + bus_describe_intr(dev, que->res, que->tag, "que %d", i); +#endif que->msix = vector; adapter->que_mask |= (u64)(1 << que->msix); /* @@ -2155,6 +2157,9 @@ ixgbe_allocate_msix(struct adapter *adap device_printf(dev, "Failed to register LINK handler"); return (error); } +#if __FreeBSD_version >= 800504 + bus_describe_intr(dev, adapter->res, adapter->tag, "link"); +#endif adapter->linkvec = vector; /* Tasklets for Link, SFP and Multispeed Fiber */ TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 19:09:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44338106564A; Fri, 11 Jun 2010 19:09:16 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99]) by mx1.freebsd.org (Postfix) with ESMTP id 208708FC0C; Fri, 11 Jun 2010 19:09:15 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp024.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3V0048R6JCAF90@asmtp024.mac.com>; Fri, 11 Jun 2010 12:09:13 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006110125 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-11_02:2010-02-06, 2010-06-11, 2010-06-11 signatures=0 From: Marcel Moolenaar In-reply-to: <20100611185245.GK13776@michelle.cdnetworks.com> Date: Fri, 11 Jun 2010 12:09:11 -0700 Message-id: <5202F479-7191-4513-8470-6A5DA1C288A1@mac.com> References: <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <20100611174137.GC13776@michelle.cdnetworks.com> <9F065122-7D91-42E9-A251-5AF4AAF0B4E5@samsco.org> <20100611175016.GD13776@michelle.cdnetworks.com> <59E450BB-1E79-440E-AF82-B78E1E8FE334@mac.com> <20100611180824.GG13776@michelle.cdnetworks.com> <20100611185245.GK13776@michelle.cdnetworks.com> To: pyunyh@gmail.com X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 19:09:16 -0000 On Jun 11, 2010, at 11:52 AM, Pyun YongHyeon wrote: > On Fri, Jun 11, 2010 at 11:49:14AM -0700, Marcel Moolenaar wrote: >> >> On Jun 11, 2010, at 11:08 AM, Pyun YongHyeon wrote: >> >>> On Fri, Jun 11, 2010 at 11:06:06AM -0700, Marcel Moolenaar wrote: >>>> >>>> On Jun 11, 2010, at 10:50 AM, Pyun YongHyeon wrote: >>>> >>>>>>>> >>>>>>>> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. >>>>>>>> >>>>>>> >>>>>>> Some controllers have 4G boundary bug so bge(4) restricts dma >>>>>>> address space. >>>>>> >>>>>> That limitation should be reflected in the boundary attribute of the tag, not the lowaddr/highaddr attributes. >>>>>> >>>>> >>>>> Yes, but that needed more code. And I don't have these buggy >>>>> controllers so I chose more simple way that would work even though >>>>> it may be inefficient. >>>> >>>> Do you happen to know if one or both of the hardware I have access to >>>> is the "buggy" hardware? >>>> >>> >>> Yes, both devices below can not handle 4GB boundary crossing in DMA >>> state machine. >> >> Thanks. I'll keep that in mind. If I have a few cycles I'll patch the >> kernel to allow 64-bit DMA addresses with a 4G boundary restriction >> and run that through stress2. >> > > I'll let you know when I have a patch to try on your box. I'm not sure > when that could be done though. Not to worry. I appreciate your support. Just let me know when you want me to test something. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 19:17:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF0DD1065672; Fri, 11 Jun 2010 19:17:36 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB40C8FC1C; Fri, 11 Jun 2010 19:17:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BJHawN065640; Fri, 11 Jun 2010 19:17:36 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BJHa93065633; Fri, 11 Jun 2010 19:17:36 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201006111917.o5BJHa93065633@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 11 Jun 2010 19:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209061 - in stable/8/sys: amd64/include/xen dev/cxgb/sys dev/xen/netfront i386/include/xen kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 19:17:36 -0000 Author: ken Date: Fri Jun 11 19:17:36 2010 New Revision: 209061 URL: http://svn.freebsd.org/changeset/base/209061 Log: MFC 199549, 199997, 204158, 207673, and 208901. Bring in a number of netfront changes: r199549 | jhb Remove commented out reference to if_watchdog and an assignment of zero to if_timer. Reviewed by: scottl r199997 | gibbs Add media ioctl support and link notifications so that devd will attempt to run dhclient on a netfront (xn) device that is setup for DHCP in /etc/rc.conf. PR: kern/136251 (fixed differently than the submitted patch) r204158 | kmacy - make printf conditional - fix witness warnings by making configuration lock a mutex r207673 | joel Switch to our preferred 2-clause BSD license. Approved by: kmacy r208901 | ken A number of netfront fixes and stability improvements: - Re-enable TSO. This was broken previously due to CSUM_TSO clearing the CSUM_TCP flag, so our checksum flags were incorrectly set going to the netback driver. That was fixed in r206844 in tcp_output.c, so we can turn TSO back on here. - Fix the way transmit slots are calculated, so that we can't overfill the ring. - Avoid sending packets with more fragments/segments than netback can handle. The Linux netback code can only handle packets of MAX_SKB_FRAGS, which turns out to be 18 on machines with 4K pages. We can easily generate packets with 32 or so fragments with TSO turned on. Right now the solution is just to drop the packets (since netback doesn't seem to handle it gracefully), but we should come up with a way to allow a driver to tell the TCP stack the maximum number of fragments it can handle in a single packet. - Fix the way the consumer is tracked in the receive path. It could get out of sync fairly easily. - Use standard Xen ring macros to make it clearer how netfront is using the rings. - Get rid of Linux-ish negative errno return values. - Added more documentation to the driver. - Refactored code to make it easier to read. - Some other minor fixes. Reviewed by: gibbs Sponsored by: Spectra Logic Approved by: re (bz) Modified: stable/8/sys/amd64/include/xen/xenfunc.h stable/8/sys/amd64/include/xen/xenvar.h stable/8/sys/dev/cxgb/sys/mvec.h stable/8/sys/dev/cxgb/sys/uipc_mvec.c stable/8/sys/dev/xen/netfront/netfront.c stable/8/sys/i386/include/xen/xenfunc.h stable/8/sys/i386/include/xen/xenvar.h stable/8/sys/kern/subr_bufring.c stable/8/sys/sys/buf_ring.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/amd64/include/xen/xenfunc.h ============================================================================== --- stable/8/sys/amd64/include/xen/xenfunc.h Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/amd64/include/xen/xenfunc.h Fri Jun 11 19:17:36 2010 (r209061) @@ -1,6 +1,5 @@ -/* - * - * Copyright (c) 2004,2005 Kip Macy +/*- + * Copyright (c) 2004, 2005 Kip Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,22 +10,22 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ */ - #ifndef _XEN_XENFUNC_H_ #define _XEN_XENFUNC_H_ Modified: stable/8/sys/amd64/include/xen/xenvar.h ============================================================================== --- stable/8/sys/amd64/include/xen/xenvar.h Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/amd64/include/xen/xenvar.h Fri Jun 11 19:17:36 2010 (r209061) @@ -1,29 +1,27 @@ -/* +/*- * Copyright (c) 2008 Kip Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: stable/8/sys/dev/cxgb/sys/mvec.h ============================================================================== --- stable/8/sys/dev/cxgb/sys/mvec.h Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/dev/cxgb/sys/mvec.h Fri Jun 11 19:17:36 2010 (r209061) @@ -1,33 +1,31 @@ -/************************************************************************** - * - * Copyright (c) 2007,2009 Kip Macy kmacy@freebsd.org +/*- + * Copyright (c) 2007, 2009 Kip Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. The name of Kip Macy nor the names of other - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ * - ***************************************************************************/ + */ #ifndef _MVEC_H_ #define _MVEC_H_ Modified: stable/8/sys/dev/cxgb/sys/uipc_mvec.c ============================================================================== --- stable/8/sys/dev/cxgb/sys/uipc_mvec.c Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/dev/cxgb/sys/uipc_mvec.c Fri Jun 11 19:17:36 2010 (r209061) @@ -1,32 +1,28 @@ -/************************************************************************** - * - * Copyright (c) 2007-2008, Kip Macy kmacy@freebsd.org +/*- + * Copyright (c) 2007-2008 Kip Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. The name of Kip Macy nor the names of other - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/8/sys/dev/xen/netfront/netfront.c Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/dev/xen/netfront/netfront.c Fri Jun 11 19:17:36 2010 (r209061) @@ -1,19 +1,27 @@ -/* - * +/*- * Copyright (c) 2004-2006 Kip Macy * All rights reserved. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ @@ -116,7 +124,16 @@ static const int MODPARM_rx_copy = 1; static const int MODPARM_rx_flip = 0; #endif -#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2) +/** + * \brief The maximum allowed data fragments in a single transmit + * request. + * + * This limit is imposed by the backend driver. We assume here that + * we are dealing with a Linux driver domain and have set our limit + * to mirror the Linux MAX_SKB_FRAGS constant. + */ +#define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) + #define RX_COPY_THRESHOLD 256 #define net_ratelimit() 0 @@ -132,6 +149,9 @@ static void xn_tick_locked(struct netfro static void xn_tick(void *); static void xn_intr(void *); +static inline int xn_count_frags(struct mbuf *m); +static int xn_assemble_tx_request(struct netfront_info *sc, + struct mbuf *m_head); static void xn_start_locked(struct ifnet *); static void xn_start(struct ifnet *); static int xn_ioctl(struct ifnet *, u_long, caddr_t); @@ -155,6 +175,9 @@ static void netif_disconnect_backend(str static int setup_device(device_t dev, struct netfront_info *info); static void end_access(int ref, void *page); +static int xn_ifmedia_upd(struct ifnet *ifp); +static void xn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); + /* Xenolinux helper functions */ int network_connect(struct netfront_info *); @@ -163,8 +186,8 @@ static void xn_free_rx_ring(struct netfr static void xn_free_tx_ring(struct netfront_info *); static int xennet_get_responses(struct netfront_info *np, - struct netfront_rx_info *rinfo, RING_IDX rp, struct mbuf **list, - int *pages_flipped_p); + struct netfront_rx_info *rinfo, RING_IDX rp, RING_IDX *cons, + struct mbuf **list, int *pages_flipped_p); #define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) @@ -176,11 +199,12 @@ static int xennet_get_responses(struct n * not the other way around. The size must track the free index arrays. */ struct xn_chain_data { - struct mbuf *xn_tx_chain[NET_TX_RING_SIZE+1]; - int xn_tx_chain_cnt; - struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; + struct mbuf *xn_tx_chain[NET_TX_RING_SIZE+1]; + int xn_tx_chain_cnt; + struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; }; +#define NUM_ELEMENTS(x) (sizeof(x)/sizeof(*x)) struct net_device_stats { @@ -230,7 +254,7 @@ struct netfront_info { struct mtx tx_lock; struct mtx rx_lock; - struct sx sc_lock; + struct mtx sc_lock; u_int handle; u_int irq; @@ -240,32 +264,29 @@ struct netfront_info { /* Receive-ring batched refills. */ #define RX_MIN_TARGET 32 #define RX_MAX_TARGET NET_RX_RING_SIZE - int rx_min_target, rx_max_target, rx_target; - - /* - * {tx,rx}_skbs store outstanding skbuffs. The first entry in each - * array is an index into a chain of free entries. - */ + int rx_min_target; + int rx_max_target; + int rx_target; grant_ref_t gref_tx_head; grant_ref_t grant_tx_ref[NET_TX_RING_SIZE + 1]; grant_ref_t gref_rx_head; grant_ref_t grant_rx_ref[NET_TX_RING_SIZE + 1]; -#define TX_MAX_TARGET min(NET_RX_RING_SIZE, 256) - device_t xbdev; - int tx_ring_ref; - int rx_ring_ref; - uint8_t mac[ETHER_ADDR_LEN]; + device_t xbdev; + int tx_ring_ref; + int rx_ring_ref; + uint8_t mac[ETHER_ADDR_LEN]; struct xn_chain_data xn_cdata; /* mbufs */ - struct mbuf_head xn_rx_batch; /* head of the batch queue */ + struct mbuf_head xn_rx_batch; /* head of the batch queue */ int xn_if_flags; struct callout xn_stat_ch; - u_long rx_pfn_array[NET_RX_RING_SIZE]; - multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; - mmu_update_t rx_mmu[NET_RX_RING_SIZE]; + u_long rx_pfn_array[NET_RX_RING_SIZE]; + multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; + mmu_update_t rx_mmu[NET_RX_RING_SIZE]; + struct ifmedia sc_media; }; #define rx_mbufs xn_cdata.xn_rx_chain @@ -274,7 +295,7 @@ struct netfront_info { #define XN_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->tx_lock, #_name"_tx", "network transmit lock", MTX_DEF); \ mtx_init(&(_sc)->rx_lock, #_name"_rx", "network receive lock", MTX_DEF); \ - sx_init(&(_sc)->sc_lock, #_name"_rx") + mtx_init(&(_sc)->sc_lock, #_name"_sc", "netfront softc lock", MTX_DEF) #define XN_RX_LOCK(_sc) mtx_lock(&(_sc)->rx_lock) #define XN_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->rx_lock) @@ -282,15 +303,15 @@ struct netfront_info { #define XN_TX_LOCK(_sc) mtx_lock(&(_sc)->tx_lock) #define XN_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->tx_lock) -#define XN_LOCK(_sc) sx_xlock(&(_sc)->sc_lock); -#define XN_UNLOCK(_sc) sx_xunlock(&(_sc)->sc_lock); +#define XN_LOCK(_sc) mtx_lock(&(_sc)->sc_lock); +#define XN_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_lock); -#define XN_LOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_lock, SX_LOCKED); +#define XN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_lock, MA_OWNED); #define XN_RX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rx_lock, MA_OWNED); #define XN_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_lock, MA_OWNED); #define XN_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->rx_lock); \ mtx_destroy(&(_sc)->tx_lock); \ - sx_destroy(&(_sc)->sc_lock); + mtx_destroy(&(_sc)->sc_lock); struct netfront_rx_info { struct netif_rx_response rx; @@ -310,18 +331,22 @@ struct netfront_rx_info { */ static inline void -add_id_to_freelist(struct mbuf **list, unsigned short id) +add_id_to_freelist(struct mbuf **list, uintptr_t id) { - KASSERT(id != 0, ("add_id_to_freelist: the head item (0) must always be free.")); + KASSERT(id != 0, + ("%s: the head item (0) must always be free.", __func__)); list[id] = list[0]; - list[0] = (void *)(u_long)id; + list[0] = (struct mbuf *)id; } static inline unsigned short get_id_from_freelist(struct mbuf **list) { - u_int id = (u_int)(u_long)list[0]; - KASSERT(id != 0, ("get_id_from_freelist: the head item (0) must always remain free.")); + uintptr_t id; + + id = (uintptr_t)list[0]; + KASSERT(id != 0, + ("%s: the head item (0) must always remain free.", __func__)); list[0] = list[id]; return (id); } @@ -333,8 +358,7 @@ xennet_rxidx(RING_IDX idx) } static inline struct mbuf * -xennet_get_rx_mbuf(struct netfront_info *np, - RING_IDX ri) +xennet_get_rx_mbuf(struct netfront_info *np, RING_IDX ri) { int i = xennet_rxidx(ri); struct mbuf *m; @@ -355,9 +379,13 @@ xennet_get_rx_ref(struct netfront_info * #define IPRINTK(fmt, args...) \ printf("[XEN] " fmt, ##args) +#ifdef INVARIANTS #define WPRINTK(fmt, args...) \ printf("[XEN] " fmt, ##args) -#if 0 +#else +#define WPRINTK(fmt, args...) +#endif +#ifdef DEBUG #define DPRINTK(fmt, args...) \ printf("[XEN] %s: " fmt, __func__, ##args) #else @@ -477,25 +505,25 @@ talk_to_backend(device_t dev, struct net goto destroy_ring; } err = xenbus_printf(xbt, node, "tx-ring-ref","%u", - info->tx_ring_ref); + info->tx_ring_ref); if (err) { message = "writing tx ring-ref"; goto abort_transaction; } err = xenbus_printf(xbt, node, "rx-ring-ref","%u", - info->rx_ring_ref); + info->rx_ring_ref); if (err) { message = "writing rx ring-ref"; goto abort_transaction; } err = xenbus_printf(xbt, node, - "event-channel", "%u", irq_to_evtchn_port(info->irq)); + "event-channel", "%u", irq_to_evtchn_port(info->irq)); if (err) { message = "writing event-channel"; goto abort_transaction; } err = xenbus_printf(xbt, node, "request-rx-copy", "%u", - info->copying_receiver); + info->copying_receiver); if (err) { message = "writing request-rx-copy"; goto abort_transaction; @@ -656,9 +684,9 @@ xn_free_rx_ring(struct netfront_info *sc int i; for (i = 0; i < NET_RX_RING_SIZE; i++) { - if (sc->xn_cdata.xn_rx_chain[i] != NULL) { - m_freem(sc->xn_cdata.xn_rx_chain[i]); - sc->xn_cdata.xn_rx_chain[i] = NULL; + if (sc->xn_cdata.rx_mbufs[i] != NULL) { + m_freem(sc->rx_mbufs[i]); + sc->rx_mbufs[i] = NULL; } } @@ -675,8 +703,8 @@ xn_free_tx_ring(struct netfront_info *sc int i; for (i = 0; i < NET_TX_RING_SIZE; i++) { - if (sc->xn_cdata.xn_tx_chain[i] != NULL) { - m_freem(sc->xn_cdata.xn_tx_chain[i]); + if (sc->tx_mbufs[i] != NULL) { + m_freem(sc->tx_mbufs[i]); sc->xn_cdata.xn_tx_chain[i] = NULL; } } @@ -685,39 +713,36 @@ xn_free_tx_ring(struct netfront_info *sc #endif } -/* - * Do some brief math on the number of descriptors available to - * determine how many slots are available. - * - * Firstly - wouldn't something with RING_FREE_REQUESTS() be more applicable? - * Secondly - MAX_SKB_FRAGS is a Linux construct which may not apply here. - * Thirdly - it isn't used here anyway; the magic constant '24' is possibly - * wrong? - * The "2" is presumably to ensure there are also enough slots available for - * the ring entries used for "options" (eg, the TSO entry before a packet - * is queued); I'm not sure why its 2 and not 1. Perhaps to make sure there's - * a "free" node in the tx mbuf list (node 0) to represent the freelist? +/** + * \brief Verify that there is sufficient space in the Tx ring + * buffer for a maximally sized request to be enqueued. * - * This only figures out whether any xenbus ring descriptors are available; - * it doesn't at all reflect how many tx mbuf ring descriptors are also - * available. + * A transmit request requires a transmit descriptor for each packet + * fragment, plus up to 2 entries for "options" (e.g. TSO). */ static inline int -netfront_tx_slot_available(struct netfront_info *np) +xn_tx_slot_available(struct netfront_info *np) { - return ((np->tx.req_prod_pvt - np->tx.rsp_cons) < - (TX_MAX_TARGET - /* MAX_SKB_FRAGS */ 24 - 2)); + return (RING_FREE_REQUESTS(&np->tx) > (MAX_TX_REQ_FRAGS + 2)); } + static void netif_release_tx_bufs(struct netfront_info *np) { - struct mbuf *m; int i; for (i = 1; i <= NET_TX_RING_SIZE; i++) { - m = np->xn_cdata.xn_tx_chain[i]; + struct mbuf *m; + + m = np->tx_mbufs[i]; - if (((u_long)m) < KERNBASE) + /* + * We assume that no kernel addresses are + * less than NET_TX_RING_SIZE. Any entry + * in the table that is below this number + * must be an index from free-list tracking. + */ + if (((uintptr_t)m) <= NET_TX_RING_SIZE) continue; gnttab_grant_foreign_access_ref(np->grant_tx_ref[i], xenbus_get_otherend_id(np->xbdev), @@ -756,19 +781,25 @@ network_alloc_rx_buffers(struct netfront return; /* - * Allocate skbuffs greedily, even though we batch updates to the + * Allocate mbufs greedily, even though we batch updates to the * receive ring. This creates a less bursty demand on the memory - * allocator, so should reduce the chance of failed allocation + * allocator, and so should reduce the chance of failed allocation * requests both for ourself and for other kernel subsystems. + * + * Here we attempt to maintain rx_target buffers in flight, counting + * buffers that we have yet to process in the receive ring. */ batch_target = sc->rx_target - (req_prod - sc->rx.rsp_cons); for (i = mbufq_len(&sc->xn_rx_batch); i < batch_target; i++) { MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) + if (m_new == NULL) { + printf("%s: MGETHDR failed\n", __func__); goto no_mbuf; + } m_cljget(m_new, M_DONTWAIT, MJUMPAGESIZE); if ((m_new->m_flags & M_EXT) == 0) { + printf("%s: m_cljget failed\n", __func__); m_freem(m_new); no_mbuf: @@ -785,16 +816,29 @@ no_mbuf: mbufq_tail(&sc->xn_rx_batch, m_new); } - /* Is the batch large enough to be worthwhile? */ + /* + * If we've allocated at least half of our target number of entries, + * submit them to the backend - we have enough to make the overhead + * of submission worthwhile. Otherwise wait for more mbufs and + * request entries to become available. + */ if (i < (sc->rx_target/2)) { if (req_prod >sc->rx.sring->req_prod) goto push; return; } - /* Adjust floating fill target if we risked running out of buffers. */ - if ( ((req_prod - sc->rx.sring->rsp_prod) < (sc->rx_target / 4)) && - ((sc->rx_target *= 2) > sc->rx_max_target) ) - sc->rx_target = sc->rx_max_target; + + /* + * Double floating fill target if we risked having the backend + * run out of empty buffers for receive traffic. We define "running + * low" as having less than a fourth of our target buffers free + * at the time we refilled the queue. + */ + if ((req_prod - sc->rx.sring->rsp_prod) < (sc->rx_target / 4)) { + sc->rx_target *= 2; + if (sc->rx_target > sc->rx_max_target) + sc->rx_target = sc->rx_max_target; + } refill: for (nr_flips = i = 0; ; i++) { @@ -806,9 +850,8 @@ refill: id = xennet_rxidx(req_prod + i); - KASSERT(sc->xn_cdata.xn_rx_chain[id] == NULL, - ("non-NULL xm_rx_chain")); - sc->xn_cdata.xn_rx_chain[id] = m_new; + KASSERT(sc->rx_mbufs[id] == NULL, ("non-NULL xm_rx_chain")); + sc->rx_mbufs[id] = m_new; ref = gnttab_claim_grant_reference(&sc->gref_rx_head); KASSERT((short)ref >= 0, ("negative ref")); @@ -932,14 +975,13 @@ xn_rxeof(struct netfront_info *np) memset(extras, 0, sizeof(rinfo.extras)); m = NULL; - err = xennet_get_responses(np, &rinfo, rp, &m, + err = xennet_get_responses(np, &rinfo, rp, &i, &m, &pages_flipped); if (unlikely(err)) { if (m) mbufq_tail(&errq, m); np->stats.rx_errors++; - i = np->rx.rsp_cons; continue; } @@ -961,7 +1003,7 @@ xn_rxeof(struct netfront_info *np) np->stats.rx_bytes += m->m_pkthdr.len; mbufq_tail(&rxq, m); - np->rx.rsp_cons = ++i; + np->rx.rsp_cons = i; } if (pages_flipped) { @@ -1056,7 +1098,6 @@ xn_txeof(struct netfront_info *np) return; ifp = np->xn_ifp; - ifp->if_timer = 0; do { prod = np->tx.sring->rsp_prod; @@ -1067,9 +1108,16 @@ xn_txeof(struct netfront_info *np) if (txr->status == NETIF_RSP_NULL) continue; + if (txr->status != NETIF_RSP_OKAY) { + printf("%s: WARNING: response is %d!\n", + __func__, txr->status); + } id = txr->id; - m = np->xn_cdata.xn_tx_chain[id]; + m = np->tx_mbufs[id]; KASSERT(m != NULL, ("mbuf not found in xn_tx_chain")); + KASSERT((uintptr_t)m > NET_TX_RING_SIZE, + ("mbuf already on the free list, but we're " + "trying to free it again!")); M_ASSERTVALID(m); /* @@ -1080,10 +1128,8 @@ xn_txeof(struct netfront_info *np) ifp->if_opackets++; if (unlikely(gnttab_query_foreign_access( np->grant_tx_ref[id]) != 0)) { - printf("network_tx_buf_gc: warning " - "-- grant still in use by backend " - "domain.\n"); - goto out; + panic("grant id %u still in use by the backend", + id); } gnttab_end_foreign_access_ref( np->grant_tx_ref[id]); @@ -1091,12 +1137,9 @@ xn_txeof(struct netfront_info *np) &np->gref_tx_head, np->grant_tx_ref[id]); np->grant_tx_ref[id] = GRANT_INVALID_REF; - np->xn_cdata.xn_tx_chain[id] = NULL; - add_id_to_freelist(np->xn_cdata.xn_tx_chain, id); + np->tx_mbufs[id] = NULL; + add_id_to_freelist(np->tx_mbufs, id); np->xn_cdata.xn_tx_chain_cnt--; - if (np->xn_cdata.xn_tx_chain_cnt < 0) { - panic("netif_release_tx_bufs: tx_chain_cnt must be >= 0"); - } m_free(m); /* Only mark the queue active if we've freed up at least one slot to try */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1118,7 +1161,6 @@ xn_txeof(struct netfront_info *np) mb(); } while (prod != np->tx.sring->rsp_prod); - out: if (np->tx_full && ((np->tx.sring->req_prod - prod) < NET_TX_RING_SIZE)) { np->tx_full = 0; @@ -1142,7 +1184,7 @@ xn_intr(void *xsc) ifp->if_drv_flags & IFF_DRV_RUNNING)) return; #endif - if (np->tx.rsp_cons != np->tx.sring->rsp_prod) { + if (RING_HAS_UNCONSUMED_RESPONSES(&np->tx)) { XN_TX_LOCK(np); xn_txeof(np); XN_TX_UNLOCK(np); @@ -1174,10 +1216,9 @@ xennet_move_rx_slot(struct netfront_info static int xennet_get_extras(struct netfront_info *np, - struct netif_extra_info *extras, RING_IDX rp) + struct netif_extra_info *extras, RING_IDX rp, RING_IDX *cons) { struct netif_extra_info *extra; - RING_IDX cons = np->rx.rsp_cons; int err = 0; @@ -1185,17 +1226,17 @@ xennet_get_extras(struct netfront_info * struct mbuf *m; grant_ref_t ref; - if (unlikely(cons + 1 == rp)) { + if (unlikely(*cons + 1 == rp)) { #if 0 if (net_ratelimit()) WPRINTK("Missing extra info\n"); #endif - err = -EINVAL; + err = EINVAL; break; } extra = (struct netif_extra_info *) - RING_GET_RESPONSE(&np->rx, ++cons); + RING_GET_RESPONSE(&np->rx, ++(*cons)); if (unlikely(!extra->type || extra->type >= XEN_NETIF_EXTRA_TYPE_MAX)) { @@ -1204,23 +1245,22 @@ xennet_get_extras(struct netfront_info * WPRINTK("Invalid extra type: %d\n", extra->type); #endif - err = -EINVAL; + err = EINVAL; } else { memcpy(&extras[extra->type - 1], extra, sizeof(*extra)); } - m = xennet_get_rx_mbuf(np, cons); - ref = xennet_get_rx_ref(np, cons); + m = xennet_get_rx_mbuf(np, *cons); + ref = xennet_get_rx_ref(np, *cons); xennet_move_rx_slot(np, m, ref); } while (extra->flags & XEN_NETIF_EXTRA_FLAG_MORE); - np->rx.rsp_cons = cons; return err; } static int xennet_get_responses(struct netfront_info *np, - struct netfront_rx_info *rinfo, RING_IDX rp, + struct netfront_rx_info *rinfo, RING_IDX rp, RING_IDX *cons, struct mbuf **list, int *pages_flipped_p) { @@ -1229,45 +1269,48 @@ xennet_get_responses(struct netfront_inf struct multicall_entry *mcl; struct netif_rx_response *rx = &rinfo->rx; struct netif_extra_info *extras = rinfo->extras; - RING_IDX cons = np->rx.rsp_cons; struct mbuf *m, *m0, *m_prev; - grant_ref_t ref = xennet_get_rx_ref(np, cons); - int max = 5 /* MAX_SKB_FRAGS + (rx->status <= RX_COPY_THRESHOLD) */; + grant_ref_t ref = xennet_get_rx_ref(np, *cons); + RING_IDX ref_cons = *cons; + int max = 5 /* MAX_TX_REQ_FRAGS + (rx->status <= RX_COPY_THRESHOLD) */; int frags = 1; int err = 0; u_long ret; - m0 = m = m_prev = xennet_get_rx_mbuf(np, cons); + m0 = m = m_prev = xennet_get_rx_mbuf(np, *cons); if (rx->flags & NETRXF_extra_info) { - err = xennet_get_extras(np, extras, rp); - cons = np->rx.rsp_cons; + err = xennet_get_extras(np, extras, rp, cons); } if (m0 != NULL) { - m0->m_pkthdr.len = 0; - m0->m_next = NULL; + m0->m_pkthdr.len = 0; + m0->m_next = NULL; } for (;;) { u_long mfn; #if 0 - printf("rx->status=%hd rx->offset=%hu frags=%u\n", + DPRINTK("rx->status=%hd rx->offset=%hu frags=%u\n", rx->status, rx->offset, frags); #endif if (unlikely(rx->status < 0 || rx->offset + rx->status > PAGE_SIZE)) { + #if 0 if (net_ratelimit()) WPRINTK("rx->offset: %x, size: %u\n", rx->offset, rx->status); #endif xennet_move_rx_slot(np, m, ref); - err = -EINVAL; - goto next; + if (m0 == m) + m0 = NULL; + m = NULL; + err = EINVAL; + goto next_skip_queue; } /* @@ -1276,11 +1319,12 @@ xennet_get_responses(struct netfront_inf * situation to the system controller to reboot the backed. */ if (ref == GRANT_INVALID_REF) { + #if 0 if (net_ratelimit()) WPRINTK("Bad rx response id %d.\n", rx->id); #endif - err = -EINVAL; + err = EINVAL; goto next; } @@ -1289,12 +1333,10 @@ xennet_get_responses(struct netfront_inf * headroom, ... */ if (!(mfn = gnttab_end_foreign_transfer_ref(ref))) { - if (net_ratelimit()) - WPRINTK("Unfulfilled rx req " - "(id=%d, st=%d).\n", - rx->id, rx->status); + WPRINTK("Unfulfilled rx req (id=%d, st=%d).\n", + rx->id, rx->status); xennet_move_rx_slot(np, m, ref); - err = -ENOMEM; + err = ENOMEM; goto next; } @@ -1332,23 +1374,43 @@ next: m->m_data += rx->offset; m0->m_pkthdr.len += rx->status; +next_skip_queue: if (!(rx->flags & NETRXF_more_data)) break; - if (cons + frags == rp) { + if (*cons + frags == rp) { if (net_ratelimit()) WPRINTK("Need more frags\n"); - err = -ENOENT; + err = ENOENT; + printf("%s: cons %u frags %u rp %u, not enough frags\n", + __func__, *cons, frags, rp); break; } + /* + * Note that m can be NULL, if rx->status < 0 or if + * rx->offset + rx->status > PAGE_SIZE above. + */ m_prev = m; - rx = RING_GET_RESPONSE(&np->rx, cons + frags); - m = xennet_get_rx_mbuf(np, cons + frags); + rx = RING_GET_RESPONSE(&np->rx, *cons + frags); + m = xennet_get_rx_mbuf(np, *cons + frags); - m_prev->m_next = m; + /* + * m_prev == NULL can happen if rx->status < 0 or if + * rx->offset + * rx->status > PAGE_SIZE above. + */ + if (m_prev != NULL) + m_prev->m_next = m; + + /* + * m0 can be NULL if rx->status < 0 or if * rx->offset + + * rx->status > PAGE_SIZE above. + */ + if (m0 == NULL) + m0 = m; m->m_next = NULL; - ref = xennet_get_rx_ref(np, cons + frags); + ref = xennet_get_rx_ref(np, *cons + frags); + ref_cons = *cons + frags; frags++; } *list = m0; @@ -1356,11 +1418,12 @@ next: if (unlikely(frags > max)) { if (net_ratelimit()) WPRINTK("Too many frags\n"); - err = -E2BIG; + printf("%s: too many frags %d > max %d\n", __func__, frags, + max); + err = E2BIG; } - if (unlikely(err)) - np->rx.rsp_cons = cons + frags; + *cons += frags; *pages_flipped_p = pages_flipped; @@ -1389,209 +1452,228 @@ xn_tick(void *xsc) XN_RX_UNLOCK(sc); } -static void -xn_start_locked(struct ifnet *ifp) + +/** + * \brief Count the number of fragments in an mbuf chain. + * + * Surprisingly, there isn't an M* macro for this. + */ +static inline int +xn_count_frags(struct mbuf *m) { - int otherend_id; - unsigned short id; - struct mbuf *m_head, *m; - struct netfront_info *sc; - netif_tx_request_t *tx; + int nfrags; + + for (nfrags = 0; m != NULL; m = m->m_next) + nfrags++; + + return (nfrags); +} + +/** + * Given an mbuf chain, make sure we have enough room and then push + * it onto the transmit ring. + */ +static int +xn_assemble_tx_request(struct netfront_info *sc, struct mbuf *m_head) +{ + struct ifnet *ifp; + struct mbuf *m; + u_int nfrags; netif_extra_info_t *extra; - RING_IDX i; - grant_ref_t ref; - u_long mfn, tx_bytes; - int notify, nfrags; + int otherend_id; - sc = ifp->if_softc; - otherend_id = xenbus_get_otherend_id(sc->xbdev); - tx_bytes = 0; + ifp = sc->xn_ifp; - if (!netfront_carrier_ok(sc)) - return; - - for (i = sc->tx.req_prod_pvt; TRUE; i++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 19:26:32 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 060C1106566C; Fri, 11 Jun 2010 19:26:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 8751B8FC24; Fri, 11 Jun 2010 19:26:30 +0000 (UTC) Received: from besplex.bde.org (c122-106-175-69.carlnfd1.nsw.optusnet.com.au [122.106.175.69]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5BJQNJC031881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 Jun 2010 05:26:29 +1000 Date: Sat, 12 Jun 2010 05:26:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <201006111826.o5BIQrj1054320@svn.freebsd.org> Message-ID: <20100612044012.Q3254@besplex.bde.org> References: <201006111826.o5BIQrj1054320@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209057 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 19:26:32 -0000 On Fri, 11 Jun 2010, Andriy Gapon wrote: > Log: > ffs_softdep: change K&R in function defintions to ANSI prototypes > > Apparently it's bad when we first have an ANSI prototype in function > declaration, but then use K&R in its defintion. No, it's bad when the prototype doesn't match the definition. Then the behaviour is undefined. The actual behaviour in gcc is to silently modify the definition to match the prototype. This conforms to Standard C since undefined behaviour can be anything, but it is bad because it is unportable and rewards bad code. > Complaint from: clang clang apparently doesn't reward this particular bad code. > Modified: head/sys/ufs/ffs/ffs_softdep.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_softdep.c Fri Jun 11 18:20:56 2010 (r209056) > +++ head/sys/ufs/ffs/ffs_softdep.c Fri Jun 11 18:26:53 2010 (r209057) > @@ -3251,12 +3251,8 @@ newjmvref(dp, ino, oldoff, newoff) > * the jsegdep when we're done. > */ > static struct jremref * > -newjremref(dirrem, dp, ip, diroff, nlink) > - struct dirrem *dirrem; > - struct inode *dp; > - struct inode *ip; > - off_t diroff; > - nlink_t nlink; The type mismatch was for nlink. THe K&R function takes an nlink arg of type __promoteof(nlink_t), but the prototype says that it takes an nlink arg of type nlink_t. Since nlink_t is uint16_t and int has > 16 bits on all supported machines, __promoteof(nlink_t) != nlink_t on any supported machines. The prototype would be correct on machines with 16-bit ints, so a protoytype that declared it as int would be incorrect on these machines, since then the promotion is u_int. __promoteof() is pseudo-code to handle this problem. Most working but still unportable prototypes for K&R functions ignore this problem and hard-code the promotion as int/u_int/long/etc. There would be type mismatches for ino_t if ints were larger than 32 bits, and type mismatches for off_t if ints were larger than 64 bits. Most prototypes for K&R functions completely ignore this problem. > +newjremref(struct dirrem *dirrem, struct inode *dp, struct inode *ip, > + off_t diroff, nlink_t nlink) > { > struct jremref *jremref; > > @@ -3271,13 +3267,8 @@ newjremref(dirrem, dp, ip, diroff, nlink > } > > static inline void > -newinoref(inoref, ino, parent, diroff, nlink, mode) > - struct inoref *inoref; > - ino_t ino; > - ino_t parent; > - off_t diroff; > - nlink_t nlink; > - uint16_t mode; Now there was also a type for the `mode' arg. Its type uint16_t may be a misspelling of mode_t. Though if_mode has type uint16_t, it has to have a type like mode_t to work, and the system type is used for almost everything else (ino_t and nlink_t here). The type mismatch problem is larger for mode_t than for ino_t, since mode_t is used in several syscall interfaces, including open(2) which is variadic so it cannot take the "mode_t mode" arg that it is documented to take in the FreeBSD man page. POSIX.1-2001 and POSIX.1-2004 are little better. They say that the third arg to open() is "taken" as type mode_t; they should say that the third arg is an integer converted to a mode_t, where the type of the integer is __promoteof(mode_t) which is hard to specify, or possibly that the type of the integer is int (if all the mode_t's needed for open() fit in the 15 value bits of a 16-bit int). > +newinoref(struct inoref *inoref, ino_t ino, ino_t parent, off_t diroff, > + nlink_t nlink, uint16_t mode) The prototype still exists and is more bogus than before for this function, since this function is inline. Inline functions need to be defined before they are used so that they are actually inlined (except -funit-at-a-time may allow them to be anywhere in a file), so a forward declaration for them is never needed. However, the forward declaration used to be sort of needed to turn the K&R definition into a prototype. However2, K&R compilers don't support inlining, so using K&R definitions for inline functions is bogus. > { > > inoref->if_jsegdep = newjsegdep(&inoref->if_list); > @@ -3296,12 +3287,8 @@ newinoref(inoref, ino, parent, diroff, n > * to have the correct FMT. > */ > static struct jaddref * > -newjaddref(dp, ino, diroff, nlink, mode) > - struct inode *dp; > - ino_t ino; > - off_t diroff; > - int16_t nlink; > - uint16_t mode; > +newjaddref(struct inode *dp, ino_t ino, off_t diroff, int16_t nlink, > + uint16_t mode) As above (non-inline case). > { > struct jaddref *jaddref; > > Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 19:27:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40168106566B; Fri, 11 Jun 2010 19:27:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EE498FC15; Fri, 11 Jun 2010 19:27:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BJRMs2067824; Fri, 11 Jun 2010 19:27:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BJRLdX067815; Fri, 11 Jun 2010 19:27:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006111927.o5BJRLdX067815@svn.freebsd.org> From: Andriy Gapon Date: Fri, 11 Jun 2010 19:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209062 - in head/sys: dev/acpica dev/usb fs/procfs geom kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 19:27:22 -0000 Author: avg Date: Fri Jun 11 19:27:21 2010 New Revision: 209062 URL: http://svn.freebsd.org/changeset/base/209062 Log: fix a few cases where a string is passed via format argument instead of via %s Most of the cases looked harmless, but this is done for the sake of correctness. In one case it even allowed to drop an intermediate buffer. Found by: clang MFC after: 2 week Modified: head/sys/dev/acpica/acpi_thermal.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_process.c head/sys/fs/procfs/procfs_type.c head/sys/geom/geom_dev.c head/sys/kern/subr_kdb.c head/sys/kern/subr_taskqueue.c Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Fri Jun 11 19:17:36 2010 (r209061) +++ head/sys/dev/acpica/acpi_thermal.c Fri Jun 11 19:27:21 2010 (r209062) @@ -1171,7 +1171,6 @@ static int acpi_tz_cooling_thread_start(struct acpi_tz_softc *sc) { int error; - char name[16]; ACPI_LOCK(thermal); if (sc->tz_cooling_proc_running) { @@ -1182,10 +1181,9 @@ acpi_tz_cooling_thread_start(struct acpi ACPI_UNLOCK(thermal); error = 0; if (sc->tz_cooling_proc == NULL) { - snprintf(name, sizeof(name), "acpi_cooling%d", - device_get_unit(sc->tz_dev)); error = kproc_create(acpi_tz_cooling_thread, sc, - &sc->tz_cooling_proc, RFHIGHPID, 0, name); + &sc->tz_cooling_proc, RFHIGHPID, 0, "acpi_cooling%d", + device_get_unit(sc->tz_dev)); if (error != 0) { device_printf(sc->tz_dev, "could not create thread - %d", error); ACPI_LOCK(thermal); Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Fri Jun 11 19:17:36 2010 (r209061) +++ head/sys/dev/usb/usb_dev.c Fri Jun 11 19:27:21 2010 (r209062) @@ -1733,7 +1733,7 @@ usb_fifo_attach(struct usb_device *udev, /* Now, create the device itself */ f_sc->dev = make_dev(&usb_devsw, 0, uid, gid, mode, - devname); + "%s", devname); /* XXX setting si_drv1 and creating the device is not atomic! */ f_sc->dev->si_drv1 = pd; } Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri Jun 11 19:17:36 2010 (r209061) +++ head/sys/dev/usb/usb_device.c Fri Jun 11 19:27:21 2010 (r209062) @@ -1577,7 +1577,7 @@ usb_alloc_device(device_t parent_dev, st udev->ctrl_dev = usb_make_dev(udev, 0, FREAD|FWRITE); /* Create a link from /dev/ugenX.X to the default endpoint */ - make_dev_alias(udev->ctrl_dev, udev->ugen_name); + make_dev_alias(udev->ctrl_dev, "%s", udev->ugen_name); #endif if (udev->flags.usb_mode == USB_MODE_HOST) { Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Fri Jun 11 19:17:36 2010 (r209061) +++ head/sys/dev/usb/usb_process.c Fri Jun 11 19:27:21 2010 (r209062) @@ -221,7 +221,7 @@ usb_proc_create(struct usb_process *up, cv_init(&up->up_drain, "usbdrain"); if (USB_THREAD_CREATE(&usb_process, up, - &up->up_ptr, pmesg)) { + &up->up_ptr, "%s", pmesg)) { DPRINTFN(0, "Unable to create USB process."); up->up_ptr = NULL; goto error; Modified: head/sys/fs/procfs/procfs_type.c ============================================================================== --- head/sys/fs/procfs/procfs_type.c Fri Jun 11 19:17:36 2010 (r209061) +++ head/sys/fs/procfs/procfs_type.c Fri Jun 11 19:27:21 2010 (r209062) @@ -48,9 +48,9 @@ procfs_doproctype(PFS_FILL_ARGS) static const char *none = "Not Available"; if (p != NULL && p->p_sysent && p->p_sysent->sv_name) - sbuf_printf(sb, p->p_sysent->sv_name); + sbuf_printf(sb, "%s", p->p_sysent->sv_name); else - sbuf_printf(sb, none); + sbuf_printf(sb, "%s", none); sbuf_putc(sb, '\n'); return (0); } Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Fri Jun 11 19:17:36 2010 (r209061) +++ head/sys/geom/geom_dev.c Fri Jun 11 19:27:21 2010 (r209062) @@ -127,7 +127,7 @@ g_dev_taste(struct g_class *mp, struct g KASSERT(error == 0, ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error)); dev = make_dev(&g_dev_cdevsw, 0, - UID_ROOT, GID_OPERATOR, 0640, gp->name); + UID_ROOT, GID_OPERATOR, 0640, "%s", gp->name); if (pp->flags & G_PF_CANDELETE) dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Fri Jun 11 19:17:36 2010 (r209061) +++ head/sys/kern/subr_kdb.c Fri Jun 11 19:27:21 2010 (r209062) @@ -230,7 +230,7 @@ kdb_panic(const char *msg) stop_cpus_hard(PCPU_GET(other_cpus)); #endif printf("KDB: panic\n"); - panic(msg); + panic("%s", msg); } void Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Fri Jun 11 19:17:36 2010 (r209061) +++ head/sys/kern/subr_taskqueue.c Fri Jun 11 19:27:21 2010 (r209062) @@ -322,7 +322,7 @@ taskqueue_start_threads(struct taskqueue for (i = 0; i < count; i++) { if (count == 1) error = kthread_add(taskqueue_thread_loop, tqp, NULL, - &tq->tq_threads[i], RFSTOPPED, 0, ktname); + &tq->tq_threads[i], RFSTOPPED, 0, "%s", ktname); else error = kthread_add(taskqueue_thread_loop, tqp, NULL, &tq->tq_threads[i], RFSTOPPED, 0, From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 19:35:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A2891065673; Fri, 11 Jun 2010 19:35:05 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A29D8FC0A; Fri, 11 Jun 2010 19:35:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BJZ5vv069574; Fri, 11 Jun 2010 19:35:05 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BJZ55T069572; Fri, 11 Jun 2010 19:35:05 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <201006111935.o5BJZ55T069572@svn.freebsd.org> From: Max Laier Date: Fri, 11 Jun 2010 19:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209063 - head/usr.sbin/arp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 19:35:05 -0000 Author: mlaier Date: Fri Jun 11 19:35:05 2010 New Revision: 209063 URL: http://svn.freebsd.org/changeset/base/209063 Log: Cache the last result from if_indextoname for printing. This speeds up "arp -an" when using a lot of aliases (on a single interface). A better fix would include a better interface for if_indextoname than getting the whole address list from the kernel just to find the one index->name mapping. Reported & analyzed by: Nick Rogers MFC after: 3 days Modified: head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Fri Jun 11 19:27:21 2010 (r209062) +++ head/usr.sbin/arp/arp.c Fri Jun 11 19:35:05 2010 (r209063) @@ -555,6 +555,9 @@ search(u_long addr, action_fn *action) /* * Display an arp entry */ +static char lifname[IF_NAMESIZE]; +static int64_t lifindex = -1; + static void print_entry(struct sockaddr_dl *sdl, struct sockaddr_inarp *addr, struct rt_msghdr *rtm) @@ -562,7 +565,6 @@ print_entry(struct sockaddr_dl *sdl, const char *host; struct hostent *hp; struct iso88025_sockaddr_dl_data *trld; - char ifname[IF_NAMESIZE]; int seg; if (nflag == 0) @@ -591,8 +593,12 @@ print_entry(struct sockaddr_dl *sdl, } } else printf("(incomplete)"); - if (if_indextoname(sdl->sdl_index, ifname) != NULL) - printf(" on %s", ifname); + if (sdl->sdl_index != lifindex && + if_indextoname(sdl->sdl_index, lifname) != NULL) { + lifindex = sdl->sdl_index; + printf(" on %s", lifname); + } else if (sdl->sdl_index == lifindex) + printf(" on %s", lifname); if (rtm->rtm_rmx.rmx_expire == 0) printf(" permanent"); else { From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 19:45:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E921B106564A; Fri, 11 Jun 2010 19:45:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 919748FC0A; Fri, 11 Jun 2010 19:45:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 89D8541C798; Fri, 11 Jun 2010 21:45:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id Itu4AzG+C8BV; Fri, 11 Jun 2010 21:45:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id BAC8F41C7AC; Fri, 11 Jun 2010 21:45:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 1706E4448F3; Fri, 11 Jun 2010 19:44:04 +0000 (UTC) Date: Fri, 11 Jun 2010 19:44:04 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Jack F Vogel In-Reply-To: <201006111903.o5BJ3xp1062600@svn.freebsd.org> Message-ID: <20100611193903.W26508@maildrop.int.zabbadoz.net> References: <201006111903.o5BJ3xp1062600@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209060 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 19:45:08 -0000 On Fri, 11 Jun 2010, Jack F Vogel wrote: > Author: jfv > Date: Fri Jun 11 19:03:59 2010 > New Revision: 209060 > URL: http://svn.freebsd.org/changeset/base/209060 > > Log: > Remove a disable_queue from the beginning of the > interrupt handler, automask handles it. > Also, add in msix vector descriptions. > > MFC for 8.1 asap Hi Jack, I just tried a couple of days old HEAD before going to update to this one and found hundreds of the follwoing "hanging" the machine as the console stays busy for .. well don't know yet... load: 1.84 cmd: ifconfig 1386 [*ix0] 399.98r 0.00u 0.07s 0% 1364k ... uma_zalloc_arg: zone "mbuf_packet" with the following non-sleepable locks held: exclusive sleep mutex ix0:rx(0) (ix0:rx(0)) r = 0 (0xffffff0001c25808) locked @ sys/modules/ixgbe/../../dev/ixgbe/ixgbe.c:3615 exclusive sleep mutex ix0 (IXGBE Core Lock) r = 0 (0xffffff80110a73b8) locked @ sys/modules/ixgbe/../../dev/ixgbe/ixgbe.c:1197 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wt_delta 15.e4dd9523a934dd00 too short rapper+0x2a kdb_backtrace() at kdb_backtrace+0x32 _witness_debugger() at _witness_debugger+0x2b witness_warn() at witness_warn+0x314 uma_zalloc_arg() at uma_zalloc_arg+0x3e ixgbe_init_locked() at ixgbe_init_locked+0x6cd ixgbe_init() at ixgbe_init+0x39 ether_ioctl() at ether_ioctl+0x71 ... This happened on: foo.example.net# ifconfig ix0 up after kldload ixgbe. /bz > Modified: > head/sys/dev/ixgbe/ixgbe.c > > Modified: head/sys/dev/ixgbe/ixgbe.c > ============================================================================== > --- head/sys/dev/ixgbe/ixgbe.c Fri Jun 11 18:46:34 2010 (r209059) > +++ head/sys/dev/ixgbe/ixgbe.c Fri Jun 11 19:03:59 2010 (r209060) > @@ -1365,7 +1365,6 @@ ixgbe_msix_que(void *arg) > bool more_tx, more_rx; > u32 newitr = 0; > > - ixgbe_disable_queue(adapter, que->msix); > ++que->irqs; > > more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); > @@ -2121,6 +2120,9 @@ ixgbe_allocate_msix(struct adapter *adap > device_printf(dev, "Failed to register QUE handler"); > return (error); > } > +#if __FreeBSD_version >= 800504 > + bus_describe_intr(dev, que->res, que->tag, "que %d", i); > +#endif > que->msix = vector; > adapter->que_mask |= (u64)(1 << que->msix); > /* > @@ -2155,6 +2157,9 @@ ixgbe_allocate_msix(struct adapter *adap > device_printf(dev, "Failed to register LINK handler"); > return (error); > } > +#if __FreeBSD_version >= 800504 > + bus_describe_intr(dev, adapter->res, adapter->tag, "link"); > +#endif > adapter->linkvec = vector; > /* Tasklets for Link, SFP and Multispeed Fiber */ > TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 19:53:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DCD11065673; Fri, 11 Jun 2010 19:53:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E74758FC12; Fri, 11 Jun 2010 19:53:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BJrg12073680; Fri, 11 Jun 2010 19:53:42 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BJrgEp073674; Fri, 11 Jun 2010 19:53:42 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006111953.o5BJrgEp073674@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 11 Jun 2010 19:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209064 - in head/sys/dev: acpi_support acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 19:53:43 -0000 Author: jkim Date: Fri Jun 11 19:53:42 2010 New Revision: 209064 URL: http://svn.freebsd.org/changeset/base/209064 Log: Remove unused assignment. Found by: clang static analyzer Found by: Coverity Prevent[tm] (CID 4537, 4538, 4539) Modified: head/sys/dev/acpi_support/acpi_fujitsu.c head/sys/dev/acpi_support/acpi_hp.c head/sys/dev/acpi_support/acpi_ibm.c head/sys/dev/acpica/acpi_dock.c head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpi_support/acpi_fujitsu.c ============================================================================== --- head/sys/dev/acpi_support/acpi_fujitsu.c Fri Jun 11 19:35:05 2010 (r209063) +++ head/sys/dev/acpi_support/acpi_fujitsu.c Fri Jun 11 19:53:42 2010 (r209064) @@ -380,7 +380,6 @@ acpi_fujitsu_init(struct acpi_fujitsu_so OID_AUTO, "fujitsu", CTLFLAG_RD, 0, ""); for (i = 0; sysctl_table[i].name != NULL; i++) { - exists = 0; switch(sysctl_table[i].method) { case METHOD_GMOU: exists = sc->gmou.exists; @@ -566,9 +565,6 @@ static uint8_t acpi_fujitsu_check_hardware(struct acpi_fujitsu_softc *sc) { int val; - struct acpi_softc *acpi_sc; - - acpi_sc = acpi_device_get_parent_softc(sc->dev); ACPI_SERIAL_ASSERT(fujitsu); /* save the hotkey bitmask */ Modified: head/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- head/sys/dev/acpi_support/acpi_hp.c Fri Jun 11 19:35:05 2010 (r209063) +++ head/sys/dev/acpi_support/acpi_hp.c Fri Jun 11 19:53:42 2010 (r209064) @@ -453,7 +453,6 @@ static int acpi_hp_attach(device_t dev) { struct acpi_hp_softc *sc; - struct acpi_softc *acpi_sc; devclass_t wmi_devclass; int arg; @@ -477,7 +476,6 @@ acpi_hp_attach(device_t dev) sc->cmi_order_size = -1; sc->verbose = 0; memset(sc->cmi_order, 0, sizeof(sc->cmi_order)); - acpi_sc = acpi_device_get_parent_softc(dev); if (!(wmi_devclass = devclass_find ("acpi_wmi"))) { device_printf(dev, "Couldn't find acpi_wmi devclass\n"); Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Fri Jun 11 19:35:05 2010 (r209063) +++ head/sys/dev/acpi_support/acpi_ibm.c Fri Jun 11 19:53:42 2010 (r209064) @@ -743,8 +743,6 @@ acpi_ibm_sysctl_set(struct acpi_ibm_soft return (status); if (sc->cmos_handle) { - val = val_ec & IBM_EC_MASK_VOL; - Args.Count = 1; Args.Pointer = &Arg; Arg.Type = ACPI_TYPE_INTEGER; Modified: head/sys/dev/acpica/acpi_dock.c ============================================================================== --- head/sys/dev/acpica/acpi_dock.c Fri Jun 11 19:35:05 2010 (r209063) +++ head/sys/dev/acpica/acpi_dock.c Fri Jun 11 19:53:42 2010 (r209064) @@ -257,12 +257,10 @@ static void acpi_dock_insert(device_t dev) { struct acpi_dock_softc *sc; - ACPI_HANDLE h; ACPI_SERIAL_ASSERT(dock); sc = device_get_softc(dev); - h = acpi_get_handle(dev); if (sc->status == ACPI_DOCK_STATUS_UNDOCKED || sc->status == ACPI_DOCK_STATUS_UNKNOWN) { @@ -414,7 +412,6 @@ acpi_dock_status_sysctl(SYSCTL_HANDLER_A device_t dev; int status, err; - err = 0; dev = (device_t)arg1; sc = device_get_softc(dev); Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Fri Jun 11 19:35:05 2010 (r209063) +++ head/sys/dev/acpica/acpi_video.c Fri Jun 11 19:53:42 2010 (r209064) @@ -429,15 +429,11 @@ acpi_video_vo_init(UINT32 adr) { struct acpi_video_output *vn, *vo, *vp; int n, x; - int display_index; - int display_port; char name[8], env[32]; const char *type, *desc; struct acpi_video_output_queue *voqh; ACPI_SERIAL_ASSERT(video); - display_index = adr & DOD_DEVID_MASK_DISPIDX; - display_port = (adr & DOD_DEVID_MASK_DISPPORT) >> 4; switch (adr & DOD_DEVID_MASK) { case DOD_DEVID_MONITOR: @@ -474,7 +470,7 @@ acpi_video_vo_init(UINT32 adr) } n = 0; - vn = vp = NULL; + vp = NULL; STAILQ_FOREACH(vn, voqh, vo_unit.next) { if (vn->vo_unit.num != n) break; @@ -782,7 +778,6 @@ acpi_video_vo_presets_sysctl(SYSCTL_HAND struct acpi_video_output *vo; int i, level, *preset, err; - err = 0; vo = (struct acpi_video_output *)arg1; ACPI_SERIAL_BEGIN(video_output); if (vo->handle == NULL) { @@ -942,7 +937,6 @@ vo_get_brightness_levels(ACPI_HANDLE han ACPI_OBJECT *res; int num, i, n, *levels; - num = 0; bcl_buf.Length = ACPI_ALLOCATE_BUFFER; bcl_buf.Pointer = NULL; status = AcpiEvaluateObject(handle, "_BCL", NULL, &bcl_buf); From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 19:58:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAD361065670; Fri, 11 Jun 2010 19:58:41 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB1398FC4C; Fri, 11 Jun 2010 19:58:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BJwfeu074828; Fri, 11 Jun 2010 19:58:41 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BJwf8w074826; Fri, 11 Jun 2010 19:58:41 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006111958.o5BJwf8w074826@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 11 Jun 2010 19:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209065 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 19:58:41 -0000 Author: jkim Date: Fri Jun 11 19:58:41 2010 New Revision: 209065 URL: http://svn.freebsd.org/changeset/base/209065 Log: Simplify a function for getting brightness levels. Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Fri Jun 11 19:53:42 2010 (r209064) +++ head/sys/dev/acpica/acpi_video.c Fri Jun 11 19:58:41 2010 (r209065) @@ -944,39 +944,34 @@ vo_get_brightness_levels(ACPI_HANDLE han if (status != AE_NOT_FOUND) printf("can't evaluate %s._BCL - %s\n", acpi_name(handle), AcpiFormatException(status)); - num = -1; goto out; } res = (ACPI_OBJECT *)bcl_buf.Pointer; if (!ACPI_PKG_VALID(res, 2)) { printf("evaluation of %s._BCL makes no sense\n", acpi_name(handle)); - num = -1; goto out; } num = res->Package.Count; - if (levelp == NULL) + if (num < 2 || levelp == NULL) goto out; levels = AcpiOsAllocate(num * sizeof(*levels)); - if (levels == NULL) { - num = -1; + if (levels == NULL) goto out; - } for (i = 0, n = 0; i < num; i++) if (acpi_PkgInt32(res, i, &levels[n]) == 0) n++; if (n < 2) { - num = -1; AcpiOsFree(levels); - } else { - num = n; - *levelp = levels; + goto out; } + *levelp = levels; + return (n); + out: if (bcl_buf.Pointer != NULL) AcpiOsFree(bcl_buf.Pointer); - - return (num); + return (0); } static int From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:02:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 530611065675; Fri, 11 Jun 2010 20:02:21 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8C7988FC12; Fri, 11 Jun 2010 20:02:20 +0000 (UTC) Received: by vws20 with SMTP id 20so544770vws.13 for ; Fri, 11 Jun 2010 13:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=TAEOhzoGBhKjnxLgHCIw8F3xr19iy8yO23D1O+llJNk=; b=H2zg7+2RftZhiLu3Q3Rtil2n8HRjFBLVghD3vBQWcRFQlH3gE3tVt+59c+EcnhI4SO MHmmd/qySDp/c7Zgz8XesC5RBPQp5jAfOppPVXkTQImS9hyoSuD2ImkjmxUXIDeV4UMv ZHhh4UJWHUnwM+zXuKDbOetglP7+3w+g2mIeg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=GBtoiUDAPwqXx1kwCANDPMAQlNNSDVUmDaEYsiYaX10yFwVJ0NqwMOcl54RsD2feZU JjobAkwcyrGPdfkjhy5srrLh80wpdSsQz/+0hvAfi5FqAw4bV6Nlh9A18AkN4hKsDQDx bLDJrf7uHESiY9D/a3PXoByOO+C4Y5scgCOzY= MIME-Version: 1.0 Received: by 10.224.86.200 with SMTP id t8mr916571qal.50.1276286538403; Fri, 11 Jun 2010 13:02:18 -0700 (PDT) Received: by 10.229.238.199 with HTTP; Fri, 11 Jun 2010 13:02:18 -0700 (PDT) In-Reply-To: <20100611193903.W26508@maildrop.int.zabbadoz.net> References: <201006111903.o5BJ3xp1062600@svn.freebsd.org> <20100611193903.W26508@maildrop.int.zabbadoz.net> Date: Fri, 11 Jun 2010 13:02:18 -0700 Message-ID: From: Jack Vogel To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209060 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:02:21 -0000 HMMMMM, I put in a change in response to some people having problems with mbuf resources, it seemed to work ok, but now i'm kinda concerned. Does this happen every time you bring the device up? In the routine 'ixgbe_setup_receive_ring()' I changed a couple of M_NOWAIT's to M_WAITOK, thinking that it would be ok in this code, can you test it, change it back to M_NOWAIT, and see if this symptom goes away? How many cores does the machine have, I'm guessing its big? Jack On Fri, Jun 11, 2010 at 12:44 PM, Bjoern A. Zeeb wrote: > On Fri, 11 Jun 2010, Jack F Vogel wrote: > > Author: jfv >> Date: Fri Jun 11 19:03:59 2010 >> New Revision: 209060 >> URL: http://svn.freebsd.org/changeset/base/209060 >> >> Log: >> Remove a disable_queue from the beginning of the >> interrupt handler, automask handles it. >> Also, add in msix vector descriptions. >> >> MFC for 8.1 asap >> > > Hi Jack, > > I just tried a couple of days old HEAD before going to update to this one > and found hundreds of the follwoing "hanging" the machine as the console > stays > busy for .. well don't know yet... load: 1.84 cmd: ifconfig 1386 [*ix0] > 399.98r 0.00u 0.07s 0% 1364k > > ... > uma_zalloc_arg: zone "mbuf_packet" with the following non-sleepable locks > held: > exclusive sleep mutex ix0:rx(0) (ix0:rx(0)) r = 0 (0xffffff0001c25808) > locked @ sys/modules/ixgbe/../../dev/ixgbe/ixgbe.c:3615 > exclusive sleep mutex ix0 (IXGBE Core Lock) r = 0 (0xffffff80110a73b8) > locked @ sys/modules/ixgbe/../../dev/ixgbe/ixgbe.c:1197 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wt_delta 15.e4dd9523a934dd00 too > short rapper+0x2a > kdb_backtrace() at kdb_backtrace+0x32 > _witness_debugger() at _witness_debugger+0x2b > witness_warn() at witness_warn+0x314 > uma_zalloc_arg() at uma_zalloc_arg+0x3e > ixgbe_init_locked() at ixgbe_init_locked+0x6cd > ixgbe_init() at ixgbe_init+0x39 > ether_ioctl() at ether_ioctl+0x71 > ... > > > This happened on: > foo.example.net# ifconfig ix0 up > after kldload ixgbe. > > /bz > > > > Modified: >> head/sys/dev/ixgbe/ixgbe.c >> >> Modified: head/sys/dev/ixgbe/ixgbe.c >> >> ============================================================================== >> --- head/sys/dev/ixgbe/ixgbe.c Fri Jun 11 18:46:34 2010 (r209059) >> +++ head/sys/dev/ixgbe/ixgbe.c Fri Jun 11 19:03:59 2010 (r209060) >> @@ -1365,7 +1365,6 @@ ixgbe_msix_que(void *arg) >> bool more_tx, more_rx; >> u32 newitr = 0; >> >> - ixgbe_disable_queue(adapter, que->msix); >> ++que->irqs; >> >> more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); >> @@ -2121,6 +2120,9 @@ ixgbe_allocate_msix(struct adapter *adap >> device_printf(dev, "Failed to register QUE >> handler"); >> return (error); >> } >> +#if __FreeBSD_version >= 800504 >> + bus_describe_intr(dev, que->res, que->tag, "que %d", i); >> +#endif >> que->msix = vector; >> adapter->que_mask |= (u64)(1 << que->msix); >> /* >> @@ -2155,6 +2157,9 @@ ixgbe_allocate_msix(struct adapter *adap >> device_printf(dev, "Failed to register LINK handler"); >> return (error); >> } >> +#if __FreeBSD_version >= 800504 >> + bus_describe_intr(dev, adapter->res, adapter->tag, "link"); >> +#endif >> adapter->linkvec = vector; >> /* Tasklets for Link, SFP and Multispeed Fiber */ >> TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); >> >> > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:08:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71B87106574A; Fri, 11 Jun 2010 20:08:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61A3C8FC1F; Fri, 11 Jun 2010 20:08:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BK8KrX077091; Fri, 11 Jun 2010 20:08:20 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BK8K9R077089; Fri, 11 Jun 2010 20:08:20 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006112008.o5BK8K9R077089@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 11 Jun 2010 20:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209066 - head/sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:08:20 -0000 Author: jkim Date: Fri Jun 11 20:08:20 2010 New Revision: 209066 URL: http://svn.freebsd.org/changeset/base/209066 Log: Fix one more case where a string is passed via format argument instead. Found by: clang Modified: head/sys/dev/acpi_support/acpi_asus.c Modified: head/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- head/sys/dev/acpi_support/acpi_asus.c Fri Jun 11 19:58:41 2010 (r209065) +++ head/sys/dev/acpi_support/acpi_asus.c Fri Jun 11 20:08:20 2010 (r209066) @@ -711,7 +711,7 @@ good: sbuf_printf(sb, "Unsupported Asus laptop: %s\n", Obj->String.Pointer); sbuf_finish(sb); - device_printf(dev, sbuf_data(sb)); + device_printf(dev, "%s", sbuf_data(sb)); sbuf_delete(sb); AcpiOsFree(Buf.Pointer); From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:15:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C255C1065741; Fri, 11 Jun 2010 20:15:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id D1D508FC34; Fri, 11 Jun 2010 20:15:06 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 2F6D441C798; Fri, 11 Jun 2010 22:15:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id e7+elPSs0AJk; Fri, 11 Jun 2010 22:15:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id A963F41C7A6; Fri, 11 Jun 2010 22:15:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 21E1E4448F3; Fri, 11 Jun 2010 20:13:25 +0000 (UTC) Date: Fri, 11 Jun 2010 20:13:24 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Jack Vogel In-Reply-To: Message-ID: <20100611200936.B26508@maildrop.int.zabbadoz.net> References: <201006111903.o5BJ3xp1062600@svn.freebsd.org> <20100611193903.W26508@maildrop.int.zabbadoz.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209060 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:15:09 -0000 On Fri, 11 Jun 2010, Jack Vogel wrote: Hi, > HMMMMM, I put in a change in response to some people having problems with > mbuf resources, it seemed to work ok, but now i'm kinda concerned. Does > this > happen every time you bring the device up? > > In the routine 'ixgbe_setup_receive_ring()' I changed a couple of > M_NOWAIT's > to M_WAITOK, thinking that it would be ok in this code, can you test it, > change > it back to M_NOWAIT, and see if this symptom goes away? Will do and let you know. I assume you mean the ones as part of r208762? > How many cores does the machine have, I'm guessing its big? 4 After ~890 of those tires, locks, abd backtraces deadlkres killed it;) /bz From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:18:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3963106566C; Fri, 11 Jun 2010 20:18:19 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2ED218FC1E; Fri, 11 Jun 2010 20:18:18 +0000 (UTC) Received: by gyh20 with SMTP id 20so1356823gyh.13 for ; Fri, 11 Jun 2010 13:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=KHmvs7QFtyY6JmZAIy0mQ5+jjlw+11GmvyenOZ2haxw=; b=Ql1r5DfWGGcAHX7VW/IEyP+a/GOk2hQG7hwPRZpXRVB/iEqu/zC+EIU854v6ZDYZmb pFFoMbyMOFu9/VCOotOYRYONwmtXKdnFQaRWFfgpAL7yHKW+acDtumoocOqGg/oDGTkw PtzsJdSqkOc/kpVVma7SoG3NXnT9mARf8RcNM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=u5xzXbBbNCeyXWIIkU0NhJDP9wtM+0iCtIWmDpVEx3xIET1oGCm8xfx1m7e1aRFHZJ 9l/4uPsCj0017alQ6IcPhJhk2eZzxZ2Na3V0NC848JmrrnwZp0kgsI8FyZkuP/Ykxaz/ QMEvElqPZTFPRyHNNzRTnBEeO/al2pO5C+nAg= MIME-Version: 1.0 Received: by 10.229.28.80 with SMTP id l16mr1394262qcc.91.1276287498118; Fri, 11 Jun 2010 13:18:18 -0700 (PDT) Received: by 10.229.238.199 with HTTP; Fri, 11 Jun 2010 13:18:17 -0700 (PDT) In-Reply-To: <20100611200936.B26508@maildrop.int.zabbadoz.net> References: <201006111903.o5BJ3xp1062600@svn.freebsd.org> <20100611193903.W26508@maildrop.int.zabbadoz.net> <20100611200936.B26508@maildrop.int.zabbadoz.net> Date: Fri, 11 Jun 2010 13:18:17 -0700 Message-ID: From: Jack Vogel To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209060 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:18:21 -0000 Odd though, because that code is in the driver on a system with 16 cores and I'm not hearing about any problem from my test engineer. Jack On Fri, Jun 11, 2010 at 1:13 PM, Bjoern A. Zeeb wrote: > On Fri, 11 Jun 2010, Jack Vogel wrote: > > Hi, > > > HMMMMM, I put in a change in response to some people having problems with >> mbuf resources, it seemed to work ok, but now i'm kinda concerned. Does >> this >> happen every time you bring the device up? >> >> In the routine 'ixgbe_setup_receive_ring()' I changed a couple of >> M_NOWAIT's >> to M_WAITOK, thinking that it would be ok in this code, can you test it, >> change >> it back to M_NOWAIT, and see if this symptom goes away? >> > > Will do and let you know. > > I assume you mean the ones as part of r208762? > > > > How many cores does the machine have, I'm guessing its big? >> > > 4 > > After ~890 of those tires, locks, abd backtraces deadlkres killed it;) > > /bz > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:25:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DCCE106567A; Fri, 11 Jun 2010 20:25:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 23A5E8FC08; Fri, 11 Jun 2010 20:25:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 74E9741C7A3; Fri, 11 Jun 2010 22:25:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id 8pzHhkoHX8yL; Fri, 11 Jun 2010 22:25:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id A9E1641C798; Fri, 11 Jun 2010 22:25:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id CAE9D4448F3; Fri, 11 Jun 2010 20:23:50 +0000 (UTC) Date: Fri, 11 Jun 2010 20:23:50 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Jack Vogel In-Reply-To: Message-ID: <20100611202054.A26508@maildrop.int.zabbadoz.net> References: <201006111903.o5BJ3xp1062600@svn.freebsd.org> <20100611193903.W26508@maildrop.int.zabbadoz.net> <20100611200936.B26508@maildrop.int.zabbadoz.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209060 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:25:07 -0000 On Fri, 11 Jun 2010, Jack Vogel wrote: > Odd though, because that code is in the driver on a system with 16 cores and > I'm > not hearing about any problem from my test engineer. So this makes it all go away: --- //depot/user/bz/vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-09 07:53:30.000000000 0000 +++ /zoo/bz/p4/bz_vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-09 07:53:30.000000000 0000 --- /tmp/tmp.96356.27 2010-06-11 16:19:14.000000000 -0400 +++ /zoo/bz/p4/bz_vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-11 16:16:02.000000000 -0400 @@ -3637,7 +3637,7 @@ ixgbe_setup_receive_ring(struct rx_ring goto skip_head; /* First the header */ - rxbuf->m_head = m_gethdr(M_WAITOK, MT_DATA); + rxbuf->m_head = m_gethdr(M_DONTWAIT, MT_DATA); if (rxbuf->m_head == NULL) { error = ENOBUFS; goto fail; @@ -3659,7 +3659,7 @@ ixgbe_setup_receive_ring(struct rx_ring skip_head: /* Now the payload cluster */ - rxbuf->m_pack = m_getjcl(M_WAITOK, MT_DATA, + rxbuf->m_pack = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (rxbuf->m_pack == NULL) { error = ENOBUFS; Are they running with WITNESS enabled to see the locking warnings? /bz From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:27:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A3F01065672; Fri, 11 Jun 2010 20:27:38 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 663458FC1C; Fri, 11 Jun 2010 20:27:37 +0000 (UTC) Received: by vws20 with SMTP id 20so576038vws.13 for ; Fri, 11 Jun 2010 13:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=Af0vrgdtglrWwpzoLh6tcgRbWaE1+uUHucMT6vzJYxw=; b=FEsCnpsmz2LTlJPNocPLq3xZThcj4hA8L4ZS3sgdmOU5cr+Fxhyk9+gPAL4XcGVk5l ddIbkfN8Fz3E5hwlX8oIzM1HqFTPb16mLYeh7gVrt8I1NOLp9QiR0OOk9dFJB6YzaHxu e1SFA3kMWHaREqhNCh9p0ALHy4D7DMgxVvj3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=pyU3kfc8i4bUHFRwQUSxHTvolus5Tkv4DPeybQ5NPOmR5uJ++mMZ9Hj4ZWaHwhoGDQ vNAAVO5w9gxQWA08+XNtOZhyEtZmm0e+sRnZ+OWUpHndXoKLYAeE4rdHIVWmghZadbU5 zBq5C0/iCG2zhsPeExPhwHhMJXdseiDyzFQ1M= MIME-Version: 1.0 Received: by 10.224.64.156 with SMTP id e28mr916668qai.200.1276288056258; Fri, 11 Jun 2010 13:27:36 -0700 (PDT) Received: by 10.229.238.199 with HTTP; Fri, 11 Jun 2010 13:27:36 -0700 (PDT) In-Reply-To: <20100611202054.A26508@maildrop.int.zabbadoz.net> References: <201006111903.o5BJ3xp1062600@svn.freebsd.org> <20100611193903.W26508@maildrop.int.zabbadoz.net> <20100611200936.B26508@maildrop.int.zabbadoz.net> <20100611202054.A26508@maildrop.int.zabbadoz.net> Date: Fri, 11 Jun 2010 13:27:36 -0700 Message-ID: From: Jack Vogel To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209060 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:27:38 -0000 OK, that's kinda what I was guessing... Damn, guess I'll have to change it back. Thanks for letting me know. Jack On Fri, Jun 11, 2010 at 1:23 PM, Bjoern A. Zeeb wrote: > On Fri, 11 Jun 2010, Jack Vogel wrote: > > Odd though, because that code is in the driver on a system with 16 cores >> and >> I'm >> not hearing about any problem from my test engineer. >> > > So this makes it all go away: > > --- //depot/user/bz/vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-09 > 07:53:30.000000000 0000 > +++ /zoo/bz/p4/bz_vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-09 > 07:53:30.000000000 0000 > --- /tmp/tmp.96356.27 2010-06-11 16:19:14.000000000 -0400 > +++ /zoo/bz/p4/bz_vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-11 > 16:16:02.000000000 -0400 > @@ -3637,7 +3637,7 @@ ixgbe_setup_receive_ring(struct rx_ring > goto skip_head; > > /* First the header */ > - rxbuf->m_head = m_gethdr(M_WAITOK, MT_DATA); > + rxbuf->m_head = m_gethdr(M_DONTWAIT, MT_DATA); > if (rxbuf->m_head == NULL) { > error = ENOBUFS; > goto fail; > @@ -3659,7 +3659,7 @@ ixgbe_setup_receive_ring(struct rx_ring > > skip_head: > /* Now the payload cluster */ > - rxbuf->m_pack = m_getjcl(M_WAITOK, MT_DATA, > + rxbuf->m_pack = m_getjcl(M_DONTWAIT, MT_DATA, > M_PKTHDR, adapter->rx_mbuf_sz); > if (rxbuf->m_pack == NULL) { > error = ENOBUFS; > > > Are they running with WITNESS enabled to see the locking warnings? > > /bz > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:38:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC1A81065677; Fri, 11 Jun 2010 20:38:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA8AE8FC1D; Fri, 11 Jun 2010 20:38:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BKcKrb083698; Fri, 11 Jun 2010 20:38:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BKcK83083694; Fri, 11 Jun 2010 20:38:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201006112038.o5BKcK83083694@svn.freebsd.org> From: Michael Tuexen Date: Fri, 11 Jun 2010 20:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209067 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:38:22 -0000 Author: tuexen Date: Fri Jun 11 20:38:20 2010 New Revision: 209067 URL: http://svn.freebsd.org/changeset/base/209067 Log: MFC 209029 3 Fixes - a) There was a case where a ICMP message could cause us to return leaving a stuck lock on an stcb. b) The iterator needed some tweaks to fix its lock ordering. c) The ITERATOR_LOCK is no longer needed in the freeing of a stcb. Now that the timer based one is gone we don't have a multiple resume situation. Add to that that there was somewhere a path out of the freeing of an assoc that did NOT release the iterator_lock.. it was time to clean this old code up and in the process fix the lock bug. Approved by: re (bz) Modified: stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Jun 11 20:08:20 2010 (r209066) +++ stable/8/sys/netinet/sctp_pcb.c Fri Jun 11 20:38:20 2010 (r209067) @@ -3075,6 +3075,11 @@ sctp_iterator_inp_being_freed(struct sct } else { it->inp = LIST_NEXT(it->inp, sctp_list); } + /* + * When its put in the refcnt is incremented so decr + * it + */ + SCTP_INP_DECR_REF(inp); } it = nit; } @@ -4428,38 +4433,6 @@ sctp_add_vtag_to_timewait(uint32_t tag, } -static void -sctp_iterator_asoc_being_freed(struct sctp_inpcb *inp, struct sctp_tcb *stcb) -{ - struct sctp_iterator *it; - - /* - * Unlock the tcb lock we do this so we avoid a dead lock scenario - * where the iterator is waiting on the TCB lock and the TCB lock is - * waiting on the iterator lock. - */ - it = stcb->asoc.stcb_starting_point_for_iterator; - if (it == NULL) { - return; - } - if (it->inp != stcb->sctp_ep) { - /* hmm, focused on the wrong one? */ - return; - } - if (it->stcb != stcb) { - return; - } - it->stcb = LIST_NEXT(stcb, sctp_tcblist); - if (it->stcb == NULL) { - /* done with all asoc's in this assoc */ - if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { - it->inp = NULL; - } else { - it->inp = LIST_NEXT(inp, sctp_list); - } - } -} - /*- * Free the association after un-hashing the remote port. This @@ -4665,7 +4638,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, SCTP_TCB_UNLOCK(stcb); - SCTP_ITERATOR_LOCK(); SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(inp); SCTP_TCB_LOCK(stcb); @@ -4704,7 +4676,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, * Make it invalid too, that way if its about to run it will abort * and return. */ - sctp_iterator_asoc_being_freed(inp, stcb); /* re-increment the lock */ if (from_inpcbfree == SCTP_NORMAL_PROC) { atomic_add_int(&stcb->asoc.refcnt, -1); @@ -4721,7 +4692,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (from_inpcbfree == SCTP_NORMAL_PROC) { SCTP_INP_INCR_REF(inp); SCTP_INP_WUNLOCK(inp); - SCTP_ITERATOR_UNLOCK(); } /* pull from vtag hash */ LIST_REMOVE(stcb, sctp_asocs); @@ -6694,20 +6664,22 @@ sctp_initiate_iterator(inp_func inpf, it->no_chunk_output = chunk_output_off; it->vn = curvnet; if (s_inp) { + /* Assume lock is held here */ it->inp = s_inp; + SCTP_INP_INCR_REF(it->inp); it->iterator_flags = SCTP_ITERATOR_DO_SINGLE_INP; } else { SCTP_INP_INFO_RLOCK(); it->inp = LIST_FIRST(&SCTP_BASE_INFO(listhead)); - + if (it->inp) { + SCTP_INP_INCR_REF(it->inp); + } SCTP_INP_INFO_RUNLOCK(); it->iterator_flags = SCTP_ITERATOR_DO_ALL_INP; } SCTP_IPI_ITERATOR_WQ_LOCK(); - if (it->inp) { - SCTP_INP_INCR_REF(it->inp); - } + TAILQ_INSERT_TAIL(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); if (sctp_it_ctl.iterator_running == 0) { sctp_wakeup_iterator(); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Jun 11 20:08:20 2010 (r209066) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Jun 11 20:38:20 2010 (r209067) @@ -402,6 +402,9 @@ sctp_ctlinput(cmd, sa, vip) SCTP_INP_DECR_REF(inp); SCTP_INP_WUNLOCK(inp); } + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } } } return; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Jun 11 20:08:20 2010 (r209066) +++ stable/8/sys/netinet/sctputil.c Fri Jun 11 20:38:20 2010 (r209067) @@ -1255,15 +1255,20 @@ sctp_iterator_work(struct sctp_iterator { int iteration_count = 0; int inp_skip = 0; + int first_in = 1; + struct sctp_inpcb *tinp; + SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); if (it->inp) { + SCTP_INP_RLOCK(it->inp); SCTP_INP_DECR_REF(it->inp); } if (it->inp == NULL) { /* iterator is complete */ done_with_iterator: SCTP_ITERATOR_UNLOCK(); + SCTP_INP_INFO_RUNLOCK(); if (it->function_atend != NULL) { (*it->function_atend) (it->pointer, it->val); } @@ -1271,7 +1276,11 @@ done_with_iterator: return; } select_a_new_ep: - SCTP_INP_RLOCK(it->inp); + if (first_in) { + first_in = 0; + } else { + SCTP_INP_RLOCK(it->inp); + } while (((it->pcb_flags) && ((it->inp->sctp_flags & it->pcb_flags) != it->pcb_flags)) || ((it->pcb_features) && @@ -1281,8 +1290,9 @@ select_a_new_ep: SCTP_INP_RUNLOCK(it->inp); goto done_with_iterator; } - SCTP_INP_RUNLOCK(it->inp); + tinp = it->inp; it->inp = LIST_NEXT(it->inp, sctp_list); + SCTP_INP_RUNLOCK(tinp); if (it->inp == NULL) { goto done_with_iterator; } @@ -1323,6 +1333,8 @@ select_a_new_ep: SCTP_INP_INCR_REF(it->inp); SCTP_INP_RUNLOCK(it->inp); SCTP_ITERATOR_UNLOCK(); + SCTP_INP_INFO_RUNLOCK(); + SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); if (sctp_it_ctl.iterator_flags) { /* We won't be staying here */ @@ -1382,9 +1394,7 @@ no_stcb: if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { it->inp = NULL; } else { - SCTP_INP_INFO_RLOCK(); it->inp = LIST_NEXT(it->inp, sctp_list); - SCTP_INP_INFO_RUNLOCK(); } if (it->inp == NULL) { goto done_with_iterator; From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:45:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A562D10656C4; Fri, 11 Jun 2010 20:45:09 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 25BA38FC17; Fri, 11 Jun 2010 20:45:01 +0000 (UTC) Received: by vws20 with SMTP id 20so597757vws.13 for ; Fri, 11 Jun 2010 13:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=ZzXhrsX7cj5m4ab5kgzww+JIH5ra10NOlg0o/4UGLf8=; b=Rexgjm4/QcmggHHSVNsjvsEZJF6f8yyBXnaipNqJsPIfI7Hwf5744A3zLnOSC7RLOK LX3zkwK6ntPEd/NhXN8UF5xltAIxybBVGZKyy7y7D6KcH0okFQLkVxr2H97HywAcmQh6 t/ceDMXXDhRBcH+V2fle4upCg3QnrxKTsBnuI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=MOMApORz6LSy90qgNY9kmLJQiDnwMjZEtBYwnNGqbPQfkfLoJF5geIx+lLTextKZtu LRBWxen7b2Y73Z5wwRTPAmLB9ik0KQ7f8XDJ8JuLeaG8jUFoTDyiSMe5u1M+6b3f+ZhV zCNHhxAAp/0Fhrlujsr1eqf8fHih6I000DSdA= MIME-Version: 1.0 Received: by 10.224.97.9 with SMTP id j9mr931453qan.289.1276289100055; Fri, 11 Jun 2010 13:45:00 -0700 (PDT) Received: by 10.229.238.199 with HTTP; Fri, 11 Jun 2010 13:44:59 -0700 (PDT) In-Reply-To: References: <201006111903.o5BJ3xp1062600@svn.freebsd.org> <20100611193903.W26508@maildrop.int.zabbadoz.net> <20100611200936.B26508@maildrop.int.zabbadoz.net> <20100611202054.A26508@maildrop.int.zabbadoz.net> Date: Fri, 11 Jun 2010 13:44:59 -0700 Message-ID: From: Jack Vogel To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209060 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:45:09 -0000 On Fri, Jun 11, 2010 at 1:27 PM, Jack Vogel wrote: > > On Fri, Jun 11, 2010 at 1:23 PM, Bjoern A. Zeeb wrote: > >> On Fri, 11 Jun 2010, Jack Vogel wrote: >> >> Odd though, because that code is in the driver on a system with 16 cores >>> and >>> I'm >>> not hearing about any problem from my test engineer. >>> >> >> So this makes it all go away: >> >> --- //depot/user/bz/vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-09 >> 07:53:30.000000000 0000 >> +++ /zoo/bz/p4/bz_vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-09 >> 07:53:30.000000000 0000 >> --- /tmp/tmp.96356.27 2010-06-11 16:19:14.000000000 -0400 >> +++ /zoo/bz/p4/bz_vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-11 >> 16:16:02.000000000 -0400 >> @@ -3637,7 +3637,7 @@ ixgbe_setup_receive_ring(struct rx_ring >> goto skip_head; >> >> /* First the header */ >> - rxbuf->m_head = m_gethdr(M_WAITOK, MT_DATA); >> + rxbuf->m_head = m_gethdr(M_DONTWAIT, MT_DATA); >> if (rxbuf->m_head == NULL) { >> error = ENOBUFS; >> goto fail; >> @@ -3659,7 +3659,7 @@ ixgbe_setup_receive_ring(struct rx_ring >> >> skip_head: >> /* Now the payload cluster */ >> - rxbuf->m_pack = m_getjcl(M_WAITOK, MT_DATA, >> + rxbuf->m_pack = m_getjcl(M_DONTWAIT, MT_DATA, >> M_PKTHDR, adapter->rx_mbuf_sz); >> if (rxbuf->m_pack == NULL) { >> error = ENOBUFS; >> >> >> Are they running with WITNESS enabled to see the locking warnings? >> > > He's running with a recent version of STABLE/8 so probably does not have WITNESS on. So you think that causes the problem? I just went into the lab, he does have the WAITOK in the driver, and the system has 16 cores. So, I'm still not clear why you see a problem when he does not. I will change it back to NOWAIT in any case. Jack From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:54:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7AE1106567B; Fri, 11 Jun 2010 20:54:27 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D60ED8FC14; Fri, 11 Jun 2010 20:54:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BKsRI2087304; Fri, 11 Jun 2010 20:54:27 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BKsRk8087302; Fri, 11 Jun 2010 20:54:27 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201006112054.o5BKsRk8087302@svn.freebsd.org> From: Jack F Vogel Date: Fri, 11 Jun 2010 20:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209068 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:54:28 -0000 Author: jfv Date: Fri Jun 11 20:54:27 2010 New Revision: 209068 URL: http://svn.freebsd.org/changeset/base/209068 Log: Add a couple fixes from Michael Tuexen. Remove unneeded rxtx handler, make que handler generic. Do not allocate header mbufs in rx ring if not doing hdr split. Release the lock in rxeof call to stack. MFC for 8.1 asap Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jun 11 20:38:20 2010 (r209067) +++ head/sys/dev/e1000/if_igb.c Fri Jun 11 20:54:27 2010 (r209068) @@ -99,7 +99,7 @@ int igb_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char igb_driver_version[] = "version - 1.9.5"; +char igb_driver_version[] = "version - 1.9.6"; /********************************************************************* @@ -240,7 +240,6 @@ static void igb_led_func(void *, int static int igb_irq_fast(void *); static void igb_add_rx_process_limit(struct adapter *, const char *, const char *, int *, int); -static void igb_handle_rxtx(void *context, int pending); static void igb_handle_que(void *context, int pending); static void igb_handle_link(void *context, int pending); @@ -818,21 +817,25 @@ igb_start(struct ifnet *ifp) static int igb_mq_start(struct ifnet *ifp, struct mbuf *m) { - struct adapter *adapter = ifp->if_softc; - struct tx_ring *txr; - int i = 0, err = 0; + struct adapter *adapter = ifp->if_softc; + struct igb_queue *que; + struct tx_ring *txr; + int i = 0, err = 0; /* Which queue to use */ if ((m->m_flags & M_FLOWID) != 0) i = m->m_pkthdr.flowid % adapter->num_queues; txr = &adapter->tx_rings[i]; + que = &adapter->queues[i]; if (IGB_TX_TRYLOCK(txr)) { err = igb_mq_start_locked(ifp, txr, m); IGB_TX_UNLOCK(txr); - } else + } else { err = drbr_enqueue(ifp, txr->br, m); + taskqueue_enqueue(que->tq, &que->que_task); + } return (err); } @@ -1225,35 +1228,6 @@ igb_init(void *arg) static void -igb_handle_rxtx(void *context, int pending) -{ - struct igb_queue *que = context; - struct adapter *adapter = que->adapter; - struct tx_ring *txr = adapter->tx_rings; - struct ifnet *ifp; - - ifp = adapter->ifp; - - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (igb_rxeof(que, adapter->rx_process_limit)) - taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); - IGB_TX_LOCK(txr); - igb_txeof(txr); - -#if __FreeBSD_version >= 800000 - if (!drbr_empty(ifp, txr->br)) - igb_mq_start_locked(ifp, txr, NULL); -#else - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - igb_start_locked(txr, ifp); -#endif - IGB_TX_UNLOCK(txr); - } - - igb_enable_intr(adapter); -} - -static void igb_handle_que(void *context, int pending) { struct igb_queue *que = context; @@ -1268,7 +1242,8 @@ igb_handle_que(void *context, int pendin IGB_TX_LOCK(txr); igb_txeof(txr); #if __FreeBSD_version >= 800000 - igb_mq_start_locked(ifp, txr, NULL); + if (!drbr_empty(ifp, txr->br)) + igb_mq_start_locked(ifp, txr, NULL); #else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) igb_start_locked(txr, ifp); @@ -1280,11 +1255,15 @@ igb_handle_que(void *context, int pendin } } - /* Reenable this interrupt */ #ifdef DEVICE_POLLING - if (!(ifp->if_capenable & IFCAP_POLLING)) + if (ifp->if_capenable & IFCAP_POLLING) + return; #endif - E1000_WRITE_REG(&adapter->hw, E1000_EIMS, que->eims); + /* Reenable this interrupt */ + if (que->eims) + E1000_WRITE_REG(&adapter->hw, E1000_EIMS, que->eims); + else + igb_enable_intr(adapter); } /* Deal with link in a sleepable context */ @@ -1923,11 +1902,6 @@ igb_local_timer(void *arg) goto timeout; } - /* Trigger an RX interrupt on all queues */ -#ifdef DEVICE_POLLING - if (!(ifp->if_capenable & IFCAP_POLLING)) -#endif - E1000_WRITE_REG(&adapter->hw, E1000_EICS, adapter->rx_mask); callout_reset(&adapter->timer, hz, igb_local_timer, adapter); return; @@ -2142,7 +2116,7 @@ igb_allocate_legacy(struct adapter *adap * Try allocating a fast interrupt and the associated deferred * processing contexts. */ - TASK_INIT(&adapter->rxtx_task, 0, igb_handle_rxtx, que); + TASK_INIT(&adapter->rxtx_task, 0, igb_handle_que, que); /* Make tasklet for deferred link handling */ TASK_INIT(&adapter->link_task, 0, igb_handle_link, adapter); adapter->tq = taskqueue_create_fast("igb_taskq", M_NOWAIT, @@ -2194,7 +2168,6 @@ igb_allocate_msix(struct adapter *adapte device_printf(dev, "Failed to register Queue handler"); return (error); } - bus_describe_intr(dev, que->res, que->tag, "que %d", i); que->msix = vector; if (adapter->hw.mac.type == e1000_82575) que->eims = E1000_EICR_TX_QUEUE0 << i; @@ -2230,7 +2203,6 @@ igb_allocate_msix(struct adapter *adapte device_printf(dev, "Failed to register Link handler"); return (error); } - bus_describe_intr(dev, adapter->res, adapter->tag, "link"); adapter->linkvec = vector; /* Make tasklet for deferred handling */ @@ -3572,7 +3544,7 @@ igb_refresh_mbufs(struct rx_ring *rxr, i cleaned = -1; /* Signify no completions */ while (i != limit) { rxbuf = &rxr->rx_buffers[i]; - if (rxbuf->m_head == NULL) { + if ((rxbuf->m_head == NULL) && (rxr->hdr_split)) { mh = m_gethdr(M_DONTWAIT, MT_DATA); if (mh == NULL) goto update; @@ -3778,16 +3750,24 @@ igb_setup_receive_ring(struct rx_ring *r */ igb_free_receive_ring(rxr); + /* Configure for header split? */ + if (igb_header_split) + rxr->hdr_split = TRUE; + /* Now replenish the ring mbufs */ for (int j = 0; j != adapter->num_rx_desc; ++j) { struct mbuf *mh, *mp; rxbuf = &rxr->rx_buffers[j]; + if (rxr->hdr_split == FALSE) + goto skip_head; /* First the header */ rxbuf->m_head = m_gethdr(M_DONTWAIT, MT_DATA); - if (rxbuf->m_head == NULL) + if (rxbuf->m_head == NULL) { + error = ENOBUFS; goto fail; + } m_adj(rxbuf->m_head, ETHER_ALIGN); mh = rxbuf->m_head; mh->m_len = mh->m_pkthdr.len = MHLEN; @@ -3803,11 +3783,14 @@ igb_setup_receive_ring(struct rx_ring *r /* Update descriptor */ rxr->rx_base[j].read.hdr_addr = htole64(hseg[0].ds_addr); +skip_head: /* Now the payload cluster */ rxbuf->m_pack = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); - if (rxbuf->m_pack == NULL) + if (rxbuf->m_pack == NULL) { + error = ENOBUFS; goto fail; + } mp = rxbuf->m_pack; mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; /* Get the memory mapping */ @@ -3826,11 +3809,8 @@ igb_setup_receive_ring(struct rx_ring *r rxr->next_to_check = 0; rxr->next_to_refresh = 0; rxr->lro_enabled = FALSE; - - if (igb_header_split) - rxr->hdr_split = TRUE; - else - ifp->if_capabilities &= ~IFCAP_LRO; + rxr->rx_split_packets = 0; + rxr->rx_bytes = 0; rxr->fmp = NULL; rxr->lmp = NULL; @@ -3874,7 +3854,7 @@ static int igb_setup_receive_structures(struct adapter *adapter) { struct rx_ring *rxr = adapter->rx_rings; - int i, j; + int i; for (i = 0; i < adapter->num_queues; i++, rxr++) if (igb_setup_receive_ring(rxr)) @@ -3885,13 +3865,11 @@ fail: /* * Free RX buffers allocated so far, we will only handle * the rings that completed, the failing case will have - * cleaned up for itself. The value of 'i' will be the - * failed ring so we must pre-decrement it. + * cleaned up for itself. 'i' is the endpoint. */ - rxr = adapter->rx_rings; - for (--i; i > 0; i--, rxr++) { - for (j = 0; j < adapter->num_rx_desc; j++) - igb_free_receive_ring(rxr); + for (int j = 0; j > i; ++j) { + rxr = &adapter->rx_rings[i]; + igb_free_receive_ring(rxr); } return (ENOBUFS); @@ -4197,7 +4175,9 @@ igb_rx_input(struct rx_ring *rxr, struct if (tcp_lro_rx(&rxr->lro, m, 0) == 0) return; } + IGB_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, m); + IGB_RX_LOCK(rxr); } /********************************************************************* @@ -4368,8 +4348,11 @@ next_desc: /* ** Send to the stack or LRO */ - if (sendmp != NULL) + if (sendmp != NULL) { + rxr->next_to_check = i; igb_rx_input(rxr, ifp, sendmp, ptype); + i = rxr->next_to_check; + } /* Every 8 descriptors we go to refresh mbufs */ if (processed == 8) { @@ -4838,19 +4821,14 @@ igb_print_debug_info(struct adapter *ada adapter->hw.fc.high_water, adapter->hw.fc.low_water); - for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { + for (int i = 0; i < adapter->num_queues; i++, txr++) { device_printf(dev, "Queue(%d) tdh = %d, tdt = %d ", i, E1000_READ_REG(&adapter->hw, E1000_TDH(i)), E1000_READ_REG(&adapter->hw, E1000_TDT(i))); - device_printf(dev, "rdh = %d, rdt = %d\n", - E1000_READ_REG(&adapter->hw, E1000_RDH(i)), - E1000_READ_REG(&adapter->hw, E1000_RDT(i))); - device_printf(dev, "TX(%d) no descriptors avail event = %lld\n", + device_printf(dev, "TX(%d) no descriptors = %lld\n", txr->me, (long long)txr->no_desc_avail); device_printf(dev, "TX(%d) Packets sent = %lld\n", txr->me, (long long)txr->tx_packets); - device_printf(dev, "RX(%d) Packets received = %lld ", - rxr->me, (long long)rxr->rx_packets); } for (int i = 0; i < adapter->num_queues; i++, rxr++) { @@ -4870,7 +4848,7 @@ igb_print_debug_info(struct adapter *ada } for (int i = 0; i < adapter->num_queues; i++, que++) - device_printf(dev,"QUE(%d) IRQs = %llx\n", + device_printf(dev,"QUE(%d) IRQs = %lld\n", i, (long long)que->irqs); device_printf(dev, "LINK MSIX IRQ Handled = %u\n", adapter->link_irq); From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:56:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A29BE106566C; Fri, 11 Jun 2010 20:56:40 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91AEA8FC18; Fri, 11 Jun 2010 20:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BKuexd087848; Fri, 11 Jun 2010 20:56:40 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BKue7S087841; Fri, 11 Jun 2010 20:56:40 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201006112056.o5BKue7S087841@svn.freebsd.org> From: Randi Harper Date: Fri, 11 Jun 2010 20:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209069 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:56:40 -0000 Author: randi Date: Fri Jun 11 20:56:40 2010 New Revision: 209069 URL: http://svn.freebsd.org/changeset/base/209069 Log: Make sysinstall WARNS=2 clean. Approved by: cperciva (mentor) MFC after: 1 month Modified: head/usr.sbin/sysinstall/Makefile head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/installUpgrade.c head/usr.sbin/sysinstall/media.c head/usr.sbin/sysinstall/system.c head/usr.sbin/sysinstall/tcpip.c Modified: head/usr.sbin/sysinstall/Makefile ============================================================================== --- head/usr.sbin/sysinstall/Makefile Fri Jun 11 20:54:27 2010 (r209068) +++ head/usr.sbin/sysinstall/Makefile Fri Jun 11 20:56:40 2010 (r209069) @@ -14,13 +14,13 @@ SRCS= anonFTP.c cdrom.c command.c config system.c tcpip.c termcap.c ttys.c ufs.c usb.c user.c \ variable.c ${_wizard} keymap.h countries.h -CFLAGS+= -DUSE_GZIP=1 +CFLAGS+= -DUSE_GZIP=1 -fno-strict-aliasing .if ${MACHINE} == "pc98" CFLAGS+= -DPC98 .endif CFLAGS+= -I${.CURDIR}/../../gnu/lib/libdialog -I. -WARNS?= 1 +WARNS?= 2 DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO} LDADD= -ldialog -lncurses -lutil -ldisk -lftpio Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Fri Jun 11 20:54:27 2010 (r209068) +++ head/usr.sbin/sysinstall/install.c Fri Jun 11 20:56:40 2010 (r209069) @@ -357,7 +357,6 @@ installFixitUSB(dialogMenuItem *self) int installFixitCDROM(dialogMenuItem *self) { - struct stat sb; int need_eject; if (!RunningAsInit) Modified: head/usr.sbin/sysinstall/installUpgrade.c ============================================================================== --- head/usr.sbin/sysinstall/installUpgrade.c Fri Jun 11 20:54:27 2010 (r209068) +++ head/usr.sbin/sysinstall/installUpgrade.c Fri Jun 11 20:56:40 2010 (r209069) @@ -368,7 +368,7 @@ media: "Next comes stage 2, where we attempt to resurrect your /etc\n" "directory!"); - if (saved_etc && chdir(saved_etc)) { + if (chdir(saved_etc)) { msgConfirm("Unable to go to your saved /etc directory in %s?! Argh!\n" "Something went seriously wrong! It's quite possible that\n" "your former /etc is toast. I hope you didn't have any\n" Modified: head/usr.sbin/sysinstall/media.c ============================================================================== --- head/usr.sbin/sysinstall/media.c Fri Jun 11 20:54:27 2010 (r209068) +++ head/usr.sbin/sysinstall/media.c Fri Jun 11 20:56:40 2010 (r209069) @@ -350,7 +350,7 @@ mediaSetFTP(dialogMenuItem *self) } urllen = strlen(cp); if (urllen >= sizeof(ftpDevice.name)) { - msgConfirm("Length of specified URL is %d characters. Allowable maximum is %d.", + msgConfirm("Length of specified URL is %zu characters. Allowable maximum is %zu.", urllen,sizeof(ftpDevice.name)-1); variable_unset(VAR_FTP_PATH); return DITEM_FAILURE; @@ -563,7 +563,7 @@ mediaSetNFS(dialogMenuItem *self) } pathlen = strlen(hostname); if (pathlen >= sizeof(nfsDevice.name)) { - msgConfirm("Length of specified NFS path is %d characters. Allowable maximum is %d.", + msgConfirm("Length of specified NFS path is %zu characters. Allowable maximum is %zu.", pathlen,sizeof(nfsDevice.name)-1); variable_unset(VAR_NFS_PATH); return DITEM_FAILURE; Modified: head/usr.sbin/sysinstall/system.c ============================================================================== --- head/usr.sbin/sysinstall/system.c Fri Jun 11 20:54:27 2010 (r209068) +++ head/usr.sbin/sysinstall/system.c Fri Jun 11 20:56:40 2010 (r209069) @@ -524,7 +524,7 @@ systemCreateHoloshell(void) printf("Type ``exit'' in this fixit shell to resume sysinstall.\n\n"); fflush(stdout); } - execlp("sh", "-sh", 0); + execlp("sh", "-sh", NULL); msgDebug("Was unable to execute sh for Holographic shell!\n"); exit(1); } Modified: head/usr.sbin/sysinstall/tcpip.c ============================================================================== --- head/usr.sbin/sysinstall/tcpip.c Fri Jun 11 20:54:27 2010 (r209068) +++ head/usr.sbin/sysinstall/tcpip.c Fri Jun 11 20:56:40 2010 (r209069) @@ -649,7 +649,6 @@ tcpDeviceScan(void) int s; struct ifmediareq ifmr; struct ifaddrs *ifap, *ifa; - struct if_data *ifd; char *network_dev; if ((s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 20:59:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00D19106567B; Fri, 11 Jun 2010 20:59:30 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4CE98FC17; Fri, 11 Jun 2010 20:59:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BKxT83088475; Fri, 11 Jun 2010 20:59:29 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BKxTNU088473; Fri, 11 Jun 2010 20:59:29 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201006112059.o5BKxTNU088473@svn.freebsd.org> From: Jack F Vogel Date: Fri, 11 Jun 2010 20:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209070 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 20:59:30 -0000 Author: jfv Date: Fri Jun 11 20:59:29 2010 New Revision: 209070 URL: http://svn.freebsd.org/changeset/base/209070 Log: Change the mbuf memory calls back to NOWAIT as a problem has been seen in one case with doing the M_WAITOK Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Jun 11 20:56:40 2010 (r209069) +++ head/sys/dev/ixgbe/ixgbe.c Fri Jun 11 20:59:29 2010 (r209070) @@ -3642,7 +3642,7 @@ ixgbe_setup_receive_ring(struct rx_ring goto skip_head; /* First the header */ - rxbuf->m_head = m_gethdr(M_WAITOK, MT_DATA); + rxbuf->m_head = m_gethdr(M_NOWAIT, MT_DATA); if (rxbuf->m_head == NULL) { error = ENOBUFS; goto fail; @@ -3664,7 +3664,7 @@ ixgbe_setup_receive_ring(struct rx_ring skip_head: /* Now the payload cluster */ - rxbuf->m_pack = m_getjcl(M_WAITOK, MT_DATA, + rxbuf->m_pack = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (rxbuf->m_pack == NULL) { error = ENOBUFS; From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 21:15:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69E931065670; Fri, 11 Jun 2010 21:15:55 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id BBDE38FC08; Fri, 11 Jun 2010 21:15:54 +0000 (UTC) Received: from [192.168.1.190] (p508FD075.dip.t-dialin.net [80.143.208.117]) by mail-n.franken.de (Postfix) with ESMTP id 1BCDD1C0C0BCE; Fri, 11 Jun 2010 23:15:53 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Michael Tuexen In-Reply-To: Date: Fri, 11 Jun 2010 23:16:43 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <88938997-F212-4825-9097-8FF32216F911@freebsd.org> References: <201006111903.o5BJ3xp1062600@svn.freebsd.org> <20100611193903.W26508@maildrop.int.zabbadoz.net> <20100611200936.B26508@maildrop.int.zabbadoz.net> <20100611202054.A26508@maildrop.int.zabbadoz.net> To: Jack Vogel X-Mailer: Apple Mail (2.1078) Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r209060 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 21:15:55 -0000 On Jun 11, 2010, at 10:44 PM, Jack Vogel wrote: >=20 >=20 > On Fri, Jun 11, 2010 at 1:27 PM, Jack Vogel wrote: >=20 > On Fri, Jun 11, 2010 at 1:23 PM, Bjoern A. Zeeb = wrote: > On Fri, 11 Jun 2010, Jack Vogel wrote: >=20 > Odd though, because that code is in the driver on a system with 16 = cores and > I'm > not hearing about any problem from my test engineer. >=20 > So this makes it all go away: >=20 > --- //depot/user/bz/vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-09 = 07:53:30.000000000 0000 > +++ /zoo/bz/p4/bz_vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-09 = 07:53:30.000000000 0000 > --- /tmp/tmp.96356.27 2010-06-11 16:19:14.000000000 -0400 > +++ /zoo/bz/p4/bz_vimage/src/sys/dev/ixgbe/ixgbe.c 2010-06-11 = 16:16:02.000000000 -0400 > @@ -3637,7 +3637,7 @@ ixgbe_setup_receive_ring(struct rx_ring > goto skip_head; >=20 > /* First the header */ > - rxbuf->m_head =3D m_gethdr(M_WAITOK, MT_DATA); > + rxbuf->m_head =3D m_gethdr(M_DONTWAIT, MT_DATA); > if (rxbuf->m_head =3D=3D NULL) { > error =3D ENOBUFS; > goto fail; > @@ -3659,7 +3659,7 @@ ixgbe_setup_receive_ring(struct rx_ring >=20 > skip_head: > /* Now the payload cluster */ > - rxbuf->m_pack =3D m_getjcl(M_WAITOK, MT_DATA, > + rxbuf->m_pack =3D m_getjcl(M_DONTWAIT, MT_DATA, > M_PKTHDR, adapter->rx_mbuf_sz); > if (rxbuf->m_pack =3D=3D NULL) { > error =3D ENOBUFS; >=20 >=20 > Are they running with WITNESS enabled to see the locking warnings? >=20 >=20 > He's running with a recent version of STABLE/8 so probably does not = have WITNESS on. > So you think that causes the problem? I just went into the lab, he = does have the WAITOK > in the driver, and the system has 16 cores. So, I'm still not clear = why you see a problem > when he does not. >=20 > I will change it back to NOWAIT in any case. Try enabling WITNESS. It is possible that I saw something like this when = trying to temporary enable WITNESS on a system. But then went back and did not = investigate it... Best regards Michael >=20 > Jack > =20 >=20 From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 21:25:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E96CB106566B; Fri, 11 Jun 2010 21:25:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BB19E8FC08; Fri, 11 Jun 2010 21:25:13 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6D69F46B86; Fri, 11 Jun 2010 17:25:13 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C668F8A03C; Fri, 11 Jun 2010 17:25:12 -0400 (EDT) From: John Baldwin To: Jack F Vogel Date: Fri, 11 Jun 2010 17:25:05 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006112054.o5BKsRk8087302@svn.freebsd.org> In-Reply-To: <201006112054.o5BKsRk8087302@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201006111725.05062.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 17:25:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209068 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 21:25:14 -0000 On Friday 11 June 2010 4:54:27 pm Jack F Vogel wrote: > Author: jfv > Date: Fri Jun 11 20:54:27 2010 > New Revision: 209068 > URL: http://svn.freebsd.org/changeset/base/209068 > > Log: > Add a couple fixes from Michael Tuexen. > Remove unneeded rxtx handler, make que handler generic. > Do not allocate header mbufs in rx ring if not doing hdr split. > Release the lock in rxeof call to stack. > > MFC for 8.1 asap You just removed the bus_describe_intr() calls again. Can you _please_ put those into your tree so you don't keep losing them? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 21:30:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E631A1065675; Fri, 11 Jun 2010 21:30:52 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 33FA48FC08; Fri, 11 Jun 2010 21:30:51 +0000 (UTC) Received: by vws20 with SMTP id 20so653143vws.13 for ; Fri, 11 Jun 2010 14:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=iKF/B+/7yY1X+JM9fg9n6V+3TacPDzxFzkVVi/x7HSA=; b=Nwi1993rh2PlSa6yIFdUKRzd1lHb9w/vn5ojTIrJhUq+n9SOh2sXiIiMs+vXFZ6EHw m3zPqaECxjCqTjdrVAJKXPmWT0hj7O01vkqg8+QWk1psU9G4ctsVciz6K35I5tp/+0Lx +Nve0qGMV7Pn5xBexjxoEXAM8y344b/5SJKKI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=e4sqo7TngnsOlcknhZTAVJvbQ7/KVU+34ddO7XnrijoWsc4OUDLrVbqS5JyCUx5zA/ nxHkG3uZjsYXLkvdZpoKkqfLPDQm86UD1Q3FzuJo+/OkvVF4RLzkz0vAyQUx3Ua641xA Lw6ymzGZ8FYiZtHalWnlwsvc6ZE9YmY4AN4mE= MIME-Version: 1.0 Received: by 10.224.71.130 with SMTP id h2mr997585qaj.90.1276291851179; Fri, 11 Jun 2010 14:30:51 -0700 (PDT) Received: by 10.229.238.199 with HTTP; Fri, 11 Jun 2010 14:30:51 -0700 (PDT) In-Reply-To: <201006111725.05062.jhb@freebsd.org> References: <201006112054.o5BKsRk8087302@svn.freebsd.org> <201006111725.05062.jhb@freebsd.org> Date: Fri, 11 Jun 2010 14:30:51 -0700 Message-ID: From: Jack Vogel To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209068 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 21:30:53 -0000 LOL, I'm sorry John, I actually did put them into my local source, I dont know what happened, just not my day :( Jack On Fri, Jun 11, 2010 at 2:25 PM, John Baldwin wrote: > On Friday 11 June 2010 4:54:27 pm Jack F Vogel wrote: > > Author: jfv > > Date: Fri Jun 11 20:54:27 2010 > > New Revision: 209068 > > URL: http://svn.freebsd.org/changeset/base/209068 > > > > Log: > > Add a couple fixes from Michael Tuexen. > > Remove unneeded rxtx handler, make que handler generic. > > Do not allocate header mbufs in rx ring if not doing hdr split. > > Release the lock in rxeof call to stack. > > > > MFC for 8.1 asap > > You just removed the bus_describe_intr() calls again. Can you _please_ put > those into your tree so you don't keep losing them? > > -- > John Baldwin > From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 21:35:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6CFA1065678; Fri, 11 Jun 2010 21:35:19 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D582A8FC1D; Fri, 11 Jun 2010 21:35:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BLZJxc096407; Fri, 11 Jun 2010 21:35:19 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BLZJuA096405; Fri, 11 Jun 2010 21:35:19 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201006112135.o5BLZJuA096405@svn.freebsd.org> From: Jack F Vogel Date: Fri, 11 Jun 2010 21:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209071 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 21:35:20 -0000 Author: jfv Date: Fri Jun 11 21:35:19 2010 New Revision: 209071 URL: http://svn.freebsd.org/changeset/base/209071 Log: Put back the lost bus_describe_intr() calls. Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jun 11 20:59:29 2010 (r209070) +++ head/sys/dev/e1000/if_igb.c Fri Jun 11 21:35:19 2010 (r209071) @@ -2168,6 +2168,9 @@ igb_allocate_msix(struct adapter *adapte device_printf(dev, "Failed to register Queue handler"); return (error); } +#if __FreeBSD_version >= 800504 + bus_describe_intr(dev, que->res, que->tag, "que %d", i); +#endif que->msix = vector; if (adapter->hw.mac.type == e1000_82575) que->eims = E1000_EICR_TX_QUEUE0 << i; @@ -2203,6 +2206,9 @@ igb_allocate_msix(struct adapter *adapte device_printf(dev, "Failed to register Link handler"); return (error); } +#if __FreeBSD_version >= 800504 + bus_describe_intr(dev, adapter->res, adapter->tag, "link"); +#endif adapter->linkvec = vector; /* Make tasklet for deferred handling */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 21:46:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33D141065677; Fri, 11 Jun 2010 21:46:46 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22FB68FC18; Fri, 11 Jun 2010 21:46:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BLkkrR098927; Fri, 11 Jun 2010 21:46:46 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BLkkor098925; Fri, 11 Jun 2010 21:46:46 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201006112146.o5BLkkor098925@svn.freebsd.org> From: Colin Percival Date: Fri, 11 Jun 2010 21:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209072 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 21:46:46 -0000 Author: cperciva Date: Fri Jun 11 21:46:45 2010 New Revision: 209072 URL: http://svn.freebsd.org/changeset/base/209072 Log: Clean up code by removing pre-C99 struct hack preprocessor magic. Approved by: randi (maintainer) Modified: head/usr.sbin/sysinstall/sysinstall.h Modified: head/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.h Fri Jun 11 21:35:19 2010 (r209071) +++ head/usr.sbin/sysinstall/sysinstall.h Fri Jun 11 21:46:45 2010 (r209072) @@ -228,13 +228,7 @@ typedef struct _dmenu { char *prompt; /* Our prompt */ char *helpline; /* Line of help at bottom */ char *helpfile; /* Help file for "F1" */ -#if (__STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3) dialogMenuItem items[]; /* Array of menu items */ -#elif __GNUC__ - dialogMenuItem items[0]; /* Array of menu items */ -#else -#error "Create hack for C89 and K&R compilers." -#endif } DMenu; /* An rc.conf variable */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 21:54:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4BA71065670; Fri, 11 Jun 2010 21:54:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C304D8FC19; Fri, 11 Jun 2010 21:54:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BLs4wd000749; Fri, 11 Jun 2010 21:54:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BLs4lS000746; Fri, 11 Jun 2010 21:54:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112154.o5BLs4lS000746@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 21:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209073 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 21:54:04 -0000 Author: marius Date: Fri Jun 11 21:54:04 2010 New Revision: 209073 URL: http://svn.freebsd.org/changeset/base/209073 Log: MFC: r208746 Don't leak memory on destruction. Reviewed by: marcel Approved by: re (kib) Modified: stable/8/sys/geom/part/g_part_bsd.c stable/8/sys/geom/part/g_part_gpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/8/sys/geom/part/g_part_bsd.c Fri Jun 11 21:46:45 2010 (r209072) +++ stable/8/sys/geom/part/g_part_bsd.c Fri Jun 11 21:54:04 2010 (r209073) @@ -239,6 +239,12 @@ g_part_bsd_create(struct g_part_table *b static int g_part_bsd_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_bsd_table *table; + + table = (struct g_part_bsd_table *)basetable; + if (table->bbarea != NULL) + g_free(table->bbarea); + table->bbarea = NULL; /* Wipe the second sector to clear the partitioning. */ basetable->gpt_smhead |= 2; Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Fri Jun 11 21:46:45 2010 (r209072) +++ stable/8/sys/geom/part/g_part_gpt.c Fri Jun 11 21:54:04 2010 (r209073) @@ -462,6 +462,12 @@ g_part_gpt_create(struct g_part_table *b static int g_part_gpt_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_gpt_table *table; + + table = (struct g_part_gpt_table *)basetable; + if (table->hdr != NULL) + g_free(table->hdr); + table->hdr = NULL; /* * Wipe the first 2 sectors as well as the last to clear the From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 21:54:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A8D61065677; Fri, 11 Jun 2010 21:54:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0947D8FC14; Fri, 11 Jun 2010 21:54:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BLs6j5000787; Fri, 11 Jun 2010 21:54:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BLs6sX000784; Fri, 11 Jun 2010 21:54:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112154.o5BLs6sX000784@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 21:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209074 - stable/7/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 21:54:07 -0000 Author: marius Date: Fri Jun 11 21:54:06 2010 New Revision: 209074 URL: http://svn.freebsd.org/changeset/base/209074 Log: MFC: r208746 Don't leak memory on destruction. Reviewed by: marcel Approved by: re (kib) Modified: stable/7/sys/geom/part/g_part_bsd.c stable/7/sys/geom/part/g_part_gpt.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/7/sys/geom/part/g_part_bsd.c Fri Jun 11 21:54:04 2010 (r209073) +++ stable/7/sys/geom/part/g_part_bsd.c Fri Jun 11 21:54:06 2010 (r209074) @@ -240,6 +240,12 @@ g_part_bsd_create(struct g_part_table *b static int g_part_bsd_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_bsd_table *table; + + table = (struct g_part_bsd_table *)basetable; + if (table->bbarea != NULL) + g_free(table->bbarea); + table->bbarea = NULL; /* Wipe the second sector to clear the partitioning. */ basetable->gpt_smhead |= 2; Modified: stable/7/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/7/sys/geom/part/g_part_gpt.c Fri Jun 11 21:54:04 2010 (r209073) +++ stable/7/sys/geom/part/g_part_gpt.c Fri Jun 11 21:54:06 2010 (r209074) @@ -454,6 +454,12 @@ g_part_gpt_create(struct g_part_table *b static int g_part_gpt_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_gpt_table *table; + + table = (struct g_part_gpt_table *)basetable; + if (table->hdr != NULL) + g_free(table->hdr); + table->hdr = NULL; /* * Wipe the first 2 sectors as well as the last to clear the From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 22:01:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67EA61065673; Fri, 11 Jun 2010 22:01:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 561FA8FC1B; Fri, 11 Jun 2010 22:01:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BM1wdV002739; Fri, 11 Jun 2010 22:01:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BM1wBI002737; Fri, 11 Jun 2010 22:01:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112201.o5BM1wBI002737@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209075 - stable/8/sys/dev/cas X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:01:58 -0000 Author: marius Date: Fri Jun 11 22:01:58 2010 New Revision: 209075 URL: http://svn.freebsd.org/changeset/base/209075 Log: MFC: r208776 Avoid possible NULL-dereferences. Found with: Coverity Prevent(tm) CID: 3428 Approved by: re (kib) Modified: stable/8/sys/dev/cas/if_cas.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Fri Jun 11 21:54:06 2010 (r209074) +++ stable/8/sys/dev/cas/if_cas.c Fri Jun 11 22:01:58 2010 (r209075) @@ -1787,6 +1787,7 @@ cas_rint(struct cas_softc *sc) } } idx2 = 0; + m2 = NULL; rxds2 = NULL; if ((word1 & CAS_RC1_SPLIT_PKT) != 0) { KASSERT((word1 & CAS_RC1_RELEASE_NEXT) != 0, @@ -1799,32 +1800,39 @@ cas_rint(struct cas_softc *sc) __func__, idx2); #endif rxds2 = &sc->sc_rxdsoft[idx2]; - MGET(m2, M_DONTWAIT, MT_DATA); - if (m2 != NULL) { - refcount_acquire( - &rxds2->rxds_refcount); - m2->m_len = len - m->m_len; - bus_dmamap_sync(sc->sc_rdmatag, - rxds2->rxds_dmamap, - BUS_DMASYNC_POSTREAD); + if (m != NULL) { + MGET(m2, M_DONTWAIT, MT_DATA); + if (m2 != NULL) { + refcount_acquire( + &rxds2->rxds_refcount); + m2->m_len = len - m->m_len; + bus_dmamap_sync( + sc->sc_rdmatag, + rxds2->rxds_dmamap, + BUS_DMASYNC_POSTREAD); #if __FreeBSD_version < 800016 - MEXTADD(m2, (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, rxds2, - M_RDONLY, EXT_NET_DRV); + MEXTADD(m2, + (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, + rxds2, M_RDONLY, + EXT_NET_DRV); #else - MEXTADD(m2, (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, - sc, (void *)(uintptr_t)idx2, - M_RDONLY, EXT_NET_DRV); + MEXTADD(m2, + (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, sc, + (void *)(uintptr_t)idx2, + M_RDONLY, EXT_NET_DRV); #endif - if ((m2->m_flags & M_EXT) == 0) { - m_freem(m2); - m2 = NULL; + if ((m2->m_flags & M_EXT) == + 0) { + m_freem(m2); + m2 = NULL; + } } } if (m2 != NULL) m->m_next = m2; - else { + else if (m != NULL) { m_freem(m); m = NULL; } From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 22:01:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43AFD1065677; Fri, 11 Jun 2010 22:01:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18F118FC1F; Fri, 11 Jun 2010 22:01:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BM1xMe002769; Fri, 11 Jun 2010 22:01:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BM1whF002767; Fri, 11 Jun 2010 22:01:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112201.o5BM1whF002767@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209076 - stable/7/sys/dev/cas X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:01:59 -0000 Author: marius Date: Fri Jun 11 22:01:58 2010 New Revision: 209076 URL: http://svn.freebsd.org/changeset/base/209076 Log: MFC: r208776 Avoid possible NULL-dereferences. Found with: Coverity Prevent(tm) CID: 3428 Modified: stable/7/sys/dev/cas/if_cas.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Fri Jun 11 22:01:58 2010 (r209075) +++ stable/7/sys/dev/cas/if_cas.c Fri Jun 11 22:01:58 2010 (r209076) @@ -1787,6 +1787,7 @@ cas_rint(struct cas_softc *sc) } } idx2 = 0; + m2 = NULL; rxds2 = NULL; if ((word1 & CAS_RC1_SPLIT_PKT) != 0) { KASSERT((word1 & CAS_RC1_RELEASE_NEXT) != 0, @@ -1799,32 +1800,39 @@ cas_rint(struct cas_softc *sc) __func__, idx2); #endif rxds2 = &sc->sc_rxdsoft[idx2]; - MGET(m2, M_DONTWAIT, MT_DATA); - if (m2 != NULL) { - refcount_acquire( - &rxds2->rxds_refcount); - m2->m_len = len - m->m_len; - bus_dmamap_sync(sc->sc_rdmatag, - rxds2->rxds_dmamap, - BUS_DMASYNC_POSTREAD); + if (m != NULL) { + MGET(m2, M_DONTWAIT, MT_DATA); + if (m2 != NULL) { + refcount_acquire( + &rxds2->rxds_refcount); + m2->m_len = len - m->m_len; + bus_dmamap_sync( + sc->sc_rdmatag, + rxds2->rxds_dmamap, + BUS_DMASYNC_POSTREAD); #if __FreeBSD_version < 800016 - MEXTADD(m2, (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, rxds2, - M_RDONLY, EXT_NET_DRV); + MEXTADD(m2, + (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, + rxds2, M_RDONLY, + EXT_NET_DRV); #else - MEXTADD(m2, (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, - sc, (void *)(uintptr_t)idx2, - M_RDONLY, EXT_NET_DRV); + MEXTADD(m2, + (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, sc, + (void *)(uintptr_t)idx2, + M_RDONLY, EXT_NET_DRV); #endif - if ((m2->m_flags & M_EXT) == 0) { - m_freem(m2); - m2 = NULL; + if ((m2->m_flags & M_EXT) == + 0) { + m_freem(m2); + m2 = NULL; + } } } if (m2 != NULL) m->m_next = m2; - else { + else if (m != NULL) { m_freem(m); m = NULL; } From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 22:25:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11884106564A; Fri, 11 Jun 2010 22:25:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F29B68FC16; Fri, 11 Jun 2010 22:25:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BMPoR7008095; Fri, 11 Jun 2010 22:25:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BMPobc008092; Fri, 11 Jun 2010 22:25:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112225.o5BMPobc008092@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209077 - in stable/8: sbin/geom/class/part sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:25:51 -0000 Author: marius Date: Fri Jun 11 22:25:50 2010 New Revision: 209077 URL: http://svn.freebsd.org/changeset/base/209077 Log: MFC: r208777 - In gpart_bootfile_read() fix an off-by-one error preventing the bootstrap file to be of maximum size. - Add special handling required for SMI/VTOC8 disklabel partcode, i.e. avoid overwriting the label when writing the bootstrap code to the partition starting at 0 and install it to all partitions when the -i option is omitted just like geom_sunlabel(4) and sunlabel(8) do by default. - Add missing prototypes. - Add const where applicable. Reviewed by: marcel Approved by: re (kib) Modified: stable/8/sbin/geom/class/part/geom_part.c stable/8/sys/sys/vtoc.h Directory Properties: stable/8/sbin/geom/class/part/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Fri Jun 11 22:01:58 2010 (r209076) +++ stable/8/sbin/geom/class/part/geom_part.c Fri Jun 11 22:25:50 2010 (r209077) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -59,13 +60,27 @@ static char autofill[] = "*"; static char optional[] = ""; static char flags[] = "C"; -static char bootcode_param[] = "bootcode"; -static char index_param[] = "index"; -static char partcode_param[] = "partcode"; - +static const char const bootcode_param[] = "bootcode"; +static const char const index_param[] = "index"; +static const char const partcode_param[] = "partcode"; + +static struct gclass *find_class(struct gmesh *, const char *); +static struct ggeom * find_geom(struct gclass *, const char *); +static const char *find_geomcfg(struct ggeom *, const char *); +static const char *find_provcfg(struct gprovider *, const char *); +static struct gprovider *find_provider(struct ggeom *, + unsigned long long); +static const char *fmtsize(int64_t); +static int gpart_autofill(struct gctl_req *); +static int gpart_autofill_resize(struct gctl_req *); static void gpart_bootcode(struct gctl_req *, unsigned int); +static void *gpart_bootfile_read(const char *, ssize_t *); static void gpart_issue(struct gctl_req *, unsigned int); static void gpart_show(struct gctl_req *, unsigned int); +static void gpart_show_geom(struct ggeom *, const char *); +static int gpart_show_hasopt(struct gctl_req *, const char *, const char *); +static void gpart_write_partcode(struct ggeom *, int, void *, ssize_t); +static void gpart_write_partcode_vtoc8(struct ggeom *, int, void *); struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { @@ -132,7 +147,7 @@ struct g_command PUBSYM(class_commands)[ { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL - }, + }, G_CMD_SENTINEL }; @@ -502,7 +517,7 @@ gpart_bootfile_read(const char *bootfile errx(EXIT_FAILURE, "%s: not a regular file", bootfile); if (sb.st_size == 0) errx(EXIT_FAILURE, "%s: empty file", bootfile); - if (*size > 0 && sb.st_size >= *size) + if (*size > 0 && sb.st_size > *size) errx(EXIT_FAILURE, "%s: file too big (%zu limit)", bootfile, *size); @@ -522,35 +537,14 @@ gpart_bootfile_read(const char *bootfile } static void -gpart_write_partcode(struct gctl_req *req, int idx, void *code, ssize_t size) +gpart_write_partcode(struct ggeom *gp, int idx, void *code, ssize_t size) { char dsf[128]; - struct gmesh mesh; - struct gclass *classp; - struct ggeom *gp; struct gprovider *pp; const char *s; char *buf; off_t bsize; - int error, fd; - - s = gctl_get_ascii(req, "class"); - if (s == NULL) - abort(); - error = geom_gettree(&mesh); - if (error != 0) - errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); - classp = find_class(&mesh, s); - if (classp == NULL) { - geom_deletetree(&mesh); - errx(EXIT_FAILURE, "Class %s not found.", s); - } - s = gctl_get_ascii(req, "geom"); - if (s == NULL) - abort(); - gp = find_geom(classp, s); - if (gp == NULL) - errx(EXIT_FAILURE, "No such geom: %s.", s); + int fd; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); @@ -587,18 +581,63 @@ gpart_write_partcode(struct gctl_req *re close(fd); } else errx(EXIT_FAILURE, "invalid partition index"); +} - geom_deletetree(&mesh); +static void +gpart_write_partcode_vtoc8(struct ggeom *gp, int idx, void *code) +{ + char dsf[128]; + struct gprovider *pp; + const char *s; + int installed, fd; + + installed = 0; + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + s = find_provcfg(pp, "index"); + if (s == NULL) + continue; + if (idx != 0 && atoi(s) != idx) + continue; + snprintf(dsf, sizeof(dsf), "/dev/%s", pp->lg_name); + if (pp->lg_sectorsize != sizeof(struct vtoc8)) + errx(EXIT_FAILURE, "%s: unexpected sector " + "size (%d)\n", dsf, pp->lg_sectorsize); + fd = open(dsf, O_WRONLY); + if (fd == -1) + err(EXIT_FAILURE, "%s", dsf); + if (lseek(fd, VTOC_BOOTSIZE, SEEK_SET) != VTOC_BOOTSIZE) + continue; + /* + * We ignore the first VTOC_BOOTSIZE bytes of boot code in + * order to avoid overwriting the label. + */ + if (lseek(fd, sizeof(struct vtoc8), SEEK_SET) != + sizeof(struct vtoc8)) + err(EXIT_FAILURE, "%s", dsf); + if (write(fd, (caddr_t)code + sizeof(struct vtoc8), + VTOC_BOOTSIZE - sizeof(struct vtoc8)) != VTOC_BOOTSIZE - + sizeof(struct vtoc8)) + err(EXIT_FAILURE, "%s", dsf); + installed++; + close(fd); + if (idx != 0 && atoi(s) == idx) + break; + } + if (installed == 0) + errx(EXIT_FAILURE, "%s: no partitions", gp->lg_name); } static void gpart_bootcode(struct gctl_req *req, unsigned int fl) { + struct gmesh mesh; + struct gclass *classp; + struct ggeom *gp; const char *s; char *sp; void *bootcode, *partcode; size_t bootsize, partsize; - int error, idx; + int error, idx, vtoc8; if (gctl_has_param(req, bootcode_param)) { s = gctl_get_ascii(req, bootcode_param); @@ -613,9 +652,31 @@ gpart_bootcode(struct gctl_req *req, uns bootsize = 0; } + s = gctl_get_ascii(req, "class"); + if (s == NULL) + abort(); + error = geom_gettree(&mesh); + if (error != 0) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + classp = find_class(&mesh, s); + if (classp == NULL) { + geom_deletetree(&mesh); + errx(EXIT_FAILURE, "Class %s not found.", s); + } + s = gctl_get_ascii(req, "geom"); + if (s == NULL) + abort(); + gp = find_geom(classp, s); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); + s = find_geomcfg(gp, "scheme"); + vtoc8 = 0; + if (strcmp(s, "VTOC8") == 0) + vtoc8 = 1; + if (gctl_has_param(req, partcode_param)) { s = gctl_get_ascii(req, partcode_param); - partsize = bootsize * 1024; + partsize = vtoc8 != 0 ? VTOC_BOOTSIZE : bootsize * 1024; partcode = gpart_bootfile_read(s, &partsize); error = gctl_delete_param(req, partcode_param); if (error) @@ -639,16 +700,20 @@ gpart_bootcode(struct gctl_req *req, uns idx = 0; if (partcode != NULL) { - if (idx == 0) - errx(EXIT_FAILURE, "missing -i option"); - gpart_write_partcode(req, idx, partcode, partsize); - } else { + if (vtoc8 == 0) { + if (idx == 0) + errx(EXIT_FAILURE, "missing -i option"); + gpart_write_partcode(gp, idx, partcode, partsize); + } else + gpart_write_partcode_vtoc8(gp, idx, partcode); + } else if (bootcode == NULL) errx(EXIT_FAILURE, "no -b nor -p"); - } if (bootcode != NULL) gpart_issue(req, fl); + + geom_deletetree(&mesh); } static void Modified: stable/8/sys/sys/vtoc.h ============================================================================== --- stable/8/sys/sys/vtoc.h Fri Jun 11 22:01:58 2010 (r209076) +++ stable/8/sys/sys/vtoc.h Fri Jun 11 22:25:50 2010 (r209077) @@ -53,9 +53,10 @@ #define VTOC_TAG_FREEBSD_ZFS 0x0904 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ -#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ +#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ #define VTOC_ASCII_LEN 128 +#define VTOC_BOOTSIZE 8192 /* 16 sectors */ #define VTOC_MAGIC 0xdabe #define VTOC_RAW_PART 2 #define VTOC_SANITY 0x600ddeee From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 22:29:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D2FB1065676; Fri, 11 Jun 2010 22:29:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C6AC8FC16; Fri, 11 Jun 2010 22:29:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BMTnl9009097; Fri, 11 Jun 2010 22:29:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BMTnoQ009095; Fri, 11 Jun 2010 22:29:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006112229.o5BMTnoQ009095@svn.freebsd.org> From: Xin LI Date: Fri, 11 Jun 2010 22:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209078 - head/lib/liblzma X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:29:50 -0000 Author: delphij Date: Fri Jun 11 22:29:49 2010 New Revision: 209078 URL: http://svn.freebsd.org/changeset/base/209078 Log: Detect bit endianness through machine/endian.h. This fixes xz on big-endian systems. Tested on: sparc64 (kindly provided by linimon), amd64 Modified: head/lib/liblzma/config.h Modified: head/lib/liblzma/config.h ============================================================================== --- head/lib/liblzma/config.h Fri Jun 11 22:25:50 2010 (r209077) +++ head/lib/liblzma/config.h Fri Jun 11 22:29:49 2010 (r209078) @@ -84,6 +84,12 @@ # define __EXTENSIONS__ 1 #endif #define VERSION "4.999.9beta" +#if defined(__FreeBSD__) +#include +#if _BYTE_ORDER == _BIG_ENDIAN +# define WORDS_BIGENDIAN 1 +#endif +#else #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 @@ -93,3 +99,4 @@ /* # undef WORDS_BIGENDIAN */ # endif #endif +#endif From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 22:35:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 701D5106566C; Fri, 11 Jun 2010 22:35:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF518FC13; Fri, 11 Jun 2010 22:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BMZh9K010552; Fri, 11 Jun 2010 22:35:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BMZhU0010549; Fri, 11 Jun 2010 22:35:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112235.o5BMZhU0010549@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209079 - in stable/7: sbin/geom/class/part sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:35:43 -0000 Author: marius Date: Fri Jun 11 22:35:43 2010 New Revision: 209079 URL: http://svn.freebsd.org/changeset/base/209079 Log: MFC: r208777 - In gpart_bootfile_read() fix an off-by-one error preventing the bootstrap file to be of maximum size. - Add special handling required for SMI/VTOC8 disklabel partcode, i.e. avoid overwriting the label when writing the bootstrap code to the partition starting at 0 and install it to all partitions when the -i option is omitted just like geom_sunlabel(4) and sunlabel(8) do by default. - Add missing prototypes. - Add const where applicable. Reviewed by: marcel Modified: stable/7/sbin/geom/class/part/geom_part.c stable/7/sys/sys/vtoc.h Directory Properties: stable/7/sbin/geom/class/part/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/7/sbin/geom/class/part/geom_part.c Fri Jun 11 22:29:49 2010 (r209078) +++ stable/7/sbin/geom/class/part/geom_part.c Fri Jun 11 22:35:43 2010 (r209079) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -58,13 +59,27 @@ uint32_t PUBSYM(version) = 0; static char optional[] = ""; static char flags[] = "C"; -static char bootcode_param[] = "bootcode"; -static char index_param[] = "index"; -static char partcode_param[] = "partcode"; - +static const char const bootcode_param[] = "bootcode"; +static const char const index_param[] = "index"; +static const char const partcode_param[] = "partcode"; + +static struct gclass *find_class(struct gmesh *, const char *); +static struct ggeom * find_geom(struct gclass *, const char *); +static const char *find_geomcfg(struct ggeom *, const char *); +static const char *find_provcfg(struct gprovider *, const char *); +static struct gprovider *find_provider(struct ggeom *, + unsigned long long); +static const char *fmtsize(int64_t); +static int gpart_autofill(struct gctl_req *); +static int gpart_autofill_resize(struct gctl_req *); static void gpart_bootcode(struct gctl_req *, unsigned int); +static void *gpart_bootfile_read(const char *, ssize_t *); static void gpart_issue(struct gctl_req *, unsigned int); static void gpart_show(struct gctl_req *, unsigned int); +static void gpart_show_geom(struct ggeom *, const char *); +static int gpart_show_hasopt(struct gctl_req *, const char *, const char *); +static void gpart_write_partcode(struct ggeom *, int, void *, ssize_t); +static void gpart_write_partcode_vtoc8(struct ggeom *, int, void *); struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { @@ -131,7 +146,7 @@ struct g_command PUBSYM(class_commands)[ { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL - }, + }, G_CMD_SENTINEL }; @@ -376,7 +391,7 @@ gpart_bootfile_read(const char *bootfile errx(EXIT_FAILURE, "%s: not a regular file", bootfile); if (sb.st_size == 0) errx(EXIT_FAILURE, "%s: empty file", bootfile); - if (*size > 0 && sb.st_size >= *size) + if (*size > 0 && sb.st_size > *size) errx(EXIT_FAILURE, "%s: file too big (%zu limit)", bootfile, *size); @@ -396,33 +411,14 @@ gpart_bootfile_read(const char *bootfile } static void -gpart_write_partcode(struct gctl_req *req, int idx, void *code, ssize_t size) +gpart_write_partcode(struct ggeom *gp, int idx, void *code, ssize_t size) { char dsf[128]; - struct gmesh mesh; - struct gclass *classp; - struct ggeom *gp; struct gprovider *pp; const char *s; char *buf; off_t bsize; - int error, fd; - - s = gctl_get_ascii(req, "class"); - if (s == NULL) - abort(); - error = geom_gettree(&mesh); - if (error != 0) - errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); - classp = find_class(&mesh, s); - if (classp == NULL) { - geom_deletetree(&mesh); - errx(EXIT_FAILURE, "Class %s not found.", s); - } - s = gctl_get_ascii(req, "geom"); - gp = find_geom(classp, s); - if (gp == NULL) - errx(EXIT_FAILURE, "No such geom: %s.", s); + int fd; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); @@ -459,18 +455,63 @@ gpart_write_partcode(struct gctl_req *re close(fd); } else errx(EXIT_FAILURE, "invalid partition index"); +} - geom_deletetree(&mesh); +static void +gpart_write_partcode_vtoc8(struct ggeom *gp, int idx, void *code) +{ + char dsf[128]; + struct gprovider *pp; + const char *s; + int installed, fd; + + installed = 0; + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + s = find_provcfg(pp, "index"); + if (s == NULL) + continue; + if (idx != 0 && atoi(s) != idx) + continue; + snprintf(dsf, sizeof(dsf), "/dev/%s", pp->lg_name); + if (pp->lg_sectorsize != sizeof(struct vtoc8)) + errx(EXIT_FAILURE, "%s: unexpected sector " + "size (%d)\n", dsf, pp->lg_sectorsize); + fd = open(dsf, O_WRONLY); + if (fd == -1) + err(EXIT_FAILURE, "%s", dsf); + if (lseek(fd, VTOC_BOOTSIZE, SEEK_SET) != VTOC_BOOTSIZE) + continue; + /* + * We ignore the first VTOC_BOOTSIZE bytes of boot code in + * order to avoid overwriting the label. + */ + if (lseek(fd, sizeof(struct vtoc8), SEEK_SET) != + sizeof(struct vtoc8)) + err(EXIT_FAILURE, "%s", dsf); + if (write(fd, (caddr_t)code + sizeof(struct vtoc8), + VTOC_BOOTSIZE - sizeof(struct vtoc8)) != VTOC_BOOTSIZE - + sizeof(struct vtoc8)) + err(EXIT_FAILURE, "%s", dsf); + installed++; + close(fd); + if (idx != 0 && atoi(s) == idx) + break; + } + if (installed == 0) + errx(EXIT_FAILURE, "%s: no partitions", gp->lg_name); } static void gpart_bootcode(struct gctl_req *req, unsigned int fl) { + struct gmesh mesh; + struct gclass *classp; + struct ggeom *gp; const char *s; char *sp; void *bootcode, *partcode; size_t bootsize, partsize; - int error, idx; + int error, idx, vtoc8; if (gctl_has_param(req, bootcode_param)) { s = gctl_get_ascii(req, bootcode_param); @@ -485,9 +526,31 @@ gpart_bootcode(struct gctl_req *req, uns bootsize = 0; } + s = gctl_get_ascii(req, "class"); + if (s == NULL) + abort(); + error = geom_gettree(&mesh); + if (error != 0) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + classp = find_class(&mesh, s); + if (classp == NULL) { + geom_deletetree(&mesh); + errx(EXIT_FAILURE, "Class %s not found.", s); + } + s = gctl_get_ascii(req, "geom"); + if (s == NULL) + abort(); + gp = find_geom(classp, s); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); + s = find_geomcfg(gp, "scheme"); + vtoc8 = 0; + if (strcmp(s, "VTOC8") == 0) + vtoc8 = 1; + if (gctl_has_param(req, partcode_param)) { s = gctl_get_ascii(req, partcode_param); - partsize = bootsize * 1024; + partsize = vtoc8 != 0 ? VTOC_BOOTSIZE : bootsize * 1024; partcode = gpart_bootfile_read(s, &partsize); error = gctl_delete_param(req, partcode_param); if (error) @@ -511,16 +574,20 @@ gpart_bootcode(struct gctl_req *req, uns idx = 0; if (partcode != NULL) { - if (idx == 0) - errx(EXIT_FAILURE, "missing -i option"); - gpart_write_partcode(req, idx, partcode, partsize); - } else { + if (vtoc8 == 0) { + if (idx == 0) + errx(EXIT_FAILURE, "missing -i option"); + gpart_write_partcode(gp, idx, partcode, partsize); + } else + gpart_write_partcode_vtoc8(gp, idx, partcode); + } else if (bootcode == NULL) errx(EXIT_FAILURE, "no -b nor -p"); - } if (bootcode != NULL) gpart_issue(req, fl); + + geom_deletetree(&mesh); } static void Modified: stable/7/sys/sys/vtoc.h ============================================================================== --- stable/7/sys/sys/vtoc.h Fri Jun 11 22:29:49 2010 (r209078) +++ stable/7/sys/sys/vtoc.h Fri Jun 11 22:35:43 2010 (r209079) @@ -53,9 +53,10 @@ #define VTOC_TAG_FREEBSD_ZFS 0x0904 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ -#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ +#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ #define VTOC_ASCII_LEN 128 +#define VTOC_BOOTSIZE 8192 /* 16 sectors */ #define VTOC_MAGIC 0xdabe #define VTOC_RAW_PART 2 #define VTOC_SANITY 0x600ddeee From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 22:53:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826DD106566C; Fri, 11 Jun 2010 22:53:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7083E8FC28; Fri, 11 Jun 2010 22:53:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BMrftG014589; Fri, 11 Jun 2010 22:53:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BMrfmU014587; Fri, 11 Jun 2010 22:53:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112253.o5BMrfmU014587@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209080 - stable/7/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:53:41 -0000 Author: marius Date: Fri Jun 11 22:53:41 2010 New Revision: 209080 URL: http://svn.freebsd.org/changeset/base/209080 Log: Revert part of r209079 which shouldn't have been MFC'ed, yet. Modified: stable/7/sbin/geom/class/part/geom_part.c Modified: stable/7/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/7/sbin/geom/class/part/geom_part.c Fri Jun 11 22:35:43 2010 (r209079) +++ stable/7/sbin/geom/class/part/geom_part.c Fri Jun 11 22:53:41 2010 (r209080) @@ -70,8 +70,6 @@ static const char *find_provcfg(struct g static struct gprovider *find_provider(struct ggeom *, unsigned long long); static const char *fmtsize(int64_t); -static int gpart_autofill(struct gctl_req *); -static int gpart_autofill_resize(struct gctl_req *); static void gpart_bootcode(struct gctl_req *, unsigned int); static void *gpart_bootfile_read(const char *, ssize_t *); static void gpart_issue(struct gctl_req *, unsigned int); From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 22:59:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BE751065674; Fri, 11 Jun 2010 22:59:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A47A8FC08; Fri, 11 Jun 2010 22:59:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BMxmRE016025; Fri, 11 Jun 2010 22:59:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BMxmqf016023; Fri, 11 Jun 2010 22:59:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112259.o5BMxmqf016023@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209081 - stable/8/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:59:48 -0000 Author: marius Date: Fri Jun 11 22:59:47 2010 New Revision: 209081 URL: http://svn.freebsd.org/changeset/base/209081 Log: Revert part of r209077 which shouldn't have been MFC'ed, yet. This is a direct commit to stable/8. Approved by: re (kib) Modified: stable/8/sbin/geom/class/part/geom_part.c Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Fri Jun 11 22:53:41 2010 (r209080) +++ stable/8/sbin/geom/class/part/geom_part.c Fri Jun 11 22:59:47 2010 (r209081) @@ -72,7 +72,6 @@ static struct gprovider *find_provider(s unsigned long long); static const char *fmtsize(int64_t); static int gpart_autofill(struct gctl_req *); -static int gpart_autofill_resize(struct gctl_req *); static void gpart_bootcode(struct gctl_req *, unsigned int); static void *gpart_bootfile_read(const char *, ssize_t *); static void gpart_issue(struct gctl_req *, unsigned int); From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 23:38:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE9AA1065674; Fri, 11 Jun 2010 23:38:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD94D8FC14; Fri, 11 Jun 2010 23:38:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BNcPrB024560; Fri, 11 Jun 2010 23:38:25 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BNcPC3024558; Fri, 11 Jun 2010 23:38:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006112338.o5BNcPC3024558@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 11 Jun 2010 23:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209082 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 23:38:25 -0000 Author: jkim Date: Fri Jun 11 23:38:25 2010 New Revision: 209082 URL: http://svn.freebsd.org/changeset/base/209082 Log: Apply band-aid around function-like macro fdrop() without turning it into a real (inline) function or applying void casting for all its consumers. In most of places, the "return value" is not checked nor assigned, which causes too many warnings for some smart compilers, i.e., clang. Found by: clang Modified: head/sys/sys/file.h Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Fri Jun 11 22:59:47 2010 (r209081) +++ head/sys/sys/file.h Fri Jun 11 23:38:25 2010 (r209082) @@ -201,10 +201,17 @@ int fgetvp_write(struct thread *td, int int fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp); void fputsock(struct socket *sp); +static __inline int +_fnoop(void) +{ + + return (0); +} + #define fhold(fp) \ (refcount_acquire(&(fp)->f_count)) #define fdrop(fp, td) \ - (refcount_release(&(fp)->f_count) ? _fdrop((fp), (td)) : 0) + (refcount_release(&(fp)->f_count) ? _fdrop((fp), (td)) : _fnoop()) static __inline fo_rdwr_t fo_read; static __inline fo_rdwr_t fo_write; From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 00:28:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC1431065674; Sat, 12 Jun 2010 00:28:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9E188FC08; Sat, 12 Jun 2010 00:28:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5C0Sfm4035624; Sat, 12 Jun 2010 00:28:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C0SfDa035622; Sat, 12 Jun 2010 00:28:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006120028.o5C0SfDa035622@svn.freebsd.org> From: Marius Strobl Date: Sat, 12 Jun 2010 00:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209083 - stable/8/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 00:28:42 -0000 Author: marius Date: Sat Jun 12 00:28:41 2010 New Revision: 209083 URL: http://svn.freebsd.org/changeset/base/209083 Log: MFC: r208778 - Mention that VTOC8 labels are found in Fujitsu SPARC64 machines as well. - Add information regarding VTOC8 bootrstrap code and how it's handled with r208777 in place. - Document the mapping of partition types to VTOC8 tags. - Add examples for VTOC8 to the respective section. - Eliminated hard sentence breaks. Reviewed by: marcel (slightly buggy version) Approved by: re (bz) Modified: stable/8/sbin/geom/class/part/gpart.8 Directory Properties: stable/8/sbin/geom/class/part/ (props changed) Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Fri Jun 11 23:38:25 2010 (r209082) +++ stable/8/sbin/geom/class/part/gpart.8 Sat Jun 12 00:28:41 2010 (r209083) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 18, 2008 +.Dd June 3, 2010 .Dt GPART 8 .Os .Sh NAME @@ -53,7 +53,10 @@ found on PCs and used on many removable The GEOM_PART_PC98 option adds support for the MBR variant as used on NEC PC-98 computers. The GEOM_PART_VTOC8 option adds support for Sun's SMI VTOC8 label as -found on UltraSPARC-based computers. +found on computers based on +.Tn SPARC64 +and +.Tn UltraSPARC. .Pp Usage of the .Xr gpart 8 @@ -191,9 +194,15 @@ The .Fl p Ar partcode option specifies a file that contains the bootstrap code intended to be written to a partition. +For the VTOC8 scheme, it is a 8192 byte file of which the last 7680 bytes +are installed as bootstrap code. The partition is specified by the .Fl i Ar index option. +For the VTOC8 scheme, if the +.Fl i Ar index +option is omitted, the bootstrap code is written to all sufficiently large +partitions. The size of the file must be smaller than the size of the partition. .Pp Addition options include: @@ -362,20 +371,20 @@ A FreeBSD partition dedicated to bootstr The scheme-specific type is "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" for GPT. .It freebsd-swap A FreeBSD partition dedicated to swap space. -The scheme-specific types are "!FreeBSD-swap" for APM, and -"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-swap" for APM, +"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0901 for VTOC8. .It freebsd-ufs A FreeBSD partition that contains a UFS or UFS2 file system. -the scheme-specific types are "!FreeBSD-UFS" for APM, and -"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT. +the scheme-specific types are "!FreeBSD-UFS" for APM, +"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0902 for VTOC8. .It freebsd-vinum A FreeBSD partition that contains a Vinum volume. -The scheme-specific types are "!FreeBSD-Vinum" for APM, and -"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-Vinum" for APM, +"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0903 for VTOC8. .It freebsd-zfs A FreeBSD partition that contains a ZFS volume. -The scheme-specific types are "!FreeBSD-ZFS" for APM, and -"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-ZFS" for APM, +"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. .It mbr A partition that is sub-partitioned by a master boot record (MBR). This type is known as "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. @@ -435,10 +444,28 @@ future need (e.g. from a ZFS partition). .Pp Create a 512MB-sized .Pa freebsd-ufs -partition that would contain UFS where the system boot from. +partition that would contain UFS where the system boots from. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 .Ed +.Pp +Create VTOC8 scheme on +.Pa da0 . +.Bd -literal -offset indent +/sbin/gpart create -s VTOC8 da0 +.Ed +.Pp +Create a 512MB-sized +.Cm freebsd-ufs +partition that would contain UFS where the system boots from. +.Bd -literal -offset indent +/sbin/gpart add -b 0 -s 1048576 -t freebsd-ufs da0 +.Ed +.Pp +After having created all required partitions, embed bootstrap code into them. +.Bd -literal -offset indent +/sbin/gpart bootcode -p /boot/boot1 da0 +.Ed .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 00:28:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFAD81065674; Sat, 12 Jun 2010 00:28:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD8E28FC13; Sat, 12 Jun 2010 00:28:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5C0SrwF035694; Sat, 12 Jun 2010 00:28:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C0SrTO035692; Sat, 12 Jun 2010 00:28:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006120028.o5C0SrTO035692@svn.freebsd.org> From: Marius Strobl Date: Sat, 12 Jun 2010 00:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209084 - stable/7/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 00:28:54 -0000 Author: marius Date: Sat Jun 12 00:28:53 2010 New Revision: 209084 URL: http://svn.freebsd.org/changeset/base/209084 Log: MFC: r208778 - Mention that VTOC8 labels are found in Fujitsu SPARC64 machines as well. - Add information regarding VTOC8 bootrstrap code and how it's handled with r208777 in place. - Document the mapping of partition types to VTOC8 tags. - Add examples for VTOC8 to the respective section. - Eliminated hard sentence breaks. Reviewed by: marcel (slightly buggy version) Modified: stable/7/sbin/geom/class/part/gpart.8 Directory Properties: stable/7/sbin/geom/class/part/ (props changed) Modified: stable/7/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/7/sbin/geom/class/part/gpart.8 Sat Jun 12 00:28:41 2010 (r209083) +++ stable/7/sbin/geom/class/part/gpart.8 Sat Jun 12 00:28:53 2010 (r209084) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 18, 2008 +.Dd June 3, 2010 .Dt GPART 8 .Os .Sh NAME @@ -53,7 +53,10 @@ found on PCs and used on many removable The GEOM_PART_PC98 option adds support for the MBR variant as used on NEC PC-98 computers. The GEOM_PART_VTOC8 option adds support for Sun's SMI VTOC8 label as -found on UltraSPARC-based computers. +found on computers based on +.Tn SPARC64 +and +.Tn UltraSPARC. .Pp Usage of the .Xr gpart 8 @@ -191,9 +194,15 @@ The .Fl p Ar partcode option specifies a file that contains the bootstrap code intended to be written to a partition. +For the VTOC8 scheme, it is a 8192 byte file of which the last 7680 bytes +are installed as bootstrap code. The partition is specified by the .Fl i Ar index option. +For the VTOC8 scheme, if the +.Fl i Ar index +option is omitted, the bootstrap code is written to all sufficiently large +partitions. The size of the file must be smaller than the size of the partition. .Pp Addition options include: @@ -362,20 +371,20 @@ A FreeBSD partition dedicated to bootstr The scheme-specific type is "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" for GPT. .It freebsd-swap A FreeBSD partition dedicated to swap space. -The scheme-specific types are "!FreeBSD-swap" for APM, and -"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-swap" for APM, +"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0901 for VTOC8. .It freebsd-ufs A FreeBSD partition that contains a UFS or UFS2 file system. -the scheme-specific types are "!FreeBSD-UFS" for APM, and -"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT. +the scheme-specific types are "!FreeBSD-UFS" for APM, +"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0902 for VTOC8. .It freebsd-vinum A FreeBSD partition that contains a Vinum volume. -The scheme-specific types are "!FreeBSD-Vinum" for APM, and -"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-Vinum" for APM, +"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0903 for VTOC8. .It freebsd-zfs A FreeBSD partition that contains a ZFS volume. -The scheme-specific types are "!FreeBSD-ZFS" for APM, and -"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-ZFS" for APM, +"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. .It mbr A partition that is sub-partitioned by a master boot record (MBR). This type is known as "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. @@ -435,10 +444,28 @@ future need (e.g. from a ZFS partition). .Pp Create a 512MB-sized .Pa freebsd-ufs -partition that would contain UFS where the system boot from. +partition that would contain UFS where the system boots from. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 .Ed +.Pp +Create VTOC8 scheme on +.Pa da0 . +.Bd -literal -offset indent +/sbin/gpart create -s VTOC8 da0 +.Ed +.Pp +Create a 512MB-sized +.Cm freebsd-ufs +partition that would contain UFS where the system boots from. +.Bd -literal -offset indent +/sbin/gpart add -b 0 -s 1048576 -t freebsd-ufs da0 +.Ed +.Pp +After having created all required partitions, embed bootstrap code into them. +.Bd -literal -offset indent +/sbin/gpart bootcode -p /boot/boot1 da0 +.Ed .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 01:45:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38DCB1065670; Sat, 12 Jun 2010 01:45:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27C1E8FC14; Sat, 12 Jun 2010 01:45:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5C1jTrD052487; Sat, 12 Jun 2010 01:45:29 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C1jT9R052484; Sat, 12 Jun 2010 01:45:29 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006120145.o5C1jT9R052484@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 12 Jun 2010 01:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209085 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 01:45:30 -0000 Author: marcel Date: Sat Jun 12 01:45:29 2010 New Revision: 209085 URL: http://svn.freebsd.org/changeset/base/209085 Log: The ptc.g operation for the Mckinley and Madison processors has the side-effect of purging more than the requested translation. While this is not a problem in general, it invalidates the assumption made during constructing the trapframe on entry into the kernel in SMP configurations. The assumption is that only the first store to the stack will possibly cause a TLB miss. Since the ptc.g purges the translation caches of all CPUs in the coherency domain, a ptc.g executed on one CPU can cause a purge on another CPU that is currently running the critical code that saves the state to the trapframe. This can cause an unexpected TLB miss and with interrupt collection disabled this means an unexpected data nested TLB fault. A data nested TLB fault will not save any context, nor provide a way for software to determine what caused the TLB miss nor where it occured. Careful construction of the kernel entry and exit code allows us to handle a TLB miss in precisely orchastrated points and thereby avoiding the need to wire the kernel stack, but the unexpected TLB miss caused by the ptc.g instructution resulted in an unrecoverable condition and resulting in machine checks. The solution to this problem is to synchronize the kernel entry on all CPUs with the use of the ptc.g instruction on a single CPU by implementing a bare-bones readers-writer lock that allows N readers (= N CPUs entering the kernel) and 1 writer (= execution of the ptc.g instruction on some CPU). This solution wins over a rendez-vous approach by not interrupting CPUs with an IPI. This problem has not been observed on the Montecito. PR: ia64/147772 MFC after: 6 days Modified: head/sys/ia64/ia64/exception.S head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/exception.S ============================================================================== --- head/sys/ia64/ia64/exception.S Sat Jun 12 00:28:53 2010 (r209084) +++ head/sys/ia64/ia64/exception.S Sat Jun 12 01:45:29 2010 (r209085) @@ -170,6 +170,27 @@ ENTRY_NOPROFILE(exception_save, 0) * r30,r31=trapframe pointers * p14,p15=memory stack switch */ + + /* PTC.G enter non-exclusive */ + mov r24 = ar.ccv + movl r25 = pmap_ptc_g_sem + ;; +.ptc_g_0: + ld8.acq r26 = [r25] + ;; + tbit.nz p12, p0 = r26, 63 +(p12) br.cond.spnt.few .ptc_g_0 + ;; + mov ar.ccv = r26 + adds r27 = 1, r26 + ;; + cmpxchg8.rel r27 = [r25], r27, ar.ccv + ;; + cmp.ne p12, p0 = r26, r27 +(p12) br.cond.spnt.few .ptc_g_0 + ;; + mov ar.ccv = r24 + exception_save_restart: { .mmi st8 [r30]=r19,16 // length @@ -407,6 +428,23 @@ exception_save_restart: movl gp=__gp ;; } + + /* PTC.G leave non-exclusive */ + srlz.d + movl r25 = pmap_ptc_g_sem + ;; +.ptc_g_1: + ld8.acq r26 = [r25] + ;; + mov ar.ccv = r26 + adds r27 = -1, r26 + ;; + cmpxchg8.rel r27 = [r25], r27, ar.ccv + ;; + cmp.ne p12, p0 = r26, r27 +(p12) br.cond.spnt.few .ptc_g_1 + ;; + { .mib srlz.d nop 0 Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sat Jun 12 00:28:53 2010 (r209084) +++ head/sys/ia64/ia64/pmap.c Sat Jun 12 01:45:29 2010 (r209085) @@ -182,7 +182,8 @@ static uint64_t pmap_ptc_e_count1 = 3; static uint64_t pmap_ptc_e_count2 = 2; static uint64_t pmap_ptc_e_stride1 = 0x2000; static uint64_t pmap_ptc_e_stride2 = 0x100000000; -struct mtx pmap_ptcmutex; + +volatile u_long pmap_ptc_g_sem; /* * Data for the RID allocator @@ -340,7 +341,6 @@ pmap_bootstrap() pmap_ptc_e_count2, pmap_ptc_e_stride1, pmap_ptc_e_stride2); - mtx_init(&pmap_ptcmutex, "Global PTC lock", NULL, MTX_SPIN); /* * Setup RIDs. RIDs 0..7 are reserved for the kernel. @@ -540,7 +540,8 @@ pmap_invalidate_page(vm_offset_t va) { struct ia64_lpte *pte; struct pcpu *pc; - uint64_t tag; + uint64_t tag, sem; + register_t is; u_int vhpt_ofs; critical_enter(); @@ -550,10 +551,32 @@ pmap_invalidate_page(vm_offset_t va) pte = (struct ia64_lpte *)(pc->pc_md.vhpt + vhpt_ofs); atomic_cmpset_64(&pte->tag, tag, 1UL << 63); } - critical_exit(); - mtx_lock_spin(&pmap_ptcmutex); + + /* PTC.G enter exclusive */ + is = intr_disable(); + + /* Atomically assert writer after all writers have gone. */ + do { + /* Wait until there's no more writer. */ + do { + sem = atomic_load_acq_long(&pmap_ptc_g_sem); + tag = sem | (1ul << 63); + } while (sem == tag); + } while (!atomic_cmpset_rel_long(&pmap_ptc_g_sem, sem, tag)); + + /* Wait until all readers are gone. */ + tag = (1ul << 63); + do { + sem = atomic_load_acq_long(&pmap_ptc_g_sem); + } while (sem != tag); + ia64_ptc_ga(va, PAGE_SHIFT << 2); - mtx_unlock_spin(&pmap_ptcmutex); + + /* PTC.G leave exclusive */ + atomic_store_rel_long(&pmap_ptc_g_sem, 0); + + intr_restore(is); + critical_exit(); } static void From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 02:00:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A88C1065676; Sat, 12 Jun 2010 02:00:15 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5981B8FC12; Sat, 12 Jun 2010 02:00:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5C20FAw055922; Sat, 12 Jun 2010 02:00:15 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C20Fkk055920; Sat, 12 Jun 2010 02:00:15 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006120200.o5C20Fkk055920@svn.freebsd.org> From: Brian Somers Date: Sat, 12 Jun 2010 02:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209086 - stable/8/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 02:00:15 -0000 Author: brian Date: Sat Jun 12 02:00:15 2010 New Revision: 209086 URL: http://svn.freebsd.org/changeset/base/209086 Log: MFC r208795; additional date -v detail PR: 147354 Approved by: re (kib) Modified: stable/8/bin/date/date.1 Directory Properties: stable/8/bin/date/ (props changed) Modified: stable/8/bin/date/date.1 ============================================================================== --- stable/8/bin/date/date.1 Sat Jun 12 01:45:29 2010 (r209085) +++ stable/8/bin/date/date.1 Sat Jun 12 02:00:15 2010 (r209086) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 2, 2007 +.Dd June 3, 2010 .Dt DATE 1 .Os .Sh NAME @@ -219,6 +219,14 @@ When the date is adjusted to a specific the resulting timezone will be set so that the date matches the earlier of the two times. .Pp +It is not possible to adjust a date to an invalid absolute day, so using +the switches +.Fl v No 31d Fl v No 12m +will simply fail five months of the year. +It is therefore usual to set the month before setting the day; using +.Fl v No 12m Fl v No 31d +always works. +.Pp Adjusting the date by months is inherently ambiguous because a month is a unit of variable length depending on the current date. This kind of date adjustment is applied in the most intuitive way. @@ -339,9 +347,9 @@ will display the last day of February in .Pp .Dl "Tue Feb 29 03:18:00 GMT 2000" .Pp -So will do the command: +So will the command: .Pp -.Dl "date -v30d -v3m -v0y -v-1m" +.Dl "date -v3m -v30d -v0y -v-1m" .Pp because there is no such date as the 30th of February. .Pp From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 05:21:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89F10106566B; Sat, 12 Jun 2010 05:21:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 790FB8FC0A; Sat, 12 Jun 2010 05:21:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5C5LTip000433; Sat, 12 Jun 2010 05:21:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C5LTIt000431; Sat, 12 Jun 2010 05:21:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006120521.o5C5LTIt000431@svn.freebsd.org> From: Xin LI Date: Sat, 12 Jun 2010 05:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209089 - stable/8/lib/liblzma X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 05:21:29 -0000 Author: delphij Date: Sat Jun 12 05:21:29 2010 New Revision: 209089 URL: http://svn.freebsd.org/changeset/base/209089 Log: MFC r209078: Detect bit endianness through machine/endian.h. This fixes xz on big-endian systems. Tested on: sparc64 (kindly provided by linimon), amd64 Approved by: re (kensmith) Modified: stable/8/lib/liblzma/config.h Directory Properties: stable/8/lib/liblzma/ (props changed) Modified: stable/8/lib/liblzma/config.h ============================================================================== --- stable/8/lib/liblzma/config.h Sat Jun 12 05:16:37 2010 (r209088) +++ stable/8/lib/liblzma/config.h Sat Jun 12 05:21:29 2010 (r209089) @@ -84,6 +84,12 @@ # define __EXTENSIONS__ 1 #endif #define VERSION "4.999.9beta" +#if defined(__FreeBSD__) +#include +#if _BYTE_ORDER == _BIG_ENDIAN +# define WORDS_BIGENDIAN 1 +#endif +#else #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 @@ -93,3 +99,4 @@ /* # undef WORDS_BIGENDIAN */ # endif #endif +#endif From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 05:22:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7067C1065675; Sat, 12 Jun 2010 05:22:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDEA8FC13; Sat, 12 Jun 2010 05:22:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5C5MtVt000831; Sat, 12 Jun 2010 05:22:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C5Mtg4000820; Sat, 12 Jun 2010 05:22:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006120522.o5C5Mtg4000820@svn.freebsd.org> From: Xin LI Date: Sat, 12 Jun 2010 05:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209090 - stable/8/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 05:22:55 -0000 Author: delphij Date: Sat Jun 12 05:22:55 2010 New Revision: 209090 URL: http://svn.freebsd.org/changeset/base/209090 Log: MFC r208888,208889,209017: - make sure that initialize isb with fstat() on input file before using it. (bin/147275) - Fix grammar for st_nlink. - Style changes. PR: bin/147275 Approved by: re (kensmith) Modified: stable/8/usr.bin/gzip/gzip.c Directory Properties: stable/8/usr.bin/gzip/ (props changed) Modified: stable/8/usr.bin/gzip/gzip.c ============================================================================== --- stable/8/usr.bin/gzip/gzip.c Sat Jun 12 05:21:29 2010 (r209089) +++ stable/8/usr.bin/gzip/gzip.c Sat Jun 12 05:22:55 2010 (r209090) @@ -65,10 +65,6 @@ __RCSID("$FreeBSD$"); #include #include -#ifndef PRIdOFF -#define PRIdOFF PRId64 -#endif - /* what type of file are we dealing with */ enum filetype { FT_GZIP, @@ -1221,40 +1217,46 @@ file_compress(char *file, char *outfile, in = open(file, O_RDONLY); if (in == -1) { maybe_warn("can't open %s", file); - return -1; + return (-1); } +#ifndef SMALL + if (fstat(in, &isb) != 0) { + maybe_warn("couldn't stat: %s", file); + close(in); + return (-1); + } +#endif + if (cflag == 0) { #ifndef SMALL - if (fstat(in, &isb) == 0) { - if (isb.st_nlink > 1 && fflag == 0) { - maybe_warnx("%s has %d other link%s -- " - "skipping", file, isb.st_nlink - 1, - isb.st_nlink == 1 ? "" : "s"); - close(in); - return -1; - } + if (isb.st_nlink > 1 && fflag == 0) { + maybe_warnx("%s has %d other link%s -- skipping", + file, isb.st_nlink - 1, + (isb.st_nlink - 1) == 1 ? "" : "s"); + close(in); + return (-1); } - if (fflag == 0 && (suff = check_suffix(file, 0)) - && suff->zipped[0] != 0) { + if (fflag == 0 && (suff = check_suffix(file, 0)) && + suff->zipped[0] != 0) { maybe_warnx("%s already has %s suffix -- unchanged", - file, suff->zipped); + file, suff->zipped); close(in); - return -1; + return (-1); } #endif /* Add (usually) .gz to filename */ if ((size_t)snprintf(outfile, outsize, "%s%s", - file, suffixes[0].zipped) >= outsize) + file, suffixes[0].zipped) >= outsize) memcpy(outfile + outsize - suffixes[0].ziplen - 1, - suffixes[0].zipped, suffixes[0].ziplen + 1); + suffixes[0].zipped, suffixes[0].ziplen + 1); #ifndef SMALL if (check_outfile(outfile) == 0) { close(in); - return -1; + return (-1); } #endif } @@ -1264,7 +1266,7 @@ file_compress(char *file, char *outfile, if (out == -1) { maybe_warn("could not create output: %s", outfile); fclose(stdin); - return -1; + return (-1); } #ifndef SMALL remove_file = outfile; @@ -1284,7 +1286,7 @@ file_compress(char *file, char *outfile, * has the expected size. */ if (cflag != 0) - return insize == -1 ? -1 : size; + return (insize == -1 ? -1 : size); #ifndef SMALL if (fstat(out, &osb) != 0) { @@ -1293,9 +1295,8 @@ file_compress(char *file, char *outfile, } if (osb.st_size != size) { - maybe_warnx("output file: %s wrong size (%" PRIdOFF - " != %" PRIdOFF "), deleting", - outfile, osb.st_size, size); + maybe_warnx("output file: %s wrong size (%ju != %ju), deleting", + outfile, (uintmax_t)osb.st_size, (uintmax_t)size); goto bad_outfile; } @@ -1307,7 +1308,7 @@ file_compress(char *file, char *outfile, /* output is good, ok to delete input */ unlink_input(file, &isb); - return size; + return (size); #ifndef SMALL bad_outfile: @@ -1316,7 +1317,7 @@ file_compress(char *file, char *outfile, maybe_warnx("leaving original %s", file); unlink(outfile); - return size; + return (size); #endif } @@ -1564,9 +1565,8 @@ file_uncompress(char *file, char *outfil return -1; } if (osb.st_size != size) { - maybe_warnx("stat gave different size: %" PRIdOFF - " != %" PRIdOFF " (leaving original)", - size, osb.st_size); + maybe_warnx("stat gave different size: %ju != %ju (leaving original)", + (uintmax_t)size, (uintmax_t)osb.st_size); close(ofd); unlink(outfile); return -1; From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 07:02:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1199106564A; Sat, 12 Jun 2010 07:02:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0D058FC12; Sat, 12 Jun 2010 07:02:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5C72hVj022684; Sat, 12 Jun 2010 07:02:43 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C72hRr022682; Sat, 12 Jun 2010 07:02:43 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006120702.o5C72hRr022682@svn.freebsd.org> From: Ed Schouten Date: Sat, 12 Jun 2010 07:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209092 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 07:02:44 -0000 Author: ed Date: Sat Jun 12 07:02:43 2010 New Revision: 209092 URL: http://svn.freebsd.org/changeset/base/209092 Log: Remove GNU-style struct initialization. Spotted by: clang Approved by: rpaulo Modified: head/sys/net80211/ieee80211_rssadapt.c Modified: head/sys/net80211/ieee80211_rssadapt.c ============================================================================== --- head/sys/net80211/ieee80211_rssadapt.c Sat Jun 12 06:00:48 2010 (r209091) +++ head/sys/net80211/ieee80211_rssadapt.c Sat Jun 12 07:02:43 2010 (r209092) @@ -58,12 +58,12 @@ struct rssadapt_expavgctl { }; static struct rssadapt_expavgctl master_expavgctl = { - rc_decay_denom : 16, - rc_decay_old : 15, - rc_thresh_denom : 8, - rc_thresh_old : 4, - rc_avgrssi_denom : 8, - rc_avgrssi_old : 4 + .rc_decay_denom = 16, + .rc_decay_old = 15, + .rc_thresh_denom = 8, + .rc_thresh_old = 4, + .rc_avgrssi_denom = 8, + .rc_avgrssi_old = 4 }; #ifdef interpolate From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 11:18:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 645FB106564A; Sat, 12 Jun 2010 11:18:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 531E38FC13; Sat, 12 Jun 2010 11:18:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CBITN2082819; Sat, 12 Jun 2010 11:18:29 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CBITGY082817; Sat, 12 Jun 2010 11:18:29 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006121118.o5CBITGY082817@svn.freebsd.org> From: Martin Matuska Date: Sat, 12 Jun 2010 11:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209093 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 11:18:29 -0000 Author: mm Date: Sat Jun 12 11:18:29 2010 New Revision: 209093 URL: http://svn.freebsd.org/changeset/base/209093 Log: Fix unable to remove a file over NFS after hitting refquota limit OpenSolaris onnv-revision: 8890:8c2bd5f17bf2 Obtained from: OpenSolaris (Bug ID 6798878) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Sat Jun 12 07:02:43 2010 (r209092) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Sat Jun 12 11:18:29 2010 (r209093) @@ -582,9 +582,9 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; } else { txh->txh_space_towrite += SPA_MAXBLOCKSIZE; - txh->txh_space_tounref += - BP_GET_ASIZE(dn->dn_phys->dn_blkptr); } + if (dn->dn_phys->dn_blkptr[0].blk_birth) + txh->txh_space_tounref += SPA_MAXBLOCKSIZE; return; } From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 11:19:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0062106567B; Sat, 12 Jun 2010 11:19:51 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9ED6D8FC16; Sat, 12 Jun 2010 11:19:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CBJpBF083158; Sat, 12 Jun 2010 11:19:51 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CBJp1k083156; Sat, 12 Jun 2010 11:19:51 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006121119.o5CBJp1k083156@svn.freebsd.org> From: Martin Matuska Date: Sat, 12 Jun 2010 11:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209094 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 11:19:51 -0000 Author: mm Date: Sat Jun 12 11:19:51 2010 New Revision: 209094 URL: http://svn.freebsd.org/changeset/base/209094 Log: Fix zfs destroy fails to free object in open context, stops up txg train OpenSolaris onnv-revision: 9409:9dc3f17354ed Obtained from: OpenSolaris (Bug ID 6809683) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Jun 12 11:18:29 2010 (r209093) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Jun 12 11:19:51 2010 (r209094) @@ -1317,16 +1317,7 @@ dnode_next_offset_level(dnode_t *dn, int for (i = (*offset >> span) & (blkfill - 1); i >= 0 && i < blkfill; i += inc) { - boolean_t newcontents = B_TRUE; - if (txg) { - int j; - newcontents = B_FALSE; - for (j = 0; j < dnp[i].dn_nblkptr; j++) { - if (dnp[i].dn_blkptr[j].blk_birth > txg) - newcontents = B_TRUE; - } - } - if (!dnp[i].dn_type == hole && newcontents) + if ((dnp[i].dn_type == DMU_OT_NONE) == hole) break; *offset += (1ULL << span) * inc; } From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 11:20:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75FC91065674; Sat, 12 Jun 2010 11:20:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6489B8FC0C; Sat, 12 Jun 2010 11:20:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CBKo2b083408; Sat, 12 Jun 2010 11:20:50 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CBKoWl083406; Sat, 12 Jun 2010 11:20:50 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006121120.o5CBKoWl083406@svn.freebsd.org> From: Martin Matuska Date: Sat, 12 Jun 2010 11:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209095 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 11:20:50 -0000 Author: mm Date: Sat Jun 12 11:20:50 2010 New Revision: 209095 URL: http://svn.freebsd.org/changeset/base/209095 Log: Fix incomplete resilvering after disk replacement (raidz) OpenSolaris onnv-revision: 9434:3bebded7c76a Obtained from: OpenSolaris (Bug ID 6794570) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sat Jun 12 11:19:51 2010 (r209094) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sat Jun 12 11:20:50 2010 (r209095) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -697,7 +697,7 @@ vdev_raidz_io_start(zio_t *zio) continue; } if (c >= rm->rm_firstdatacol || rm->rm_missingdata > 0 || - (zio->io_flags & ZIO_FLAG_SCRUB)) { + (zio->io_flags & (ZIO_FLAG_SCRUB | ZIO_FLAG_RESILVER))) { zio_nowait(zio_vdev_child_io(zio, NULL, cvd, rc->rc_offset, rc->rc_data, rc->rc_size, zio->io_type, zio->io_priority, 0, From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 11:21:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E80B1106567A; Sat, 12 Jun 2010 11:21:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6C678FC1A; Sat, 12 Jun 2010 11:21:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CBLbMf083617; Sat, 12 Jun 2010 11:21:37 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CBLb20083615; Sat, 12 Jun 2010 11:21:37 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006121121.o5CBLb20083615@svn.freebsd.org> From: Martin Matuska Date: Sat, 12 Jun 2010 11:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209096 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 11:21:38 -0000 Author: mm Date: Sat Jun 12 11:21:37 2010 New Revision: 209096 URL: http://svn.freebsd.org/changeset/base/209096 Log: Fix vdev_probe() starvation brings txg train to a screeching halt OpenSolaris onnv-revision: 9722:e3866bad4e96 Obtained from: OpenSolaris (Bug ID 6844069) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Jun 12 11:20:50 2010 (r209095) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Jun 12 11:21:37 2010 (r209096) @@ -894,11 +894,11 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ zio_type_t t = zio->io_type; /* - * If we're a config writer, the normal issue and interrupt threads - * may all be blocked waiting for the config lock. In this case, - * select the otherwise-unused taskq for ZIO_TYPE_NULL. + * If we're a config writer or a probe, the normal issue and + * interrupt threads may all be blocked waiting for the config lock. + * In this case, select the otherwise-unused taskq for ZIO_TYPE_NULL. */ - if (zio->io_flags & ZIO_FLAG_CONFIG_WRITER) + if (zio->io_flags & (ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_PROBE)) t = ZIO_TYPE_NULL; /* From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 11:22:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1B8E1065672; Sat, 12 Jun 2010 11:22:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D090D8FC25; Sat, 12 Jun 2010 11:22:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CBMjJI083933; Sat, 12 Jun 2010 11:22:45 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CBMjhH083931; Sat, 12 Jun 2010 11:22:45 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006121122.o5CBMjhH083931@svn.freebsd.org> From: Martin Matuska Date: Sat, 12 Jun 2010 11:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209097 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 11:22:46 -0000 Author: mm Date: Sat Jun 12 11:22:45 2010 New Revision: 209097 URL: http://svn.freebsd.org/changeset/base/209097 Log: Fix ZFS panic deadlock: cycle in blocking chain via zfs_zget OpenSolaris onnv-revision: 9774:0bb234ab2287 Obtained from: OpenSolaris (Bug ID 6788152) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jun 12 11:21:37 2010 (r209096) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jun 12 11:22:45 2010 (r209097) @@ -2344,8 +2344,6 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i ZFS_VERIFY_ZP(zp); pzp = zp->z_phys; - mutex_enter(&zp->z_lock); - /* * If ACL is trivial don't bother looking for ACE_READ_ATTRIBUTES. * Also, if we are the owner don't bother, since owner should @@ -2355,7 +2353,6 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i (pzp->zp_uid != crgetuid(cr))) { if (error = zfs_zaccess(zp, ACE_READ_ATTRIBUTES, 0, skipaclchk, cr)) { - mutex_exit(&zp->z_lock); ZFS_EXIT(zfsvfs); return (error); } @@ -2366,6 +2363,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i * than to determine whether we were asked the question. */ + mutex_enter(&zp->z_lock); vap->va_type = IFTOVT(pzp->zp_mode); vap->va_mode = pzp->zp_mode & ~S_IFMT; zfs_fuid_map_ids(zp, cr, &vap->va_uid, &vap->va_gid); From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 11:24:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DF98106566C; Sat, 12 Jun 2010 11:24:11 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CC928FC18; Sat, 12 Jun 2010 11:24:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CBOB2F084263; Sat, 12 Jun 2010 11:24:11 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CBOAVK084261; Sat, 12 Jun 2010 11:24:11 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006121124.o5CBOAVK084261@svn.freebsd.org> From: Martin Matuska Date: Sat, 12 Jun 2010 11:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209098 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 11:24:11 -0000 Author: mm Date: Sat Jun 12 11:24:10 2010 New Revision: 209098 URL: http://svn.freebsd.org/changeset/base/209098 Log: Fix zpool resilver stalls with spa_scrub_thread in a 3 way deadlock OpenSolaris onnv-revision: 9997:174d75a29a1c Obtained from: OpenSolaris (Bug ID 6843235) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c Sat Jun 12 11:22:45 2010 (r209097) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c Sat Jun 12 11:24:10 2010 (r209098) @@ -1008,6 +1008,8 @@ dsl_pool_scrub_clean_cb(dsl_pool_t *dp, int dsl_pool_scrub_clean(dsl_pool_t *dp) { + spa_t *spa = dp->dp_spa; + /* * Purge all vdev caches. We do this here rather than in sync * context because this requires a writer lock on the spa_config @@ -1015,11 +1017,11 @@ dsl_pool_scrub_clean(dsl_pool_t *dp) * spa_scrub_reopen flag indicates that vdev_open() should not * attempt to start another scrub. */ - spa_config_enter(dp->dp_spa, SCL_ALL, FTAG, RW_WRITER); - dp->dp_spa->spa_scrub_reopen = B_TRUE; - vdev_reopen(dp->dp_spa->spa_root_vdev); - dp->dp_spa->spa_scrub_reopen = B_FALSE; - spa_config_exit(dp->dp_spa, SCL_ALL, FTAG); + spa_vdev_state_enter(spa); + spa->spa_scrub_reopen = B_TRUE; + vdev_reopen(spa->spa_root_vdev); + spa->spa_scrub_reopen = B_FALSE; + (void) spa_vdev_state_exit(spa, NULL, 0); return (dsl_pool_scrub_setup(dp, SCRUB_FUNC_CLEAN)); } From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 11:25:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D8F51065676; Sat, 12 Jun 2010 11:25:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0A538FC17; Sat, 12 Jun 2010 11:25:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CBPvG8084701; Sat, 12 Jun 2010 11:25:57 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CBPvKE084699; Sat, 12 Jun 2010 11:25:57 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006121125.o5CBPvKE084699@svn.freebsd.org> From: Martin Matuska Date: Sat, 12 Jun 2010 11:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209099 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 11:25:58 -0000 Author: mm Date: Sat Jun 12 11:25:57 2010 New Revision: 209099 URL: http://svn.freebsd.org/changeset/base/209099 Log: Fix possible zfs panic on zpool import OpenSolaris onnv-revision: 10040:38b25aeeaf7a Obtained from: OpenSolaris (Bug ID 6857012) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Sat Jun 12 11:24:10 2010 (r209098) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Sat Jun 12 11:25:57 2010 (r209099) @@ -96,7 +96,6 @@ dsl_dir_open_obj(dsl_pool_t *dp, uint64_ #endif if (dd == NULL) { dsl_dir_t *winner; - int err; dd = kmem_zalloc(sizeof (dsl_dir_t), KM_SLEEP); dd->dd_object = ddobj; From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 11:27:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC5F21065678; Sat, 12 Jun 2010 11:27:10 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB28E8FC15; Sat, 12 Jun 2010 11:27:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CBRA3n085007; Sat, 12 Jun 2010 11:27:10 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CBRAfk085005; Sat, 12 Jun 2010 11:27:10 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006121127.o5CBRAfk085005@svn.freebsd.org> From: Martin Matuska Date: Sat, 12 Jun 2010 11:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209100 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 11:27:10 -0000 Author: mm Date: Sat Jun 12 11:27:10 2010 New Revision: 209100 URL: http://svn.freebsd.org/changeset/base/209100 Log: Fix panic in zfs_getsecattr OpenSolaris onnv-revision: 10295:f7a18a1e9610 Obtained from: OpenSolaris (Bug ID 6870564) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat Jun 12 11:25:57 2010 (r209099) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat Jun 12 11:27:10 2010 (r209100) @@ -1984,8 +1984,6 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec if (mask & VSA_ACE) { size_t aclsz; - zfs_acl_node_t *aclnode = list_head(&aclp->z_acl); - aclsz = count * sizeof (ace_t) + sizeof (ace_object_t) * largeace; @@ -1996,8 +1994,17 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec zfs_copy_fuid_2_ace(zp->z_zfsvfs, aclp, cr, vsecp->vsa_aclentp, !(mask & VSA_ACE_ALLTYPES)); else { - bcopy(aclnode->z_acldata, vsecp->vsa_aclentp, - count * sizeof (ace_t)); + zfs_acl_node_t *aclnode; + void *start = vsecp->vsa_aclentp; + + for (aclnode = list_head(&aclp->z_acl); aclnode; + aclnode = list_next(&aclp->z_acl, aclnode)) { + bcopy(aclnode->z_acldata, start, + aclnode->z_size); + start = (caddr_t)start + aclnode->z_size; + } + ASSERT((caddr_t)start - (caddr_t)vsecp->vsa_aclentp == + aclp->z_acl_bytes); } } if (mask & VSA_ACE_ACLFLAGS) { From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 11:28:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD6FA106564A; Sat, 12 Jun 2010 11:28:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC4E18FC0A; Sat, 12 Jun 2010 11:28:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CBSkXD085399; Sat, 12 Jun 2010 11:28:46 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CBSkjJ085397; Sat, 12 Jun 2010 11:28:46 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006121128.o5CBSkjJ085397@svn.freebsd.org> From: Martin Matuska Date: Sat, 12 Jun 2010 11:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209101 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 11:28:46 -0000 Author: mm Date: Sat Jun 12 11:28:46 2010 New Revision: 209101 URL: http://svn.freebsd.org/changeset/base/209101 Log: Fix arc_read_done may try to byteswap undefined data (sparc related) OpenSolaris onnv-revision: 10839:cf83b553a2ab Obtained from: OpenSolaris (Bug ID 6836714) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Jun 12 11:27:10 2010 (r209100) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Jun 12 11:28:46 2010 (r209101) @@ -2687,7 +2687,7 @@ arc_read_done(zio_t *zio) /* byteswap if necessary */ callback_list = hdr->b_acb; ASSERT(callback_list != NULL); - if (BP_SHOULD_BYTESWAP(zio->io_bp)) { + if (BP_SHOULD_BYTESWAP(zio->io_bp) && zio->io_error == 0) { arc_byteswap_func_t *func = BP_GET_LEVEL(zio->io_bp) > 0 ? byteswap_uint64_array : dmu_ot[BP_GET_TYPE(zio->io_bp)].ot_byteswap; From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 12:19:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7251106566B; Sat, 12 Jun 2010 12:19:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B62258FC08; Sat, 12 Jun 2010 12:19:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CCJ8fW096484; Sat, 12 Jun 2010 12:19:08 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CCJ8pe096481; Sat, 12 Jun 2010 12:19:08 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006121219.o5CCJ8pe096481@svn.freebsd.org> From: Ed Schouten Date: Sat, 12 Jun 2010 12:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209102 - head/sys/compat/ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 12:19:09 -0000 Author: ed Date: Sat Jun 12 12:19:08 2010 New Revision: 209102 URL: http://svn.freebsd.org/changeset/base/209102 Log: ANSIfy prototypes in subr_usbd.c. Clang generates the following warnings when building subr_usbd.c: | subr_usbd.c:598:13: warning: promoted type 'int' of K&R function | parameter is not compatible with the parameter type 'uint8_t' (aka | 'unsigned char') declared in a previous prototype | subr_usbd.c:627:13: warning: promoted type 'int' of K&R function | parameter is not compatible with the parameter type 'uint8_t' (aka | 'unsigned char') declared in a previous prototype | subr_usbd.c:649:13: warning: promoted type 'int' of K&R function | parameter is not compatible with the parameter type 'uint8_t' (aka | 'unsigned char') declared in a previous prototype Instead of just ANSIfying these three prototypes, do it for the entire file. Spotted by: clang Modified: head/sys/compat/ndis/subr_usbd.c Modified: head/sys/compat/ndis/subr_usbd.c ============================================================================== --- head/sys/compat/ndis/subr_usbd.c Sat Jun 12 11:28:46 2010 (r209101) +++ head/sys/compat/ndis/subr_usbd.c Sat Jun 12 12:19:08 2010 (r209102) @@ -234,9 +234,7 @@ usbd_libfini(void) } static int32_t -usbd_iodispatch(dobj, ip) - device_object *dobj; - irp *ip; +usbd_iodispatch(device_object *dobj, irp *ip) { device_t dev = dobj->do_devext; int32_t status; @@ -266,9 +264,7 @@ usbd_iodispatch(dobj, ip) } static int32_t -usbd_ioinvalid(dobj, ip) - device_object *dobj; - irp *ip; +usbd_ioinvalid(device_object *dobj, irp *ip) { device_t dev = dobj->do_devext; struct io_stack_location *irp_sl; @@ -286,9 +282,7 @@ usbd_ioinvalid(dobj, ip) } static int32_t -usbd_pnp(dobj, ip) - device_object *dobj; - irp *ip; +usbd_pnp(device_object *dobj, irp *ip) { device_t dev = dobj->do_devext; struct io_stack_location *irp_sl; @@ -306,9 +300,7 @@ usbd_pnp(dobj, ip) } static int32_t -usbd_power(dobj, ip) - device_object *dobj; - irp *ip; +usbd_power(device_object *dobj, irp *ip) { device_t dev = dobj->do_devext; struct io_stack_location *irp_sl; @@ -327,8 +319,7 @@ usbd_power(dobj, ip) /* Convert USBD_STATUS to NTSTATUS */ static int32_t -usbd_urb2nt(status) - int32_t status; +usbd_urb2nt(int32_t status) { switch (status) { @@ -387,8 +378,7 @@ usbd_usb2urb(int status) } static union usbd_urb * -usbd_geturb(ip) - irp *ip; +usbd_geturb(irp *ip) { struct io_stack_location *irp_sl; @@ -398,8 +388,7 @@ usbd_geturb(ip) } static int32_t -usbd_submit_urb(ip) - irp *ip; +usbd_submit_urb(irp *ip) { device_t dev = IRP_NDIS_DEV(ip); int32_t status; @@ -452,8 +441,7 @@ usbd_submit_urb(ip) } static int32_t -usbd_func_getdesc(ip) - irp *ip; +usbd_func_getdesc(irp *ip) { #define NDISUSB_GETDESC_MAXRETRIES 3 device_t dev = IRP_NDIS_DEV(ip); @@ -513,8 +501,7 @@ exit: } static int32_t -usbd_func_selconf(ip) - irp *ip; +usbd_func_selconf(irp *ip) { device_t dev = IRP_NDIS_DEV(ip); int i, j; @@ -593,11 +580,8 @@ usbd_func_selconf(ip) } static usb_error_t -usbd_setup_endpoint_one(ip, ifidx, ne, epconf) - irp *ip; - uint8_t ifidx; - struct ndisusb_ep *ne; - struct usb_config *epconf; +usbd_setup_endpoint_one(irp *ip, uint8_t ifidx, struct ndisusb_ep *ne, + struct usb_config *epconf) { device_t dev = IRP_NDIS_DEV(ip); struct ndis_softc *sc = device_get_softc(dev); @@ -622,9 +606,7 @@ usbd_setup_endpoint_one(ip, ifidx, ne, e } static usb_error_t -usbd_setup_endpoint_default(ip, ifidx) - irp *ip; - uint8_t ifidx; +usbd_setup_endpoint_default(irp *ip, uint8_t ifidx) { device_t dev = IRP_NDIS_DEV(ip); struct ndis_softc *sc = device_get_softc(dev); @@ -644,10 +626,8 @@ usbd_setup_endpoint_default(ip, ifidx) } static usb_error_t -usbd_setup_endpoint(ip, ifidx, ep) - irp *ip; - uint8_t ifidx; - struct usb_endpoint_descriptor *ep; +usbd_setup_endpoint(irp *ip, uint8_t ifidx, + struct usb_endpoint_descriptor *ep) { device_t dev = IRP_NDIS_DEV(ip); struct ndis_softc *sc = device_get_softc(dev); @@ -702,8 +682,7 @@ usbd_setup_endpoint(ip, ifidx, ep) } static int32_t -usbd_func_abort_pipe(ip) - irp *ip; +usbd_func_abort_pipe(irp *ip) { device_t dev = IRP_NDIS_DEV(ip); struct ndis_softc *sc = device_get_softc(dev); @@ -726,8 +705,7 @@ usbd_func_abort_pipe(ip) } static int32_t -usbd_func_vendorclass(ip) - irp *ip; +usbd_func_vendorclass(irp *ip) { device_t dev = IRP_NDIS_DEV(ip); int32_t error; @@ -781,9 +759,7 @@ usbd_func_vendorclass(ip) } static void -usbd_irpcancel(dobj, ip) - device_object *dobj; - irp *ip; +usbd_irpcancel(device_object *dobj, irp *ip) { device_t dev = IRP_NDIS_DEV(ip); struct ndis_softc *sc = device_get_softc(dev); @@ -1102,9 +1078,7 @@ next: } static struct ndisusb_ep * -usbd_get_ndisep(ip, ep) - irp *ip; - usb_endpoint_descriptor_t *ep; +usbd_get_ndisep(irp *ip, usb_endpoint_descriptor_t *ep) { device_t dev = IRP_NDIS_DEV(ip); struct ndis_softc *sc = device_get_softc(dev); @@ -1119,9 +1093,7 @@ usbd_get_ndisep(ip, ep) } static void -usbd_xfertask(dobj, arg) - device_object *dobj; - void *arg; +usbd_xfertask(device_object *dobj, void *arg) { int error; irp *ip; @@ -1201,9 +1173,7 @@ usbd_xfertask(dobj, arg) * we don't want to be in the scope of HAL lock. */ static int32_t -usbd_taskadd(ip, type) - irp *ip; - unsigned type; +usbd_taskadd(irp *ip, unsigned type) { device_t dev = IRP_NDIS_DEV(ip); struct ndis_softc *sc = device_get_softc(dev); @@ -1226,9 +1196,7 @@ usbd_taskadd(ip, type) } static void -usbd_task(dobj, arg) - device_object *dobj; - void *arg; +usbd_task(device_object *dobj, void *arg) { irp *ip; list_entry *l; @@ -1289,8 +1257,7 @@ exit: } static int32_t -usbd_func_bulkintr(ip) - irp *ip; +usbd_func_bulkintr(irp *ip) { int32_t error; struct ndisusb_ep *ne; @@ -1336,9 +1303,7 @@ usbd_func_bulkintr(ip) } static union usbd_urb * -USBD_CreateConfigurationRequest(conf, len) - usb_config_descriptor_t *conf; - uint16_t *len; +USBD_CreateConfigurationRequest(usb_config_descriptor_t *conf, uint16_t *len) { struct usbd_interface_list_entry list[2]; union usbd_urb *urb; @@ -1355,9 +1320,8 @@ USBD_CreateConfigurationRequest(conf, le } static union usbd_urb * -USBD_CreateConfigurationRequestEx(conf, list) - usb_config_descriptor_t *conf; - struct usbd_interface_list_entry *list; +USBD_CreateConfigurationRequestEx(usb_config_descriptor_t *conf, + struct usbd_interface_list_entry *list) { int i, j, size; struct usbd_interface_information *intf; @@ -1413,8 +1377,7 @@ USBD_CreateConfigurationRequestEx(conf, } static void -USBD_GetUSBDIVersion(ui) - usbd_version_info *ui; +USBD_GetUSBDIVersion(usbd_version_info *ui) { /* Pretend to be Windows XP. */ @@ -1433,15 +1396,9 @@ USBD_ParseConfigurationDescriptor(usb_co } static usb_interface_descriptor_t * -USBD_ParseConfigurationDescriptorEx(conf, start, intfnum, - altset, intfclass, intfsubclass, intfproto) - usb_config_descriptor_t *conf; - void *start; - int32_t intfnum; - int32_t altset; - int32_t intfclass; - int32_t intfsubclass; - int32_t intfproto; +USBD_ParseConfigurationDescriptorEx(usb_config_descriptor_t *conf, + void *start, int32_t intfnum, int32_t altset, int32_t intfclass, + int32_t intfsubclass, int32_t intfproto) { struct usb_descriptor *next = NULL; usb_interface_descriptor_t *desc; From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 13:10:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 864CA1065672; Sat, 12 Jun 2010 13:10:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75C0D8FC16; Sat, 12 Jun 2010 13:10:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CDA4QT007853; Sat, 12 Jun 2010 13:10:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CDA4Lg007851; Sat, 12 Jun 2010 13:10:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006121310.o5CDA4Lg007851@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jun 2010 13:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209103 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 13:10:04 -0000 Author: mav Date: Sat Jun 12 13:10:03 2010 New Revision: 209103 URL: http://svn.freebsd.org/changeset/base/209103 Log: Check general TSC presence before doing more specific checks and printfs. Modified: head/sys/i386/i386/tsc.c Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Sat Jun 12 12:19:08 2010 (r209102) +++ head/sys/i386/i386/tsc.c Sat Jun 12 13:10:03 2010 (r209103) @@ -123,6 +123,10 @@ init_TSC(void) void init_TSC_tc(void) { + + if (!tsc_present) + return; + /* * We can not use the TSC if we support APM. Precise timekeeping * on an APM'ed machine is at best a fools pursuit, since @@ -152,7 +156,7 @@ init_TSC_tc(void) tsc_timecounter.tc_quality = -100; #endif - if (tsc_present && tsc_freq != 0 && !tsc_is_broken) { + if (tsc_freq != 0 && !tsc_is_broken) { tsc_timecounter.tc_frequency = tsc_freq; tc_init(&tsc_timecounter); } From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 13:20:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16AD4106564A; Sat, 12 Jun 2010 13:20:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05DFB8FC21; Sat, 12 Jun 2010 13:20:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CDKc0K010173; Sat, 12 Jun 2010 13:20:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CDKc4U010170; Sat, 12 Jun 2010 13:20:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006121320.o5CDKc4U010170@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 12 Jun 2010 13:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209104 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 13:20:39 -0000 Author: kib Date: Sat Jun 12 13:20:38 2010 New Revision: 209104 URL: http://svn.freebsd.org/changeset/base/209104 Log: Add modifications of devctl_notify(9) functions that take flags. Use flags to specify M_WAITOK/M_NOWAIT. M_WAITOK allows devctl to sleep for the memory allocation. As Warner noted, allowing the functions to sleep might cause reordering of the queued notifications. Reviewed by: imp, jh MFC after: 3 weeks Modified: head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Jun 12 13:10:03 2010 (r209103) +++ head/sys/kern/subr_bus.c Sat Jun 12 13:20:38 2010 (r209104) @@ -539,7 +539,7 @@ devctl_process_running(void) * that @p data is allocated using the M_BUS malloc type. */ void -devctl_queue_data(char *data) +devctl_queue_data_f(char *data, int flags) { struct dev_event_info *n1 = NULL, *n2 = NULL; struct proc *p; @@ -548,7 +548,7 @@ devctl_queue_data(char *data) goto out; if (devctl_queue_length == 0) goto out; - n1 = malloc(sizeof(*n1), M_BUS, M_NOWAIT); + n1 = malloc(sizeof(*n1), M_BUS, flags); if (n1 == NULL) goto out; n1->dei_data = data; @@ -588,12 +588,19 @@ out: return; } +void +devctl_queue_data(char *data) +{ + + devctl_queue_data_f(data, M_NOWAIT); +} + /** * @brief Send a 'notification' to userland, using standard ways */ void -devctl_notify(const char *system, const char *subsystem, const char *type, - const char *data) +devctl_notify_f(const char *system, const char *subsystem, const char *type, + const char *data, int flags) { int len = 0; char *msg; @@ -611,7 +618,7 @@ devctl_notify(const char *system, const if (data != NULL) len += strlen(data); len += 3; /* '!', '\n', and NUL */ - msg = malloc(len, M_BUS, M_NOWAIT); + msg = malloc(len, M_BUS, flags); if (msg == NULL) return; /* Drop it on the floor */ if (data != NULL) @@ -620,7 +627,15 @@ devctl_notify(const char *system, const else snprintf(msg, len, "!system=%s subsystem=%s type=%s\n", system, subsystem, type); - devctl_queue_data(msg); + devctl_queue_data_f(msg, flags); +} + +void +devctl_notify(const char *system, const char *subsystem, const char *type, + const char *data) +{ + + devctl_notify_f(system, subsystem, type, data, M_NOWAIT); } /* Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sat Jun 12 13:10:03 2010 (r209103) +++ head/sys/sys/bus.h Sat Jun 12 13:20:38 2010 (r209104) @@ -85,8 +85,11 @@ struct u_device { * included in case devctl_notify isn't sufficiently general. */ boolean_t devctl_process_running(void); +void devctl_notify_f(const char *__system, const char *__subsystem, + const char *__type, const char *__data, int __flags); void devctl_notify(const char *__system, const char *__subsystem, const char *__type, const char *__data); +void devctl_queue_data_f(char *__data, int __flags); void devctl_queue_data(char *__data); /** From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 13:21:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44AEB106566C; Sat, 12 Jun 2010 13:21:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 349578FC18; Sat, 12 Jun 2010 13:21:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CDLQSf010404; Sat, 12 Jun 2010 13:21:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CDLQd5010402; Sat, 12 Jun 2010 13:21:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006121321.o5CDLQd5010402@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 12 Jun 2010 13:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209105 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 13:21:26 -0000 Author: kib Date: Sat Jun 12 13:21:25 2010 New Revision: 209105 URL: http://svn.freebsd.org/changeset/base/209105 Log: When make_dev_credf(MAKEDEV_WAITOK) is called, use devctl_notify_f(M_WAITOK) for devfs notifications. Suggested by: jh Reviewed by: imp, jh MFC after: 3 weeks Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Jun 12 13:20:38 2010 (r209104) +++ head/sys/kern/kern_conf.c Sat Jun 12 13:21:25 2010 (r209105) @@ -509,18 +509,18 @@ notify(struct cdev *dev, const char *ev, { static const char prefix[] = "cdev="; char *data; - int namelen; + int namelen, mflags; if (cold) return; + mflags = (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK; namelen = strlen(dev->si_name); - data = malloc(namelen + sizeof(prefix), M_TEMP, - (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK); + data = malloc(namelen + sizeof(prefix), M_TEMP, mflags); if (data == NULL) return; memcpy(data, prefix, sizeof(prefix) - 1); memcpy(data + sizeof(prefix) - 1, dev->si_name, namelen + 1); - devctl_notify("DEVFS", "CDEV", ev, data); + devctl_notify_f("DEVFS", "CDEV", ev, data, mflags); free(data, M_TEMP); } From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 13:22:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C9D11065673; Sat, 12 Jun 2010 13:22:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B6A78FC12; Sat, 12 Jun 2010 13:22:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CDMdLf010718; Sat, 12 Jun 2010 13:22:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CDMd57010715; Sat, 12 Jun 2010 13:22:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006121322.o5CDMd57010715@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 12 Jun 2010 13:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209106 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 13:22:40 -0000 Author: kib Date: Sat Jun 12 13:22:39 2010 New Revision: 209106 URL: http://svn.freebsd.org/changeset/base/209106 Log: Add another variation of make_dev(9), make_dev_p(9), that is allowed to fail and can return useful error code. Requested by: jh Reviewed by: imp, jh MFC after: 3 weeks Modified: head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Jun 12 13:21:25 2010 (r209105) +++ head/sys/kern/kern_conf.c Sat Jun 12 13:22:39 2010 (r209106) @@ -55,9 +55,8 @@ struct mtx devmtx; static void destroy_devl(struct cdev *dev); static int destroy_dev_sched_cbl(struct cdev *dev, void (*cb)(void *), void *arg); -static struct cdev *make_dev_credv(int flags, - struct cdevsw *devsw, int unit, - struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, +static int make_dev_credv(int flags, struct cdev **dres, struct cdevsw *devsw, + int unit, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, va_list ap); static struct cdev_priv_list cdevp_free_list = @@ -580,20 +579,20 @@ prep_cdevsw(struct cdevsw *devsw, int fl mtx_assert(&devmtx, MA_OWNED); if (devsw->d_flags & D_INIT) - return (1); + return (0); if (devsw->d_flags & D_NEEDGIANT) { dev_unlock(); dsw2 = malloc(sizeof *dsw2, M_DEVT, (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK); dev_lock(); if (dsw2 == NULL && !(devsw->d_flags & D_INIT)) - return (0); + return (ENOMEM); } else dsw2 = NULL; if (devsw->d_flags & D_INIT) { if (dsw2 != NULL) cdevsw_free_devlocked(dsw2); - return (1); + return (0); } if (devsw->d_version != D_VERSION_03) { @@ -651,25 +650,28 @@ prep_cdevsw(struct cdevsw *devsw, int fl if (dsw2 != NULL) cdevsw_free_devlocked(dsw2); - return (1); + return (0); } -static struct cdev * -make_dev_credv(int flags, struct cdevsw *devsw, int unit, - struct ucred *cr, uid_t uid, - gid_t gid, int mode, const char *fmt, va_list ap) +static int +make_dev_credv(int flags, struct cdev **dres, struct cdevsw *devsw, int unit, + struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, + va_list ap) { struct cdev *dev; - int i; + int i, res; + KASSERT((flags & MAKEDEV_WAITOK) == 0 || (flags & MAKEDEV_NOWAIT) == 0, + ("make_dev_credv: both WAITOK and NOWAIT specified")); dev = devfs_alloc(flags); if (dev == NULL) - return (NULL); + return (ENOMEM); dev_lock(); - if (!prep_cdevsw(devsw, flags)) { + res = prep_cdevsw(devsw, flags); + if (res != 0) { dev_unlock(); devfs_free(dev); - return (NULL); + return (res); } dev = newdev(devsw, unit, dev); if (flags & MAKEDEV_REF) @@ -682,7 +684,8 @@ make_dev_credv(int flags, struct cdevsw * XXX: still ?? */ dev_unlock_and_free(); - return (dev); + *dres = dev; + return (0); } KASSERT(!(dev->si_flags & SI_NAMED), ("make_dev() by driver %s on pre-existing device (min=%x, name=%s)", @@ -707,7 +710,8 @@ make_dev_credv(int flags, struct cdevsw notify_create(dev, flags); - return (dev); + *dres = dev; + return (0); } struct cdev * @@ -716,10 +720,13 @@ make_dev(struct cdevsw *devsw, int unit, { struct cdev *dev; va_list ap; + int res; va_start(ap, fmt); - dev = make_dev_credv(0, devsw, unit, NULL, uid, gid, mode, fmt, ap); + res = make_dev_credv(0, &dev, devsw, unit, NULL, uid, gid, mode, fmt, + ap); va_end(ap); + KASSERT(res == 0 && dev != NULL, ("make_dev: failed make_dev_credv")); return (dev); } @@ -729,28 +736,50 @@ make_dev_cred(struct cdevsw *devsw, int { struct cdev *dev; va_list ap; + int res; va_start(ap, fmt); - dev = make_dev_credv(0, devsw, unit, cr, uid, gid, mode, fmt, ap); + res = make_dev_credv(0, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap); va_end(ap); + KASSERT(res == 0 && dev != NULL, + ("make_dev_cred: failed make_dev_credv")); return (dev); } struct cdev * -make_dev_credf(int flags, struct cdevsw *devsw, int unit, - struct ucred *cr, uid_t uid, - gid_t gid, int mode, const char *fmt, ...) +make_dev_credf(int flags, struct cdevsw *devsw, int unit, struct ucred *cr, + uid_t uid, gid_t gid, int mode, const char *fmt, ...) { struct cdev *dev; va_list ap; + int res; va_start(ap, fmt); - dev = make_dev_credv(flags, devsw, unit, cr, uid, gid, mode, + res = make_dev_credv(flags, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap); va_end(ap); - return (dev); + KASSERT((flags & MAKEDEV_NOWAIT) != 0 || res == 0, + ("make_dev_credf: failed make_dev_credv")); + return (res == 0 ? dev : NULL); +} + +int +make_dev_p(int flags, struct cdev **cdev, struct cdevsw *devsw, int unit, + struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, ...) +{ + va_list ap; + int res; + + va_start(ap, fmt); + res = make_dev_credv(flags, cdev, devsw, unit, cr, uid, gid, mode, + fmt, ap); + va_end(ap); + + KASSERT((flags & MAKEDEV_NOWAIT) != 0 || res == 0, + ("make_dev_credf: failed make_dev_credv")); + return (res); } static void Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Sat Jun 12 13:21:25 2010 (r209105) +++ head/sys/sys/conf.h Sat Jun 12 13:22:39 2010 (r209106) @@ -270,7 +270,11 @@ struct cdev *make_dev_credf(int _flags, struct cdevsw *_devsw, int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, const char *_fmt, ...) __printflike(8, 9); -struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...) __printflike(2, 3); +int make_dev_p(int _flags, struct cdev **_cdev, struct cdevsw *_devsw, + int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, + const char *_fmt, ...) __printflike(9, 10); +struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...) + __printflike(2, 3); void dev_lock(void); void dev_unlock(void); void setconf(void); From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 14:49:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5FE1065674; Sat, 12 Jun 2010 14:49:17 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 2A4E28FC1E; Sat, 12 Jun 2010 14:49:16 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 661A3C42DD; Sat, 12 Jun 2010 16:54:30 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id 42-67p7X4T7D; Sat, 12 Jun 2010 16:54:29 +0200 (CEST) Received: from [192.168.133.14] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id ACACAC42DB; Sat, 12 Jun 2010 16:54:29 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <20100610.092502.72112000528403516.imp@bsdimp.com> Date: Sat, 12 Jun 2010 16:49:14 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006091957.o59JvKbu025122@svn.freebsd.org> <20100610.092502.72112000528403516.imp@bsdimp.com> To: M. Warner Losh X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, rdivacky@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208964 - in head: . etc/mtree lib share/mk usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 14:49:17 -0000 On 2010-06-10, at 17:25, M. Warner Losh wrote: > In message: <201006091957.o59JvKbu025122@svn.freebsd.org> > Roman Divacky writes: > : Modified: head/share/mk/bsd.own.mk > : = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > : --- head/share/mk/bsd.own.mk Wed Jun 9 19:32:20 2010 = (r208963) > : +++ head/share/mk/bsd.own.mk Wed Jun 9 19:57:20 2010 = (r208964) > : @@ -288,6 +288,18 @@ _no_fdt=3D FDT > : .endif > : =20 > : # > : +# Default behaviour of MK_CLANG depends on the architecture. > : +# > : +.if ${MACHINE_ARCH} =3D=3D "amd64" || ${MACHINE_ARCH} =3D=3D "i386" = || \ > : + ${MACHINE_ARCH} =3D=3D "powerpc" > : +_clang_yes=3DCLANG > : +_clang_no=3D > : +.else > : +_clang_yes=3D > : +_clang_no=3DCLANG > : +.endif >=20 > We really should *NOT* be encoding architecture stuff like this into > bsd.own.mk. Sometimes the right thing here is MACHINE_ARCH, and for > the moment, since clang is not a bootstrap tool, this is correct. > However, once clang is a bootstrap tool, this will be incorrect > because during the bootstrapping for cross building TARGET_ARCH is > what should be tested. We have the same problem with the FTD stuff > that was recently committed. raj@ and I have been talking about the > best ways to fix it. I think I'm going to drop setting WITH_FDT by default for selected = arches until the tdbemd arrives, and for this little (I hope :-) while = it will just be required for FDT-enabled platforms to specify WITH_FDT = explicitly. Rafal From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 15:13:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFAC81065675; Sat, 12 Jun 2010 15:13:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BED708FC0C; Sat, 12 Jun 2010 15:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CFDafS034967; Sat, 12 Jun 2010 15:13:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CFDaMW034964; Sat, 12 Jun 2010 15:13:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006121513.o5CFDaMW034964@svn.freebsd.org> From: Ed Schouten Date: Sat, 12 Jun 2010 15:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209107 - in head: contrib/llvm/tools/clang/lib/Basic lib/clang X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 15:13:36 -0000 Author: ed Date: Sat Jun 12 15:13:36 2010 New Revision: 209107 URL: http://svn.freebsd.org/changeset/base/209107 Log: Do the branding right this time. I've looked at other places in the source tree where CLANG_VENDOR is used and I suspect it might not be safe to use newlines here. CLANG_VENDOR should just be defined to "FreeBSD ", just like the latest Clang preview in OS X uses "Apple ". Properly use SVN_REVISION to define it to the imported revision of Clang. I do want to have a date in there, so slightly modify the code to support CLANG_VENDOR_SUFFIX. Modified: head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/lib/clang/clang.build.mk Modified: head/contrib/llvm/tools/clang/lib/Basic/Version.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sat Jun 12 13:22:39 2010 (r209106) +++ head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sat Jun 12 15:13:36 2010 (r209107) @@ -70,6 +70,9 @@ std::string getClangFullVersion() { #endif OS << "clang version " CLANG_VERSION_STRING " (" << getClangFullRepositoryVersion() << ')'; +#ifdef CLANG_VENDOR_SUFFIX + OS << CLANG_VENDOR_SUFFIX; +#endif return OS.str(); } Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Sat Jun 12 13:22:39 2010 (r209106) +++ head/lib/clang/clang.build.mk Sat Jun 12 15:13:36 2010 (r209107) @@ -11,7 +11,8 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG TARGET_ARCH?= ${MACHINE_ARCH} # XXX: 8.0, to keep __FreeBSD_cc_version happy CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\" \ - -DCLANG_VENDOR=\"clang\ r104832\ 20100610\ [FreeBSD]\\n\" + -DCLANG_VENDOR=\"FreeBSD\ \" -DSVN_REVISION=\"104832\" \ + -DCLANG_VENDOR_SUFFIX=\"\ 20100612\" .PATH: ${LLVM_SRCS}/${SRCDIR} From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 15:29:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F4FE1065677; Sat, 12 Jun 2010 15:29:46 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0C8A68FC16; Sat, 12 Jun 2010 15:29:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5CFS7gt009698; Sat, 12 Jun 2010 09:28:07 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 12 Jun 2010 09:28:09 -0600 (MDT) Message-Id: <20100612.092809.322386357415738459.imp@bsdimp.com> To: raj@semihalf.com From: "M. Warner Losh" In-Reply-To: References: <201006091957.o59JvKbu025122@svn.freebsd.org> <20100610.092502.72112000528403516.imp@bsdimp.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, rdivacky@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208964 - in head: . etc/mtree lib share/mk usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 15:29:46 -0000 In message: Rafal Jaworowski writes: : : On 2010-06-10, at 17:25, M. Warner Losh wrote: : : > In message: <201006091957.o59JvKbu025122@svn.freebsd.org> : > Roman Divacky writes: : > : Modified: head/share/mk/bsd.own.mk : > : ============================================================================== : > : --- head/share/mk/bsd.own.mk Wed Jun 9 19:32:20 2010 (r208963) : > : +++ head/share/mk/bsd.own.mk Wed Jun 9 19:57:20 2010 (r208964) : > : @@ -288,6 +288,18 @@ _no_fdt= FDT : > : .endif : > : : > : # : > : +# Default behaviour of MK_CLANG depends on the architecture. : > : +# : > : +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ : > : + ${MACHINE_ARCH} == "powerpc" : > : +_clang_yes=CLANG : > : +_clang_no= : > : +.else : > : +_clang_yes= : > : +_clang_no=CLANG : > : +.endif : > : > We really should *NOT* be encoding architecture stuff like this into : > bsd.own.mk. Sometimes the right thing here is MACHINE_ARCH, and for : > the moment, since clang is not a bootstrap tool, this is correct. : > However, once clang is a bootstrap tool, this will be incorrect : > because during the bootstrapping for cross building TARGET_ARCH is : > what should be tested. We have the same problem with the FTD stuff : > that was recently committed. raj@ and I have been talking about the : > best ways to fix it. : : I think I'm going to drop setting WITH_FDT by default for selected : arches until the tdbemd arrives, and for this little (I hope :-) : while it will just be required for FDT-enabled platforms to specify : WITH_FDT explicitly. Yes. I think that the current WITH/WITHOUT system works well for things that are optional, like sendmail or lpt. I think it doesn't work well to specify intrinsic characteristics about a platform. That's why we're having the problems with FDT and CLANG. They are trying to specify a property of a platform by turning an optional component on or off. We've traditionally not done that, but instead have controlled this via Makefile ifdefs. I'm transitioning the latter to provide better separation.... Warner From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 15:42:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 640F4106566B; Sat, 12 Jun 2010 15:42:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533478FC08; Sat, 12 Jun 2010 15:42:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CFgsfl041674; Sat, 12 Jun 2010 15:42:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CFgsKB041672; Sat, 12 Jun 2010 15:42:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201006121542.o5CFgsKB041672@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 12 Jun 2010 15:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209108 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 15:42:54 -0000 Author: bz Date: Sat Jun 12 15:42:54 2010 New Revision: 209108 URL: http://svn.freebsd.org/changeset/base/209108 Log: "MFC" (parts of) r185849: Fix a locking issue triggering an assertion in rt_setgate() via arp_rtrequest() due to no radix node head (rnh) lock held in case of a route change. The previous MFC in r189026 left out this hunk. Reported by: Haven Hash (haven.hash isilon.com) Tested by: Haven Hash (haven.hash isilon.com) PR: kern/147767 Modified: stable/7/sys/net/rtsock.c Modified: stable/7/sys/net/rtsock.c ============================================================================== --- stable/7/sys/net/rtsock.c Sat Jun 12 15:13:36 2010 (r209107) +++ stable/7/sys/net/rtsock.c Sat Jun 12 15:42:54 2010 (r209108) @@ -672,8 +672,13 @@ route_output(struct mbuf *m, struct sock rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx, &rt->rt_rmx); rtm->rtm_index = rt->rt_ifp->if_index; - if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest) - rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, &info); + if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest) { + RT_UNLOCK(rt); + RADIX_NODE_HEAD_LOCK(rnh); + RT_LOCK(rt); + rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, &info); + RADIX_NODE_HEAD_UNLOCK(rnh); + } if (info.rti_info[RTAX_GENMASK]) rt->rt_genmask = info.rti_info[RTAX_GENMASK]; /* FALLTHROUGH */ From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 16:04:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7568C1065675; Sat, 12 Jun 2010 16:04:29 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C38F8FC1B; Sat, 12 Jun 2010 16:04:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CG4TEq046432; Sat, 12 Jun 2010 16:04:29 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CG4Tcu046430; Sat, 12 Jun 2010 16:04:29 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201006121604.o5CG4Tcu046430@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 12 Jun 2010 16:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209109 - head/usr.bin/clang X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 16:04:29 -0000 Author: des Date: Sat Jun 12 16:04:29 2010 New Revision: 209109 URL: http://svn.freebsd.org/changeset/base/209109 Log: Install tblgen so partial / progressive builds are still possible. Modified: head/usr.bin/clang/Makefile Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Sat Jun 12 15:42:54 2010 (r209108) +++ head/usr.bin/clang/Makefile Sat Jun 12 16:04:29 2010 (r209109) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= clang +SUBDIR= clang tblgen .include From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 17:32:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31374106566C; Sat, 12 Jun 2010 17:32:06 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08E258FC18; Sat, 12 Jun 2010 17:32:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CHW5TX065726; Sat, 12 Jun 2010 17:32:05 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CHW5Cs065722; Sat, 12 Jun 2010 17:32:05 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201006121732.o5CHW5Cs065722@svn.freebsd.org> From: David Schultz Date: Sat, 12 Jun 2010 17:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 17:32:06 -0000 Author: das Date: Sat Jun 12 17:32:05 2010 New Revision: 209110 URL: http://svn.freebsd.org/changeset/base/209110 Log: Introduce __isnanf() as an alias for isnanf(), and make the isnan() macro expand to __isnanf() instead of isnanf() for float arguments. This change is needed because isnanf() isn't declared in strict POSIX or C99 mode. Compatibility note: Apps using isnan(float) that are compiled after this change won't link against an older libm. Reported by: Florian Forster Modified: head/lib/msun/Symbol.map head/lib/msun/src/math.h head/lib/msun/src/s_isnan.c Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Sat Jun 12 16:04:29 2010 (r209109) +++ head/lib/msun/Symbol.map Sat Jun 12 17:32:05 2010 (r209110) @@ -218,3 +218,8 @@ FBSD_1.1 { cprojf; cprojl; }; + +/* First added in 9.0-CURRENT */ +FBSD_1.2 { + __isnanf; +}; Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Sat Jun 12 16:04:29 2010 (r209109) +++ head/lib/msun/src/math.h Sat Jun 12 17:32:05 2010 (r209110) @@ -97,7 +97,7 @@ extern const union __nan_un { : (sizeof (x) == sizeof (double)) ? isinf(x) \ : __isinfl(x)) #define isnan(x) \ - ((sizeof (x) == sizeof (float)) ? isnanf(x) \ + ((sizeof (x) == sizeof (float)) ? __isnanf(x) \ : (sizeof (x) == sizeof (double)) ? isnan(x) \ : __isnanl(x)) #define isnormal(x) \ @@ -179,6 +179,7 @@ int __isfinite(double) __pure2; int __isfinitel(long double) __pure2; int __isinff(float) __pure2; int __isinfl(long double) __pure2; +int __isnanf(float) __pure2; int __isnanl(long double) __pure2; int __isnormalf(float) __pure2; int __isnormal(double) __pure2; Modified: head/lib/msun/src/s_isnan.c ============================================================================== --- head/lib/msun/src/s_isnan.c Sat Jun 12 16:04:29 2010 (r209109) +++ head/lib/msun/src/s_isnan.c Sat Jun 12 17:32:05 2010 (r209110) @@ -43,7 +43,7 @@ isnan(double d) #endif int -isnanf(float f) +__isnanf(float f) { union IEEEf2bits u; @@ -60,3 +60,5 @@ __isnanl(long double e) mask_nbit_l(u); return (u.bits.exp == 32767 && (u.bits.manl != 0 || u.bits.manh != 0)); } + +__weak_reference(__isnanf, isnanf); From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 18:05:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9934F1065673; Sat, 12 Jun 2010 18:05:56 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5548FC08; Sat, 12 Jun 2010 18:05:56 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id o5CI5uhn057384; Sat, 12 Jun 2010 11:05:56 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id o5CI5ueq057383; Sat, 12 Jun 2010 11:05:56 -0700 (PDT) (envelope-from sgk) Date: Sat, 12 Jun 2010 11:05:56 -0700 From: Steve Kargl To: David Schultz Message-ID: <20100612180556.GA57369@troutmask.apl.washington.edu> References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201006121732.o5CHW5Cs065722@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 18:05:56 -0000 On Sat, Jun 12, 2010 at 05:32:05PM +0000, David Schultz wrote: > Author: das > Date: Sat Jun 12 17:32:05 2010 > New Revision: 209110 > URL: http://svn.freebsd.org/changeset/base/209110 > > Log: > Introduce __isnanf() as an alias for isnanf(), and make the isnan() > macro expand to __isnanf() instead of isnanf() for float arguments. > This change is needed because isnanf() isn't declared in strict POSIX > or C99 mode. > > Compatibility note: Apps using isnan(float) that are compiled after > this change won't link against an older libm. > Does this then mean that libm's version number needs to be bumped? -- Steve From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 19:14:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74FCB1065672; Sat, 12 Jun 2010 19:14:20 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 33CC08FC08; Sat, 12 Jun 2010 19:14:20 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id o5CJEJOZ006666; Sat, 12 Jun 2010 15:14:19 -0400 (EDT) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id o5CJEJ79006665; Sat, 12 Jun 2010 15:14:19 -0400 (EDT) (envelope-from das@freebsd.org) Date: Sat, 12 Jun 2010 15:14:19 -0400 From: David Schultz To: Steve Kargl Message-ID: <20100612191419.GA6352@zim.MIT.EDU> Mail-Followup-To: Steve Kargl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100612180556.GA57369@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100612180556.GA57369@troutmask.apl.washington.edu> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 19:14:20 -0000 On Sat, Jun 12, 2010, Steve Kargl wrote: > On Sat, Jun 12, 2010 at 05:32:05PM +0000, David Schultz wrote: > > Author: das > > Date: Sat Jun 12 17:32:05 2010 > > New Revision: 209110 > > URL: http://svn.freebsd.org/changeset/base/209110 > > > > Log: > > Introduce __isnanf() as an alias for isnanf(), and make the isnan() > > macro expand to __isnanf() instead of isnanf() for float arguments. > > This change is needed because isnanf() isn't declared in strict POSIX > > or C99 mode. > > > > Compatibility note: Apps using isnan(float) that are compiled after > > this change won't link against an older libm. > > > > Does this then mean that libm's version number needs to be bumped? It shouldn't. Compiling an app under one release and running it on an earlier release isn't supported. (In the Linux world, a new symbol would be a minor version bump and you'd need at least that version. In Solaris, pvs(1) would tell you what releases your app works with.) From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 19:32:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0A5C1065678; Sat, 12 Jun 2010 19:32:52 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C79318FC17; Sat, 12 Jun 2010 19:32:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CJWqrv092650; Sat, 12 Jun 2010 19:32:52 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CJWq0J092649; Sat, 12 Jun 2010 19:32:52 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201006121932.o5CJWq0J092649@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 12 Jun 2010 19:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209112 - head/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 19:32:53 -0000 Author: gavin Date: Sat Jun 12 19:32:52 2010 New Revision: 209112 URL: http://svn.freebsd.org/changeset/base/209112 Log: These files are no longer required since r207607 Deleted: head/usr.bin/tftp/extern.h head/usr.bin/tftp/tftpsubs.c head/usr.bin/tftp/tftpsubs.h From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 21:14:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82E2A1065677; Sat, 12 Jun 2010 21:14:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58CAE8FC0C; Sat, 12 Jun 2010 21:14:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CLENmx015049; Sat, 12 Jun 2010 21:14:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CLENg9015047; Sat, 12 Jun 2010 21:14:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006122114.o5CLENg9015047@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 12 Jun 2010 21:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209114 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 21:14:23 -0000 Author: nwhitehorn Date: Sat Jun 12 21:14:22 2010 New Revision: 209114 URL: http://svn.freebsd.org/changeset/base/209114 Log: Make SMP work on MPC7400-based Apple desktops like the PowerMac3,3. Modified: head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/aim/platform_chrp.c Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Sat Jun 12 20:08:01 2010 (r209113) +++ head/sys/powerpc/aim/mp_cpudep.c Sat Jun 12 21:14:22 2010 (r209114) @@ -75,9 +75,21 @@ cpudep_ap_bootstrap(void) } static register_t -mpc745x_l2_enable(register_t l2cr_config) +mpc74xx_l2_enable(register_t l2cr_config) { - register_t ccr; + register_t ccr, bit; + uint16_t vers; + + vers = mfpvr() >> 16; + switch (vers) { + case MPC7400: + case MPC7410: + bit = L2CR_L2IP; + break; + default: + bit = L2CR_L2I; + break; + } ccr = mfspr(SPR_L2CR); if (ccr & L2CR_L2E) @@ -88,7 +100,7 @@ mpc745x_l2_enable(register_t l2cr_config mtspr(SPR_L2CR, ccr | L2CR_L2I); do { ccr = mfspr(SPR_L2CR); - } while (ccr & L2CR_L2I); + } while (ccr & bit); powerpc_sync(); mtspr(SPR_L2CR, l2cr_config); powerpc_sync(); @@ -129,7 +141,7 @@ mpc745x_l3_enable(register_t l3cr_config } static register_t -mpc745x_l1d_enable(void) +mpc74xx_l1d_enable(void) { register_t hid; @@ -147,7 +159,7 @@ mpc745x_l1d_enable(void) } static register_t -mpc745x_l1i_enable(void) +mpc74xx_l1i_enable(void) { register_t hid; @@ -267,9 +279,9 @@ cpudep_ap_setup() mtspr(SPR_HID0, bsp_state[0]); isync(); mtspr(SPR_HID1, bsp_state[1]); isync(); - reg = mpc745x_l2_enable(bsp_state[2]); - reg = mpc745x_l1d_enable(); - reg = mpc745x_l1i_enable(); + reg = mpc74xx_l2_enable(bsp_state[2]); + reg = mpc74xx_l1d_enable(); + reg = mpc74xx_l1i_enable(); break; default: Modified: head/sys/powerpc/aim/platform_chrp.c ============================================================================== --- head/sys/powerpc/aim/platform_chrp.c Sat Jun 12 20:08:01 2010 (r209113) +++ head/sys/powerpc/aim/platform_chrp.c Sat Jun 12 21:14:22 2010 (r209114) @@ -228,8 +228,26 @@ chrp_smp_start_cpu(platform_t plat, stru cpu = pc->pc_hwref; res = OF_getprop(cpu, "soft-reset", &reset, sizeof(reset)); - if (res < 0) - return (ENXIO); + if (res < 0) { + reset = 0x58; + + switch (pc->pc_cpuid) { + case 0: + reset += 0x03; + break; + case 1: + reset += 0x04; + break; + case 2: + reset += 0x0f; + break; + case 4: + reset += 0x10; + break; + default: + return (ENXIO); + } + } ap_pcpu = pc; @@ -239,10 +257,12 @@ chrp_smp_start_cpu(platform_t plat, stru rstvec = rstvec_virtbase + reset; *rstvec = 4; + powerpc_sync(); (void)(*rstvec); powerpc_sync(); DELAY(1); *rstvec = 0; + powerpc_sync(); (void)(*rstvec); powerpc_sync(); From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 22:24:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF12E1065673; Sat, 12 Jun 2010 22:24:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE9E38FC14; Sat, 12 Jun 2010 22:24:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CMOdIO030490; Sat, 12 Jun 2010 22:24:39 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CMOdDw030488; Sat, 12 Jun 2010 22:24:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201006122224.o5CMOdDw030488@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 12 Jun 2010 22:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209115 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 22:24:39 -0000 Author: np Date: Sat Jun 12 22:24:39 2010 New Revision: 209115 URL: http://svn.freebsd.org/changeset/base/209115 Log: make format string a string literal. Reported by: clang Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Sat Jun 12 21:14:22 2010 (r209114) +++ head/sys/dev/cxgb/cxgb_main.c Sat Jun 12 22:24:39 2010 (r209115) @@ -980,7 +980,7 @@ cxgb_makedev(struct port_info *pi) { pi->port_cdev = make_dev(&cxgb_cdevsw, pi->ifp->if_dunit, - UID_ROOT, GID_WHEEL, 0600, if_name(pi->ifp)); + UID_ROOT, GID_WHEEL, 0600, "%s", if_name(pi->ifp)); if (pi->port_cdev == NULL) return (ENOMEM); From owner-svn-src-all@FreeBSD.ORG Sat Jun 12 22:33:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C222A1065675; Sat, 12 Jun 2010 22:33:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B113C8FC18; Sat, 12 Jun 2010 22:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CMX4R0032370; Sat, 12 Jun 2010 22:33:04 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CMX4Fc032367; Sat, 12 Jun 2010 22:33:04 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201006122233.o5CMX4Fc032367@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 12 Jun 2010 22:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209116 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 22:33:04 -0000 Author: np Date: Sat Jun 12 22:33:04 2010 New Revision: 209116 URL: http://svn.freebsd.org/changeset/base/209116 Log: cxgb(4): add knob to get packet timestamps from the hardware. The T3 ASIC can provide an incoming packet's timestamp instead of its RSS hash. The timestamp is just a counter running off the card's clock. With a 175MHz clock an increment represents ~5.7ns and the 32 bit value wraps around in ~25s. # sysctl -d dev.cxgbc.0.pkt_timestamp dev.cxgbc.0.pkt_timestamp: provide packet timestamp instead of connection hash # sysctl -d dev.cxgbc.0.core_clock dev.cxgbc.0.core_clock: core clock frequency (in KHz) # sysctl dev.cxgbc.0.core_clock dev.cxgbc.0.core_clock: 175000 Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Sat Jun 12 22:24:39 2010 (r209115) +++ head/sys/dev/cxgb/cxgb_adapter.h Sat Jun 12 22:33:04 2010 (r209116) @@ -388,6 +388,8 @@ struct adapter { char reglockbuf[ADAPTER_LOCK_NAME_LEN]; char mdiolockbuf[ADAPTER_LOCK_NAME_LEN]; char elmerlockbuf[ADAPTER_LOCK_NAME_LEN]; + + int timestamp; }; struct t3_rx_mode { Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Jun 12 22:24:39 2010 (r209115) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Jun 12 22:33:04 2010 (r209116) @@ -2961,6 +2961,7 @@ process_responses(adapter_t *adap, struc struct lro_ctrl *lro_ctrl = &qs->lro.ctrl; struct mbuf *offload_mbufs[RX_BUNDLE_SIZE]; int ngathered = 0; + struct t3_mbuf_hdr *mh = &rspq->rspq_mh; #ifdef DEBUG static int last_holdoff = 0; if (cxgb_debug && rspq->holdoff_tmr != last_holdoff) { @@ -2984,9 +2985,9 @@ process_responses(adapter_t *adap, struc if (cxgb_debug) printf("async notification\n"); - if (rspq->rspq_mh.mh_head == NULL) { - rspq->rspq_mh.mh_head = m_gethdr(M_DONTWAIT, MT_DATA); - m = rspq->rspq_mh.mh_head; + if (mh->mh_head == NULL) { + mh->mh_head = m_gethdr(M_DONTWAIT, MT_DATA); + m = mh->mh_head; } else { m = m_gethdr(M_DONTWAIT, MT_DATA); } @@ -3005,27 +3006,28 @@ process_responses(adapter_t *adap, struc DPRINTF("IMM DATA VALID opcode=0x%x rspq->cidx=%d\n", r->rss_hdr.opcode, rspq->cidx); - if (rspq->rspq_mh.mh_head == NULL) - rspq->rspq_mh.mh_head = m_gethdr(M_DONTWAIT, MT_DATA); + if (mh->mh_head == NULL) + mh->mh_head = m_gethdr(M_DONTWAIT, MT_DATA); else m = m_gethdr(M_DONTWAIT, MT_DATA); - if (rspq->rspq_mh.mh_head == NULL && m == NULL) { + if (mh->mh_head == NULL && m == NULL) { no_mem: rspq->next_holdoff = NOMEM_INTR_DELAY; budget_left--; break; } - get_imm_packet(adap, r, rspq->rspq_mh.mh_head); + get_imm_packet(adap, r, mh->mh_head); eop = 1; rspq->imm_data++; } else if (r->len_cq) { int drop_thresh = eth ? SGE_RX_DROP_THRES : 0; - eop = get_packet(adap, drop_thresh, qs, &rspq->rspq_mh, r); + eop = get_packet(adap, drop_thresh, qs, mh, r); if (eop) { - rspq->rspq_mh.mh_head->m_flags |= M_FLOWID; - rspq->rspq_mh.mh_head->m_pkthdr.flowid = rss_hash; + if (r->rss_hdr.hash_type && !adap->timestamp) + mh->mh_head->m_flags |= M_FLOWID; + mh->mh_head->m_pkthdr.flowid = rss_hash; } ethpad = 2; @@ -3050,20 +3052,20 @@ process_responses(adapter_t *adap, struc rspq->credits = 0; } if (!eth && eop) { - rspq->rspq_mh.mh_head->m_pkthdr.csum_data = rss_csum; + mh->mh_head->m_pkthdr.csum_data = rss_csum; /* * XXX size mismatch */ - m_set_priority(rspq->rspq_mh.mh_head, rss_hash); + m_set_priority(mh->mh_head, rss_hash); ngathered = rx_offload(&adap->tdev, rspq, - rspq->rspq_mh.mh_head, offload_mbufs, ngathered); - rspq->rspq_mh.mh_head = NULL; + mh->mh_head, offload_mbufs, ngathered); + mh->mh_head = NULL; DPRINTF("received offload packet\n"); } else if (eth && eop) { - struct mbuf *m = rspq->rspq_mh.mh_head; + struct mbuf *m = mh->mh_head; t3_rx_eth(adap, rspq, m, ethpad); @@ -3092,7 +3094,7 @@ process_responses(adapter_t *adap, struc struct ifnet *ifp = m->m_pkthdr.rcvif; (*ifp->if_input)(ifp, m); } - rspq->rspq_mh.mh_head = NULL; + mh->mh_head = NULL; } __refill_fl_lt(adap, &qs->fl[0], 32); @@ -3459,6 +3461,29 @@ t3_set_coalesce_usecs(SYSCTL_HANDLER_ARG return (0); } +static int +t3_pkt_timestamp(SYSCTL_HANDLER_ARGS) +{ + adapter_t *sc = arg1; + int rc, timestamp; + + if ((sc->flags & FULL_INIT_DONE) == 0) + return (ENXIO); + + timestamp = sc->timestamp; + rc = sysctl_handle_int(oidp, ×tamp, arg2, req); + + if (rc != 0) + return (rc); + + if (timestamp != sc->timestamp) { + t3_set_reg_field(sc, A_TP_PC_CONFIG2, F_ENABLERXPKTTMSTPRSS, + timestamp ? F_ENABLERXPKTTMSTPRSS : 0); + sc->timestamp = timestamp; + } + + return (0); +} void t3_add_attach_sysctls(adapter_t *sc) @@ -3493,6 +3518,10 @@ t3_add_attach_sysctls(adapter_t *sc) "txq_overrun", CTLFLAG_RD, &txq_fills, 0, "#times txq overrun"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "core_clock", + CTLFLAG_RD, &sc->params.vpd.cclk, + 0, "core clock frequency (in KHz)"); } @@ -3537,6 +3566,12 @@ t3_add_configured_sysctls(adapter_t *sc) 0, t3_set_coalesce_usecs, "I", "interrupt coalescing timer (us)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "pkt_timestamp", + CTLTYPE_INT | CTLFLAG_RW, sc, + 0, t3_pkt_timestamp, + "I", "provide packet timestamp instead of connection hash"); + for (i = 0; i < sc->params.nports; i++) { struct port_info *pi = &sc->port[i]; struct sysctl_oid *poid;