From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 01:05: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 AC43A1065674; Sun, 24 Oct 2010 01:05:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AF3D8FC17; Sun, 24 Oct 2010 01:05: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 o9O15A18007323; Sun, 24 Oct 2010 01:05:10 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9O15Am1007321; Sun, 24 Oct 2010 01:05:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201010240105.o9O15Am1007321@svn.freebsd.org> From: Ed Maste Date: Sun, 24 Oct 2010 01:05: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: r214256 - head/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 01:05:10 -0000 Author: emaste Date: Sun Oct 24 01:05:10 2010 New Revision: 214256 URL: http://svn.freebsd.org/changeset/base/214256 Log: Move variable declarations into the conditional block where they are used, to fix warning if WITH_SSL is not set. Submitted by: Sean Bruno MFC after: 1 week Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Sat Oct 23 22:28:29 2010 (r214255) +++ head/lib/libfetch/common.c Sun Oct 24 01:05:10 2010 (r214256) @@ -321,9 +321,9 @@ fetch_connect(const char *host, int port int fetch_ssl(conn_t *conn, int verbose) { +#ifdef WITH_SSL int ret, ssl_err; -#ifdef WITH_SSL /* Init the SSL library and context */ if (!SSL_library_init()){ fprintf(stderr, "SSL library init failed\n"); From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 02:59: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 2A3A2106564A; Sun, 24 Oct 2010 02:59:03 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184FE8FC0A; Sun, 24 Oct 2010 02:59: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 o9O2x2HG011920; Sun, 24 Oct 2010 02:59:02 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9O2x2CE011918; Sun, 24 Oct 2010 02:59:02 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201010240259.o9O2x2CE011918@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 24 Oct 2010 02:59: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: r214257 - head/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 02:59:03 -0000 Author: nyan Date: Sun Oct 24 02:59:02 2010 New Revision: 214257 URL: http://svn.freebsd.org/changeset/base/214257 Log: MFi386: revision 214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Modified: head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Sun Oct 24 01:05:10 2010 (r214256) +++ head/sys/boot/pc98/boot2/boot2.c Sun Oct 24 02:59:02 2010 (r214257) @@ -485,7 +485,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -522,7 +522,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 03:20: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 59A76106564A; Sun, 24 Oct 2010 03:20:55 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C6D08FC1A; Sun, 24 Oct 2010 03:20: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 o9O3KtQ5014106; Sun, 24 Oct 2010 03:20:55 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9O3KtCM014104; Sun, 24 Oct 2010 03:20:55 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201010240320.o9O3KtCM014104@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 24 Oct 2010 03:20:55 +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: r214258 - head/sys/pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 03:20:55 -0000 Author: nyan Date: Sun Oct 24 03:20:54 2010 New Revision: 214258 URL: http://svn.freebsd.org/changeset/base/214258 Log: MFi386: the part of revision 213226. Rewrite the i386 memory probe: - Move the base memory setup into a new basemem_setup() routine. MFC after: 1 week Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sun Oct 24 02:59:02 2010 (r214257) +++ head/sys/pc98/pc98/machdep.c Sun Oct 24 03:20:54 2010 (r214258) @@ -1776,52 +1776,13 @@ sdtossd(sd, ssd) ssd->ssd_gran = sd->sd_gran; } -/* - * Populate the (physmap) array with base/bound pairs describing the - * available physical memory in the system, then test this memory and - * build the phys_avail array describing the actually-available memory. - * - * If we cannot accurately determine the physical memory map, then use - * value from the 0xE801 call, and failing that, the RTC. - * - * Total memory size may be set by the kernel environment variable - * hw.physmem or the compile-time define MAXMEM. - * - * XXX first should be vm_paddr_t. - */ static void -getmemsize(int first) +basemem_setup(void) { - int i, off, physmap_idx, pa_indx, da_indx; - int pg_n; - u_long physmem_tunable; - u_int extmem; - u_int under16; - vm_paddr_t pa, physmap[PHYSMAP_SIZE]; + vm_paddr_t pa; pt_entry_t *pte; - quad_t dcons_addr, dcons_size; - - bzero(physmap, sizeof(physmap)); - - /* XXX - some of EPSON machines can't use PG_N */ - pg_n = PG_N; - if (pc98_machine_type & M_EPSON_PC98) { - switch (epson_machine_id) { -#ifdef WB_CACHE - default: -#endif - case EPSON_PC486_HX: - case EPSON_PC486_HG: - case EPSON_PC486_HA: - pg_n = 0; - break; - } - } + int i; - /* - * Perform "base memory" related probes & setup - */ - under16 = pc98_getmemsize(&basemem, &extmem); if (basemem > 640) { printf("Preposterous BIOS basemem of %uK, truncating to 640K\n", basemem); @@ -1853,12 +1814,62 @@ getmemsize(int first) pmap_kenter(KERNBASE + pa, pa); /* - * if basemem != 640, map pages r/w into vm86 page table so - * that the bios can scribble on it. + * Map pages between basemem and ISA_HOLE_START, if any, r/w into + * the vm86 page table so that vm86 can scribble on them using + * the vm86 map too. XXX: why 2 ways for this and only 1 way for + * page 0, at least as initialized here? */ pte = (pt_entry_t *)vm86paddr; for (i = basemem / 4; i < 160; i++) pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U; +} + +/* + * Populate the (physmap) array with base/bound pairs describing the + * available physical memory in the system, then test this memory and + * build the phys_avail array describing the actually-available memory. + * + * If we cannot accurately determine the physical memory map, then use + * value from the 0xE801 call, and failing that, the RTC. + * + * Total memory size may be set by the kernel environment variable + * hw.physmem or the compile-time define MAXMEM. + * + * XXX first should be vm_paddr_t. + */ +static void +getmemsize(int first) +{ + int off, physmap_idx, pa_indx, da_indx; + u_long physmem_tunable; + vm_paddr_t physmap[PHYSMAP_SIZE]; + pt_entry_t *pte; + quad_t dcons_addr, dcons_size; + int i; + int pg_n; + u_int extmem; + u_int under16; + vm_paddr_t pa; + + bzero(physmap, sizeof(physmap)); + + /* XXX - some of EPSON machines can't use PG_N */ + pg_n = PG_N; + if (pc98_machine_type & M_EPSON_PC98) { + switch (epson_machine_id) { +#ifdef WB_CACHE + default: +#endif + case EPSON_PC486_HX: + case EPSON_PC486_HG: + case EPSON_PC486_HA: + pg_n = 0; + break; + } + } + + under16 = pc98_getmemsize(&basemem, &extmem); + basemem_setup(); physmap[0] = 0; physmap[1] = basemem * 1024; From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 05:22: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 02629106566B; Sun, 24 Oct 2010 05:22:08 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4F448FC1E; Sun, 24 Oct 2010 05:22: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 o9O5M7ZQ018470; Sun, 24 Oct 2010 05:22:07 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9O5M780018468; Sun, 24 Oct 2010 05:22:07 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201010240522.o9O5M780018468@svn.freebsd.org> From: "Jayachandran C." Date: Sun, 24 Oct 2010 05:22: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: r214260 - head/lib/libc/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, 24 Oct 2010 05:22:08 -0000 Author: jchandra Date: Sun Oct 24 05:22:07 2010 New Revision: 214260 URL: http://svn.freebsd.org/changeset/base/214260 Log: Fix PIC_RETURN when abicalls are not defined. Submitted by: Artem Belevich (artemb at gmail dot com) Modified: head/lib/libc/mips/SYS.h Modified: head/lib/libc/mips/SYS.h ============================================================================== --- head/lib/libc/mips/SYS.h Sun Oct 24 04:38:56 2010 (r214259) +++ head/lib/libc/mips/SYS.h Sun Oct 24 05:22:07 2010 (r214260) @@ -91,7 +91,7 @@ #else # define PIC_PROLOGUE(x) # define PIC_TAILCALL(l) j _C_LABEL(l) -# define PIC_RETURN() +# define PIC_RETURN() j ra #endif /* __ABICALLS__ */ # define SYSTRAP(x) li v0,SYS_ ## x; syscall; From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 06:17: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 3E6931065672 for ; Sun, 24 Oct 2010 06:17:42 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id B4CCA8FC08 for ; Sun, 24 Oct 2010 06:17:41 +0000 (UTC) Received: (qmail 67844 invoked from network); 24 Oct 2010 06:05:13 -0000 Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 24 Oct 2010 06:05:13 -0000 Message-ID: <4CC3CF84.2050606@freebsd.org> Date: Sun, 24 Oct 2010 08:17:40 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201009172205.o8HM5RPG043265@svn.freebsd.org> <20101023131021.C66242@maildrop.int.zabbadoz.net> In-Reply-To: <20101023131021.C66242@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212803 - 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, 24 Oct 2010 06:17:42 -0000 On 23.10.2010 15:10, Bjoern A. Zeeb wrote: > On Fri, 17 Sep 2010, Andre Oppermann wrote: > >> Author: andre >> Date: Fri Sep 17 22:05:27 2010 >> New Revision: 212803 >> URL: http://svn.freebsd.org/changeset/base/212803 >> >> Log: >> Rearrange the TSO code to make it more readable and to clearly >> separate the decision logic, of whether we can do TSO, and the >> calculation of the burst length into two distinct parts. >> >> Change the way the TSO burst length calculation is done. While >> TSO could do bursts of 65535 bytes that can't be represented in >> ip_len together with the IP and TCP header. Account for that and >> use IP_MAXPACKET instead of TCP_MAXWIN as base constant (both >> have the same value of 64K). When more data is available prevent >> less than MSS sized segments from being sent during the current >> TSO burst. >> >> Add two more KASSERTs to ensure the integrity of the packets. >> >> Tested by: Ben Wilber >> MFC after: 10 days > > As this hasn't happned yet, please do not do. It breaks things. I'll > follow-up later as soon as I have more details. I was busied out after the EuroBSDCon DevSummit and didn't have have time to MFC. Incidentially I was planning on doing it today, but will hold off based on your request. The version currently in 8 certainly has a bug. For the one in head you are the first report. Others reported their all their issues to be fixed with this patch. Can you give an high level description of the problem you are seeing? A detailed description is not required to take a first look on whatever issue you may have. -- Andre > >> Modified: >> head/sys/netinet/tcp_output.c >> >> Modified: head/sys/netinet/tcp_output.c >> ============================================================================== >> --- head/sys/netinet/tcp_output.c Fri Sep 17 21:53:56 2010 (r212802) >> +++ head/sys/netinet/tcp_output.c Fri Sep 17 22:05:27 2010 (r212803) >> @@ -465,9 +465,8 @@ after_sack_rexmit: >> } >> >> /* >> - * Truncate to the maximum segment length or enable TCP Segmentation >> - * Offloading (if supported by hardware) and ensure that FIN is removed >> - * if the length no longer contains the last data byte. >> + * Decide if we can use TCP Segmentation Offloading (if supported by >> + * hardware). >> * >> * TSO may only be used if we are in a pure bulk sending state. The >> * presence of TCP-MD5, SACK retransmits, SACK advertizements and >> @@ -475,10 +474,6 @@ after_sack_rexmit: >> * (except for the sequence number) for all generated packets. This >> * makes it impossible to transmit any options which vary per generated >> * segment or packet. >> - * >> - * The length of TSO bursts is limited to TCP_MAXWIN. That limit and >> - * removal of FIN (if not already catched here) are handled later after >> - * the exact length of the TCP options are known. >> */ >> #ifdef IPSEC >> /* >> @@ -487,22 +482,15 @@ after_sack_rexmit: >> */ >> ipsec_optlen = ipsec_hdrsiz_tcp(tp); >> #endif >> - if (len > tp->t_maxseg) { >> - if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && >> - ((tp->t_flags & TF_SIGNATURE) == 0) && >> - tp->rcv_numsacks == 0 && sack_rxmit == 0 && >> - tp->t_inpcb->inp_options == NULL && >> - tp->t_inpcb->in6p_options == NULL >> + if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg && >> + ((tp->t_flags & TF_SIGNATURE) == 0) && >> + tp->rcv_numsacks == 0 && sack_rxmit == 0 && >> #ifdef IPSEC >> - && ipsec_optlen == 0 >> + ipsec_optlen == 0 && >> #endif >> - ) { >> - tso = 1; >> - } else { >> - len = tp->t_maxseg; >> - sendalot = 1; >> - } >> - } >> + tp->t_inpcb->inp_options == NULL && >> + tp->t_inpcb->in6p_options == NULL) >> + tso = 1; >> >> if (sack_rxmit) { >> if (SEQ_LT(p->rxmit + len, tp->snd_una + so->so_snd.sb_cc)) >> @@ -732,28 +720,53 @@ send: >> * bump the packet length beyond the t_maxopd length. >> * Clear the FIN bit because we cut off the tail of >> * the segment. >> - * >> - * When doing TSO limit a burst to TCP_MAXWIN minus the >> - * IP, TCP and Options length to keep ip->ip_len from >> - * overflowing. Prevent the last segment from being >> - * fractional thus making them all equal sized and set >> - * the flag to continue sending. TSO is disabled when >> - * IP options or IPSEC are present. >> */ >> if (len + optlen + ipoptlen > tp->t_maxopd) { >> flags &= ~TH_FIN; >> + >> if (tso) { >> - if (len > TCP_MAXWIN - hdrlen - optlen) { >> - len = TCP_MAXWIN - hdrlen - optlen; >> - len = len - (len % (tp->t_maxopd - optlen)); >> + KASSERT(ipoptlen == 0, >> + ("%s: TSO can't do IP options", __func__)); >> + >> + /* >> + * Limit a burst to IP_MAXPACKET minus IP, >> + * TCP and options length to keep ip->ip_len >> + * from overflowing. >> + */ >> + if (len > IP_MAXPACKET - hdrlen) { >> + len = IP_MAXPACKET - hdrlen; >> + sendalot = 1; >> + } >> + >> + /* >> + * Prevent the last segment from being >> + * fractional unless the send sockbuf can >> + * be emptied. >> + */ >> + if (sendalot && off + len < so->so_snd.sb_cc) { >> + len -= len % (tp->t_maxopd - optlen); >> sendalot = 1; >> - } else if (tp->t_flags & TF_NEEDFIN) >> + } >> + >> + /* >> + * Send the FIN in a separate segment >> + * after the bulk sending is done. >> + * We don't trust the TSO implementations >> + * to clear the FIN flag on all but the >> + * last segment. >> + */ >> + if (tp->t_flags & TF_NEEDFIN) >> sendalot = 1; >> + >> } else { >> len = tp->t_maxopd - optlen - ipoptlen; >> sendalot = 1; >> } >> - } >> + } else >> + tso = 0; >> + >> + KASSERT(len + hdrlen + ipoptlen <= IP_MAXPACKET, >> + ("%s: len > IP_MAXPACKET", __func__)); >> >> /*#ifdef DIAGNOSTIC*/ >> #ifdef INET6 >> @@ -1068,6 +1081,9 @@ send: >> m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen; >> } >> >> + KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), >> + ("%s: mbuf chain shorter than expected", __func__)); >> + >> /* >> * In transmit state, time the transmission and arrange for >> * the retransmit. In persist state, just set snd_max. >> > From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 08:17: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 36DE0106564A; Sun, 24 Oct 2010 08:17:23 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 35BEE8FC16; Sun, 24 Oct 2010 08:17:20 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA14191; Sun, 24 Oct 2010 11:17:19 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1P9vlX-000L6L-2E; Sun, 24 Oct 2010 11:17:19 +0300 Message-ID: <4CC3EB8E.9000701@freebsd.org> Date: Sun, 24 Oct 2010 11:17:18 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.11) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.5 MIME-Version: 1.0 To: Robert Watson References: <201010220846.o9M8kMEo020056@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: r214199 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 08:17:23 -0000 on 23/10/2010 13:05 Robert Watson said the following: > > On Fri, 22 Oct 2010, Andriy Gapon wrote: > >> +20101022: >> + A workaround for a fixed ld bug has been removed in kernel code, >> + so make sure that your system ld is built from sources after >> + revision 211583 (r210245 if building stable/8 kernel on head, >> + r211584 for stable/7). A symptom of incorrect ld version is >> + different addresses for set_pcpu section and __start_set_pcpu >> + symbol in kernel and/or modules. > > Since many of our users still rely on cvsup to update FreeBSD source, it might > be useful to provide rough date thresholds for the branches in addition to the > Subversion changeset numbers (which are less easy to deal with when checking out > with cvsup/cvs). Good point. Will do. Thank you! -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 09:14: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 1C9BB106564A; Sun, 24 Oct 2010 09:14:22 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E499D8FC1A; Sun, 24 Oct 2010 09:14: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 o9O9ELB9022929; Sun, 24 Oct 2010 09:14:21 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9O9ELh3022927; Sun, 24 Oct 2010 09:14:21 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201010240914.o9O9ELh3022927@svn.freebsd.org> From: Robert Watson Date: Sun, 24 Oct 2010 09:14: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: r214261 - head/tools/tools/syscall_timing X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 09:14:22 -0000 Author: rwatson Date: Sun Oct 24 09:14:21 2010 New Revision: 214261 URL: http://svn.freebsd.org/changeset/base/214261 Log: Add microbenchmark for create/unlink of a zero-byte file. Sponsored by: Google, Inc. MFC after: 2 weeks Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Sun Oct 24 05:22:07 2010 (r214260) +++ head/tools/tools/syscall_timing/syscall_timing.c Sun Oct 24 09:14:21 2010 (r214261) @@ -260,6 +260,34 @@ test_socketpair_dgram(uintmax_t num, uin } uintmax_t +test_create_unlink(uintmax_t num, uintmax_t int_arg, const char *path) +{ + uintmax_t i; + int fd; + + (void)unlink(path); + fd = open(path, O_RDWR | O_CREAT, 0600); + if (fd < 0) + err(-1, "test_create_unlink: create: %s", path); + close(fd); + if (unlink(path) < 0) + err(-1, "test_create_unlink: unlink: %s", path); + benchmark_start(); + for (i = 0; i < num; i++) { + if (alarm_fired) + break; + fd = open(path, O_RDWR | O_CREAT, 0600); + if (fd < 0) + err(-1, "test_create_unlink: create: %s", path); + close(fd); + if (unlink(path) < 0) + err(-1, "test_create_unlink: unlink: %s", path); + } + benchmark_stop(); + return (i); +} + +uintmax_t test_open_close(uintmax_t num, uintmax_t int_arg, const char *path) { uintmax_t i; @@ -292,7 +320,7 @@ test_read(uintmax_t num, uintmax_t int_a fd = open(path, O_RDONLY); if (fd < 0) - err(-1, "test_open_close: %s", path); + err(-1, "test_open_read: %s", path); (void)pread(fd, buf, int_arg, 0); benchmark_start(); @@ -315,7 +343,7 @@ test_open_read_close(uintmax_t num, uint fd = open(path, O_RDONLY); if (fd < 0) - err(-1, "test_open_close: %s", path); + err(-1, "test_open_read_close: %s", path); (void)read(fd, buf, int_arg); close(fd); @@ -325,7 +353,7 @@ test_open_read_close(uintmax_t num, uint break; fd = open(path, O_RDONLY); if (fd < 0) - err(-1, "test_open_close: %s", path); + err(-1, "test_open_read_close: %s", path); (void)read(fd, buf, int_arg); close(fd); } @@ -587,6 +615,7 @@ static const struct test tests[] = { { "socketpair_dgram", test_socketpair_dgram }, { "socket_tcp", test_socket_stream, .t_int = PF_INET }, { "socket_udp", test_socket_dgram, .t_int = PF_INET }, + { "create_unlink", test_create_unlink, .t_flags = FLAG_PATH }, { "open_close", test_open_close, .t_flags = FLAG_PATH }, { "open_read_close_1", test_open_read_close, .t_flags = FLAG_PATH, .t_int = 1 }, From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 11:37: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 D5945106564A; Sun, 24 Oct 2010 11:37:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C41B18FC0C; Sun, 24 Oct 2010 11:37: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 o9OBb1ZZ026780; Sun, 24 Oct 2010 11:37:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OBb12X026778; Sun, 24 Oct 2010 11:37:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010241137.o9OBb12X026778@svn.freebsd.org> From: Marius Strobl Date: Sun, 24 Oct 2010 11:37:01 +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: r214262 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 11:37:01 -0000 Author: marius Date: Sun Oct 24 11:37:01 2010 New Revision: 214262 URL: http://svn.freebsd.org/changeset/base/214262 Log: - Take advantage of mii_phy_dev_probe(). - Use mii_phy_add_media() instead of mii_add_media(). I'm not sure how this driver actually managed to work before as mii_add_media() is intended to be used to gether with mii_anar() while mii_phy_add_media() is intended to be used with mii_phy_setmedia(), however this driver mii_add_media() along with mii_phy_setmedia(). Modified: head/sys/dev/mii/smcphy.c Modified: head/sys/dev/mii/smcphy.c ============================================================================== --- head/sys/dev/mii/smcphy.c Sun Oct 24 09:14:21 2010 (r214261) +++ head/sys/dev/mii/smcphy.c Sun Oct 24 11:37:01 2010 (r214262) @@ -76,20 +76,16 @@ static driver_t smcphy_driver = { DRIVER_MODULE(smcphy, miibus, smcphy_driver, smcphy_devclass, 0, 0); +static const struct mii_phydesc smcphys[] = { + MII_PHY_DESC(SMSC, LAN83C183), + MII_PHY_END +}; + static int smcphy_probe(device_t dev) { - struct mii_attach_args *ma; - - ma = device_get_ivars(dev); - if (MII_OUI(ma->mii_id1, ma->mii_id2) != MII_OUI_SMSC || - MII_MODEL(ma->mii_id2) != MII_MODEL_SMSC_LAN83C183) - return (ENXIO); - - device_set_desc(dev, MII_STR_SMSC_LAN83C183); - - return (0); + return (mii_phy_dev_probe(dev, smcphys, BUS_PROBE_DEFAULT)); } static int @@ -111,7 +107,7 @@ smcphy_attach(device_t dev) sc->mii_service = smcphy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; + sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; if (smcphy_reset(sc) != 0) { device_printf(dev, "reset failed\n"); @@ -122,7 +118,7 @@ smcphy_attach(device_t dev) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); - mii_add_media(sc); + mii_phy_add_media(sc); printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 11:38: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 2B98B106566B; Sun, 24 Oct 2010 11:38:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3DE68FC08; Sun, 24 Oct 2010 11: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 o9OBcPH3026841; Sun, 24 Oct 2010 11:38:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OBcPi7026839; Sun, 24 Oct 2010 11:38:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010241138.o9OBcPi7026839@svn.freebsd.org> From: Marius Strobl Date: Sun, 24 Oct 2010 11: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: r214263 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 11:38:26 -0000 Author: marius Date: Sun Oct 24 11:38:25 2010 New Revision: 214263 URL: http://svn.freebsd.org/changeset/base/214263 Log: Take advantage of mii_phy_add_media()/mii_phy_setmedia(). Modified: head/sys/dev/mii/pnaphy.c Modified: head/sys/dev/mii/pnaphy.c ============================================================================== --- head/sys/dev/mii/pnaphy.c Sun Oct 24 11:37:01 2010 (r214262) +++ head/sys/dev/mii/pnaphy.c Sun Oct 24 11:38:25 2010 (r214263) @@ -102,7 +102,6 @@ pnaphy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; - const char *sep = ""; sc = device_get_softc(dev); ma = device_get_ivars(dev); @@ -116,29 +115,16 @@ pnaphy_attach(device_t dev) sc->mii_service = pnaphy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; - -#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) -#define PRINT(s) printf("%s%s", sep, s); sep = ", " + sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP | MIIF_IS_HPNA; mii_phy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_HPNA_1, 0, sc->mii_inst), 0); - PRINT("HomePNA"); - } - + mii_phy_add_media(sc); printf("\n"); -#undef ADD -#undef PRINT - MIIBUS_MEDIAINIT(sc->mii_dev); - return (0); } @@ -159,17 +145,11 @@ pnaphy_service(struct mii_softc *sc, str break; switch (IFM_SUBTYPE(ife->ifm_media)) { - case IFM_AUTO: - case IFM_10_T: - case IFM_100_TX: - case IFM_100_T4: - return (EINVAL); + case IFM_HPNA_1: + mii_phy_setmedia(sc); + break; default: - /* - * BMCR data is stored in the ifmedia entry. - */ - PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media)); - PHY_WRITE(sc, MII_BMCR, ife->ifm_data); + return (EINVAL); } break; @@ -182,7 +162,7 @@ pnaphy_service(struct mii_softc *sc, str /* Update the media status. */ ukphy_status(sc); if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T) - mii->mii_media_active = IFM_ETHER|IFM_HPNA_1; + mii->mii_media_active = IFM_ETHER | IFM_HPNA_1; /* Callback if something changed. */ mii_phy_update(sc, cmd); From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 12:51: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 530501065672; Sun, 24 Oct 2010 12:51:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FCA38FC19; Sun, 24 Oct 2010 12:51: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 o9OCp3sv028393; Sun, 24 Oct 2010 12:51:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OCp3wx028388; Sun, 24 Oct 2010 12:51:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010241251.o9OCp3wx028388@svn.freebsd.org> From: Marius Strobl Date: Sun, 24 Oct 2010 12:51: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: r214264 - in head/sys/dev: mii tl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 12:51:03 -0000 Author: marius Date: Sun Oct 24 12:51:02 2010 New Revision: 214264 URL: http://svn.freebsd.org/changeset/base/214264 Log: - Add IFM_10_2 and IFM_10_5 media via tlphy(4) only in case the respective interface also has such connectors. - In tl_attach() unify three different ways of obtaining the device and vendor IDs and remove the now obsolete tl_dinfo from tl_softc. - Given that tlphy(4) only handles the integrated PHYs of NICs driven by tl(4) make it only probe on the latter. - Switch mlphy(4) and tlphy(4) to use mii_phy_add_media()/mii_phy_setmedia(). - Simplify looking for the respective companion PHY in mlphy(4) and tlphy(4) by ignoring the native one by just comparing the device_t's directly rather than the device name. Modified: head/sys/dev/mii/mlphy.c head/sys/dev/mii/tlphy.c head/sys/dev/tl/if_tl.c head/sys/dev/tl/if_tlreg.h Modified: head/sys/dev/mii/mlphy.c ============================================================================== --- head/sys/dev/mii/mlphy.c Sun Oct 24 11:38:25 2010 (r214263) +++ head/sys/dev/mii/mlphy.c Sun Oct 24 12:51:02 2010 (r214264) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); struct mlphy_softc { struct mii_softc ml_mii; + device_t ml_dev; int ml_state; int ml_linked; }; @@ -96,6 +97,7 @@ static driver_t mlphy_driver = { DRIVER_MODULE(mlphy, miibus, mlphy_driver, mlphy_devclass, 0, 0); +static struct mii_softc *mlphy_find_other(struct mlphy_softc *); static int mlphy_service(struct mii_softc *, struct mii_data *, int); static void mlphy_reset(struct mii_softc *); static void mlphy_status(struct mii_softc *); @@ -105,10 +107,8 @@ mlphy_probe(dev) device_t dev; { struct mii_attach_args *ma; - device_t parent; ma = device_get_ivars(dev); - parent = device_get_parent(device_get_parent(dev)); /* * Micro Linear PHY reports oui == 0 model == 0 @@ -122,7 +122,8 @@ mlphy_probe(dev) * encountered the 6692 on an Olicom card with a ThunderLAN * controller chip. */ - if (strcmp(device_get_name(parent), "tl") != 0) + if (strcmp(device_get_name(device_get_parent(device_get_parent(dev))), + "tl") != 0) return (ENXIO); device_set_desc(dev, "Micro Linear 6692 media interface"); @@ -141,6 +142,7 @@ mlphy_attach(dev) msc = device_get_softc(dev); sc = &msc->ml_mii; + msc->ml_dev = dev; ma = device_get_ivars(dev); sc->mii_dev = device_get_parent(dev); mii = ma->mii_data; @@ -155,14 +157,15 @@ mlphy_attach(dev) #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), - BMCR_LOOP|BMCR_S100); + MII_MEDIA_100_TX); mii_phy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + /* Let the companion PHY (if any) only handle the media we don't. */ ma->mii_capmask = ~sc->mii_capabilities; device_printf(dev, " "); - mii_add_media(sc); + mii_phy_add_media(sc); printf("\n"); #undef ADD MIIBUS_MEDIAINIT(sc->mii_dev); @@ -170,20 +173,21 @@ mlphy_attach(dev) } static struct mii_softc * -mlphy_find_other(device_t mii) +mlphy_find_other(struct mlphy_softc *msc) { device_t *devlist; struct mii_softc *retval; int i, devs; retval = NULL; - if (device_get_children(mii, &devlist, &devs)) + if (device_get_children(msc->ml_mii.mii_dev, &devlist, &devs) != 0) return (NULL); - for (i = 0; i < devs; i++) - if (strcmp(device_get_name(devlist[i]), "mlphy")) { + for (i = 0; i < devs; i++) { + if (devlist[i] != msc->ml_dev) { retval = device_get_softc(devlist[i]); break; } + } free(devlist, M_TEMP); return (retval); } @@ -204,7 +208,7 @@ mlphy_service(xsc, mii, cmd) * See if there's another PHY on this bus with us. * If so, we may need it for 10Mbps modes. */ - other = mlphy_find_other(msc->ml_mii.mii_dev); + other = mlphy_find_other(msc); switch (cmd) { case MII_POLLSTAT: @@ -229,7 +233,7 @@ mlphy_service(xsc, mii, cmd) mii_phy_reset(other); PHY_WRITE(other, MII_BMCR, BMCR_ISO); } - (void) mii_phy_auto(sc); + (void)mii_phy_auto(sc); msc->ml_linked = 0; return (0); case IFM_10_T: @@ -246,8 +250,7 @@ mlphy_service(xsc, mii, cmd) mii_phy_reset(other); PHY_WRITE(other, MII_BMCR, ife->ifm_data); } - PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media)); - PHY_WRITE(sc, MII_BMCR, ife->ifm_data); + mii_phy_setmedia(sc); msc->ml_state = 0; break; case IFM_100_TX: @@ -262,17 +265,11 @@ mlphy_service(xsc, mii, cmd) mii_phy_reset(other); PHY_WRITE(other, MII_BMCR, BMCR_ISO); } - PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media)); - PHY_WRITE(sc, MII_BMCR, ife->ifm_data); + mii_phy_setmedia(sc); msc->ml_state = 0; break; - case IFM_100_T4: - /* - * XXX Not supported as a manual setting right now. - */ - return (EINVAL); default: - break; + return (EINVAL); } break; @@ -381,7 +378,7 @@ mlphy_status(sc) struct mii_softc *other = NULL; /* See if there's another PHY on the bus with us. */ - other = mlphy_find_other(msc->ml_mii.mii_dev); + other = mlphy_find_other(msc); if (other == NULL) return; Modified: head/sys/dev/mii/tlphy.c ============================================================================== --- head/sys/dev/mii/tlphy.c Sun Oct 24 11:38:25 2010 (r214263) +++ head/sys/dev/mii/tlphy.c Sun Oct 24 12:51:02 2010 (r214264) @@ -124,6 +124,9 @@ static int tlphy_probe(device_t dev) { + if (strcmp(device_get_name(device_get_parent(device_get_parent(dev))), + "tl") != 0) + return (ENXIO); return (mii_phy_dev_probe(dev, tlphys, BUS_PROBE_DEFAULT)); } @@ -150,11 +153,17 @@ tlphy_attach(device_t dev) sc->sc_mii.mii_service = tlphy_service; sc->sc_mii.mii_pdata = mii; + /* + * Note that if we're on a device that also supports 100baseTX, + * we are not going to want to use the built-in 10baseT port, + * since there will be another PHY on the MII wired up to the + * UTP connector. + */ capmask = BMSR_DEFCAPMASK; if (mii->mii_instance && device_get_children(sc->sc_mii.mii_dev, &devlist, &devs) == 0) { for (i = 0; i < devs; i++) { - if (strcmp(device_get_name(devlist[i]), "tlphy")) { + if (devlist[i] != dev) { other = device_get_softc(devlist[i]); capmask &= ~other->mii_capabilities; break; @@ -167,38 +176,36 @@ tlphy_attach(device_t dev) mii_phy_reset(&sc->sc_mii); - /* - * Note that if we're on a device that also supports 100baseTX, - * we are not going to want to use the built-in 10baseT port, - * since there will be another PHY on the MII wired up to the - * UTP connector. The parent indicates this to us by specifying - * the TLPHY_MEDIA_NO_10_T bit. - */ sc->sc_mii.mii_capabilities = PHY_READ(&sc->sc_mii, MII_BMSR) & capmask; #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->sc_mii.mii_inst), - BMCR_ISO); - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_LOOP, - sc->sc_mii.mii_inst), BMCR_LOOP); + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_LOOP, sc->sc_mii.mii_inst), + MII_MEDIA_100_TX); #define PRINT(s) printf("%s%s", sep, s); sep = ", " - device_printf(dev, " "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_2, 0, sc->sc_mii.mii_inst), 0); - PRINT("10base2/BNC"); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, sc->sc_mii.mii_inst), 0); - PRINT("10base5/AUI"); - - if (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) { + if ((sc->sc_mii.mii_flags & (MIIF_MACPRIV0 | MIIF_MACPRIV1)) != 0 && + (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) != 0) + device_printf(dev, " "); + if ((sc->sc_mii.mii_flags & MIIF_MACPRIV0) != 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_2, 0, sc->sc_mii.mii_inst), + 0); + PRINT("10base2/BNC"); + } + if ((sc->sc_mii.mii_flags & MIIF_MACPRIV1) != 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, sc->sc_mii.mii_inst), + 0); + PRINT("10base5/AUI"); + } + if ((sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) != 0) { printf("%s", sep); - mii_add_media(&sc->sc_mii); + mii_phy_add_media(&sc->sc_mii); } - - printf("\n"); + if ((sc->sc_mii.mii_flags & (MIIF_MACPRIV0 | MIIF_MACPRIV1)) != 0 && + (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) != 0) + printf("\n"); #undef ADD #undef PRINT MIIBUS_MEDIAINIT(sc->sc_mii.mii_dev); @@ -233,7 +240,7 @@ tlphy_service(struct mii_softc *self, st * an autonegotiation cycle, so there's no such * thing as "already in auto mode". */ - (void) tlphy_auto(sc); + (void)tlphy_auto(sc); break; case IFM_10_2: case IFM_10_5: @@ -244,9 +251,7 @@ tlphy_service(struct mii_softc *self, st default: PHY_WRITE(&sc->sc_mii, MII_TLPHY_CTRL, 0); DELAY(100000); - PHY_WRITE(&sc->sc_mii, MII_ANAR, - mii_anar(ife->ifm_media)); - PHY_WRITE(&sc->sc_mii, MII_BMCR, ife->ifm_data); + mii_phy_setmedia(&sc->sc_mii); } break; @@ -283,7 +288,7 @@ tlphy_service(struct mii_softc *self, st sc->sc_mii.mii_ticks = 0; mii_phy_reset(&sc->sc_mii); - tlphy_auto(sc); + (void)tlphy_auto(sc); return (0); } Modified: head/sys/dev/tl/if_tl.c ============================================================================== --- head/sys/dev/tl/if_tl.c Sun Oct 24 11:38:25 2010 (r214263) +++ head/sys/dev/tl/if_tl.c Sun Oct 24 12:51:02 2010 (r214264) @@ -1104,12 +1104,11 @@ static int tl_attach(dev) device_t dev; { - int i; u_int16_t did, vid; struct tl_type *t; struct ifnet *ifp; struct tl_softc *sc; - int unit, error = 0, rid; + int error, flags, i, rid, unit; u_char eaddr[6]; vid = pci_get_vendor(dev); @@ -1207,10 +1206,9 @@ tl_attach(dev) bzero(sc->tl_ldata, sizeof(struct tl_list_data)); - sc->tl_dinfo = t; - if (t->tl_vid == COMPAQ_VENDORID || t->tl_vid == TI_VENDORID) + if (vid == COMPAQ_VENDORID || vid == TI_VENDORID) sc->tl_eeaddr = TL_EEPROM_EADDR; - if (t->tl_vid == OLICOM_VENDORID) + if (vid == OLICOM_VENDORID) sc->tl_eeaddr = TL_EEPROM_EADDR_OC; /* Reset the adapter. */ @@ -1241,7 +1239,7 @@ tl_attach(dev) * word. To make things even more confusing, neither 00:00:28 * nor 00:00:24 appear in the IEEE OUI database. */ - if (sc->tl_dinfo->tl_vid == OLICOM_VENDORID) { + if (vid == OLICOM_VENDORID) { for (i = 0; i < ETHER_ADDR_LEN; i += 2) { u_int16_t *p; p = (u_int16_t *)&eaddr[i]; @@ -1279,6 +1277,20 @@ tl_attach(dev) * XXX mii_attach() can fail for reason different than * no PHYs found! */ + flags = 0; + if (vid == COMPAQ_VENDORID) { + if (did == COMPAQ_DEVICEID_NETEL_10_100_PROLIANT || + did == COMPAQ_DEVICEID_NETFLEX_3P_INTEGRATED || + did == COMPAQ_DEVICEID_NETFLEX_3P_BNC || + did == COMPAQ_DEVICEID_NETEL_10_T2_UTP_COAX) + flags |= MIIF_MACPRIV0; + if (did == COMPAQ_DEVICEID_NETEL_10 || + did == COMPAQ_DEVICEID_NETEL_10_100_DUAL || + did == COMPAQ_DEVICEID_NETFLEX_3P || + did == COMPAQ_DEVICEID_NETEL_10_100_EMBEDDED) + flags |= MIIF_MACPRIV1; + } else if (vid == OLICOM_VENDORID && did == OLICOM_DEVICEID_OC2183) + flags |= MIIF_MACPRIV0 | MIIF_MACPRIV1; if (mii_attach(dev, &sc->tl_miibus, ifp, tl_ifmedia_upd, tl_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0)) { struct ifmedia *ifm; Modified: head/sys/dev/tl/if_tlreg.h ============================================================================== --- head/sys/dev/tl/if_tlreg.h Sun Oct 24 11:38:25 2010 (r214263) +++ head/sys/dev/tl/if_tlreg.h Sun Oct 24 12:51:02 2010 (r214264) @@ -116,7 +116,6 @@ struct tl_softc { struct resource *tl_irq; struct resource *tl_res; device_t tl_miibus; - struct tl_type *tl_dinfo; /* ThunderLAN adapter info */ u_int8_t tl_eeaddr; struct tl_list_data *tl_ldata; /* TX/RX lists and mbufs */ struct tl_chain_data tl_cdata; From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 12:59: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 281D11065670; Sun, 24 Oct 2010 12:59:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 161078FC0C; Sun, 24 Oct 2010 12:59: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 o9OCxhFn028602; Sun, 24 Oct 2010 12:59:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OCxhqu028599; Sun, 24 Oct 2010 12:59:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010241259.o9OCxhqu028599@svn.freebsd.org> From: Marius Strobl Date: Sun, 24 Oct 2010 12:59: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: r214265 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 12:59:44 -0000 Author: marius Date: Sun Oct 24 12:59:43 2010 New Revision: 214265 URL: http://svn.freebsd.org/changeset/base/214265 Log: - Given that as of r214264 all PHY drivers using mii(4) finally have been converted to use the mii_phy_add_media()/mii_phy_setmedia() pair instead of mii_add_media()/mii_anar() remove the latter. - Declare mii_media mii_media_table static as it shouldn't be used outside of mii_physubr.c. MFC after: never Modified: head/sys/dev/mii/mii_physubr.c head/sys/dev/mii/miivar.h Modified: head/sys/dev/mii/mii_physubr.c ============================================================================== --- head/sys/dev/mii/mii_physubr.c Sun Oct 24 12:51:02 2010 (r214264) +++ head/sys/dev/mii/mii_physubr.c Sun Oct 24 12:59:43 2010 (r214265) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); /* * Media to register setting conversion table. Order matters. */ -const struct mii_media mii_media_table[MII_NMEDIA] = { +static const struct mii_media mii_media_table[MII_NMEDIA] = { /* None */ { BMCR_ISO, ANAR_CSMA, 0, }, @@ -287,99 +287,6 @@ mii_phy_update(struct mii_softc *sc, int } /* - * Given an ifmedia word, return the corresponding ANAR value. - */ -int -mii_anar(int media) -{ - int rv; - - switch (media & (IFM_TMASK|IFM_NMASK|IFM_FDX)) { - case IFM_ETHER|IFM_10_T: - rv = ANAR_10|ANAR_CSMA; - break; - case IFM_ETHER|IFM_10_T|IFM_FDX: - rv = ANAR_10_FD|ANAR_CSMA; - break; - case IFM_ETHER|IFM_100_TX: - rv = ANAR_TX|ANAR_CSMA; - break; - case IFM_ETHER|IFM_100_TX|IFM_FDX: - rv = ANAR_TX_FD|ANAR_CSMA; - break; - case IFM_ETHER|IFM_100_T4: - rv = ANAR_T4|ANAR_CSMA; - break; - default: - rv = 0; - break; - } - - return (rv); -} - -/* - * Initialize generic PHY media based on BMSR, called when a PHY is - * attached. We expect to be set up to print a comma-separated list - * of media names. Does not print a newline. - */ -void -mii_add_media(struct mii_softc *sc) -{ - struct mii_data *mii = sc->mii_pdata; - const char *sep = ""; - - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) { - printf("no media present"); - return; - } - -#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) -#define PRINT(s) printf("%s%s", sep, s); sep = ", " - - if (sc->mii_capabilities & BMSR_10THDX) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), 0); - PRINT("10baseT"); - } - if (sc->mii_capabilities & BMSR_10TFDX) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), - BMCR_FDX); - PRINT("10baseT-FDX"); - } - if (sc->mii_capabilities & BMSR_100TXHDX) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), - BMCR_S100); - PRINT("100baseTX"); - } - if (sc->mii_capabilities & BMSR_100TXFDX) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), - BMCR_S100|BMCR_FDX); - PRINT("100baseTX-FDX"); - } - if (sc->mii_capabilities & BMSR_100T4) { - /* - * XXX How do you enable 100baseT4? I assume we set - * XXX BMCR_S100 and then assume the PHYs will take - * XXX watever action is necessary to switch themselves - * XXX into T4 mode. - */ - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_T4, 0, sc->mii_inst), - BMCR_S100); - PRINT("100baseT4"); - } - if (sc->mii_capabilities & BMSR_ANEG) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), - BMCR_AUTOEN); - PRINT("auto"); - } - - - -#undef ADD -#undef PRINT -} - -/* * Initialize generic PHY media based on BMSR, called when a PHY is * attached. We expect to be set up to print a comma-separated list * of media names. Does not print a newline. Modified: head/sys/dev/mii/miivar.h ============================================================================== --- head/sys/dev/mii/miivar.h Sun Oct 24 12:51:02 2010 (r214264) +++ head/sys/dev/mii/miivar.h Sun Oct 24 12:59:43 2010 (r214265) @@ -227,12 +227,10 @@ int miibus_detach(device_t); int mii_attach(device_t, device_t *, struct ifnet *, ifm_change_cb_t, ifm_stat_cb_t, int, int, int, int); -int mii_anar(int); void mii_down(struct mii_data *); int mii_mediachg(struct mii_data *); void mii_tick(struct mii_data *); void mii_pollstat(struct mii_data *); -void mii_add_media(struct mii_softc *); void mii_phy_add_media(struct mii_softc *); int mii_phy_auto(struct mii_softc *); From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 13:20:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id BAD3F106566B; Sun, 24 Oct 2010 13:20:17 +0000 (UTC) Date: Sun, 24 Oct 2010 13:20:17 +0000 From: Alexander Best To: Robert Watson Message-ID: <20101024132017.GA77378@freebsd.org> References: <201010240914.o9O9ELh3022927@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010240914.o9O9ELh3022927@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214261 - head/tools/tools/syscall_timing X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 13:20:17 -0000 On Sun Oct 24 10, Robert Watson wrote: > Author: rwatson > Date: Sun Oct 24 09:14:21 2010 > New Revision: 214261 > URL: http://svn.freebsd.org/changeset/base/214261 > > Log: > Add microbenchmark for create/unlink of a zero-byte file. clang still complaining: syscall_timing.c:766:24: warning: conversion specifies type 'int' but the argument has type 'uintmax_t' (aka 'unsigned long') [-Wformat] printf("%ju.%09ju\t%d\t", (uintmax_t)ts_end.tv_sec, ~^ %lu 1 warning generated. cheers. alex > > Sponsored by: Google, Inc. > MFC after: 2 weeks > > Modified: > head/tools/tools/syscall_timing/syscall_timing.c > > Modified: head/tools/tools/syscall_timing/syscall_timing.c > ============================================================================== > --- head/tools/tools/syscall_timing/syscall_timing.c Sun Oct 24 05:22:07 2010 (r214260) > +++ head/tools/tools/syscall_timing/syscall_timing.c Sun Oct 24 09:14:21 2010 (r214261) > @@ -260,6 +260,34 @@ test_socketpair_dgram(uintmax_t num, uin > } > > uintmax_t > +test_create_unlink(uintmax_t num, uintmax_t int_arg, const char *path) > +{ > + uintmax_t i; > + int fd; > + > + (void)unlink(path); > + fd = open(path, O_RDWR | O_CREAT, 0600); > + if (fd < 0) > + err(-1, "test_create_unlink: create: %s", path); > + close(fd); > + if (unlink(path) < 0) > + err(-1, "test_create_unlink: unlink: %s", path); > + benchmark_start(); > + for (i = 0; i < num; i++) { > + if (alarm_fired) > + break; > + fd = open(path, O_RDWR | O_CREAT, 0600); > + if (fd < 0) > + err(-1, "test_create_unlink: create: %s", path); > + close(fd); > + if (unlink(path) < 0) > + err(-1, "test_create_unlink: unlink: %s", path); > + } > + benchmark_stop(); > + return (i); > +} > + > +uintmax_t > test_open_close(uintmax_t num, uintmax_t int_arg, const char *path) > { > uintmax_t i; > @@ -292,7 +320,7 @@ test_read(uintmax_t num, uintmax_t int_a > > fd = open(path, O_RDONLY); > if (fd < 0) > - err(-1, "test_open_close: %s", path); > + err(-1, "test_open_read: %s", path); > (void)pread(fd, buf, int_arg, 0); > > benchmark_start(); > @@ -315,7 +343,7 @@ test_open_read_close(uintmax_t num, uint > > fd = open(path, O_RDONLY); > if (fd < 0) > - err(-1, "test_open_close: %s", path); > + err(-1, "test_open_read_close: %s", path); > (void)read(fd, buf, int_arg); > close(fd); > > @@ -325,7 +353,7 @@ test_open_read_close(uintmax_t num, uint > break; > fd = open(path, O_RDONLY); > if (fd < 0) > - err(-1, "test_open_close: %s", path); > + err(-1, "test_open_read_close: %s", path); > (void)read(fd, buf, int_arg); > close(fd); > } > @@ -587,6 +615,7 @@ static const struct test tests[] = { > { "socketpair_dgram", test_socketpair_dgram }, > { "socket_tcp", test_socket_stream, .t_int = PF_INET }, > { "socket_udp", test_socket_dgram, .t_int = PF_INET }, > + { "create_unlink", test_create_unlink, .t_flags = FLAG_PATH }, > { "open_close", test_open_close, .t_flags = FLAG_PATH }, > { "open_read_close_1", test_open_read_close, .t_flags = FLAG_PATH, > .t_int = 1 }, -- a13x From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 13:39: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 A849B1065695; Sun, 24 Oct 2010 13:39:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 943128FC1C; Sun, 24 Oct 2010 13:39: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 o9ODdJQF029571; Sun, 24 Oct 2010 13:39:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ODdJp1029552; Sun, 24 Oct 2010 13:39:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010241339.o9ODdJp1029552@svn.freebsd.org> From: Marius Strobl Date: Sun, 24 Oct 2010 13:39:19 +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: r214266 - in stable/8/sys/dev: dc mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 13:39:19 -0000 Author: marius Date: Sun Oct 24 13:39:19 2010 New Revision: 214266 URL: http://svn.freebsd.org/changeset/base/214266 Log: MFC: r213364 - In the spirit of previous simplifications factor out the checks for a different PHY instance being selected and isolation out into the wrappers around the service methods rather than duplicating them over and over again (besides, a PHY driver shouldn't need to care about which instance it actually is). - Centralize the check for the need to isolate a non-zero PHY instance not supporting isolation in mii_mediachg() and just ignore it rather than panicing, which should sufficient given that a) things are likely to just work anyway if one doesn't plug in more than one port at a time and b) refusing to attach in this case just leaves us in a unknown but most likely also not exactly correct configuration (besides several drivers setting MIIF_NOISOLATE didn't care about these anyway, probably due to setting this flag for no real reason). - Minor fixes like removing unnecessary setting of sc->mii_anegticks, using sc->mii_anegticks instead of hardcoded values etc. Modified: stable/8/sys/dev/dc/dcphy.c stable/8/sys/dev/dc/pnphy.c stable/8/sys/dev/mii/acphy.c stable/8/sys/dev/mii/amphy.c stable/8/sys/dev/mii/atphy.c stable/8/sys/dev/mii/axphy.c stable/8/sys/dev/mii/bmtphy.c stable/8/sys/dev/mii/brgphy.c stable/8/sys/dev/mii/ciphy.c stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/mii/exphy.c stable/8/sys/dev/mii/gentbi.c stable/8/sys/dev/mii/icsphy.c stable/8/sys/dev/mii/inphy.c stable/8/sys/dev/mii/ip1000phy.c stable/8/sys/dev/mii/jmphy.c stable/8/sys/dev/mii/lxtphy.c stable/8/sys/dev/mii/mii.c stable/8/sys/dev/mii/mlphy.c stable/8/sys/dev/mii/nsgphy.c stable/8/sys/dev/mii/nsphy.c stable/8/sys/dev/mii/nsphyter.c stable/8/sys/dev/mii/pnaphy.c stable/8/sys/dev/mii/qsphy.c stable/8/sys/dev/mii/rgephy.c stable/8/sys/dev/mii/rlphy.c stable/8/sys/dev/mii/rlswitch.c stable/8/sys/dev/mii/ruephy.c stable/8/sys/dev/mii/smcphy.c stable/8/sys/dev/mii/tdkphy.c stable/8/sys/dev/mii/tlphy.c stable/8/sys/dev/mii/truephy.c stable/8/sys/dev/mii/ukphy.c stable/8/sys/dev/mii/xmphy.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) Modified: stable/8/sys/dev/dc/dcphy.c ============================================================================== --- stable/8/sys/dev/dc/dcphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/dc/dcphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -149,7 +149,7 @@ dcphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = dcphy_service; sc->mii_pdata = mii; @@ -159,8 +159,6 @@ dcphy_attach(device_t dev) */ sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; - mii->mii_instance++; - /*dcphy_reset(sc);*/ dc_sc = mii->mii_ifp->if_softc; CSR_WRITE_4(dc_sc, DC_10BTSTAT, 0); @@ -204,22 +202,10 @@ dcphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -276,12 +262,6 @@ dcphy_service(struct mii_softc *sc, stru case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/8/sys/dev/dc/pnphy.c ============================================================================== --- stable/8/sys/dev/dc/pnphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/dc/pnphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -132,7 +132,7 @@ pnphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = pnphy_service; sc->mii_pdata = mii; @@ -142,8 +142,6 @@ pnphy_attach(device_t dev) */ sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; - mii->mii_instance++; - sc->mii_capabilities = BMSR_100TXFDX | BMSR_100TXHDX | BMSR_10TFDX | BMSR_10THDX; sc->mii_capabilities &= ma->mii_capmask; @@ -162,22 +160,10 @@ pnphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -212,12 +198,6 @@ pnphy_service(struct mii_softc *sc, stru case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/8/sys/dev/mii/acphy.c ============================================================================== --- stable/8/sys/dev/mii/acphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/acphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -132,17 +132,14 @@ acphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = acphy_service; sc->mii_pdata = mii; - mii->mii_instance++; - acphy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) @@ -167,22 +164,8 @@ acphy_attach(device_t dev) static int acphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; - /* - * If we're not selected, then do nothing, just isolate and power - * down, if changing media. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - if (cmd == MII_MEDIACHG) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO | BMCR_PDOWN); - } - - return (0); - } - switch (cmd) { case MII_POLLSTAT: break; Modified: stable/8/sys/dev/mii/amphy.c ============================================================================== --- stable/8/sys/dev/mii/amphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/amphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -109,13 +109,11 @@ amphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = amphy_service; sc->mii_pdata = mii; - mii->mii_instance++; - #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) #if 0 @@ -125,8 +123,7 @@ amphy_attach(device_t dev) mii_phy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); mii_phy_add_media(sc); printf("\n"); @@ -138,30 +135,13 @@ amphy_attach(device_t dev) static int amphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -171,11 +151,6 @@ amphy_service(struct mii_softc *sc, stru break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/8/sys/dev/mii/atphy.c ============================================================================== --- stable/8/sys/dev/mii/atphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/atphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -113,13 +113,10 @@ atphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = atphy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS_GIGE; - - mii->mii_instance++; asc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); asc->mii_model = MII_MODEL(ma->mii_id2); @@ -138,7 +135,7 @@ atphy_attach(device_t dev) printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); - return(0); + return (0); } static int @@ -149,25 +146,10 @@ atphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - bmcr = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -225,12 +207,6 @@ done: case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/8/sys/dev/mii/axphy.c ============================================================================== --- stable/8/sys/dev/mii/axphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/axphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -99,12 +99,12 @@ axphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = axphy_service; sc->mii_pdata = mii; + sc->mii_flags |= MIIF_NOISOLATE; - mii->mii_instance++; mii_phy_reset(sc); @@ -122,22 +122,12 @@ axphy_attach(device_t dev) static int axphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; switch (cmd) { case MII_POLLSTAT: - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - /* * If the interface is not up, don't do anything. */ @@ -148,8 +138,6 @@ axphy_service(struct mii_softc *sc, stru break; case MII_TICK: - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/8/sys/dev/mii/bmtphy.c ============================================================================== --- stable/8/sys/dev/mii/bmtphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/bmtphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -147,17 +147,14 @@ bmtphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = bmtphy_service; sc->mii_pdata = mii; mii_phy_reset(sc); - mii->mii_instance++; - - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); mii_phy_add_media(sc); printf("\n"); @@ -170,32 +167,13 @@ bmtphy_attach(device_t dev) static int bmtphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife; - int reg; - - ife = mii->mii_media.ifm_cur; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -205,11 +183,6 @@ bmtphy_service(struct mii_softc *sc, str break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/brgphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -191,13 +191,17 @@ brgphy_attach(device_t dev) LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); /* Initialize mii_softc structure */ - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = brgphy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS_GIGE; + + /* + * At least some variants wedge when isolating, at least some also + * don't support loopback. + */ sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; - mii->mii_instance++; + sc->mii_anegticks = MII_ANEGTICKS_GIGE; /* Initialize brgphy_softc structure */ bsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); @@ -283,9 +287,6 @@ brgphy_attach(device_t dev) #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) - /* Create an instance of Ethernet media. */ - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst), BMCR_ISO); - /* Add the supported media types */ if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), @@ -345,26 +346,12 @@ brgphy_service(struct mii_softc *sc, str { struct brgphy_softc *bsc = (struct brgphy_softc *)sc; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int error = 0; int val; switch (cmd) { case MII_POLLSTAT: - /* If we're not polling our PHY instance, just return. */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - goto brgphy_service_exit; break; case MII_MEDIACHG: - /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - PHY_WRITE(sc, MII_BMCR, - PHY_READ(sc, MII_BMCR) | BMCR_ISO); - goto brgphy_service_exit; - } - /* If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; @@ -385,18 +372,13 @@ brgphy_service(struct mii_softc *sc, str mii->mii_ifp->if_flags & IFF_LINK0); break; default: - error = EINVAL; - goto brgphy_service_exit; + return (EINVAL); } break; case MII_TICK: - /* Bail if we're not currently selected. */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - goto brgphy_service_exit; - /* Bail if the interface isn't up. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - goto brgphy_service_exit; + return (0); /* Bail if autoneg isn't in process. */ @@ -465,8 +447,7 @@ brgphy_service(struct mii_softc *sc, str } } mii_phy_update(sc, cmd); -brgphy_service_exit: - return (error); + return (0); } @@ -1182,4 +1163,3 @@ brgphy_reset(struct mii_softc *sc) } } - Modified: stable/8/sys/dev/mii/ciphy.c ============================================================================== --- stable/8/sys/dev/mii/ciphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/ciphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -118,18 +118,16 @@ ciphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = ciphy_service; sc->mii_pdata = mii; sc->mii_flags |= MIIF_NOISOLATE; - mii->mii_instance++; ciphy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); device_printf(dev, " "); @@ -148,25 +146,10 @@ ciphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -239,12 +222,6 @@ setit: case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/e1000phy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -144,11 +144,10 @@ e1000phy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = e1000phy_service; sc->mii_pdata = mii; - mii->mii_instance++; esc->mii_model = MII_MODEL(ma->mii_id2); ifp = sc->mii_pdata->mii_ifp; @@ -322,25 +321,10 @@ e1000phy_service(struct mii_softc *sc, s switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, E1000_CR); - PHY_WRITE(sc, E1000_CR, reg | E1000_CR_ISOLATE); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -417,12 +401,6 @@ done: break; case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/8/sys/dev/mii/exphy.c ============================================================================== --- stable/8/sys/dev/mii/exphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/exphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -136,24 +136,16 @@ exphy_attach(device_t dev) ma = device_get_ivars(dev); sc->mii_dev = device_get_parent(dev); mii = ma->mii_data; - - /* - * The 3Com PHY can never be isolated, so never allow non-zero - * instances! - */ - if (mii->mii_instance != 0) { - device_printf(dev, "ignoring this PHY, non-zero instance\n"); - return (ENXIO); - } - LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = exphy_service; sc->mii_pdata = mii; - mii->mii_instance++; + /* + * The 3Com PHY can never be isolated. + */ sc->mii_flags |= MIIF_NOISOLATE; #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) @@ -163,8 +155,7 @@ exphy_attach(device_t dev) exphy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); mii_phy_add_media(sc); printf("\n"); @@ -176,13 +167,6 @@ exphy_attach(device_t dev) static int exphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - - /* - * We can't isolate the 3Com PHY, so it has to be the only one! - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - panic("exphy_service: can't isolate 3Com PHY"); switch (cmd) { case MII_POLLSTAT: Modified: stable/8/sys/dev/mii/gentbi.c ============================================================================== --- stable/8/sys/dev/mii/gentbi.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/gentbi.c Sun Oct 24 13:39:19 2010 (r214266) @@ -55,7 +55,7 @@ */ /* - * Driver for generic ten-bit (1000BASE-SX) interfaces, built in to + * Driver for generic ten-bit (1000BASE-SX) interfaces, built into * many Gigabit Ethernet chips. * * All we have to do here is correctly report speed and duplex. @@ -166,13 +166,11 @@ gentbi_attach(device_t dev) MII_OUI(ma->mii_id1, ma->mii_id2), MII_MODEL(ma->mii_id2), MII_REV(ma->mii_id2)); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = gentbi_service; sc->mii_pdata = mii; - mii->mii_instance++; - mii_phy_reset(sc); /* @@ -195,30 +193,13 @@ gentbi_attach(device_t dev) static int gentbi_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -228,12 +209,6 @@ gentbi_service(struct mii_softc *sc, str break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/8/sys/dev/mii/icsphy.c ============================================================================== --- stable/8/sys/dev/mii/icsphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/icsphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -141,14 +141,12 @@ icsphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = icsphy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS; - sc->mii_flags |= MIIF_NOISOLATE; - mii->mii_instance++; + sc->mii_flags |= MIIF_NOISOLATE; ifmedia_add(&mii->mii_media, IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), @@ -170,20 +168,6 @@ icsphy_attach(device_t dev) static int icsphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; - - /* - * If we're not selected, then do nothing, just isolate, if - * changing media. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - if (cmd == MII_MEDIACHG) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - } - return (0); - } switch (cmd) { case MII_POLLSTAT: Modified: stable/8/sys/dev/mii/inphy.c ============================================================================== --- stable/8/sys/dev/mii/inphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/inphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -107,11 +107,10 @@ inphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = inphy_service; sc->mii_pdata = mii; - mii->mii_instance++; ifmedia_add(&mii->mii_media, IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), @@ -132,22 +131,12 @@ inphy_attach(device_t dev) static int inphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; switch (cmd) { case MII_POLLSTAT: - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - /* * If the interface is not up, don't do anything. */ @@ -158,8 +147,6 @@ inphy_service(struct mii_softc *sc, stru break; case MII_TICK: - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/8/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/8/sys/dev/mii/ip1000phy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/ip1000phy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -114,13 +114,12 @@ ip1000phy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = ip1000phy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; - mii->mii_instance++; + sc->mii_flags |= MIIF_NOISOLATE; isc->model = MII_MODEL(ma->mii_id2); isc->revision = MII_REV(ma->mii_id2); @@ -135,7 +134,7 @@ ip1000phy_attach(device_t dev) printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); - return(0); + return (0); } static int @@ -146,26 +145,10 @@ ip1000phy_service(struct mii_softc *sc, switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, IP1000PHY_MII_BMCR); - PHY_WRITE(sc, IP1000PHY_MII_BMCR, - reg | IP1000PHY_BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) { @@ -237,11 +220,6 @@ done: case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/8/sys/dev/mii/jmphy.c ============================================================================== --- stable/8/sys/dev/mii/jmphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/jmphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -112,13 +112,11 @@ jmphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = jmphy_service; sc->mii_pdata = mii; - mii->mii_instance++; - jsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); jsc->mii_model = MII_MODEL(ma->mii_id2); jsc->mii_rev = MII_REV(ma->mii_id2); @@ -136,36 +134,20 @@ jmphy_attach(device_t dev) printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); - return(0); + return (0); } static int jmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - uint16_t bmcr; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - bmcr = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -177,12 +159,6 @@ jmphy_service(struct mii_softc *sc, stru case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/8/sys/dev/mii/lxtphy.c ============================================================================== --- stable/8/sys/dev/mii/lxtphy.c Sun Oct 24 12:59:43 2010 (r214265) +++ stable/8/sys/dev/mii/lxtphy.c Sun Oct 24 13:39:19 2010 (r214266) @@ -135,17 +135,14 @@ lxtphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = lxtphy_service; sc->mii_pdata = mii; - mii->mii_instance++; - mii_phy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); /* @@ -177,29 +174,13 @@ static int lxtphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 13:39: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 455321065693; Sun, 24 Oct 2010 13:39:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A98E8FC23; Sun, 24 Oct 2010 13:39: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 o9ODdRo9029626; Sun, 24 Oct 2010 13:39:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ODdQBa029607; Sun, 24 Oct 2010 13:39:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010241339.o9ODdQBa029607@svn.freebsd.org> From: Marius Strobl Date: Sun, 24 Oct 2010 13:39:26 +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: r214267 - in stable/7/sys/dev: dc mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 13:39:27 -0000 Author: marius Date: Sun Oct 24 13:39:26 2010 New Revision: 214267 URL: http://svn.freebsd.org/changeset/base/214267 Log: MFC: r213364 - In the spirit of previous simplifications factor out the checks for a different PHY instance being selected and isolation out into the wrappers around the service methods rather than duplicating them over and over again (besides, a PHY driver shouldn't need to care about which instance it actually is). - Centralize the check for the need to isolate a non-zero PHY instance not supporting isolation in mii_mediachg() and just ignore it rather than panicing, which should sufficient given that a) things are likely to just work anyway if one doesn't plug in more than one port at a time and b) refusing to attach in this case just leaves us in a unknown but most likely also not exactly correct configuration (besides several drivers setting MIIF_NOISOLATE didn't care about these anyway, probably due to setting this flag for no real reason). - Minor fixes like removing unnecessary setting of sc->mii_anegticks, using sc->mii_anegticks instead of hardcoded values etc. Modified: stable/7/sys/dev/dc/dcphy.c stable/7/sys/dev/dc/pnphy.c stable/7/sys/dev/mii/acphy.c stable/7/sys/dev/mii/amphy.c stable/7/sys/dev/mii/atphy.c stable/7/sys/dev/mii/bmtphy.c stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/ciphy.c stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/exphy.c stable/7/sys/dev/mii/gentbi.c stable/7/sys/dev/mii/icsphy.c stable/7/sys/dev/mii/inphy.c stable/7/sys/dev/mii/ip1000phy.c stable/7/sys/dev/mii/jmphy.c stable/7/sys/dev/mii/lxtphy.c stable/7/sys/dev/mii/mii.c stable/7/sys/dev/mii/mlphy.c stable/7/sys/dev/mii/nsgphy.c stable/7/sys/dev/mii/nsphy.c stable/7/sys/dev/mii/nsphyter.c stable/7/sys/dev/mii/pnaphy.c stable/7/sys/dev/mii/qsphy.c stable/7/sys/dev/mii/rgephy.c stable/7/sys/dev/mii/rlphy.c stable/7/sys/dev/mii/rlswitch.c stable/7/sys/dev/mii/ruephy.c stable/7/sys/dev/mii/tdkphy.c stable/7/sys/dev/mii/tlphy.c stable/7/sys/dev/mii/truephy.c stable/7/sys/dev/mii/ukphy.c stable/7/sys/dev/mii/xmphy.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/dc/dcphy.c ============================================================================== --- stable/7/sys/dev/dc/dcphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/dc/dcphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -149,7 +149,7 @@ dcphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = dcphy_service; sc->mii_pdata = mii; @@ -159,8 +159,6 @@ dcphy_attach(device_t dev) */ sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; - mii->mii_instance++; - /*dcphy_reset(sc);*/ dc_sc = mii->mii_ifp->if_softc; CSR_WRITE_4(dc_sc, DC_10BTSTAT, 0); @@ -204,22 +202,10 @@ dcphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -276,12 +262,6 @@ dcphy_service(struct mii_softc *sc, stru case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/7/sys/dev/dc/pnphy.c ============================================================================== --- stable/7/sys/dev/dc/pnphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/dc/pnphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -132,7 +132,7 @@ pnphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = pnphy_service; sc->mii_pdata = mii; @@ -142,8 +142,6 @@ pnphy_attach(device_t dev) */ sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; - mii->mii_instance++; - sc->mii_capabilities = BMSR_100TXFDX | BMSR_100TXHDX | BMSR_10TFDX | BMSR_10THDX; sc->mii_capabilities &= ma->mii_capmask; @@ -162,22 +160,10 @@ pnphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -212,12 +198,6 @@ pnphy_service(struct mii_softc *sc, stru case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/7/sys/dev/mii/acphy.c ============================================================================== --- stable/7/sys/dev/mii/acphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/acphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -132,17 +132,14 @@ acphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = acphy_service; sc->mii_pdata = mii; - mii->mii_instance++; - acphy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) @@ -167,22 +164,8 @@ acphy_attach(device_t dev) static int acphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; - /* - * If we're not selected, then do nothing, just isolate and power - * down, if changing media. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - if (cmd == MII_MEDIACHG) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO | BMCR_PDOWN); - } - - return (0); - } - switch (cmd) { case MII_POLLSTAT: break; Modified: stable/7/sys/dev/mii/amphy.c ============================================================================== --- stable/7/sys/dev/mii/amphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/amphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -109,13 +109,11 @@ amphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = amphy_service; sc->mii_pdata = mii; - mii->mii_instance++; - #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) #if 0 @@ -125,8 +123,7 @@ amphy_attach(device_t dev) mii_phy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); mii_phy_add_media(sc); printf("\n"); @@ -138,30 +135,13 @@ amphy_attach(device_t dev) static int amphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -171,11 +151,6 @@ amphy_service(struct mii_softc *sc, stru break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/7/sys/dev/mii/atphy.c ============================================================================== --- stable/7/sys/dev/mii/atphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/atphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -113,13 +113,10 @@ atphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = atphy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS_GIGE; - - mii->mii_instance++; asc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); asc->mii_model = MII_MODEL(ma->mii_id2); @@ -138,7 +135,7 @@ atphy_attach(device_t dev) printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); - return(0); + return (0); } static int @@ -149,25 +146,10 @@ atphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - bmcr = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -225,12 +207,6 @@ done: case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/7/sys/dev/mii/bmtphy.c ============================================================================== --- stable/7/sys/dev/mii/bmtphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/bmtphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -147,17 +147,14 @@ bmtphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = bmtphy_service; sc->mii_pdata = mii; mii_phy_reset(sc); - mii->mii_instance++; - - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); mii_phy_add_media(sc); printf("\n"); @@ -170,32 +167,13 @@ bmtphy_attach(device_t dev) static int bmtphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife; - int reg; - - ife = mii->mii_media.ifm_cur; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -205,11 +183,6 @@ bmtphy_service(struct mii_softc *sc, str break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/brgphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -191,13 +191,17 @@ brgphy_attach(device_t dev) LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); /* Initialize mii_softc structure */ - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = brgphy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS_GIGE; + + /* + * At least some variants wedge when isolating, at least some also + * don't support loopback. + */ sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; - mii->mii_instance++; + sc->mii_anegticks = MII_ANEGTICKS_GIGE; /* Initialize brgphy_softc structure */ bsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); @@ -283,9 +287,6 @@ brgphy_attach(device_t dev) #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) - /* Create an instance of Ethernet media. */ - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst), BMCR_ISO); - /* Add the supported media types */ if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), @@ -345,26 +346,12 @@ brgphy_service(struct mii_softc *sc, str { struct brgphy_softc *bsc = (struct brgphy_softc *)sc; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int error = 0; int val; switch (cmd) { case MII_POLLSTAT: - /* If we're not polling our PHY instance, just return. */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - goto brgphy_service_exit; break; case MII_MEDIACHG: - /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - PHY_WRITE(sc, MII_BMCR, - PHY_READ(sc, MII_BMCR) | BMCR_ISO); - goto brgphy_service_exit; - } - /* If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; @@ -385,18 +372,13 @@ brgphy_service(struct mii_softc *sc, str mii->mii_ifp->if_flags & IFF_LINK0); break; default: - error = EINVAL; - goto brgphy_service_exit; + return (EINVAL); } break; case MII_TICK: - /* Bail if we're not currently selected. */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - goto brgphy_service_exit; - /* Bail if the interface isn't up. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - goto brgphy_service_exit; + return (0); /* Bail if autoneg isn't in process. */ @@ -465,8 +447,7 @@ brgphy_service(struct mii_softc *sc, str } } mii_phy_update(sc, cmd); -brgphy_service_exit: - return (error); + return (0); } static void @@ -1170,4 +1151,3 @@ brgphy_reset(struct mii_softc *sc) } } - Modified: stable/7/sys/dev/mii/ciphy.c ============================================================================== --- stable/7/sys/dev/mii/ciphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/ciphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -118,18 +118,16 @@ ciphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = ciphy_service; sc->mii_pdata = mii; sc->mii_flags |= MIIF_NOISOLATE; - mii->mii_instance++; ciphy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); device_printf(dev, " "); @@ -148,25 +146,10 @@ ciphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -239,12 +222,6 @@ setit: case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/e1000phy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -144,11 +144,10 @@ e1000phy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = e1000phy_service; sc->mii_pdata = mii; - mii->mii_instance++; esc->mii_model = MII_MODEL(ma->mii_id2); ifp = sc->mii_pdata->mii_ifp; @@ -322,25 +321,10 @@ e1000phy_service(struct mii_softc *sc, s switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, E1000_CR); - PHY_WRITE(sc, E1000_CR, reg | E1000_CR_ISOLATE); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -417,12 +401,6 @@ done: break; case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/7/sys/dev/mii/exphy.c ============================================================================== --- stable/7/sys/dev/mii/exphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/exphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -136,24 +136,16 @@ exphy_attach(device_t dev) ma = device_get_ivars(dev); sc->mii_dev = device_get_parent(dev); mii = ma->mii_data; - - /* - * The 3Com PHY can never be isolated, so never allow non-zero - * instances! - */ - if (mii->mii_instance != 0) { - device_printf(dev, "ignoring this PHY, non-zero instance\n"); - return (ENXIO); - } - LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = exphy_service; sc->mii_pdata = mii; - mii->mii_instance++; + /* + * The 3Com PHY can never be isolated. + */ sc->mii_flags |= MIIF_NOISOLATE; #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) @@ -163,8 +155,7 @@ exphy_attach(device_t dev) exphy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); mii_phy_add_media(sc); printf("\n"); @@ -176,13 +167,6 @@ exphy_attach(device_t dev) static int exphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - - /* - * We can't isolate the 3Com PHY, so it has to be the only one! - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - panic("exphy_service: can't isolate 3Com PHY"); switch (cmd) { case MII_POLLSTAT: Modified: stable/7/sys/dev/mii/gentbi.c ============================================================================== --- stable/7/sys/dev/mii/gentbi.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/gentbi.c Sun Oct 24 13:39:26 2010 (r214267) @@ -55,7 +55,7 @@ */ /* - * Driver for generic ten-bit (1000BASE-SX) interfaces, built in to + * Driver for generic ten-bit (1000BASE-SX) interfaces, built into * many Gigabit Ethernet chips. * * All we have to do here is correctly report speed and duplex. @@ -166,13 +166,11 @@ gentbi_attach(device_t dev) MII_OUI(ma->mii_id1, ma->mii_id2), MII_MODEL(ma->mii_id2), MII_REV(ma->mii_id2)); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = gentbi_service; sc->mii_pdata = mii; - mii->mii_instance++; - mii_phy_reset(sc); /* @@ -195,30 +193,13 @@ gentbi_attach(device_t dev) static int gentbi_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -228,12 +209,6 @@ gentbi_service(struct mii_softc *sc, str break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/7/sys/dev/mii/icsphy.c ============================================================================== --- stable/7/sys/dev/mii/icsphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/icsphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -141,14 +141,12 @@ icsphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = icsphy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS; - sc->mii_flags |= MIIF_NOISOLATE; - mii->mii_instance++; + sc->mii_flags |= MIIF_NOISOLATE; ifmedia_add(&mii->mii_media, IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), @@ -170,20 +168,6 @@ icsphy_attach(device_t dev) static int icsphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; - - /* - * If we're not selected, then do nothing, just isolate, if - * changing media. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - if (cmd == MII_MEDIACHG) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - } - return (0); - } switch (cmd) { case MII_POLLSTAT: Modified: stable/7/sys/dev/mii/inphy.c ============================================================================== --- stable/7/sys/dev/mii/inphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/inphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -107,11 +107,10 @@ inphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = inphy_service; sc->mii_pdata = mii; - mii->mii_instance++; ifmedia_add(&mii->mii_media, IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), @@ -132,22 +131,12 @@ inphy_attach(device_t dev) static int inphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; switch (cmd) { case MII_POLLSTAT: - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - /* * If the interface is not up, don't do anything. */ @@ -158,8 +147,6 @@ inphy_service(struct mii_softc *sc, stru break; case MII_TICK: - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/ip1000phy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -114,13 +114,12 @@ ip1000phy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = ip1000phy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; - mii->mii_instance++; + sc->mii_flags |= MIIF_NOISOLATE; isc->model = MII_MODEL(ma->mii_id2); isc->revision = MII_REV(ma->mii_id2); @@ -135,7 +134,7 @@ ip1000phy_attach(device_t dev) printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); - return(0); + return (0); } static int @@ -146,26 +145,10 @@ ip1000phy_service(struct mii_softc *sc, switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, IP1000PHY_MII_BMCR); - PHY_WRITE(sc, IP1000PHY_MII_BMCR, - reg | IP1000PHY_BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) { @@ -237,11 +220,6 @@ done: case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/7/sys/dev/mii/jmphy.c ============================================================================== --- stable/7/sys/dev/mii/jmphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/jmphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -112,13 +112,11 @@ jmphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = jmphy_service; sc->mii_pdata = mii; - mii->mii_instance++; - jsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); jsc->mii_model = MII_MODEL(ma->mii_id2); jsc->mii_rev = MII_REV(ma->mii_id2); @@ -136,36 +134,20 @@ jmphy_attach(device_t dev) printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); - return(0); + return (0); } static int jmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - uint16_t bmcr; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - bmcr = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -177,12 +159,6 @@ jmphy_service(struct mii_softc *sc, stru case MII_TICK: /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); - - /* * Is the interface even up? */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) Modified: stable/7/sys/dev/mii/lxtphy.c ============================================================================== --- stable/7/sys/dev/mii/lxtphy.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/lxtphy.c Sun Oct 24 13:39:26 2010 (r214267) @@ -135,17 +135,14 @@ lxtphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); - sc->mii_inst = mii->mii_instance; + sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = lxtphy_service; sc->mii_pdata = mii; - mii->mii_instance++; - mii_phy_reset(sc); - sc->mii_capabilities = - PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); /* @@ -177,29 +174,13 @@ static int lxtphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); break; case MII_MEDIACHG: /* - * If the media indicates a different PHY instance, - * isolate ourselves. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { - reg = PHY_READ(sc, MII_BMCR); - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); - } - - /* * If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) @@ -214,11 +195,6 @@ lxtphy_service(struct mii_softc *sc, str break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); if (mii_phy_tick(sc) == EJUSTRETURN) return (0); break; Modified: stable/7/sys/dev/mii/mii.c ============================================================================== --- stable/7/sys/dev/mii/mii.c Sun Oct 24 13:39:19 2010 (r214266) +++ stable/7/sys/dev/mii/mii.c Sun Oct 24 13:39:26 2010 (r214267) @@ -359,12 +359,28 @@ int mii_mediachg(struct mii_data *mii) { struct mii_softc *child; + struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int rv; mii->mii_media_status = 0; mii->mii_media_active = IFM_NONE; LIST_FOREACH(child, &mii->mii_phys, mii_list) { + /* + * If the media indicates a different PHY instance, + * isolate this one. + */ + if (IFM_INST(ife->ifm_media) != child->mii_inst) { + if ((child->mii_flags & MIIF_NOISOLATE) != 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 13:41: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 906B2106564A; Sun, 24 Oct 2010 13:41:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D28A8FC19; Sun, 24 Oct 2010 13:41: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 o9ODfcmw029746; Sun, 24 Oct 2010 13:41:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ODfcro029729; Sun, 24 Oct 2010 13:41:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010241341.o9ODfcro029729@svn.freebsd.org> From: Marius Strobl Date: Sun, 24 Oct 2010 13:41:38 +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: r214268 - in stable/8/sys/dev: dc mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 13:41:38 -0000 Author: marius Date: Sun Oct 24 13:41:38 2010 New Revision: 214268 URL: http://svn.freebsd.org/changeset/base/214268 Log: MFC: r213384 Consistently always explicitly set IFM_HDX for half-duplex. Obtained from: OpenBSD (mostly) Modified: stable/8/sys/dev/dc/dcphy.c stable/8/sys/dev/dc/pnphy.c stable/8/sys/dev/mii/acphy.c stable/8/sys/dev/mii/amphy.c stable/8/sys/dev/mii/axphy.c stable/8/sys/dev/mii/bmtphy.c stable/8/sys/dev/mii/gentbi.c stable/8/sys/dev/mii/inphy.c stable/8/sys/dev/mii/lxtphy.c stable/8/sys/dev/mii/nsphy.c stable/8/sys/dev/mii/qsphy.c stable/8/sys/dev/mii/rlphy.c stable/8/sys/dev/mii/ruephy.c stable/8/sys/dev/mii/tdkphy.c stable/8/sys/dev/mii/tlphy.c stable/8/sys/dev/mii/ukphy_subr.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) Modified: stable/8/sys/dev/dc/dcphy.c ============================================================================== --- stable/8/sys/dev/dc/dcphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/dc/dcphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -341,14 +341,14 @@ dcphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX | IFM_FDX; else if (anlpar & ANLPAR_T4 && sc->mii_capabilities & BMSR_100T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4 | IFM_HDX; else if (anlpar & ANLPAR_TX && sc->mii_capabilities & BMSR_100TXHDX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX | IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T | IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; if (DC_IS_INTEL(dc_sc)) @@ -366,9 +366,9 @@ dcphy_status(struct mii_softc *sc) * change the media settings if we're wrong. */ if (!(reg & DC_TSTAT_LS100)) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX | IFM_HDX; else if (!(reg & DC_TSTAT_LS10)) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; if (DC_IS_INTEL(dc_sc)) @@ -383,6 +383,8 @@ skip: mii->mii_media_active |= IFM_100_TX; if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } static int Modified: stable/8/sys/dev/dc/pnphy.c ============================================================================== --- stable/8/sys/dev/dc/pnphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/dc/pnphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -237,4 +237,6 @@ pnphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX; if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } Modified: stable/8/sys/dev/mii/acphy.c ============================================================================== --- stable/8/sys/dev/mii/acphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/acphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -245,6 +245,8 @@ acphy_status(struct mii_softc *sc) if (diag & AC_DIAG_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/8/sys/dev/mii/amphy.c ============================================================================== --- stable/8/sys/dev/mii/amphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/amphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -206,13 +206,13 @@ amphy_status(struct mii_softc *sc) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -225,11 +225,11 @@ amphy_status(struct mii_softc *sc) if (par & DSCSR_100FDX) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (par & DSCSR_100HDX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (par & DSCSR_10FDX) mii->mii_media_active |= IFM_10_T|IFM_HDX; else if (par & DSCSR_10HDX) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/8/sys/dev/mii/axphy.c ============================================================================== --- stable/8/sys/dev/mii/axphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/axphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -189,6 +189,8 @@ axphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (scr & SCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; #endif } else mii->mii_media_active = ife->ifm_media; Modified: stable/8/sys/dev/mii/bmtphy.c ============================================================================== --- stable/8/sys/dev/mii/bmtphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/bmtphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -243,6 +243,8 @@ bmtphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (aux_csr & AUX_CSR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/8/sys/dev/mii/gentbi.c ============================================================================== --- stable/8/sys/dev/mii/gentbi.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/gentbi.c Sun Oct 24 13:41:38 2010 (r214268) @@ -263,11 +263,12 @@ gentbi_status(struct mii_softc *sc) * see if we're doing full-duplex. */ mii->mii_media_active |= IFM_1000_SX; - anlpar = PHY_READ(sc, MII_ANLPAR); if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0 && (anlpar & ANLPAR_X_FD) != 0) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/8/sys/dev/mii/inphy.c ============================================================================== --- stable/8/sys/dev/mii/inphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/inphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -197,6 +197,8 @@ inphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (scr & SCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/8/sys/dev/mii/lxtphy.c ============================================================================== --- stable/8/sys/dev/mii/lxtphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/lxtphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -250,6 +250,8 @@ lxtphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (csr & CSR_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/8/sys/dev/mii/nsphy.c ============================================================================== --- stable/8/sys/dev/mii/nsphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/nsphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -298,13 +298,13 @@ nsphy_status(struct mii_softc *sc) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -320,10 +320,7 @@ nsphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; -#if 0 - if (par & PAR_FDX) - mii->mii_media_active |= IFM_FDX; -#endif + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/8/sys/dev/mii/qsphy.c ============================================================================== --- stable/8/sys/dev/mii/qsphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/qsphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -215,19 +215,19 @@ qsphy_status(struct mii_softc *sc) pctl = PHY_READ(sc, MII_QSPHY_PCTL); switch (pctl & PCTL_OPMASK) { case PCTL_10_T: - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; break; case PCTL_10_T_FDX: mii->mii_media_active |= IFM_10_T|IFM_FDX; break; case PCTL_100_TX: - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; break; case PCTL_100_TX_FDX: mii->mii_media_active |= IFM_100_TX|IFM_FDX; break; case PCTL_100_T4: - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; break; case PCTL_AN: mii->mii_media_active |= IFM_NONE; Modified: stable/8/sys/dev/mii/rlphy.c ============================================================================== --- stable/8/sys/dev/mii/rlphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/rlphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -249,13 +249,13 @@ rlphy_status(struct mii_softc *phy) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -299,6 +299,7 @@ rlphy_status(struct mii_softc *phy) else mii->mii_media_active |= IFM_100_TX; } + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/8/sys/dev/mii/ruephy.c ============================================================================== --- stable/8/sys/dev/mii/ruephy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/ruephy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -244,6 +244,8 @@ ruephy_status(struct mii_softc *phy) if (msr & RUEPHY_MSR_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/8/sys/dev/mii/tdkphy.c ============================================================================== --- stable/8/sys/dev/mii/tdkphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/tdkphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -217,13 +217,13 @@ tdkphy_status(struct mii_softc *phy) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else { /* * ANLPAR isn't set, which leaves two possibilities: @@ -234,10 +234,12 @@ tdkphy_status(struct mii_softc *phy) */ diag = PHY_READ(phy, MII_DIAG); if (diag & DIAG_NEGFAIL) /* assume 10baseT if no neg */ - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else { if (diag & DIAG_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; if (diag & DIAG_RATE_100) mii->mii_media_active |= IFM_100_TX; else Modified: stable/8/sys/dev/mii/tlphy.c ============================================================================== --- stable/8/sys/dev/mii/tlphy.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/tlphy.c Sun Oct 24 13:41:38 2010 (r214268) @@ -333,6 +333,8 @@ tlphy_status(struct tlphy_softc *sc) */ if (bmcr & BMCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; mii->mii_media_active |= IFM_10_T; } Modified: stable/8/sys/dev/mii/ukphy_subr.c ============================================================================== --- stable/8/sys/dev/mii/ukphy_subr.c Sun Oct 24 13:39:26 2010 (r214267) +++ stable/8/sys/dev/mii/ukphy_subr.c Sun Oct 24 13:41:38 2010 (r214268) @@ -104,17 +104,17 @@ ukphy_status(struct mii_softc *phy) mii->mii_media_active |= IFM_1000_T|IFM_FDX; else if ((gtcr & GTCR_ADV_1000THDX) && (gtsr & GTSR_LP_1000THDX)) - mii->mii_media_active |= IFM_1000_T; + mii->mii_media_active |= IFM_1000_T|IFM_HDX; else if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; } else From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 13:42: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 1FF2B106566B; Sun, 24 Oct 2010 13:42:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CD1D8FC23; Sun, 24 Oct 2010 13:42: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 o9ODg4is029828; Sun, 24 Oct 2010 13:42:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ODg3Rp029812; Sun, 24 Oct 2010 13:42:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010241342.o9ODg3Rp029812@svn.freebsd.org> From: Marius Strobl Date: Sun, 24 Oct 2010 13:42:03 +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: r214269 - in stable/7/sys/dev: dc mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 13:42:04 -0000 Author: marius Date: Sun Oct 24 13:42:03 2010 New Revision: 214269 URL: http://svn.freebsd.org/changeset/base/214269 Log: MFC: r213384 Consistently always explicitly set IFM_HDX for half-duplex. Obtained from: OpenBSD (mostly) Modified: stable/7/sys/dev/dc/dcphy.c stable/7/sys/dev/dc/pnphy.c stable/7/sys/dev/mii/acphy.c stable/7/sys/dev/mii/amphy.c stable/7/sys/dev/mii/bmtphy.c stable/7/sys/dev/mii/gentbi.c stable/7/sys/dev/mii/inphy.c stable/7/sys/dev/mii/lxtphy.c stable/7/sys/dev/mii/nsphy.c stable/7/sys/dev/mii/qsphy.c stable/7/sys/dev/mii/rlphy.c stable/7/sys/dev/mii/ruephy.c stable/7/sys/dev/mii/tdkphy.c stable/7/sys/dev/mii/tlphy.c stable/7/sys/dev/mii/ukphy_subr.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/dc/dcphy.c ============================================================================== --- stable/7/sys/dev/dc/dcphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/dc/dcphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -341,14 +341,14 @@ dcphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX | IFM_FDX; else if (anlpar & ANLPAR_T4 && sc->mii_capabilities & BMSR_100T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4 | IFM_HDX; else if (anlpar & ANLPAR_TX && sc->mii_capabilities & BMSR_100TXHDX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX | IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T | IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; if (DC_IS_INTEL(dc_sc)) @@ -366,9 +366,9 @@ dcphy_status(struct mii_softc *sc) * change the media settings if we're wrong. */ if (!(reg & DC_TSTAT_LS100)) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX | IFM_HDX; else if (!(reg & DC_TSTAT_LS10)) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; if (DC_IS_INTEL(dc_sc)) @@ -383,6 +383,8 @@ skip: mii->mii_media_active |= IFM_100_TX; if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } static int Modified: stable/7/sys/dev/dc/pnphy.c ============================================================================== --- stable/7/sys/dev/dc/pnphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/dc/pnphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -237,4 +237,6 @@ pnphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX; if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } Modified: stable/7/sys/dev/mii/acphy.c ============================================================================== --- stable/7/sys/dev/mii/acphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/acphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -245,6 +245,8 @@ acphy_status(struct mii_softc *sc) if (diag & AC_DIAG_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/7/sys/dev/mii/amphy.c ============================================================================== --- stable/7/sys/dev/mii/amphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/amphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -206,13 +206,13 @@ amphy_status(struct mii_softc *sc) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -225,11 +225,11 @@ amphy_status(struct mii_softc *sc) if (par & DSCSR_100FDX) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (par & DSCSR_100HDX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (par & DSCSR_10FDX) mii->mii_media_active |= IFM_10_T|IFM_HDX; else if (par & DSCSR_10HDX) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/7/sys/dev/mii/bmtphy.c ============================================================================== --- stable/7/sys/dev/mii/bmtphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/bmtphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -243,6 +243,8 @@ bmtphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (aux_csr & AUX_CSR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/7/sys/dev/mii/gentbi.c ============================================================================== --- stable/7/sys/dev/mii/gentbi.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/gentbi.c Sun Oct 24 13:42:03 2010 (r214269) @@ -263,11 +263,12 @@ gentbi_status(struct mii_softc *sc) * see if we're doing full-duplex. */ mii->mii_media_active |= IFM_1000_SX; - anlpar = PHY_READ(sc, MII_ANLPAR); if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0 && (anlpar & ANLPAR_X_FD) != 0) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/7/sys/dev/mii/inphy.c ============================================================================== --- stable/7/sys/dev/mii/inphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/inphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -197,6 +197,8 @@ inphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (scr & SCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/7/sys/dev/mii/lxtphy.c ============================================================================== --- stable/7/sys/dev/mii/lxtphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/lxtphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -250,6 +250,8 @@ lxtphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (csr & CSR_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/7/sys/dev/mii/nsphy.c ============================================================================== --- stable/7/sys/dev/mii/nsphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/nsphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -298,13 +298,13 @@ nsphy_status(struct mii_softc *sc) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -320,10 +320,7 @@ nsphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; -#if 0 - if (par & PAR_FDX) - mii->mii_media_active |= IFM_FDX; -#endif + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/7/sys/dev/mii/qsphy.c ============================================================================== --- stable/7/sys/dev/mii/qsphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/qsphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -215,19 +215,19 @@ qsphy_status(struct mii_softc *sc) pctl = PHY_READ(sc, MII_QSPHY_PCTL); switch (pctl & PCTL_OPMASK) { case PCTL_10_T: - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; break; case PCTL_10_T_FDX: mii->mii_media_active |= IFM_10_T|IFM_FDX; break; case PCTL_100_TX: - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; break; case PCTL_100_TX_FDX: mii->mii_media_active |= IFM_100_TX|IFM_FDX; break; case PCTL_100_T4: - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; break; case PCTL_AN: mii->mii_media_active |= IFM_NONE; Modified: stable/7/sys/dev/mii/rlphy.c ============================================================================== --- stable/7/sys/dev/mii/rlphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/rlphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -249,13 +249,13 @@ rlphy_status(struct mii_softc *phy) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -299,6 +299,7 @@ rlphy_status(struct mii_softc *phy) else mii->mii_media_active |= IFM_100_TX; } + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/7/sys/dev/mii/ruephy.c ============================================================================== --- stable/7/sys/dev/mii/ruephy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/ruephy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -244,6 +244,8 @@ ruephy_status(struct mii_softc *phy) if (msr & RUEPHY_MSR_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: stable/7/sys/dev/mii/tdkphy.c ============================================================================== --- stable/7/sys/dev/mii/tdkphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/tdkphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -217,13 +217,13 @@ tdkphy_status(struct mii_softc *phy) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else { /* * ANLPAR isn't set, which leaves two possibilities: @@ -234,10 +234,12 @@ tdkphy_status(struct mii_softc *phy) */ diag = PHY_READ(phy, MII_DIAG); if (diag & DIAG_NEGFAIL) /* assume 10baseT if no neg */ - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else { if (diag & DIAG_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; if (diag & DIAG_RATE_100) mii->mii_media_active |= IFM_100_TX; else Modified: stable/7/sys/dev/mii/tlphy.c ============================================================================== --- stable/7/sys/dev/mii/tlphy.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/tlphy.c Sun Oct 24 13:42:03 2010 (r214269) @@ -333,6 +333,8 @@ tlphy_status(struct tlphy_softc *sc) */ if (bmcr & BMCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; mii->mii_media_active |= IFM_10_T; } Modified: stable/7/sys/dev/mii/ukphy_subr.c ============================================================================== --- stable/7/sys/dev/mii/ukphy_subr.c Sun Oct 24 13:41:38 2010 (r214268) +++ stable/7/sys/dev/mii/ukphy_subr.c Sun Oct 24 13:42:03 2010 (r214269) @@ -104,17 +104,17 @@ ukphy_status(struct mii_softc *phy) mii->mii_media_active |= IFM_1000_T|IFM_FDX; else if ((gtcr & GTCR_ADV_1000THDX) && (gtsr & GTSR_LP_1000THDX)) - mii->mii_media_active |= IFM_1000_T; + mii->mii_media_active |= IFM_1000_T|IFM_HDX; else if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; } else From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 13:43: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 4938D106564A; Sun, 24 Oct 2010 13:43:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3703F8FC18; Sun, 24 Oct 2010 13:43: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 o9ODhkpr029900; Sun, 24 Oct 2010 13:43:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ODhkEN029898; Sun, 24 Oct 2010 13:43:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010241343.o9ODhkEN029898@svn.freebsd.org> From: Marius Strobl Date: Sun, 24 Oct 2010 13:43: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: r214270 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 13:43:46 -0000 Author: marius Date: Sun Oct 24 13:43:45 2010 New Revision: 214270 URL: http://svn.freebsd.org/changeset/base/214270 Log: MFC: r213385 Remove a header that apart from the license is empty. Deleted: stable/8/sys/dev/mii/axphyreg.h Modified: stable/8/sys/dev/mii/axphy.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) Modified: stable/8/sys/dev/mii/axphy.c ============================================================================== --- stable/8/sys/dev/mii/axphy.c Sun Oct 24 13:42:03 2010 (r214269) +++ stable/8/sys/dev/mii/axphy.c Sun Oct 24 13:43:45 2010 (r214270) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include "miidevs.h" -#include - #include "miibus_if.h" static int axphy_probe(device_t dev); From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 13:46: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 CB294106566C for ; Sun, 24 Oct 2010 13:46:36 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from fep34.mx.upcmail.net (fep34.mx.upcmail.net [62.179.121.52]) by mx1.freebsd.org (Postfix) with ESMTP id 10DE08FC13 for ; Sun, 24 Oct 2010 13:46:35 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep18-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20101024132910.YJNV1424.viefep18-int.chello.at@edge04.upcmail.net> for ; Sun, 24 Oct 2010 15:29:10 +0200 Received: from pinky ([213.46.23.80]) by edge04.upcmail.net with edge id NdV71f02f1jgp3H04dV8kb; Sun, 24 Oct 2010 15:29:09 +0200 X-SourceIP: 213.46.23.80 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: svn-src-all@freebsd.org References: <201010220846.o9M8kMEo020056@svn.freebsd.org> Date: Sun, 24 Oct 2010 15:29:10 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.63 (Win32) X-Cloudmark-Analysis: v=1.1 cv=kR1739jI04gsLPPBAx/k25XPeS1fzQof9TaPDYrpM2k= c=1 sm=0 a=1GZMQFKa5poA:10 a=bgpUlknNv7MA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=jYRlTTsP19nFC9T2o6kA:9 a=nC5fjfFcU4KvLO5kpnkA:7 a=XzbtGanPI6_hWmDhXsHYYGUTSFYA:4 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Subject: Re: svn commit: r214199 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 13:46:36 -0000 On Sat, 23 Oct 2010 12:05:00 +0200, Robert Watson wrote: > > On Fri, 22 Oct 2010, Andriy Gapon wrote: > >> +20101022: >> + A workaround for a fixed ld bug has been removed in kernel code, >> + so make sure that your system ld is built from sources after >> + revision 211583 (r210245 if building stable/8 kernel on head, >> + r211584 for stable/7). A symptom of incorrect ld version is >> + different addresses for set_pcpu section and __start_set_pcpu >> + symbol in kernel and/or modules. > > Since many of our users still rely on cvsup to update FreeBSD source, it > might be useful to provide rough date thresholds for the branches in > addition to the Subversion changeset numbers (which are less easy to > deal with when checking out with cvsup/cvs). > > Thanks! > > Robert As a non-freebsd developer is there an advantage to do svn checkout in stead of c(v)sup? Ronald. From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 13:48: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 6837C1065782; Sun, 24 Oct 2010 13:48:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5642F8FC17; Sun, 24 Oct 2010 13:48: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 o9ODmBq5030060; Sun, 24 Oct 2010 13:48:11 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ODmB7w030058; Sun, 24 Oct 2010 13:48:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010241348.o9ODmB7w030058@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 24 Oct 2010 13:48:11 +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: r214271 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 13:48:11 -0000 Author: hselasky Date: Sun Oct 24 13:48:11 2010 New Revision: 214271 URL: http://svn.freebsd.org/changeset/base/214271 Log: Remove stray semicolon. Submitted by: arundel Modified: head/usr.sbin/usbconfig/usbconfig.c Modified: head/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.c Sun Oct 24 13:43:45 2010 (r214270) +++ head/usr.sbin/usbconfig/usbconfig.c Sun Oct 24 13:48:11 2010 (r214271) @@ -640,7 +640,7 @@ main(int argc, char **argv) opt->bus = unit; opt->addr = addr; opt->got_bus = 1; -; opt->got_addr = 1; + opt->got_addr = 1; n++; break; From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 14:04: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 59BB31065675; Sun, 24 Oct 2010 14:04:52 +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 2DCC18FC17; Sun, 24 Oct 2010 14:04:52 +0000 (UTC) Received: from [10.57.169.185] (unknown [212.183.140.34]) by cyrus.watson.org (Postfix) with ESMTPSA id 41AD846B09; Sun, 24 Oct 2010 10:04:51 -0400 (EDT) References: <201010240914.o9O9ELh3022927@svn.freebsd.org> <20101024132017.GA77378@freebsd.org> Message-Id: From: "Robert N. M. Watson" To: Alexander Best In-Reply-To: <20101024132017.GA77378@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Mailer: iPad Mail (7B500) Mime-Version: 1.0 (iPad Mail 7B500) Date: Sun, 24 Oct 2010 15:05:36 +0100 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Robert Watson Subject: Re: svn commit: r214261 - head/tools/tools/syscall_timing X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 14:04:52 -0000 On 24 Oct 2010, at 14:20, Alexander Best wrote: > On Sun Oct 24 10, Robert Watson wrote: >> Author: rwatson >> Date: Sun Oct 24 09:14:21 2010 >> New Revision: 214261 >> URL: http://svn.freebsd.org/changeset/base/214261 >>=20 >> Log: >> Add microbenchmark for create/unlink of a zero-byte file. >=20 > clang still complaining: >=20 > syscall_timing.c:766:24: warning: conversion specifies type 'int' but = the argument has type 'uintmax_t' (aka 'unsigned long') [-Wformat] > printf("%ju.%09ju\t%d\t", = (uintmax_t)ts_end.tv_sec, > ~^ > %lu > 1 warning generated. Hi Alexander: I also have detail feedback pending from Bruce on the uses of types in = this tool, which I hope to get to later this week! Since doing so is = sure to change the warnings, I'll revisit them then. In the mean time, = however, I'll keep updating to tool to finish up this chapter... :-) Thanks, Robert=20= From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 15: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 DD558106566C; Sun, 24 Oct 2010 15:31:41 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B15F58FC15; Sun, 24 Oct 2010 15: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 o9OFVffd032195; Sun, 24 Oct 2010 15:31:41 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OFVfCL032193; Sun, 24 Oct 2010 15:31:41 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201010241531.o9OFVfCL032193@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 24 Oct 2010 15:31: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: r214272 - head/usr.bin/lex X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 15:31:42 -0000 Author: uqs Date: Sun Oct 24 15:31:41 2010 New Revision: 214272 URL: http://svn.freebsd.org/changeset/base/214272 Log: flex: add missing ifdef magic to create/hide prototypes This unbreaks build for some software with higher WARNS flags. Reviewed by: rpaulo PR: bin/139319 (parts already committed in previous revision) Modified: head/usr.bin/lex/flex.skl Modified: head/usr.bin/lex/flex.skl ============================================================================== --- head/usr.bin/lex/flex.skl Sun Oct 24 13:48:11 2010 (r214271) +++ head/usr.bin/lex/flex.skl Sun Oct 24 15:31:41 2010 (r214272) @@ -747,7 +747,11 @@ void yyFlexLexer::LexerOutput( const cha */ %- +#ifdef YY_USE_PROTOS static int yy_get_next_buffer(void) +#else +static int yy_get_next_buffer() +#endif %+ int yyFlexLexer::yy_get_next_buffer() %* @@ -883,7 +887,11 @@ int yyFlexLexer::yy_get_next_buffer() /* yy_get_previous_state - get the state just before the EOB char was reached */ %- +#ifdef YY_USE_PROTOS static yy_state_type yy_get_previous_state(void) +#else +static yy_state_type yy_get_previous_state() +#endif %+ yy_state_type yyFlexLexer::yy_get_previous_state() %* @@ -983,7 +991,11 @@ void yyFlexLexer::yyunput( int c, char* #ifdef __cplusplus static int yyinput() #else +#ifdef YY_USE_PROTOS static int input(void) +#else +static int input() +#endif #endif %+ int yyFlexLexer::yyinput() @@ -1055,7 +1067,9 @@ int yyFlexLexer::yyinput() return c; } -#endif /* ifndef YY_NO_INPUT */ +%- +#endif /* ifndef YY_NO_INPUT */ +%* %- @@ -1404,7 +1418,11 @@ void yyFlexLexer::yy_push_state( int new #ifndef YY_NO_POP_STATE %- +#ifdef YY_USE_PROTOS +static void yy_pop_state(void) +#else static void yy_pop_state() +#endif %+ void yyFlexLexer::yy_pop_state() %* @@ -1419,7 +1437,11 @@ void yyFlexLexer::yy_pop_state() #ifndef YY_NO_TOP_STATE %- +#ifdef YY_USE_PROTOS +static int yy_top_state(void) +#else static int yy_top_state() +#endif %+ int yyFlexLexer::yy_top_state() %* From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 15:32: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 3A1A51065672 for ; Sun, 24 Oct 2010 15:32:35 +0000 (UTC) (envelope-from gljennjohn@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 7FC7B8FC22 for ; Sun, 24 Oct 2010 15:32:34 +0000 (UTC) Received: by bwz3 with SMTP id 3so2377643bwz.13 for ; Sun, 24 Oct 2010 08:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=OnszHTWI+sX4asN1qLTCN2CcvxtMcy/ygh7KJWVgZ3A=; b=i0EfVm7iagOPNGlqw/riwQCgO9EjJ1PH3IuVuKjYjPARnaboNx8nm8emv/GIYw0DTU WhRHD39z5rW3+67qXAV6/Ouy5wekNf3TSifYuEwqfHoS0OxfMdQqDbr3T8NKrnE+mjdv cE59WxyPzg+ncHHfGsCo+D1ZDAGtCLULNESFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=ejhHzQ0qRR3NMsEFcCdSnM/tXLzDPTRw/f3JYilcqgsxi6SviIEnaAsozM5fxFtQPr l8pufQhbma1DuzrKB8dtgSLRegtlcD1emWE566paiORK6As5atu4iJmU2GTAh+oPsnDm 3LOL36gGk9g9D7Htrkm+eGvJZfgh8LaPzpx0s= Received: by 10.204.53.4 with SMTP id k4mr3194855bkg.145.1287932974543; Sun, 24 Oct 2010 08:09:34 -0700 (PDT) Received: from ernst.jennejohn.org (p578E1745.dip.t-dialin.net [87.142.23.69]) by mx.google.com with ESMTPS id d12sm3955630bkw.7.2010.10.24.08.09.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 24 Oct 2010 08:09:33 -0700 (PDT) Date: Sun, 24 Oct 2010 17:09:31 +0200 From: Gary Jennejohn To: "Ronald Klop" Message-ID: <20101024170931.755867ea@ernst.jennejohn.org> In-Reply-To: References: <201010220846.o9M8kMEo020056@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r214199 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.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: Sun, 24 Oct 2010 15:32:35 -0000 On Sun, 24 Oct 2010 15:29:10 +0200 "Ronald Klop" wrote: > On Sat, 23 Oct 2010 12:05:00 +0200, Robert Watson > wrote: > > > > > On Fri, 22 Oct 2010, Andriy Gapon wrote: > > > >> +20101022: > >> + A workaround for a fixed ld bug has been removed in kernel code, > >> + so make sure that your system ld is built from sources after > >> + revision 211583 (r210245 if building stable/8 kernel on head, > >> + r211584 for stable/7). A symptom of incorrect ld version is > >> + different addresses for set_pcpu section and __start_set_pcpu > >> + symbol in kernel and/or modules. > > > > Since many of our users still rely on cvsup to update FreeBSD source, it > > might be useful to provide rough date thresholds for the branches in > > addition to the Subversion changeset numbers (which are less easy to > > deal with when checking out with cvsup/cvs). > > > > Thanks! > > > > Robert > > As a non-freebsd developer is there an advantage to do svn checkout in > stead of c(v)sup? > As a FreeBSD developer (but now only ports), I still use c(v)sup to keep my CVS and src/ports trees up-to-date. I also occasionally check out the svn tree, but far less frequently than CVS. AFAIK the project doesn't have as many svn mirrors as it does CVS mirrors, but I might be wrong. -- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 15:38: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 752AF106566B; Sun, 24 Oct 2010 15:38:58 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63B4C8FC1A; Sun, 24 Oct 2010 15:38: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 o9OFcwfa032460; Sun, 24 Oct 2010 15:38:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OFcwUQ032458; Sun, 24 Oct 2010 15:38:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010241538.o9OFcwUQ032458@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 24 Oct 2010 15:38: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: r214273 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 15:38:58 -0000 Author: pjd Date: Sun Oct 24 15:38:58 2010 New Revision: 214273 URL: http://svn.freebsd.org/changeset/base/214273 Log: Load geom_gate.ko module after parsing arguments. MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Sun Oct 24 15:31:41 2010 (r214272) +++ head/sbin/hastd/hastd.c Sun Oct 24 15:38:58 2010 (r214273) @@ -701,8 +701,6 @@ main(int argc, char *argv[]) int debuglevel; sigset_t mask; - g_gate_load(); - foreground = false; debuglevel = 0; pidfile = HASTD_PIDFILE; @@ -736,6 +734,8 @@ main(int argc, char *argv[]) pjdlog_debug_set(debuglevel); + g_gate_load(); + pfh = pidfile_open(pidfile, 0600, &otherpid); if (pfh == NULL) { if (errno == EEXIST) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 15:41: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 09208106566B; Sun, 24 Oct 2010 15:41:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB47B8FC0A; Sun, 24 Oct 2010 15:41: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 o9OFfNrL032571; Sun, 24 Oct 2010 15:41:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OFfN0N032567; Sun, 24 Oct 2010 15:41:23 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010241541.o9OFfN0N032567@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 24 Oct 2010 15:41: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: r214274 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 15:41:24 -0000 Author: pjd Date: Sun Oct 24 15:41:23 2010 New Revision: 214274 URL: http://svn.freebsd.org/changeset/base/214274 Log: Plug memory leaks. Found with: valgrind MFC after: 3 days Modified: head/sbin/hastd/parse.y head/sbin/hastd/primary.c head/sbin/hastd/synch.h Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Sun Oct 24 15:38:58 2010 (r214273) +++ head/sbin/hastd/parse.y Sun Oct 24 15:41:23 2010 (r214274) @@ -264,6 +264,7 @@ control_statement: CONTROL STR sizeof(depth0_control)) >= sizeof(depth0_control)) { pjdlog_error("control argument is too long."); + free($2); return (1); } break; @@ -274,12 +275,14 @@ control_statement: CONTROL STR sizeof(lconfig->hc_controladdr)) >= sizeof(lconfig->hc_controladdr)) { pjdlog_error("control argument is too long."); + free($2); return (1); } break; default: assert(!"control at wrong depth level"); } + free($2); } ; @@ -291,6 +294,7 @@ listen_statement: LISTEN STR sizeof(depth0_listen)) >= sizeof(depth0_listen)) { pjdlog_error("listen argument is too long."); + free($2); return (1); } break; @@ -301,12 +305,14 @@ listen_statement: LISTEN STR sizeof(lconfig->hc_listenaddr)) >= sizeof(lconfig->hc_listenaddr)) { pjdlog_error("listen argument is too long."); + free($2); return (1); } break; default: assert(!"listen at wrong depth level"); } + free($2); } ; @@ -357,6 +363,7 @@ exec_statement: EXEC STR if (strlcpy(depth0_exec, $2, sizeof(depth0_exec)) >= sizeof(depth0_exec)) { pjdlog_error("Exec path is too long."); + free($2); return (1); } break; @@ -367,12 +374,14 @@ exec_statement: EXEC STR sizeof(curres->hr_exec)) >= sizeof(curres->hr_exec)) { pjdlog_error("Exec path is too long."); + free($2); return (1); } break; default: assert(!"exec at wrong depth level"); } + free($2); } ; @@ -386,6 +395,7 @@ node_start: STR { switch (isitme($1)) { case -1: + free($1); return (1); case 0: break; @@ -395,6 +405,7 @@ node_start: STR default: assert(!"invalid isitme() return value"); } + free($1); } ; @@ -482,14 +493,17 @@ resource_start: STR curres = calloc(1, sizeof(*curres)); if (curres == NULL) { pjdlog_error("Unable to allocate memory for resource."); + free($1); return (1); } if (strlcpy(curres->hr_name, $1, sizeof(curres->hr_name)) >= sizeof(curres->hr_name)) { pjdlog_error("Resource name is too long."); + free($1); return (1); } + free($1); curres->hr_role = HAST_ROLE_INIT; curres->hr_previous_role = HAST_ROLE_INIT; curres->hr_replication = -1; @@ -530,6 +544,7 @@ name_statement: NAME STR sizeof(depth1_provname)) >= sizeof(depth1_provname)) { pjdlog_error("name argument is too long."); + free($2); return (1); } break; @@ -541,12 +556,14 @@ name_statement: NAME STR sizeof(curres->hr_provname)) >= sizeof(curres->hr_provname)) { pjdlog_error("name argument is too long."); + free($2); return (1); } break; default: assert(!"name at wrong depth level"); } + free($2); } ; @@ -558,6 +575,7 @@ local_statement: LOCAL STR sizeof(depth1_localpath)) >= sizeof(depth1_localpath)) { pjdlog_error("local argument is too long."); + free($2); return (1); } break; @@ -569,12 +587,14 @@ local_statement: LOCAL STR sizeof(curres->hr_localpath)) >= sizeof(curres->hr_localpath)) { pjdlog_error("local argument is too long."); + free($2); return (1); } break; default: assert(!"local at wrong depth level"); } + free($2); } ; @@ -589,6 +609,7 @@ resource_node_start: STR if (curres != NULL) { switch (isitme($1)) { case -1: + free($1); return (1); case 0: break; @@ -599,6 +620,7 @@ resource_node_start: STR assert(!"invalid isitme() return value"); } } + free($1); } ; @@ -624,8 +646,10 @@ remote_statement: REMOTE STR sizeof(curres->hr_remoteaddr)) >= sizeof(curres->hr_remoteaddr)) { pjdlog_error("remote argument is too long."); + free($2); return (1); } } + free($2); } ; Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Oct 24 15:38:58 2010 (r214273) +++ head/sbin/hastd/primary.c Sun Oct 24 15:41:23 2010 (r214274) @@ -646,6 +646,7 @@ init_remote(struct hast_resource *res, s */ (void)hast_activemap_flush(res); } + nv_free(nvin); pjdlog_info("Connected to %s.", res->hr_remoteaddr); if (inp != NULL && outp != NULL) { *inp = in; Modified: head/sbin/hastd/synch.h ============================================================================== --- head/sbin/hastd/synch.h Sun Oct 24 15:38:58 2010 (r214273) +++ head/sbin/hastd/synch.h Sun Oct 24 15:41:23 2010 (r214274) @@ -140,6 +140,8 @@ cv_init(pthread_cond_t *cv) assert(error == 0); error = pthread_cond_init(cv, &attr); assert(error == 0); + error = pthread_condattr_destroy(&attr); + assert(error == 0); } static __inline void cv_wait(pthread_cond_t *cv, pthread_mutex_t *lock) From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 15:42: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 C5CBD106564A; Sun, 24 Oct 2010 15:42:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48428FC16; Sun, 24 Oct 2010 15:42: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 o9OFgG9W032630; Sun, 24 Oct 2010 15:42:16 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OFgGCl032628; Sun, 24 Oct 2010 15:42:16 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010241542.o9OFgGCl032628@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 24 Oct 2010 15:42: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: r214275 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 15:42:16 -0000 Author: pjd Date: Sun Oct 24 15:42:16 2010 New Revision: 214275 URL: http://svn.freebsd.org/changeset/base/214275 Log: Plug memory leak. MFC after: 3 days Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Sun Oct 24 15:41:23 2010 (r214274) +++ head/sbin/hastd/secondary.c Sun Oct 24 15:42:16 2010 (r214275) @@ -323,6 +323,8 @@ init_remote(struct hast_resource *res, s nv_free(nvout); exit(EX_TEMPFAIL); } + if (map != NULL) + free(map); nv_free(nvout); if (res->hr_secondary_localcnt > res->hr_primary_remotecnt && res->hr_primary_localcnt > res->hr_secondary_remotecnt) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 15:44: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 55016106564A; Sun, 24 Oct 2010 15:44:23 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 439158FC13; Sun, 24 Oct 2010 15:44: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 o9OFiNq4032718; Sun, 24 Oct 2010 15:44:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OFiNXZ032716; Sun, 24 Oct 2010 15:44:23 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010241544.o9OFiNXZ032716@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 24 Oct 2010 15:44: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: r214276 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 15:44:23 -0000 Author: pjd Date: Sun Oct 24 15:44:23 2010 New Revision: 214276 URL: http://svn.freebsd.org/changeset/base/214276 Log: Simplify code a bit. MFC after: 3 days Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Sun Oct 24 15:42:16 2010 (r214275) +++ head/sbin/hastd/secondary.c Sun Oct 24 15:44:23 2010 (r214276) @@ -318,10 +318,8 @@ init_remote(struct hast_resource *res, s (uintmax_t)res->hr_secondary_remotecnt); } if (hast_proto_send(res, res->hr_remotein, nvout, map, mapsize) < 0) { - pjdlog_errno(LOG_WARNING, "Unable to send activemap to %s", + pjdlog_exit(EX_TEMPFAIL, "Unable to send activemap to %s", res->hr_remoteaddr); - nv_free(nvout); - exit(EX_TEMPFAIL); } if (map != NULL) free(map); From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 15:56: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 A02FB1065698; Sun, 24 Oct 2010 15:56:21 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6298FC1E; Sun, 24 Oct 2010 15:56: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 o9OFuL61032993; Sun, 24 Oct 2010 15:56:21 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OFuLkE032990; Sun, 24 Oct 2010 15:56:21 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010241556.o9OFuLkE032990@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 24 Oct 2010 15:56: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: r214277 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 15:56:21 -0000 Author: jh Date: Sun Oct 24 15:56:21 2010 New Revision: 214277 URL: http://svn.freebsd.org/changeset/base/214277 Log: Document make_dev_p(9). Reviewed by: brueffer, kib Modified: head/share/man/man9/Makefile head/share/man/man9/make_dev.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Oct 24 15:44:23 2010 (r214276) +++ head/share/man/man9/Makefile Sun Oct 24 15:56:21 2010 (r214277) @@ -775,7 +775,8 @@ MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 dev_depends.9 \ make_dev.9 make_dev_alias.9 \ make_dev.9 make_dev_cred.9 \ - make_dev.9 make_dev_credf.9 + make_dev.9 make_dev_credf.9 \ + make_dev.9 make_dev_p.9 MLINKS+=malloc.9 free.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ Modified: head/share/man/man9/make_dev.9 ============================================================================== --- head/share/man/man9/make_dev.9 Sun Oct 24 15:44:23 2010 (r214276) +++ head/share/man/man9/make_dev.9 Sun Oct 24 15:56:21 2010 (r214277) @@ -24,13 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2010 +.Dd October 24, 2010 .Dt MAKE_DEV 9 .Os .Sh NAME .Nm make_dev , .Nm make_dev_cred , .Nm make_dev_credf , +.Nm make_dev_p , .Nm make_dev_alias , .Nm destroy_dev , .Nm destroy_dev_sched , @@ -49,6 +50,8 @@ and DEVFS registration for devices .Fn make_dev_cred "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... .Ft struct cdev * .Fn make_dev_credf "int flags" "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... +.Ft int +.Fn make_dev_p "int flags" "struct cdev **cdev" "struct cdevsw *devsw" "struct ucred *cr" "uid_t uid" "gid_t gid" "int mode" "const char *fmt" ... .Ft struct cdev * .Fn make_dev_alias "struct cdev *pdev" "const char *fmt" ... .Ft void @@ -128,20 +131,22 @@ member of the initialized The .Va flags argument alters the operation of -.Fn make_dev_credf . +.Fn make_dev_credf +or +.Fn make_dev_p . The following values are currently accepted: .Pp .Bl -tag -width "MAKEDEV_CHECKNAME" -compact -offset indent .It MAKEDEV_REF reference the created device .It MAKEDEV_NOWAIT -do not sleep, may return NULL +do not sleep, the call may fail .It MAKEDEV_WAITOK allow the function to sleep to satisfy malloc .It MAKEDEV_ETERNAL created device will be never destroyed .It MAKEDEV_CHECKNAME -return NULL if the device name is invalid or already exists +return an error if the device name is invalid or already exists .El .Pp The @@ -190,6 +195,14 @@ make_dev_credf(0, cdevsw, unit, NULL, ui .Ed .Pp The +.Fn make_dev_p +function is similar to +.Fn make_dev_credf +but it may return an error number and takes a pointer to the resulting +.Ft *cdev +as an argument. +.Pp +The .Fn make_dev_alias function takes the returned .Ft cdev @@ -293,6 +306,44 @@ is called for all instantiated devices, unload until .Fn destroy_dev is actually finished for all of them. +.Sh RETURN VALUES +If successful, +.Fn make_dev_p +will return 0, otherwise it will return an error. +If successful, +.Fn make_dev_credf +will return a valid +.Fa cdev +pointer, otherwise it will return +.Dv NULL . +.Sh ERRORS +The +.Fn make_dev_p +call will fail and the device will be not registered if: +.Bl -tag -width Er +.It Bq Er ENOMEM +The +.Dv MAKEDEV_NOWAIT +flags was specified and a memory allocation request could not be satisfied. +.It Bq Er ENAMETOOLONG +The +.Dv MAKEDEV_CHECKNAME +flags was specified and the provided device name is longer than +.Dv SPECNAMELEN . +.It Bq Er EINVAL +The +.Dv MAKEDEV_CHECKNAME +flags was specified and the provided device name is empty, contains a +.Qq \&. +or +.Qq .. +path component or ends with +.Ql / . +.It Bq Er EEXIST +The +.Dv MAKEDEV_CHECKNAME +flags was specified and the provided device name already exists. +.El .Pp .Sh SEE ALSO .Xr devctl 4 , @@ -320,3 +371,7 @@ The functions .Fn destroy_dev_sched_cb first appeared in .Fx 7.0 . +The function +.Fn make_dev_p +first appeared in +.Fx 8.2 . From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 16:10: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 54F2D1065670; Sun, 24 Oct 2010 16:10:33 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2943C8FC08; Sun, 24 Oct 2010 16:10: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 o9OGAXat033299; Sun, 24 Oct 2010 16:10:33 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OGAX6a033297; Sun, 24 Oct 2010 16:10:33 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010241610.o9OGAX6a033297@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 24 Oct 2010 16:10: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: r214278 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 16:10:33 -0000 Author: jh Date: Sun Oct 24 16:10:32 2010 New Revision: 214278 URL: http://svn.freebsd.org/changeset/base/214278 Log: Use .Dv with NULL. Modified: head/share/man/man9/make_dev.9 Modified: head/share/man/man9/make_dev.9 ============================================================================== --- head/share/man/man9/make_dev.9 Sun Oct 24 15:56:21 2010 (r214277) +++ head/share/man/man9/make_dev.9 Sun Oct 24 16:10:32 2010 (r214278) @@ -271,7 +271,9 @@ After .Fn destroy_dev is finished, and if the supplied .Fa cb -is not NULL, the callback +is not +.Dv NULL , +the callback .Fa cb is called, with argument .Fa arg . From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 16:31: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 446131065672; Sun, 24 Oct 2010 16:31:58 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30EA68FC17; Sun, 24 Oct 2010 16:31: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 o9OGVw6B033822; Sun, 24 Oct 2010 16:31:58 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OGVw1C033817; Sun, 24 Oct 2010 16:31:58 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201010241631.o9OGVw1C033817@svn.freebsd.org> From: Bruce Cran Date: Sun, 24 Oct 2010 16:31: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: r214279 - in head: share/man/man4 sys/cam sys/cam/ata 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: Sun, 24 Oct 2010 16:31:58 -0000 Author: brucec Date: Sun Oct 24 16:31:57 2010 New Revision: 214279 URL: http://svn.freebsd.org/changeset/base/214279 Log: Mostly revert r203420, and add similar functionality into ada(4) since the existing code caused problems with some SCSI controllers. A new sysctl kern.cam.ada.spindown_shutdown has been added that controls whether or not to spin-down disks when shutting down. Spinning down the disks unloads/parks the heads - this is much better than removing power when the disk is still spinning because otherwise an Emergency Unload occurs which may cause damage to the actuator. PR: kern/140752 Submitted by: olli Reviewed by: arundel Discussed with: mav MFC after: 2 weeks Modified: head/share/man/man4/ada.4 head/sys/cam/ata/ata_da.c head/sys/cam/cam_xpt.c head/sys/kern/kern_shutdown.c Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Sun Oct 24 16:10:32 2010 (r214278) +++ head/share/man/man4/ada.4 Sun Oct 24 16:31:57 2010 (r214279) @@ -118,6 +118,9 @@ This variable determines how long the driver will wait before timing out an outstanding command. The units for this value are seconds, and the default is currently 30 seconds. +.It kern.cam.ada.spindown_shutdown +.Pp +This variable determines whether to spin-down disks when shutting down. .El .Sh FILES .Bl -tag -width ".Pa /dev/ada*" -compact Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Oct 24 16:10:32 2010 (r214278) +++ head/sys/cam/ata/ata_da.c Sun Oct 24 16:31:57 2010 (r214279) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #endif /* _KERNEL */ @@ -79,7 +80,8 @@ typedef enum { ADA_FLAG_CAN_TRIM = 0x080, ADA_FLAG_OPEN = 0x100, ADA_FLAG_SCTX_INIT = 0x200, - ADA_FLAG_CAN_CFA = 0x400 + ADA_FLAG_CAN_CFA = 0x400, + ADA_FLAG_CAN_POWERMGT = 0x800 } ada_flags; typedef enum { @@ -180,6 +182,10 @@ static void adashutdown(void *arg, int #define ADA_DEFAULT_SEND_ORDERED 1 #endif +#ifndef ADA_DEFAULT_SPINDOWN_SHUTDOWN +#define ADA_DEFAULT_SPINDOWN_SHUTDOWN 1 +#endif + /* * Most platforms map firmware geometry to actual, but some don't. If * not overridden, default to nothing. @@ -191,6 +197,7 @@ static void adashutdown(void *arg, int static int ada_retry_count = ADA_DEFAULT_RETRY; static int ada_default_timeout = ADA_DEFAULT_TIMEOUT; static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED; +static int ada_spindown_shutdown = ADA_DEFAULT_SPINDOWN_SHUTDOWN; SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -203,6 +210,9 @@ TUNABLE_INT("kern.cam.ada.default_timeou SYSCTL_INT(_kern_cam_ada, OID_AUTO, ada_send_ordered, CTLFLAG_RW, &ada_send_ordered, 0, "Send Ordered Tags"); TUNABLE_INT("kern.cam.ada.ada_send_ordered", &ada_send_ordered); +SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW, + &ada_spindown_shutdown, 0, "Spin down upon shutdown"); +TUNABLE_INT("kern.cam.ada.spindown_shutdown", &ada_spindown_shutdown); /* * ADA_ORDEREDTAG_INTERVAL determines how often, relative @@ -665,6 +675,8 @@ adaregister(struct cam_periph *periph, v softc->flags |= ADA_FLAG_CAN_48BIT; if (cgd->ident_data.support.command2 & ATA_SUPPORT_FLUSHCACHE) softc->flags |= ADA_FLAG_CAN_FLUSHCACHE; + if (cgd->ident_data.support.command1 & ATA_SUPPORT_POWERMGT) + softc->flags |= ADA_FLAG_CAN_POWERMGT; if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ && cgd->inq_flags & SID_CmdQue) softc->flags |= ADA_FLAG_CAN_NCQ; @@ -1227,6 +1239,56 @@ adashutdown(void * arg, int howto) /*getcount_only*/0); cam_periph_unlock(periph); } + + if (ada_spindown_shutdown == 0 || + (howto & (RB_HALT | RB_POWEROFF)) == 0) + return; + + TAILQ_FOREACH(periph, &adadriver.units, unit_links) { + union ccb ccb; + + /* If we paniced with lock held - not recurse here. */ + if (cam_periph_owned(periph)) + continue; + cam_periph_lock(periph); + softc = (struct ada_softc *)periph->softc; + /* + * We only spin-down the drive if it is capable of it.. + */ + if ((softc->flags & ADA_FLAG_CAN_POWERMGT) == 0) { + cam_periph_unlock(periph); + continue; + } + + if (bootverbose) + xpt_print(periph->path, "spin-down\n"); + + xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + + ccb.ccb_h.ccb_state = ADA_CCB_DUMP; + cam_fill_ataio(&ccb.ataio, + 1, + adadone, + CAM_DIR_NONE, + 0, + NULL, + 0, + ada_default_timeout*1000); + + ata_28bit_cmd(&ccb.ataio, ATA_STANDBY_IMMEDIATE, 0, 0, 0); + xpt_polled_action(&ccb); + + if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + xpt_print(periph->path, "Spin-down disk failed\n"); + + if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(ccb.ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + cam_periph_unlock(periph); + } } #endif /* _KERNEL */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Oct 24 16:10:32 2010 (r214278) +++ head/sys/cam/cam_xpt.c Sun Oct 24 16:31:57 2010 (r214279) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -153,10 +152,6 @@ static struct xpt_softc xsoftc; TUNABLE_INT("kern.cam.boot_delay", &xsoftc.boot_delay); SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, &xsoftc.boot_delay, 0, "Bus registration wait time"); -static int xpt_power_down = 0; -TUNABLE_INT("kern.cam.power_down", &xpt_power_down); -SYSCTL_INT(_kern_cam, OID_AUTO, power_down, CTLFLAG_RW, - &xpt_power_down, 0, "Power down devices on shutdown"); /* Queues for our software interrupt handler */ typedef TAILQ_HEAD(cam_isrq, ccb_hdr) cam_isrq_t; @@ -250,7 +245,6 @@ static struct cam_ed* xpt_find_device(struct cam_et *target, lun_id_t lun_id); static void xpt_config(void *arg); static xpt_devicefunc_t xptpassannouncefunc; -static void xpt_shutdown(void *arg, int howto); static void xptaction(struct cam_sim *sim, union ccb *work_ccb); static void xptpoll(struct cam_sim *sim); static void camisr(void *); @@ -4538,12 +4532,6 @@ xpt_config(void *arg) #endif /* CAM_DEBUG_BUS */ #endif /* CAMDEBUG */ - /* Register our shutdown event handler */ - if ((EVENTHANDLER_REGISTER(shutdown_final, xpt_shutdown, - NULL, SHUTDOWN_PRI_FIRST)) == NULL) { - printf("xpt_config: failed to register shutdown event.\n"); - } - periphdriver_init(1); xpt_hold_boot(); callout_init(&xsoftc.boot_callout, 1); @@ -4625,87 +4613,6 @@ xpt_finishconfig_task(void *context, int free(context, M_CAMXPT); } -/* - * Power down all devices when we are going to power down the system. - */ -static void -xpt_shutdown_dev_done(struct cam_periph *periph, union ccb *done_ccb) -{ - - /* No-op. We're polling. */ - return; -} - -static int -xpt_shutdown_dev(struct cam_ed *device, void *arg) -{ - union ccb ccb; - struct cam_path path; - - if (device->flags & CAM_DEV_UNCONFIGURED) - return (1); - - if (device->protocol == PROTO_ATA) { - /* Only power down device if it supports power management. */ - if ((device->ident_data.support.command1 & - ATA_SUPPORT_POWERMGT) == 0) - return (1); - } else if (device->protocol != PROTO_SCSI) - return (1); - - xpt_compile_path(&path, - NULL, - device->target->bus->path_id, - device->target->target_id, - device->lun_id); - xpt_setup_ccb(&ccb.ccb_h, &path, CAM_PRIORITY_NORMAL); - if (device->protocol == PROTO_ATA) { - cam_fill_ataio(&ccb.ataio, - 1, - xpt_shutdown_dev_done, - CAM_DIR_NONE, - 0, - NULL, - 0, - 30*1000); - ata_28bit_cmd(&ccb.ataio, ATA_SLEEP, 0, 0, 0); - } else { - scsi_start_stop(&ccb.csio, - /*retries*/1, - xpt_shutdown_dev_done, - MSG_SIMPLE_Q_TAG, - /*start*/FALSE, - /*load/eject*/FALSE, - /*immediate*/TRUE, - SSD_FULL_SIZE, - /*timeout*/50*1000); - } - xpt_polled_action(&ccb); - - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) - xpt_print(&path, "Device power down failed\n"); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - xpt_release_path(&path); - return (1); -} - -static void -xpt_shutdown(void * arg, int howto) -{ - - if (!xpt_power_down) - return; - if ((howto & RB_POWEROFF) == 0) - return; - - xpt_for_all_devices(xpt_shutdown_dev, NULL); -} - cam_status xpt_register_async(int event, ac_callback_t *cbfunc, void *cbarg, struct cam_path *path) Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sun Oct 24 16:10:32 2010 (r214278) +++ head/sys/kern/kern_shutdown.c Sun Oct 24 16:31:57 2010 (r214279) @@ -144,7 +144,7 @@ shutdown_conf(void *unused) { EVENTHANDLER_REGISTER(shutdown_final, poweroff_wait, NULL, - SHUTDOWN_PRI_FIRST + 100); + SHUTDOWN_PRI_FIRST); EVENTHANDLER_REGISTER(shutdown_final, shutdown_halt, NULL, SHUTDOWN_PRI_LAST + 100); EVENTHANDLER_REGISTER(shutdown_final, shutdown_panic, NULL, From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 16:35: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 43CA9106566C; Sun, 24 Oct 2010 16:35:36 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id D06038FC0C; Sun, 24 Oct 2010 16:35:35 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 11E6AE7F6E; Sun, 24 Oct 2010 17:35:35 +0100 (BST) Received: from core.nessbank (client-81-107-142-135.midd.adsl.virginmedia.com [81.107.142.135]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA; Sun, 24 Oct 2010 17:35:34 +0100 (BST) From: Bruce Cran To: src-committers@freebsd.org Date: Sun, 24 Oct 2010 17:35:32 +0100 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.5.1; amd64; ; ) References: <201010241631.o9OGVw1C033817@svn.freebsd.org> In-Reply-To: <201010241631.o9OGVw1C033817@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201010241735.32876.bruce@cran.org.uk> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r214279 - in head: share/man/man4 sys/cam sys/cam/ata 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: Sun, 24 Oct 2010 16:35:36 -0000 On Sunday 24 October 2010 17:31:58 Bruce Cran wrote: > Log: > Mostly revert r203420, and add similar functionality into ada(4) since > the existing code caused problems with some SCSI controllers. > > A new sysctl kern.cam.ada.spindown_shutdown has been added that controls > whether or not to spin-down disks when shutting down. > Spinning down the disks unloads/parks the heads - this is > much better than removing power when the disk is still > spinning because otherwise an Emergency Unload occurs which may cause > damage to the actuator. The FLUSH CACHE + STANDBY IMMEDIATE commands are issued (instead of just SLEEP) following the procedure documented in Fujitsu's MHW series product documentation under section 1.10.1, "Recommended power-off sequence". -- Bruce Cran From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 16:55: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 CEEAE1065670; Sun, 24 Oct 2010 16:55:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD1288FC08; Sun, 24 Oct 2010 16:55: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 o9OGtHb3034337; Sun, 24 Oct 2010 16:55:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OGtHYE034334; Sun, 24 Oct 2010 16:55:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010241655.o9OGtHYE034334@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Oct 2010 16:55: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: r214280 - head/tools/regression/bin/sh/parser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 16:55:17 -0000 Author: jilles Date: Sun Oct 24 16:55:17 2010 New Revision: 214280 URL: http://svn.freebsd.org/changeset/base/214280 Log: sh: Add some testcases for alias expansion. Added: head/tools/regression/bin/sh/parser/alias1.0 (contents, props changed) head/tools/regression/bin/sh/parser/alias2.0 (contents, props changed) Added: head/tools/regression/bin/sh/parser/alias1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias1.0 Sun Oct 24 16:55:17 2010 (r214280) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +alias alias0=exit +eval 'alias0 0' +exit 1 Added: head/tools/regression/bin/sh/parser/alias2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias2.0 Sun Oct 24 16:55:17 2010 (r214280) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +alias alias0=exit +x=alias0 +eval 'case $x in alias0) exit 0;; esac' +exit 1 From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:03: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 3F6E8106566C; Sun, 24 Oct 2010 17:03:23 +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 676188FC13; Sun, 24 Oct 2010 17:03:21 +0000 (UTC) Received: by fxm17 with SMTP id 17so2179951fxm.13 for ; Sun, 24 Oct 2010 10:03:21 -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=mCIztr/xowHskuQsaz9rG/AXkbudb6MEwChNz7qITpI=; b=jDvkYfB56w5X0z2HcTIjWJOK+FX/3WWC5rwbLh6khhUwufk30YHKTsnoYOvbxYW8Sm aMbx3JvFVlgPgUi6DEd4JUMMtvAob6v4u4oPAx+cX68clTm9LsWcyO8GBEPa1i1GbA9H CwQDolM9ar6i3k62hXuwiTH2ryjHRZaMOkc8I= 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=Y8lkaTw/cRjULrnssFzNmCzsIqVM1mc4uYYuRgc/4egyrGl9EY9UG01T7Aqr0j9P3i SfUFrzwql57n69hKTXrT5UnWpdGq3Kx891Zai+2+4F51lkiPDbqLhg7FP2Jd9vCuXDWJ 8/7Ymvk275ALiKASQWNYhGxp0A5laJy6E/9vY= Received: by 10.103.192.8 with SMTP id u8mr6771297mup.20.1287939801167; Sun, 24 Oct 2010 10:03:21 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n8sm2443619faa.7.2010.10.24.10.03.18 (version=SSLv3 cipher=RC4-MD5); Sun, 24 Oct 2010 10:03:19 -0700 (PDT) Sender: Alexander Motin Message-ID: <4CC466D5.6080306@FreeBSD.org> Date: Sun, 24 Oct 2010 20:03:17 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Bruce Cran References: <201010241631.o9OGVw1C033817@svn.freebsd.org> <201010241735.32876.bruce@cran.org.uk> In-Reply-To: <201010241735.32876.bruce@cran.org.uk> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214279 - in head: share/man/man4 sys/cam sys/cam/ata 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: Sun, 24 Oct 2010 17:03:23 -0000 Bruce Cran wrote: > On Sunday 24 October 2010 17:31:58 Bruce Cran wrote: > >> Log: >> Mostly revert r203420, and add similar functionality into ada(4) since >> the existing code caused problems with some SCSI controllers. Proper way would be IMHO to fix polling in aac driver. >> A new sysctl kern.cam.ada.spindown_shutdown has been added that controls >> whether or not to spin-down disks when shutting down. >> Spinning down the disks unloads/parks the heads - this is >> much better than removing power when the disk is still >> spinning because otherwise an Emergency Unload occurs which may cause >> damage to the actuator. > > The FLUSH CACHE + STANDBY IMMEDIATE commands are issued (instead of just > SLEEP) following the procedure documented in Fujitsu's MHW series product > documentation under section 1.10.1, "Recommended power-off sequence". Not instead of "just SLEEP", but instead of FLUSH CACHE (by respective peripheral driver) + SLEEP (by xpt). It should probably be the same. Just for the note, SCSI specification states that STOP automatically implies FLUSH CACHE. ATA - doesn't. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:06: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 697A8106566B; Sun, 24 Oct 2010 17:06:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CFA58FC1F; Sun, 24 Oct 2010 17:06: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 o9OH6o59034600; Sun, 24 Oct 2010 17:06:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OH6oOV034597; Sun, 24 Oct 2010 17:06:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010241706.o9OH6oOV034597@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Oct 2010 17:06: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: r214281 - in head: bin/sh tools/regression/bin/sh/parser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 17:06:50 -0000 Author: jilles Date: Sun Oct 24 17:06:49 2010 New Revision: 214281 URL: http://svn.freebsd.org/changeset/base/214281 Log: sh: Change ! within a pipeline to start a new pipeline instead. This is how ksh93 treats ! within a pipeline and makes the ! in a | ! b | c negate the exit status of the pipeline, as if it were a | { ! b | c; } Side effect: something like f() ! a is now a syntax error, because a function definition takes a command, not a pipeline. Exp-run done by: pav (with some other sh(1) changes) Added: head/tools/regression/bin/sh/parser/pipe-not1.0 (contents, props changed) Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Oct 24 16:55:17 2010 (r214280) +++ head/bin/sh/parser.c Sun Oct 24 17:06:49 2010 (r214281) @@ -328,7 +328,7 @@ pipeline(void) { union node *n1, *n2, *pipenode; struct nodelist *lp, *prev; - int negate; + int negate, t; negate = 0; checkkwd = 2; @@ -347,7 +347,13 @@ pipeline(void) do { prev = lp; lp = (struct nodelist *)stalloc(sizeof (struct nodelist)); - lp->n = command(); + checkkwd = 2; + t = readtoken(); + tokpushback++; + if (t == TNOT) + lp->n = pipeline(); + else + lp->n = command(); prev->next = lp; } while (readtoken() == TPIPE); lp->next = NULL; @@ -372,7 +378,7 @@ command(void) union node *ap, **app; union node *cp, **cpp; union node *redir, **rpp; - int t, negate = 0; + int t; checkkwd = 2; redir = NULL; @@ -387,12 +393,6 @@ command(void) } tokpushback++; - while (readtoken() == TNOT) { - TRACE(("command: TNOT recognized\n")); - negate = !negate; - } - tokpushback++; - switch (readtoken()) { case TIF: n1 = (union node *)stalloc(sizeof (struct nif)); @@ -573,7 +573,7 @@ TRACE(("expecting DO got %s %s\n", tokna case TRP: tokpushback++; n1 = simplecmd(rpp, redir); - goto checkneg; + return n1; default: synexpect(-1); } @@ -596,15 +596,7 @@ TRACE(("expecting DO got %s %s\n", tokna n1->nredir.redirect = redir; } -checkneg: - if (negate) { - n2 = (union node *)stalloc(sizeof (struct nnot)); - n2->type = NNOT; - n2->nnot.com = n1; - return n2; - } - else - return n1; + return n1; } Added: head/tools/regression/bin/sh/parser/pipe-not1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/pipe-not1.0 Sun Oct 24 17:06:49 2010 (r214281) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +: | ! : | false From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:22: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 F22391065675; Sun, 24 Oct 2010 17:22:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6B038FC0A; Sun, 24 Oct 2010 17:22: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 o9OHMYMW034966; Sun, 24 Oct 2010 17:22:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OHMYXS034963; Sun, 24 Oct 2010 17:22:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010241722.o9OHMYXS034963@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 24 Oct 2010 17:22: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: r214282 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 17:22:35 -0000 Author: pjd Date: Sun Oct 24 17:22:34 2010 New Revision: 214282 URL: http://svn.freebsd.org/changeset/base/214282 Log: Move all NV defines into nv.c, they are not used externally thus there is no need to make then visible from outside. MFC after: 3 days Modified: head/sbin/hastd/nv.c head/sbin/hastd/nv.h Modified: head/sbin/hastd/nv.c ============================================================================== --- head/sbin/hastd/nv.c Sun Oct 24 17:06:49 2010 (r214281) +++ head/sbin/hastd/nv.c Sun Oct 24 17:22:34 2010 (r214282) @@ -46,6 +46,33 @@ __FBSDID("$FreeBSD$"); #include #include +#define NV_TYPE_INT8 1 +#define NV_TYPE_UINT8 2 +#define NV_TYPE_INT16 3 +#define NV_TYPE_UINT16 4 +#define NV_TYPE_INT32 5 +#define NV_TYPE_UINT32 6 +#define NV_TYPE_INT64 7 +#define NV_TYPE_UINT64 8 +#define NV_TYPE_INT8_ARRAY 9 +#define NV_TYPE_UINT8_ARRAY 10 +#define NV_TYPE_INT16_ARRAY 11 +#define NV_TYPE_UINT16_ARRAY 12 +#define NV_TYPE_INT32_ARRAY 13 +#define NV_TYPE_UINT32_ARRAY 14 +#define NV_TYPE_INT64_ARRAY 15 +#define NV_TYPE_UINT64_ARRAY 16 +#define NV_TYPE_STRING 17 + +#define NV_TYPE_MASK 0x7f +#define NV_TYPE_FIRST NV_TYPE_INT8 +#define NV_TYPE_LAST NV_TYPE_STRING + +#define NV_ORDER_NETWORK 0x00 +#define NV_ORDER_HOST 0x80 + +#define NV_ORDER_MASK 0x80 + #define NV_MAGIC 0xaea1e struct nv { int nv_magic; Modified: head/sbin/hastd/nv.h ============================================================================== --- head/sbin/hastd/nv.h Sun Oct 24 17:06:49 2010 (r214281) +++ head/sbin/hastd/nv.h Sun Oct 24 17:22:34 2010 (r214282) @@ -41,33 +41,6 @@ #include -#define NV_TYPE_INT8 1 -#define NV_TYPE_UINT8 2 -#define NV_TYPE_INT16 3 -#define NV_TYPE_UINT16 4 -#define NV_TYPE_INT32 5 -#define NV_TYPE_UINT32 6 -#define NV_TYPE_INT64 7 -#define NV_TYPE_UINT64 8 -#define NV_TYPE_INT8_ARRAY 9 -#define NV_TYPE_UINT8_ARRAY 10 -#define NV_TYPE_INT16_ARRAY 11 -#define NV_TYPE_UINT16_ARRAY 12 -#define NV_TYPE_INT32_ARRAY 13 -#define NV_TYPE_UINT32_ARRAY 14 -#define NV_TYPE_INT64_ARRAY 15 -#define NV_TYPE_UINT64_ARRAY 16 -#define NV_TYPE_STRING 17 - -#define NV_TYPE_MASK 0x7f -#define NV_TYPE_FIRST NV_TYPE_INT8 -#define NV_TYPE_LAST NV_TYPE_STRING - -#define NV_ORDER_NETWORK 0x00 -#define NV_ORDER_HOST 0x80 - -#define NV_ORDER_MASK 0x80 - struct nv; struct nv *nv_alloc(void); From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:24: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 CA360106566B; Sun, 24 Oct 2010 17:24:08 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E4948FC08; Sun, 24 Oct 2010 17:24: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 o9OHO8Hs035034; Sun, 24 Oct 2010 17:24:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OHO8FU035031; Sun, 24 Oct 2010 17:24:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010241724.o9OHO8FU035031@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 24 Oct 2010 17:24: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: r214283 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 17:24:08 -0000 Author: pjd Date: Sun Oct 24 17:24:08 2010 New Revision: 214283 URL: http://svn.freebsd.org/changeset/base/214283 Log: Implement nv_exists() function that returns true if argument of the given name exists. MFC after: 3 days Modified: head/sbin/hastd/nv.c head/sbin/hastd/nv.h Modified: head/sbin/hastd/nv.c ============================================================================== --- head/sbin/hastd/nv.c Sun Oct 24 17:22:34 2010 (r214282) +++ head/sbin/hastd/nv.c Sun Oct 24 17:24:08 2010 (r214283) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define NV_TYPE_NONE 0 + #define NV_TYPE_INT8 1 #define NV_TYPE_UINT8 2 #define NV_TYPE_INT16 3 @@ -561,6 +563,29 @@ nv_get_string(struct nv *nv, const char return (str); } +bool +nv_exists(struct nv *nv, const char *namefmt, ...) +{ + struct nvhdr *nvh; + va_list nameap; + int snverror, serrno; + + if (nv == NULL) + return (false); + + serrno = errno; + snverror = nv->nv_error; + + va_start(nameap, namefmt); + nvh = nv_find(nv, NV_TYPE_NONE, namefmt, nameap); + va_end(nameap); + + errno = serrno; + nv->nv_error = snverror; + + return (nvh != NULL); +} + /* * Dump content of the nv structure. */ @@ -797,7 +822,8 @@ nv_find(struct nv *nv, int type, const c assert(size >= NVH_SIZE(nvh)); nv_swap(nvh, true); if (strcmp(nvh->nvh_name, name) == 0) { - if ((nvh->nvh_type & NV_TYPE_MASK) != type) { + if (type != NV_TYPE_NONE && + (nvh->nvh_type & NV_TYPE_MASK) != type) { errno = EINVAL; if (nv->nv_error == 0) nv->nv_error = EINVAL; Modified: head/sbin/hastd/nv.h ============================================================================== --- head/sbin/hastd/nv.h Sun Oct 24 17:22:34 2010 (r214282) +++ head/sbin/hastd/nv.h Sun Oct 24 17:24:08 2010 (r214283) @@ -126,6 +126,7 @@ const uint64_t *nv_get_uint64_array(stru const char *nv_get_string(struct nv *nv, const char *namefmt, ...) __printflike(2, 3); +bool nv_exists(struct nv *nv, const char *namefmt, ...) __printflike(2, 3); void nv_dump(struct nv *nv); #endif /* !_NV_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:28: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 C1CCD106564A; Sun, 24 Oct 2010 17:28:25 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B01468FC1A; Sun, 24 Oct 2010 17:28: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 o9OHSP6H035154; Sun, 24 Oct 2010 17:28:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OHSPQV035151; Sun, 24 Oct 2010 17:28:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010241728.o9OHSPQV035151@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 24 Oct 2010 17:28: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: r214284 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 17:28:25 -0000 Author: pjd Date: Sun Oct 24 17:28:25 2010 New Revision: 214284 URL: http://svn.freebsd.org/changeset/base/214284 Log: Before this change on first connect between primary and secondary we initialize all the data. This is huge waste of time and resources if there were no writes yet, as there is no real data to synchronize. Optimize this by sending "virgin" argument to secondary, which gives it a hint that synchronization is not needed. In the common case (where noth nodes are configured at the same time) instead of synchronizing everything, we don't synchronize at all. MFC after: 1 week Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Oct 24 17:24:08 2010 (r214283) +++ head/sbin/hastd/primary.c Sun Oct 24 17:28:25 2010 (r214284) @@ -417,6 +417,24 @@ init_environment(struct hast_resource *r } } +static bool +init_resuid(struct hast_resource *res) +{ + + mtx_lock(&metadata_lock); + if (res->hr_resuid != 0) { + mtx_unlock(&metadata_lock); + return (false); + } else { + /* Initialize unique resource identifier. */ + arc4random_buf(&res->hr_resuid, sizeof(res->hr_resuid)); + mtx_unlock(&metadata_lock); + if (metadata_write(res) < 0) + exit(EX_NOINPUT); + return (true); + } +} + static void init_local(struct hast_resource *res) { @@ -452,10 +470,12 @@ init_local(struct hast_resource *res) if (res->hr_resuid != 0) return; /* - * We're using provider for the first time, so we have to generate - * resource unique identifier and initialize local and remote counts. + * We're using provider for the first time. Initialize local and remote + * counters. We don't initialize resuid here, as we want to do it just + * in time. The reason for this is that we want to inform secondary + * that there were no writes yet, so there is no need to synchronize + * anything. */ - arc4random_buf(&res->hr_resuid, sizeof(res->hr_resuid)); res->hr_primary_localcnt = 1; res->hr_primary_remotecnt = 0; if (metadata_write(res) < 0) @@ -566,6 +586,19 @@ init_remote(struct hast_resource *res, s nv_add_string(nvout, res->hr_name, "resource"); nv_add_uint8_array(nvout, res->hr_token, sizeof(res->hr_token), "token"); + if (res->hr_resuid == 0) { + /* + * The resuid field was not yet initialized. + * Because we do synchronization inside init_resuid(), it is + * possible that someone already initialized it, the function + * will return false then, but if we successfully initialized + * it, we will get true. True means that there were no writes + * to this resource yet and we want to inform secondary that + * synchronization is not needed by sending "virgin" argument. + */ + if (init_resuid(res)) + nv_add_int8(nvout, 1, "virgin"); + } nv_add_uint64(nvout, res->hr_resuid, "resuid"); nv_add_uint64(nvout, res->hr_primary_localcnt, "localcnt"); nv_add_uint64(nvout, res->hr_primary_remotecnt, "remotecnt"); @@ -1006,6 +1039,10 @@ ggate_recv_thread(void *arg) QUEUE_INSERT1(hio, send, ncomp); break; case BIO_WRITE: + if (res->hr_resuid == 0) { + /* This is first write, initialize resuid. */ + (void)init_resuid(res); + } for (;;) { mtx_lock(&range_lock); if (rangelock_islocked(range_sync, Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Sun Oct 24 17:24:08 2010 (r214283) +++ head/sbin/hastd/secondary.c Sun Oct 24 17:28:25 2010 (r214284) @@ -243,13 +243,22 @@ init_remote(struct hast_resource *res, s */ if (res->hr_resuid == 0) { /* - * Provider is used for the first time. Initialize everything. + * Provider is used for the first time. If primary node done no + * writes yet as well (we will find "virgin" argument) then + * there is no need to synchronize anything. If primary node + * done any writes already we have to synchronize everything. */ assert(res->hr_secondary_localcnt == 0); res->hr_resuid = resuid; if (metadata_write(res) < 0) exit(EX_NOINPUT); - memset(map, 0xff, mapsize); + if (nv_exists(nvin, "virgin")) { + free(map); + map = NULL; + mapsize = 0; + } else { + memset(map, 0xff, mapsize); + } nv_add_uint8(nvout, HAST_SYNCSRC_PRIMARY, "syncsrc"); } else if ( /* Is primary is out-of-date? */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:40: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 5E22C106564A; Sun, 24 Oct 2010 17:40:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C5478FC20; Sun, 24 Oct 2010 17:40: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 o9OHeJdm035432; Sun, 24 Oct 2010 17:40:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OHeJA2035430; Sun, 24 Oct 2010 17:40:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010241740.o9OHeJA2035430@svn.freebsd.org> From: Alexander Motin Date: Sun, 24 Oct 2010 17:40:19 +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: r214285 - stable/8/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 17:40:19 -0000 Author: mav Date: Sun Oct 24 17:40:19 2010 New Revision: 214285 URL: http://svn.freebsd.org/changeset/base/214285 Log: MFC r212991: Decrease poll interval from 1000 to 100us. This significantly reduces kernel dump time, especially with minidump. Modified: stable/8/sys/cam/cam_xpt.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) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Sun Oct 24 17:28:25 2010 (r214284) +++ stable/8/sys/cam/cam_xpt.c Sun Oct 24 17:40:19 2010 (r214285) @@ -2876,7 +2876,7 @@ xpt_polled_action(union ccb *start_ccb) struct cam_ed *dev; - timeout = start_ccb->ccb_h.timeout; + timeout = start_ccb->ccb_h.timeout * 10; sim = start_ccb->ccb_h.path->bus->sim; devq = sim->devq; dev = start_ccb->ccb_h.path->device; @@ -2892,7 +2892,7 @@ xpt_polled_action(union ccb *start_ccb) while(((devq != NULL && devq->send_openings <= 0) || dev->ccbq.dev_openings < 0) && (--timeout > 0)) { - DELAY(1000); + DELAY(100); (*(sim->sim_poll))(sim); camisr_runqueue(&sim->sim_doneq); } @@ -2908,7 +2908,7 @@ xpt_polled_action(union ccb *start_ccb) if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) break; - DELAY(1000); + DELAY(100); } if (timeout == 0) { /* From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:42: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 70F87106566B; Sun, 24 Oct 2010 17:42:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED1C8FC15; Sun, 24 Oct 2010 17:42: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 o9OHgfCJ035526; Sun, 24 Oct 2010 17:42:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OHgfFW035523; Sun, 24 Oct 2010 17:42:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010241742.o9OHgfFW035523@svn.freebsd.org> From: Alexander Motin Date: Sun, 24 Oct 2010 17:42: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: r214286 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 17:42:41 -0000 Author: mav Date: Sun Oct 24 17:42:41 2010 New Revision: 214286 URL: http://svn.freebsd.org/changeset/base/214286 Log: MFC r213509: Add ID for Vodafone (ZTE) Mobile Broadband K3565-Z modem. Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs 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) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sun Oct 24 17:40:19 2010 (r214285) +++ stable/8/sys/dev/usb/serial/u3g.c Sun Oct 24 17:42:41 2010 (r214286) @@ -408,6 +408,7 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0078, 0), U3G_DEV(QUALCOMMINC, E0082, 0), U3G_DEV(QUALCOMMINC, E0086, 0), + U3G_DEV(QUALCOMMINC, E2000, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, MF626, 0), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sun Oct 24 17:40:19 2010 (r214285) +++ stable/8/sys/dev/usb/usbdevs Sun Oct 24 17:42:41 2010 (r214286) @@ -2636,6 +2636,7 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC E2000 0x2000 3G modem product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:48: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 952CE106566C; Sun, 24 Oct 2010 17:48:03 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id A58D38FC0C; Sun, 24 Oct 2010 17:48:02 +0000 (UTC) Received: by wwb24 with SMTP id 24so2524953wwb.31 for ; Sun, 24 Oct 2010 10:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=kn1xHWXUzSuEBBiJnszf3n8EHIEk98x4G3Xvi/1obXI=; b=sglQFp5RvQMhS0fWpO53BnjWkRQ66FfMEvw1xpQ3MoFjF+9w4jbsxEAmwoTHLVUdNp bEdHaTl+Tl8iP3R3ycZb075r4nYA3Mb9fi7vV8GB2OcWdGObns4RgkRv7jw4A/Pz//gC H3LIIcWVmYPxGU+pgCVxqalx15WuCVva3lcKQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=LVGbwBVFR3eE8OZ5KglK3p8LYL2uFFTL3rKUiakLJcfkkhkvI9hZG8pIt4AsqYSfZr 1z8HpmrWVjDf1VYOaxGwB+7sbHVNssyEyQFkUT6vQ05iYEzxmGmqHFAONk59i6hdYg/Q 00z9HPnDcBde1h3zxR++bpRkTWR+I+ODbCRdY= MIME-Version: 1.0 Received: by 10.216.51.21 with SMTP id a21mr5182008wec.50.1287942481516; Sun, 24 Oct 2010 10:48:01 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.10.198 with HTTP; Sun, 24 Oct 2010 10:48:01 -0700 (PDT) In-Reply-To: <4CC466D5.6080306@FreeBSD.org> References: <201010241631.o9OGVw1C033817@svn.freebsd.org> <201010241735.32876.bruce@cran.org.uk> <4CC466D5.6080306@FreeBSD.org> Date: Sun, 24 Oct 2010 10:48:01 -0700 X-Google-Sender-Auth: nCRq69EH9kF-5fbE9fnXC4NqJJM Message-ID: From: Garrett Cooper To: Alexander Motin Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214279 - in head: share/man/man4 sys/cam sys/cam/ata 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: Sun, 24 Oct 2010 17:48:03 -0000 On Sun, Oct 24, 2010 at 10:03 AM, Alexander Motin wrote: > Bruce Cran wrote: >> On Sunday 24 October 2010 17:31:58 Bruce Cran wrote: >> >>> Log: >>> =A0 Mostly revert r203420, and add similar functionality into ada(4) si= nce >>> the existing code caused problems with some SCSI controllers. > > Proper way would be IMHO to fix polling in aac driver. > >>> =A0 A new sysctl kern.cam.ada.spindown_shutdown has been added that con= trols >>> =A0 whether or not to spin-down disks when shutting down. >>> =A0 Spinning down the disks unloads/parks the heads - this is >>> =A0 much better than removing power when the disk is still >>> =A0 spinning because otherwise an Emergency Unload occurs which may cau= se >>> damage to the actuator. >> >> The FLUSH CACHE + STANDBY IMMEDIATE commands are issued (instead of just >> SLEEP) following the procedure documented in Fujitsu's MHW series produc= t >> documentation under section 1.10.1, "Recommended power-off sequence". > > Not instead of "just SLEEP", but instead of FLUSH CACHE (by respective > peripheral driver) + SLEEP (by xpt). It should probably be the same. > > Just for the note, SCSI specification states that STOP automatically > implies FLUSH CACHE. ATA - doesn't. I could be wrong, but I think the ANSI ATA<->SCSI spec states otherwise (taken from ANSI INCITS 431-2007 page 62 -- see steps 1-4): 9.11.3 START STOP UNIT START bit LOEJ bit combinations The SATL shall perform the actions shown in table 40 in response to a START STOP UNIT command. Table 40 =97 Definition of START and LOEJ bits in the START STOP UNIT CDB START LOEJ Definition 0 0 The SATL shall: 1) If the IMMED bit is set to one, then return GOOD status; 2) Issue an ATA flush command (see 3.1.11) to the ATA device; 3) If the ATA flush command completes with any error, then process ending s= tatus according to the IMMED bit (see 9.11.2) with the additional sense code set = to COMMAND SEQUENCE ERROR; 4) If the ATA flush command completes without error, then issue an ATA STAN= DBY IMMEDIATE command to the ATA Sector Count set to zero; 5) If the ATA STANDBY IMMEDIATE command completes with any error, then process ending status according to the IMMED bit (see 9.11.2) with the additional sense code set to COMMAND SEQUENCE ERROR; and 6) If the ATA STANDBY IMMEDIATE command completes without error and the IMMED bit is set to zero, then return GOOD status (see 9.11.2) a. Not sure about the ATA spec standalone... might be present in the ATA8 = spec. Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:55: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 5820A1065673; Sun, 24 Oct 2010 17:55:20 +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 856868FC18; Sun, 24 Oct 2010 17:55:18 +0000 (UTC) Received: by fxm17 with SMTP id 17so2207419fxm.13 for ; Sun, 24 Oct 2010 10:55:18 -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=olUGFM9qA7DvZC9LUgMAyNO4slEoSGQ7lx5cQzVvYZE=; b=J/2gu0k+MCc3WJW7i+ocbYfbC78oqMl9pXJkxD7bQOMXboA52DzJwBwO+3zUCdcMmZ VcHTMbifpSxDA/CbnE1pKSaHRblwciUYGCqMH7jmmwQ1oyZhoI9YVGgnMY6/L71awnLM 6HqGdcsWIb4Iolwn+xHlTpKt+zPMC2Z4qeSEM= 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=NM7/Xzcd0U9dzAMdXrTnpCyvHuGQt7UdGr5Hs611hSgeiCQ5q+9fdaRRobQD9BJX96 Ub6hzF+Ma5R0awKK04wuJEnW3ZtIRd5Y+Duo6yGK7u29wY+a7mpxj2zHV4SF7xDczlTV +8F3OpziE70kXmKtpXMzZGLWxI1ivy9RTWfrM= Received: by 10.102.244.13 with SMTP id r13mr798456muh.14.1287942918087; Sun, 24 Oct 2010 10:55:18 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id p2sm2458753fak.22.2010.10.24.10.55.15 (version=SSLv3 cipher=RC4-MD5); Sun, 24 Oct 2010 10:55:17 -0700 (PDT) Sender: Alexander Motin Message-ID: <4CC47301.9020609@FreeBSD.org> Date: Sun, 24 Oct 2010 20:55:13 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Garrett Cooper References: <201010241631.o9OGVw1C033817@svn.freebsd.org> <201010241735.32876.bruce@cran.org.uk> <4CC466D5.6080306@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214279 - in head: share/man/man4 sys/cam sys/cam/ata 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: Sun, 24 Oct 2010 17:55:20 -0000 Garrett Cooper wrote: > On Sun, Oct 24, 2010 at 10:03 AM, Alexander Motin wrote: >> Bruce Cran wrote: >>> On Sunday 24 October 2010 17:31:58 Bruce Cran wrote: >>> >>>> Log: >>>> Mostly revert r203420, and add similar functionality into ada(4) since >>>> the existing code caused problems with some SCSI controllers. >> Proper way would be IMHO to fix polling in aac driver. >> >>>> A new sysctl kern.cam.ada.spindown_shutdown has been added that controls >>>> whether or not to spin-down disks when shutting down. >>>> Spinning down the disks unloads/parks the heads - this is >>>> much better than removing power when the disk is still >>>> spinning because otherwise an Emergency Unload occurs which may cause >>>> damage to the actuator. >>> The FLUSH CACHE + STANDBY IMMEDIATE commands are issued (instead of just >>> SLEEP) following the procedure documented in Fujitsu's MHW series product >>> documentation under section 1.10.1, "Recommended power-off sequence". >> Not instead of "just SLEEP", but instead of FLUSH CACHE (by respective >> peripheral driver) + SLEEP (by xpt). It should probably be the same. >> >> Just for the note, SCSI specification states that STOP automatically >> implies FLUSH CACHE. ATA - doesn't. > > I could be wrong, but I think the ANSI ATA<->SCSI spec states > otherwise (taken from ANSI INCITS 431-2007 page 62 -- see steps 1-4): > > 9.11.3 START STOP UNIT START bit LOEJ bit combinations > The SATL shall perform the actions shown in table 40 in response to a > START STOP UNIT command. > Table 40 — Definition of START and LOEJ bits in the START STOP UNIT CDB > START LOEJ Definition > 0 0 The SATL shall: > 1) If the IMMED bit is set to one, then return GOOD status; > 2) Issue an ATA flush command (see 3.1.11) to the ATA device; > 3) If the ATA flush command completes with any error, then process ending status > according to the IMMED bit (see 9.11.2) with the additional sense code set to > COMMAND SEQUENCE ERROR; > 4) If the ATA flush command completes without error, then issue an ATA STANDBY > IMMEDIATE command to the ATA Sector Count set to zero; > 5) If the ATA STANDBY IMMEDIATE command completes with any error, then > process ending status according to the IMMED bit (see 9.11.2) with the > additional > sense code set to COMMAND SEQUENCE ERROR; and > 6) If the ATA STANDBY IMMEDIATE command completes without error and the > IMMED bit is set to zero, then return GOOD status (see 9.11.2) a. > > Not sure about the ATA spec standalone... might be present in the ATA8 spec. As I understand, this just confirms what I have said: SCSI STOP == ATA FLUSH CACHE + STANDBY IMMEDIATE. So SCSI STOP implies flush, while ATA STANDBY IMMEDIATE doesn't. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 17:58: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 F2867106566C; Sun, 24 Oct 2010 17:58:54 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0C3D58FC12; Sun, 24 Oct 2010 17:58:53 +0000 (UTC) Received: by wyb42 with SMTP id 42so2589317wyb.13 for ; Sun, 24 Oct 2010 10:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=6kjr9i32ab5fHwYwIVchjyD9CvV35F65tFSJKzia9II=; b=SPOe/DUkwXM6RGzpIssy//ILX+JsNyEZVpk3g5xLsIEo2v8CF2XUN60MC6vqHTKDSL w9XyIwb9sLspodpQcBZq9x0akfReBZfr3t26V5mC5EHZHI2gB03nrQCb0kUlKEmoqeQd +K4s64aCWIgZDrobYHMoPtBRiiSZ9pGgGOsdY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=XCgrs+OxwfcaQCJ4nUgF5w94OGx3W2FDjAIgSBrdlLZWElwl0QmjnZGQmy3LMCODv8 QjeKDCmkib3it7y0ZQKvEXWTwFSAOg0n5WqixqjcKo3HfCtSuojyuo7U2iIcr6Rae3YL oSppMhd3u/z9OteLmdOv8utB1psBpVmOiPHd0= MIME-Version: 1.0 Received: by 10.216.188.197 with SMTP id a47mr5168480wen.70.1287943132906; Sun, 24 Oct 2010 10:58:52 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.10.198 with HTTP; Sun, 24 Oct 2010 10:58:52 -0700 (PDT) In-Reply-To: <4CC47301.9020609@FreeBSD.org> References: <201010241631.o9OGVw1C033817@svn.freebsd.org> <201010241735.32876.bruce@cran.org.uk> <4CC466D5.6080306@FreeBSD.org> <4CC47301.9020609@FreeBSD.org> Date: Sun, 24 Oct 2010 10:58:52 -0700 X-Google-Sender-Auth: KbrTlV6qYtzOfp6kVVNG4ndNQ64 Message-ID: From: Garrett Cooper To: Alexander Motin Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214279 - in head: share/man/man4 sys/cam sys/cam/ata 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: Sun, 24 Oct 2010 17:58:55 -0000 On Sun, Oct 24, 2010 at 10:55 AM, Alexander Motin wrote: > Garrett Cooper wrote: >> On Sun, Oct 24, 2010 at 10:03 AM, Alexander Motin wrot= e: >>> Bruce Cran wrote: >>>> On Sunday 24 October 2010 17:31:58 Bruce Cran wrote: >>>> >>>>> Log: >>>>> =A0 Mostly revert r203420, and add similar functionality into ada(4) = since >>>>> the existing code caused problems with some SCSI controllers. >>> Proper way would be IMHO to fix polling in aac driver. >>> >>>>> =A0 A new sysctl kern.cam.ada.spindown_shutdown has been added that c= ontrols >>>>> =A0 whether or not to spin-down disks when shutting down. >>>>> =A0 Spinning down the disks unloads/parks the heads - this is >>>>> =A0 much better than removing power when the disk is still >>>>> =A0 spinning because otherwise an Emergency Unload occurs which may c= ause >>>>> damage to the actuator. >>>> The FLUSH CACHE + STANDBY IMMEDIATE commands are issued (instead of ju= st >>>> SLEEP) following the procedure documented in Fujitsu's MHW series prod= uct >>>> documentation under section 1.10.1, "Recommended power-off sequence". >>> Not instead of "just SLEEP", but instead of FLUSH CACHE (by respective >>> peripheral driver) + SLEEP (by xpt). It should probably be the same. >>> >>> Just for the note, SCSI specification states that STOP automatically >>> implies FLUSH CACHE. ATA - doesn't. >> >> =A0 =A0 I could be wrong, but I think the ANSI ATA<->SCSI spec states >> otherwise (taken from ANSI INCITS 431-2007 page 62 -- see steps 1-4): >> >> 9.11.3 START STOP UNIT START bit LOEJ bit combinations >> The SATL shall perform the actions shown in table 40 in response to a >> START STOP UNIT command. >> Table 40 =97 Definition of START and LOEJ bits in the START STOP UNIT CD= B >> START LOEJ Definition >> 0 0 The SATL shall: >> 1) If the IMMED bit is set to one, then return GOOD status; >> 2) Issue an ATA flush command (see 3.1.11) to the ATA device; >> 3) If the ATA flush command completes with any error, then process endin= g status >> according to the IMMED bit (see 9.11.2) with the additional sense code s= et to >> COMMAND SEQUENCE ERROR; >> 4) If the ATA flush command completes without error, then issue an ATA S= TANDBY >> IMMEDIATE command to the ATA Sector Count set to zero; >> 5) If the ATA STANDBY IMMEDIATE command completes with any error, then >> process ending status according to the IMMED bit (see 9.11.2) with the >> additional >> sense code set to COMMAND SEQUENCE ERROR; and >> 6) If the ATA STANDBY IMMEDIATE command completes without error and the >> IMMED bit is set to zero, then return GOOD status (see 9.11.2) a. >> >> =A0 =A0 Not sure about the ATA spec standalone... might be present in th= e ATA8 spec. > > As I understand, this just confirms what I have said: > SCSI STOP =3D=3D ATA FLUSH CACHE + STANDBY IMMEDIATE. > So SCSI STOP implies flush, while ATA STANDBY IMMEDIATE doesn't. Looking at it from that perspective, I agree. From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 18:12: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 6A603106564A; Sun, 24 Oct 2010 18:12:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57D9F8FC0A; Sun, 24 Oct 2010 18:12: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 o9OICBPX036168; Sun, 24 Oct 2010 18:12:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OICB2p036165; Sun, 24 Oct 2010 18:12:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201010241812.o9OICB2p036165@svn.freebsd.org> From: Ed Schouten Date: Sun, 24 Oct 2010 18:12:11 +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: r214287 - stable/8/contrib/ee X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 18:12:11 -0000 Author: ed Date: Sun Oct 24 18:12:11 2010 New Revision: 214287 URL: http://svn.freebsd.org/changeset/base/214287 Log: MFC r213567: Import ee 1.5.2 into HEAD. PR: bin/145921 Modified: stable/8/contrib/ee/ee.c stable/8/contrib/ee/ee_version.h Directory Properties: stable/8/contrib/ee/ (props changed) Modified: stable/8/contrib/ee/ee.c ============================================================================== --- stable/8/contrib/ee/ee.c Sun Oct 24 17:42:41 2010 (r214286) +++ stable/8/contrib/ee/ee.c Sun Oct 24 18:12:11 2010 (r214287) @@ -50,7 +50,7 @@ | proprietary information which is protected by | copyright. All rights are reserved. | - | $Header: /home/hugh/sources/old_ae/RCS/ee.c,v 1.102 2009/02/17 03:22:50 hugh Exp hugh $ + | $Header: /home/hugh/sources/old_ae/RCS/ee.c,v 1.104 2010/06/04 01:55:31 hugh Exp hugh $ | */ @@ -62,7 +62,7 @@ char *ee_copyright_message = #include "ee_version.h" -char *version = "@(#) ee, version " EE_VERSION " $Revision: 1.102 $"; +char *version = "@(#) ee, version " EE_VERSION " $Revision: 1.104 $"; #ifdef NCURSE #include "new_curse.h" @@ -307,7 +307,7 @@ void undel_word P_((void)); void del_line P_((void)); void undel_line P_((void)); void adv_word P_((void)); -void move_rel P_((char *direction, int lines)); +void move_rel P_((char direction, int lines)); void eol P_((void)); void bol P_((void)); void adv_line P_((void)); @@ -816,7 +816,7 @@ int disp; tp++; temp2++; } - if (scr_horz < horiz_offset) + if ((scr_horz < horiz_offset) && (horiz_offset > 0)) { horiz_offset -= 8; midscreen(scr_vert, point); @@ -824,7 +824,6 @@ int disp; } else if (curr_line->prev_line != NULL) { - absolute_lin--; text_changes = TRUE; left(disp); /* go to previous line */ temp_buff = curr_line->next_line; @@ -1220,11 +1219,11 @@ control() /* use control for commands else if (in == 13) /* control m */ insert_line(TRUE); else if (in == 14) /* control n */ - move_rel("d", max(5, (last_line - 5))); + move_rel('d', max(5, (last_line - 5))); else if (in == 15) /* control o */ eol(); else if (in == 16) /* control p */ - move_rel("u", max(5, (last_line - 5))); + move_rel('u', max(5, (last_line - 5))); else if (in == 17) /* control q */ ; else if (in == 18) /* control r */ @@ -1275,7 +1274,7 @@ emacs_control() else if (in == 6) /* control f */ right(TRUE); else if (in == 7) /* control g */ - move_rel("u", max(5, (last_line - 5))); + move_rel('u', max(5, (last_line - 5))); else if (in == 8) /* control h */ delete(TRUE); else if (in == 9) /* control i */ @@ -1314,7 +1313,7 @@ emacs_control() else if (in == 21) /* control u */ bottom(); else if (in == 22) /* control v */ - move_rel("d", max(5, (last_line - 5))); + move_rel('d', max(5, (last_line - 5))); else if (in == 23) /* control w */ del_word(); else if (in == 24) /* control x */ @@ -1549,9 +1548,9 @@ function_key() /* process function ke else if (in == KEY_DOWN) down(); else if (in == KEY_NPAGE) - move_rel("d", max( 5, (last_line - 5))); + move_rel('d', max( 5, (last_line - 5))); else if (in == KEY_PPAGE) - move_rel("u", max(5, (last_line - 5))); + move_rel('u', max(5, (last_line - 5))); else if (in == KEY_DL) del_line(); else if (in == KEY_DC) @@ -1989,7 +1988,7 @@ char *cmd_str; int number; int i; char *ptr; - char *direction = "d"; + char direction = '\0'; struct text *t_line; ptr = cmd_str; @@ -2006,12 +2005,12 @@ char *cmd_str; { i++; t_line = t_line->prev_line; - direction = "u"; + direction = 'u'; } while ((t_line->line_number < number) && (t_line->next_line != NULL)) { i++; - direction = "d"; + direction = 'd'; t_line = t_line->next_line; } if ((i < 30) && (i > 0)) @@ -2020,7 +2019,7 @@ char *cmd_str; } else { - if (!strcmp(direction, "d")) + if (direction != 'd') { absolute_lin += i; } @@ -2217,7 +2216,7 @@ check_fp() /* open or close files accor if (start_at_line != NULL) { line_num = atoi(start_at_line) - 1; - move_rel("d", line_num); + move_rel('d', line_num); line_num = 0; start_at_line = NULL; } @@ -2660,7 +2659,7 @@ int display_message; { if (lines_moved < 30) { - move_rel("d", lines_moved); + move_rel('d', lines_moved); while (position < iter) right(TRUE); } @@ -2730,8 +2729,8 @@ del_char() /* delete current character } else { - right(FALSE); - delete(FALSE); + right(TRUE); + delete(TRUE); } } @@ -2940,13 +2939,13 @@ while ((position < curr_line->line_lengt void move_rel(direction, lines) /* move relative to current line */ -char *direction; +char direction; int lines; { int i; char *tmp; - if (*direction == 'u') + if (direction == 'u') { scr_pos = 0; while (position > 1) Modified: stable/8/contrib/ee/ee_version.h ============================================================================== --- stable/8/contrib/ee/ee_version.h Sun Oct 24 17:42:41 2010 (r214286) +++ stable/8/contrib/ee/ee_version.h Sun Oct 24 18:12:11 2010 (r214287) @@ -2,5 +2,5 @@ | provide a version number for ee */ -#define EE_VERSION "1.5.0" -#define DATE_STRING "$Date: 2009/02/17 03:32:30 $" +#define EE_VERSION "1.5.2" +#define DATE_STRING "$Date: 2010/06/04 02:35:35 $" From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 18:53: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 C12A71065670; Sun, 24 Oct 2010 18:53:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFDA18FC0A; Sun, 24 Oct 2010 18:53: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 o9OIrGpk037025; Sun, 24 Oct 2010 18:53:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OIrGYn037023; Sun, 24 Oct 2010 18:53:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010241853.o9OIrGYn037023@svn.freebsd.org> From: Alexander Motin Date: Sun, 24 Oct 2010 18:53: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: r214288 - 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: Sun, 24 Oct 2010 18:53:16 -0000 Author: mav Date: Sun Oct 24 18:53:16 2010 New Revision: 214288 URL: http://svn.freebsd.org/changeset/base/214288 Log: Make da driver to handle some probably broken Android devices, returning zero media and sector size instead of "Medium not present" error, until some confirmation button is tapped on device. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sun Oct 24 18:12:11 2010 (r214287) +++ head/sys/cam/scsi/scsi_da.c Sun Oct 24 18:53:16 2010 (r214288) @@ -1667,7 +1667,10 @@ dadone(struct cam_periph *periph, union * give them an 'illegal' value we'll avoid that * here. */ - if (block_size >= MAXPHYS || block_size == 0) { + if (block_size == 0 && maxsector == 0) { + snprintf(announce_buf, sizeof(announce_buf), + "0MB (no media?)"); + } else if (block_size >= MAXPHYS || block_size == 0) { xpt_print(periph->path, "unsupportable block size %ju\n", (uintmax_t) block_size); From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 19:40: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 2B7371065670; Sun, 24 Oct 2010 19:40:08 +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 490868FC13; Sun, 24 Oct 2010 19:40:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4253D41C749; Sun, 24 Oct 2010 21:40: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 beAJgRPZetpz; Sun, 24 Oct 2010 21:40:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 7030241C75B; Sun, 24 Oct 2010 21:40: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 88AE54448F3; Sun, 24 Oct 2010 19:35:34 +0000 (UTC) Date: Sun, 24 Oct 2010 19:35:34 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Andre Oppermann In-Reply-To: <20101023131021.C66242@maildrop.int.zabbadoz.net> Message-ID: <20101024191523.R66242@maildrop.int.zabbadoz.net> References: <201009172205.o8HM5RPG043265@svn.freebsd.org> <20101023131021.C66242@maildrop.int.zabbadoz.net> 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: r212803 - 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, 24 Oct 2010 19:40:08 -0000 On Sat, 23 Oct 2010, Bjoern A. Zeeb wrote: > On Fri, 17 Sep 2010, Andre Oppermann wrote: > >> Author: andre >> Date: Fri Sep 17 22:05:27 2010 >> New Revision: 212803 >> URL: http://svn.freebsd.org/changeset/base/212803 >> >> Log: >> Rearrange the TSO code to make it more readable and to clearly >> separate the decision logic, of whether we can do TSO, and the >> calculation of the burst length into two distinct parts. >> >> Change the way the TSO burst length calculation is done. While >> TSO could do bursts of 65535 bytes that can't be represented in >> ip_len together with the IP and TCP header. Account for that and >> use IP_MAXPACKET instead of TCP_MAXWIN as base constant (both >> have the same value of 64K). When more data is available prevent >> less than MSS sized segments from being sent during the current >> TSO burst. >> >> Add two more KASSERTs to ensure the integrity of the packets. I changed the order for simplicity of explanations. >> @@ -1068,6 +1081,9 @@ send: >> m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen; >> } >> >> + KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), >> + ("%s: mbuf chain shorter than expected", __func__)); >> + I have hit this KASSERT() and it was unhelpful to figure out what was wrong in first place. I had hit it with a TCP6 connect initially. Adter I changed it I realized that it was due to IPSEC and not due to IPv6. So I have two local changes now, neither of which I particularly like but I didn't want to revert ipoptlen in the IPSEC case though it might be the better option if INVARIANTS is on, as it's not used anymore further on but it would obviously confusing as well. +#ifdef IPSEC + KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL), + ("%s: mbuf chain shorter than expected: %ld + %u + %u - %u != %u", + __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL))); +#else KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected", __func__)); + ("%s: mbuf chain shorter than expected: %ld + %u + %u != %u", + __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); +#endif >> /* >> * In transmit state, time the transmission and arrange for >> * the retransmit. In persist state, just set snd_max. The second worry I have is ... > > >> Modified: >> head/sys/netinet/tcp_output.c >> >> Modified: head/sys/netinet/tcp_output.c >> ============================================================================== >> --- head/sys/netinet/tcp_output.c Fri Sep 17 21:53:56 2010 >> (r212802) >> +++ head/sys/netinet/tcp_output.c Fri Sep 17 22:05:27 2010 >> (r212803) >> @@ -465,9 +465,8 @@ after_sack_rexmit: >> } >> >> /* >> - * Truncate to the maximum segment length or enable TCP Segmentation >> - * Offloading (if supported by hardware) and ensure that FIN is >> removed >> - * if the length no longer contains the last data byte. >> + * Decide if we can use TCP Segmentation Offloading (if supported by >> + * hardware). >> * >> * TSO may only be used if we are in a pure bulk sending state. The >> * presence of TCP-MD5, SACK retransmits, SACK advertizements and >> @@ -475,10 +474,6 @@ after_sack_rexmit: >> * (except for the sequence number) for all generated packets. This >> * makes it impossible to transmit any options which vary per >> generated >> * segment or packet. >> - * >> - * The length of TSO bursts is limited to TCP_MAXWIN. That limit and >> - * removal of FIN (if not already catched here) are handled later >> after >> - * the exact length of the TCP options are known. >> */ >> #ifdef IPSEC >> /* >> @@ -487,22 +482,15 @@ after_sack_rexmit: >> */ >> ipsec_optlen = ipsec_hdrsiz_tcp(tp); >> #endif >> - if (len > tp->t_maxseg) { >> - if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && >> - ((tp->t_flags & TF_SIGNATURE) == 0) && >> - tp->rcv_numsacks == 0 && sack_rxmit == 0 && >> - tp->t_inpcb->inp_options == NULL && >> - tp->t_inpcb->in6p_options == NULL >> + if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg && >> + ((tp->t_flags & TF_SIGNATURE) == 0) && >> + tp->rcv_numsacks == 0 && sack_rxmit == 0 && >> #ifdef IPSEC >> - && ipsec_optlen == 0 >> + ipsec_optlen == 0 && >> #endif >> - ) { >> - tso = 1; >> - } else { >> - len = tp->t_maxseg; >> - sendalot = 1; >> - } >> - } >> + tp->t_inpcb->inp_options == NULL && >> + tp->t_inpcb->in6p_options == NULL) >> + tso = 1; Given the fact that in the TSO case we still check for len > tp->t_maxseg there is the assumption that it can happen. Unfortunately in the non-TSO we no longer adjust len in that case anymore, even though len is just used the second next line and all further on for various calculations and comparisons until the new code comes to re-adjust it, in case of only TSO. Now that changes the meanings of quite a bit of code further down in the former if (!TSO && len > tp->t_maxseg) len = tp->t_maxseg; case. So why was the old code wrong and why is the new code right, assuming it would not just be an oversight. It seems it's just a subtle change but I fear it has non-understood consequences given there was no Reviewed by: on the commit and no explanation for this. Can you explain? >> if (sack_rxmit) { >> if (SEQ_LT(p->rxmit + len, tp->snd_una + so->so_snd.sb_cc)) -- Bjoern A. Zeeb Welcome a new stage of life. Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 19:56: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 746DA106566B; Sun, 24 Oct 2010 19:56:34 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62A7C8FC15; Sun, 24 Oct 2010 19:56: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 o9OJuYTQ038273; Sun, 24 Oct 2010 19:56:34 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OJuYWB038272; Sun, 24 Oct 2010 19:56:34 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010241956.o9OJuYWB038272@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Oct 2010 19:56: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: r214289 - head/tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 19:56:34 -0000 Author: jilles Date: Sun Oct 24 19:56:34 2010 New Revision: 214289 URL: http://svn.freebsd.org/changeset/base/214289 Log: sh: Add a test trying to close a descriptor that is not open. In stable/8 and older, this fails. Some of the redirection changes in head have fixed it. Added: head/tools/regression/bin/sh/execution/redir3.0 (contents, props changed) Added: head/tools/regression/bin/sh/execution/redir3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/redir3.0 Sun Oct 24 19:56:34 2010 (r214289) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +3>&- 3>&- From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 20: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 9F604106566C; Sun, 24 Oct 2010 20:09:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5068FC20; Sun, 24 Oct 2010 20: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 o9OK9n0x038631; Sun, 24 Oct 2010 20:09:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OK9nQ3038628; Sun, 24 Oct 2010 20:09:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010242009.o9OK9nQ3038628@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Oct 2010 20: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: r214290 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 20:09:49 -0000 Author: jilles Date: Sun Oct 24 20:09:49 2010 New Revision: 214290 URL: http://svn.freebsd.org/changeset/base/214290 Log: sh: Check whether dup2 was successful for >&FD and <&FD. A failure (usually caused by FD not being open) is a redirection error. Exp-run done by: pav (with some other sh(1) changes) Added: head/tools/regression/bin/sh/execution/redir4.0 (contents, props changed) Modified: head/bin/sh/redir.c Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Sun Oct 24 19:56:34 2010 (r214289) +++ head/bin/sh/redir.c Sun Oct 24 20:09:49 2010 (r214290) @@ -217,8 +217,11 @@ movefd: if (redir->ndup.dupfd >= 0) { /* if not ">&-" */ if (memory[redir->ndup.dupfd]) memory[fd] = 1; - else - dup2(redir->ndup.dupfd, fd); + else { + if (dup2(redir->ndup.dupfd, fd) < 0) + error("%d: %s", redir->ndup.dupfd, + strerror(errno)); + } } else { close(fd); } Added: head/tools/regression/bin/sh/execution/redir4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/redir4.0 Sun Oct 24 20:09:49 2010 (r214290) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +{ echo bad 0>&3; } 2>/dev/null 3>/dev/null 3>&- +exit 0 From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 20:45: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 747AA106564A; Sun, 24 Oct 2010 20:45:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4865D8FC17; Sun, 24 Oct 2010 20:45: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 o9OKjD2t039438; Sun, 24 Oct 2010 20:45:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OKjDCr039435; Sun, 24 Oct 2010 20:45:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010242045.o9OKjDCr039435@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Oct 2010 20:45: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: r214291 - in head: bin/sh tools/regression/bin/sh/parser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 20:45:13 -0000 Author: jilles Date: Sun Oct 24 20:45:13 2010 New Revision: 214291 URL: http://svn.freebsd.org/changeset/base/214291 Log: sh: Make sure defined functions can actually be called. Add some conservative checks on function names: - Disallow expansions or quoting characters; these can only be called via strange control characters - Disallow '/'; these functions cannot be called anyway, as exec.c assumes they are pathnames - Make the CTL* bytes work properly in function names. These are syntax errors. POSIX does not require us to support more than names (letters, digits and underscores, not starting with a digit), but I do not want to restrict it that much at this time. Exp-run done by: pav (with some other sh(1) changes) Added: head/tools/regression/bin/sh/parser/func1.0 (contents, props changed) Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Oct 24 20:09:49 2010 (r214290) +++ head/bin/sh/parser.c Sun Oct 24 20:45:13 2010 (r214291) @@ -639,10 +639,14 @@ simplecmd(union node **rpp, union node * if (readtoken() != TRP) synexpect(TRP); funclinno = plinno; -#ifdef notdef - if (! goodname(n->narg.text)) + /* + * - Require plain text. + * - Functions with '/' cannot be called. + */ + if (!noexpand(n->narg.text) || quoteflag || + strchr(n->narg.text, '/')) synerror("Bad function name"); -#endif + rmescapes(n->narg.text); n->type = NDEFUN; n->narg.next = command(); funclinno = 0; Added: head/tools/regression/bin/sh/parser/func1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/func1.0 Sun Oct 24 20:45:13 2010 (r214291) @@ -0,0 +1,25 @@ +# $FreeBSD$ +# POSIX does not require these bytes to work in function names, +# but making them all work seems a good goal. + +failures=0 +unset LC_ALL +export LC_CTYPE=en_US.ISO8859-1 +i=128 +set -f +while [ "$i" -le 255 ]; do + c=$(printf \\"$(printf %o "$i")") + ok=0 + eval "$c() { ok=1; }" + $c + ok1=$ok + ok=0 + "$c" + if [ "$ok" != 1 ] || [ "$ok1" != 1 ]; then + echo "Bad results for character $i" >&2 + : $((failures += 1)) + fi + unset -f $c + i=$((i+1)) +done +exit $((failures > 0)) From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 20:54: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 F37171065670; Sun, 24 Oct 2010 20:54:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E21D78FC08; Sun, 24 Oct 2010 20:54: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 o9OKskCY039636; Sun, 24 Oct 2010 20:54:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OKsk5r039634; Sun, 24 Oct 2010 20:54:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242054.o9OKsk5r039634@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 20:54: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: r214292 - 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: Sun, 24 Oct 2010 20:54:47 -0000 Author: yongari Date: Sun Oct 24 20:54:46 2010 New Revision: 214292 URL: http://svn.freebsd.org/changeset/base/214292 Log: Use bge_chipid to compare controller ids. r214251 incorrectly used bge_chiprev. Reported by: Buganini gmail dot com > Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Oct 24 20:45:13 2010 (r214291) +++ head/sys/dev/bge/if_bge.c Sun Oct 24 20:54:46 2010 (r214292) @@ -1695,9 +1695,9 @@ bge_blockinit(struct bge_softc *sc) /* Choose de-pipeline mode for BCM5906 A0, A1 and A2. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { - if (sc->bge_chiprev == BGE_CHIPID_BCM5906_A0 || - sc->bge_chiprev == BGE_CHIPID_BCM5906_A1 || - sc->bge_chiprev == BGE_CHIPID_BCM5906_A2) + if (sc->bge_chipid == BGE_CHIPID_BCM5906_A0 || + sc->bge_chipid == BGE_CHIPID_BCM5906_A1 || + sc->bge_chipid == BGE_CHIPID_BCM5906_A2) CSR_WRITE_4(sc, BGE_ISO_PKT_TX, (CSR_READ_4(sc, BGE_ISO_PKT_TX) & ~3) | 2); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:07: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 92B77106566C; Sun, 24 Oct 2010 21:07:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65EEA8FC08; Sun, 24 Oct 2010 21:07: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 o9OL7DMQ039959; Sun, 24 Oct 2010 21:07:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OL7Dma039957; Sun, 24 Oct 2010 21:07:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242107.o9OL7Dma039957@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:07: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: r214293 - stable/8/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 21:07:13 -0000 Author: yongari Date: Sun Oct 24 21:07:13 2010 New Revision: 214293 URL: http://svn.freebsd.org/changeset/base/214293 Log: MFC r213842: Backout r204230. TX mbuf parser for VLAN is still required to enable TX checksum offloading if VLAN hardware tagging is disabled. Modified: stable/8/sys/dev/alc/if_alc.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) Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Sun Oct 24 20:54:46 2010 (r214292) +++ stable/8/sys/dev/alc/if_alc.c Sun Oct 24 21:07:13 2010 (r214293) @@ -2019,7 +2019,7 @@ alc_encap(struct alc_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[ALC_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, hdrlen, poff, vtag; + uint32_t cflags, hdrlen, ip_off, poff, vtag; int error, idx, nsegs, prod; ALC_LOCK_ASSERT(sc); @@ -2029,7 +2029,7 @@ alc_encap(struct alc_softc *sc, struct m m = *m_head; ip = NULL; tcp = NULL; - poff = 0; + ip_off = poff = 0; if ((m->m_pkthdr.csum_flags & (ALC_CSUM_FEATURES | CSUM_TSO)) != 0) { /* * AR813x/AR815x requires offset of TCP/UDP header in its @@ -2039,6 +2039,7 @@ alc_encap(struct alc_softc *sc, struct m * cycles on FreeBSD so fast host CPU is required to get * smooth TSO performance. */ + struct ether_header *eh; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ @@ -2052,15 +2053,32 @@ alc_encap(struct alc_softc *sc, struct m *m_head = m; } - m = m_pullup(m, sizeof(struct ether_header) + - sizeof(struct ip)); + ip_off = sizeof(struct ether_header); + m = m_pullup(m, ip_off); if (m == NULL) { *m_head = NULL; return (ENOBUFS); } - ip = (struct ip *)(mtod(m, char *) + - sizeof(struct ether_header)); - poff = sizeof(struct ether_header) + (ip->ip_hl << 2); + eh = mtod(m, struct ether_header *); + /* + * Check if hardware VLAN insertion is off. + * Additional check for LLC/SNAP frame? + */ + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { + ip_off = sizeof(struct ether_vlan_header); + m = m_pullup(m, ip_off); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + } + m = m_pullup(m, ip_off + sizeof(struct ip)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + ip = (struct ip *)(mtod(m, char *) + ip_off); + poff = ip_off + (ip->ip_hl << 2); if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { m = m_pullup(m, poff + sizeof(struct tcphdr)); if (m == NULL) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:09: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 4DC29106566C; Sun, 24 Oct 2010 21:09:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 213788FC14; Sun, 24 Oct 2010 21:09: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 o9OL9WJw040049; Sun, 24 Oct 2010 21:09:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OL9WN0040047; Sun, 24 Oct 2010 21:09:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242109.o9OL9WN0040047@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:09:32 +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: r214294 - stable/7/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 21:09:32 -0000 Author: yongari Date: Sun Oct 24 21:09:31 2010 New Revision: 214294 URL: http://svn.freebsd.org/changeset/base/214294 Log: MFC r213842: Backout r204230. TX mbuf parser for VLAN is still required to enable TX checksum offloading if VLAN hardware tagging is disabled. Modified: stable/7/sys/dev/alc/if_alc.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/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Sun Oct 24 21:07:13 2010 (r214293) +++ stable/7/sys/dev/alc/if_alc.c Sun Oct 24 21:09:31 2010 (r214294) @@ -2019,7 +2019,7 @@ alc_encap(struct alc_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[ALC_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, hdrlen, poff, vtag; + uint32_t cflags, hdrlen, ip_off, poff, vtag; int error, idx, nsegs, prod; ALC_LOCK_ASSERT(sc); @@ -2029,7 +2029,7 @@ alc_encap(struct alc_softc *sc, struct m m = *m_head; ip = NULL; tcp = NULL; - poff = 0; + ip_off = poff = 0; if ((m->m_pkthdr.csum_flags & (ALC_CSUM_FEATURES | CSUM_TSO)) != 0) { /* * AR813x/AR815x requires offset of TCP/UDP header in its @@ -2039,6 +2039,7 @@ alc_encap(struct alc_softc *sc, struct m * cycles on FreeBSD so fast host CPU is required to get * smooth TSO performance. */ + struct ether_header *eh; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ @@ -2052,15 +2053,32 @@ alc_encap(struct alc_softc *sc, struct m *m_head = m; } - m = m_pullup(m, sizeof(struct ether_header) + - sizeof(struct ip)); + ip_off = sizeof(struct ether_header); + m = m_pullup(m, ip_off); if (m == NULL) { *m_head = NULL; return (ENOBUFS); } - ip = (struct ip *)(mtod(m, char *) + - sizeof(struct ether_header)); - poff = sizeof(struct ether_header) + (ip->ip_hl << 2); + eh = mtod(m, struct ether_header *); + /* + * Check if hardware VLAN insertion is off. + * Additional check for LLC/SNAP frame? + */ + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { + ip_off = sizeof(struct ether_vlan_header); + m = m_pullup(m, ip_off); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + } + m = m_pullup(m, ip_off + sizeof(struct ip)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + ip = (struct ip *)(mtod(m, char *) + ip_off); + poff = ip_off + (ip->ip_hl << 2); if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { m = m_pullup(m, poff + sizeof(struct tcphdr)); if (m == NULL) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:14: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 E9A891065674; Sun, 24 Oct 2010 21:14:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D63908FC14; Sun, 24 Oct 2010 21:14: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 o9OLE17V040209; Sun, 24 Oct 2010 21:14:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OLE12x040200; Sun, 24 Oct 2010 21:14:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242114.o9OLE12x040200@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:14: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: r214295 - in stable/8/sys/dev: age alc ale bce bge fxp jme 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: Sun, 24 Oct 2010 21:14:02 -0000 Author: yongari Date: Sun Oct 24 21:14:01 2010 New Revision: 214295 URL: http://svn.freebsd.org/changeset/base/214295 Log: MFC r213844: Make sure to not use stale ip/tcp header pointers. The ip/tcp header parser uses m_pullup(9) to get access to mbuf chain. m_pullup(9) can allocate new mbuf chain and free old one if the space left in the mbuf chain is not enough to hold requested contiguous bytes. Previously drivers can use stale ip/tcp header pointer if m_pullup(9) returned new mbuf chain. Reported by: Andrew Boyer (aboyer <> averesystems dot com) Modified: stable/8/sys/dev/age/if_age.c stable/8/sys/dev/alc/if_alc.c stable/8/sys/dev/ale/if_ale.c stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/fxp/if_fxp.c stable/8/sys/dev/jme/if_jme.c 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) Modified: stable/8/sys/dev/age/if_age.c ============================================================================== --- stable/8/sys/dev/age/if_age.c Sun Oct 24 21:09:31 2010 (r214294) +++ stable/8/sys/dev/age/if_age.c Sun Oct 24 21:14:01 2010 (r214295) @@ -1565,6 +1565,7 @@ age_encap(struct age_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } + ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); /* * L1 requires IP/TCP header size and offset as Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Sun Oct 24 21:09:31 2010 (r214294) +++ stable/8/sys/dev/alc/if_alc.c Sun Oct 24 21:14:01 2010 (r214295) @@ -2104,6 +2104,8 @@ alc_encap(struct alc_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum as NDIS specification said. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); Modified: stable/8/sys/dev/ale/if_ale.c ============================================================================== --- stable/8/sys/dev/ale/if_ale.c Sun Oct 24 21:09:31 2010 (r214294) +++ stable/8/sys/dev/ale/if_ale.c Sun Oct 24 21:14:01 2010 (r214295) @@ -1677,6 +1677,7 @@ ale_encap(struct ale_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } + ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); m = m_pullup(m, poff + (tcp->th_off << 2)); if (m == NULL) { Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Sun Oct 24 21:09:31 2010 (r214294) +++ stable/8/sys/dev/bce/if_bce.c Sun Oct 24 21:14:01 2010 (r214295) @@ -6733,6 +6733,7 @@ bce_tso_setup(struct bce_softc *sc, stru } /* Get the TCP header length in bytes (min 20) */ + ip = (struct ip *)(m->m_data + sizeof(struct ether_header)); th = (struct tcphdr *)((caddr_t)ip + ip_hlen); tcp_hlen = (th->th_off << 2); @@ -6745,6 +6746,7 @@ bce_tso_setup(struct bce_softc *sc, stru } /* IP header length and checksum will be calc'd by hardware */ + ip = (struct ip *)(m->m_data + sizeof(struct ether_header)); ip_len = ip->ip_len; ip->ip_len = 0; ip->ip_sum = 0; Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Oct 24 21:09:31 2010 (r214294) +++ stable/8/sys/dev/bge/if_bge.c Sun Oct 24 21:14:01 2010 (r214295) @@ -3839,9 +3839,11 @@ bge_setup_tso(struct bge_softc *sc, stru * checksum. These checksum computed by upper stack should be 0. */ *mss = m->m_pkthdr.tso_segsz; + ip = (struct ip *)(mtod(m, char *) + sizeof(struct ether_header)); ip->ip_sum = 0; ip->ip_len = htons(*mss + (ip->ip_hl << 2) + (tcp->th_off << 2)); /* Clear pseudo checksum computed by TCP stack. */ + tcp = (struct tcphdr *)(mtod(m, char *) + poff); tcp->th_sum = 0; /* * Broadcom controllers uses different descriptor format for Modified: stable/8/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/8/sys/dev/fxp/if_fxp.c Sun Oct 24 21:09:31 2010 (r214294) +++ stable/8/sys/dev/fxp/if_fxp.c Sun Oct 24 21:14:01 2010 (r214295) @@ -1454,6 +1454,8 @@ fxp_encap(struct fxp_softc *sc, struct m * Since 82550/82551 doesn't modify IP length and pseudo * checksum in the first frame driver should compute it. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; ip->ip_len = htons(m->m_pkthdr.tso_segsz + (ip->ip_hl << 2) + (tcp->th_off << 2)); Modified: stable/8/sys/dev/jme/if_jme.c ============================================================================== --- stable/8/sys/dev/jme/if_jme.c Sun Oct 24 21:09:31 2010 (r214294) +++ stable/8/sys/dev/jme/if_jme.c Sun Oct 24 21:14:01 2010 (r214295) @@ -1665,11 +1665,12 @@ jme_encap(struct jme_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } - tcp = (struct tcphdr *)(mtod(m, char *) + poff); /* * Reset IP checksum and recompute TCP pseudo * checksum that NDIS specification requires. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) { tcp->th_sum = in_pseudo(ip->ip_src.s_addr, Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Sun Oct 24 21:09:31 2010 (r214294) +++ stable/8/sys/dev/sge/if_sge.c Sun Oct 24 21:14:01 2010 (r214295) @@ -1457,7 +1457,9 @@ sge_encap(struct sge_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum that NDIS specification requires. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); ip->ip_sum = 0; + tcp = (struct tcphdr *)(mtod(m, char *) + poff); tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); *m_head = m; From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:17: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 14A781065672; Sun, 24 Oct 2010 21:17:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 013C58FC12; Sun, 24 Oct 2010 21:17: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 o9OLHNcF040330; Sun, 24 Oct 2010 21:17:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OLHN40040321; Sun, 24 Oct 2010 21:17:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242117.o9OLHN40040321@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:17: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: r214296 - in stable/7/sys/dev: age alc ale bce bge fxp jme 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: Sun, 24 Oct 2010 21:17:24 -0000 Author: yongari Date: Sun Oct 24 21:17:23 2010 New Revision: 214296 URL: http://svn.freebsd.org/changeset/base/214296 Log: MFC r213844: Make sure to not use stale ip/tcp header pointers. The ip/tcp header parser uses m_pullup(9) to get access to mbuf chain. m_pullup(9) can allocate new mbuf chain and free old one if the space left in the mbuf chain is not enough to hold requested contiguous bytes. Previously drivers can use stale ip/tcp header pointer if m_pullup(9) returned new mbuf chain. Reported by: Andrew Boyer (aboyer <> averesystems dot com) Modified: stable/7/sys/dev/age/if_age.c stable/7/sys/dev/alc/if_alc.c stable/7/sys/dev/ale/if_ale.c stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/fxp/if_fxp.c stable/7/sys/dev/jme/if_jme.c 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/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Sun Oct 24 21:14:01 2010 (r214295) +++ stable/7/sys/dev/age/if_age.c Sun Oct 24 21:17:23 2010 (r214296) @@ -1565,6 +1565,7 @@ age_encap(struct age_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } + ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); /* * L1 requires IP/TCP header size and offset as Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Sun Oct 24 21:14:01 2010 (r214295) +++ stable/7/sys/dev/alc/if_alc.c Sun Oct 24 21:17:23 2010 (r214296) @@ -2104,6 +2104,8 @@ alc_encap(struct alc_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum as NDIS specification said. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); Modified: stable/7/sys/dev/ale/if_ale.c ============================================================================== --- stable/7/sys/dev/ale/if_ale.c Sun Oct 24 21:14:01 2010 (r214295) +++ stable/7/sys/dev/ale/if_ale.c Sun Oct 24 21:17:23 2010 (r214296) @@ -1677,6 +1677,7 @@ ale_encap(struct ale_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } + ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); m = m_pullup(m, poff + (tcp->th_off << 2)); if (m == NULL) { Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Sun Oct 24 21:14:01 2010 (r214295) +++ stable/7/sys/dev/bce/if_bce.c Sun Oct 24 21:17:23 2010 (r214296) @@ -6733,6 +6733,7 @@ bce_tso_setup(struct bce_softc *sc, stru } /* Get the TCP header length in bytes (min 20) */ + ip = (struct ip *)(m->m_data + sizeof(struct ether_header)); th = (struct tcphdr *)((caddr_t)ip + ip_hlen); tcp_hlen = (th->th_off << 2); @@ -6745,6 +6746,7 @@ bce_tso_setup(struct bce_softc *sc, stru } /* IP header length and checksum will be calc'd by hardware */ + ip = (struct ip *)(m->m_data + sizeof(struct ether_header)); ip_len = ip->ip_len; ip->ip_len = 0; ip->ip_sum = 0; Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Sun Oct 24 21:14:01 2010 (r214295) +++ stable/7/sys/dev/bge/if_bge.c Sun Oct 24 21:17:23 2010 (r214296) @@ -3835,9 +3835,11 @@ bge_setup_tso(struct bge_softc *sc, stru * checksum. These checksum computed by upper stack should be 0. */ *mss = m->m_pkthdr.tso_segsz; + ip = (struct ip *)(mtod(m, char *) + sizeof(struct ether_header)); ip->ip_sum = 0; ip->ip_len = htons(*mss + (ip->ip_hl << 2) + (tcp->th_off << 2)); /* Clear pseudo checksum computed by TCP stack. */ + tcp = (struct tcphdr *)(mtod(m, char *) + poff); tcp->th_sum = 0; /* * Broadcom controllers uses different descriptor format for Modified: stable/7/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/7/sys/dev/fxp/if_fxp.c Sun Oct 24 21:14:01 2010 (r214295) +++ stable/7/sys/dev/fxp/if_fxp.c Sun Oct 24 21:17:23 2010 (r214296) @@ -1455,6 +1455,8 @@ fxp_encap(struct fxp_softc *sc, struct m * Since 82550/82551 doesn't modify IP length and pseudo * checksum in the first frame driver should compute it. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; ip->ip_len = htons(m->m_pkthdr.tso_segsz + (ip->ip_hl << 2) + (tcp->th_off << 2)); Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Sun Oct 24 21:14:01 2010 (r214295) +++ stable/7/sys/dev/jme/if_jme.c Sun Oct 24 21:17:23 2010 (r214296) @@ -1665,11 +1665,12 @@ jme_encap(struct jme_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } - tcp = (struct tcphdr *)(mtod(m, char *) + poff); /* * Reset IP checksum and recompute TCP pseudo * checksum that NDIS specification requires. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) { tcp->th_sum = in_pseudo(ip->ip_src.s_addr, Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Sun Oct 24 21:14:01 2010 (r214295) +++ stable/7/sys/dev/sge/if_sge.c Sun Oct 24 21:17:23 2010 (r214296) @@ -1457,7 +1457,9 @@ sge_encap(struct sge_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum that NDIS specification requires. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); ip->ip_sum = 0; + tcp = (struct tcphdr *)(mtod(m, char *) + poff); tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); *m_head = m; From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:22: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 980C71065670; Sun, 24 Oct 2010 21:22:00 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5694C8FC14; Sun, 24 Oct 2010 21:22: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 o9OLM0W5040468; Sun, 24 Oct 2010 21:22:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OLM0UY040466; Sun, 24 Oct 2010 21:22:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242122.o9OLM0UY040466@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:22: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: r214297 - stable/8/sys/dev/usb/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: Sun, 24 Oct 2010 21:22:00 -0000 Author: yongari Date: Sun Oct 24 21:22:00 2010 New Revision: 214297 URL: http://svn.freebsd.org/changeset/base/214297 Log: MFC r213423: Move updating TX packet counter to the inside of send loop. axe(4) controllers combine multiple TX requests into single one if there is room in TX buffer of controller. Updating TX packet counter at the end of TX completion resulted in incorrect TX packet counter as axe(4) thought it sent 1 packet. There is no easy way to know how many combined TX were completed in the callback. Because this change updates TX packet counter before actual transmission, it may not be ideal one. But I believe it's better than showing fake 8kpps under high TX load. With this change, TX shows 221kpps on Linksus USB200M. Modified: stable/8/sys/dev/usb/net/if_axe.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) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:17:23 2010 (r214296) +++ stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:22:00 2010 (r214297) @@ -862,7 +862,6 @@ axe_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); - ifp->if_opackets++; /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: @@ -908,6 +907,17 @@ tr_setup: pos += m->m_pkthdr.len; /* + * XXX + * Update TX packet counter here. This is not + * correct way but it seems that there is no way + * to know how many packets are sent at the end + * of transfer because controller combines + * multiple writes into single one if there is + * room in TX buffer of controller. + */ + ifp->if_opackets++; + + /* * if there's a BPF listener, bounce a copy * of this frame to him: */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:23: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 A75A4106566B; Sun, 24 Oct 2010 21:23:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ACF48FC0C; Sun, 24 Oct 2010 21:23: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 o9OLNRve040558; Sun, 24 Oct 2010 21:23:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OLNRnt040556; Sun, 24 Oct 2010 21:23:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242123.o9OLNRnt040556@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:23:27 +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: r214298 - stable/8/sys/dev/usb/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: Sun, 24 Oct 2010 21:23:27 -0000 Author: yongari Date: Sun Oct 24 21:23:27 2010 New Revision: 214298 URL: http://svn.freebsd.org/changeset/base/214298 Log: MFC r213424: Make upper stack know driver's output status. This change increased TX performance from 221kpps to 231kpps. Modified: stable/8/sys/dev/usb/net/if_axe.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) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:22:00 2010 (r214297) +++ stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:23:27 2010 (r214298) @@ -862,12 +862,15 @@ axe_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - if ((sc->sc_flags & AXE_FLAG_LINK) == 0) { + if ((sc->sc_flags & AXE_FLAG_LINK) == 0 || + (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { /* - * don't send anything if there is no link ! + * Don't send anything if there is no link or + * controller is busy. */ return; } @@ -938,6 +941,7 @@ tr_setup: usbd_xfer_set_frame_len(xfer, 0, pos); usbd_transfer_submit(xfer); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; default: /* Error */ @@ -945,6 +949,7 @@ tr_setup: usbd_errstr(error)); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ @@ -1077,7 +1082,7 @@ axe_stop(struct usb_ether *ue) AXE_LOCK_ASSERT(sc, MA_OWNED); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->sc_flags &= ~AXE_FLAG_LINK; /* From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:25: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 71C98106578D; Sun, 24 Oct 2010 21:25:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F9D98FC19; Sun, 24 Oct 2010 21:25: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 o9OLPFD6040642; Sun, 24 Oct 2010 21:25:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OLPFod040640; Sun, 24 Oct 2010 21:25:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242125.o9OLPFod040640@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:25: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: r214299 - stable/8/sys/dev/usb/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: Sun, 24 Oct 2010 21:25:15 -0000 Author: yongari Date: Sun Oct 24 21:25:15 2010 New Revision: 214299 URL: http://svn.freebsd.org/changeset/base/214299 Log: MFC r213436: Don't count input error twice. uether_rxbuf() already updated that counter. Modified: stable/8/sys/dev/usb/net/if_axe.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) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:23:27 2010 (r214298) +++ stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:25:15 2010 (r214299) @@ -813,13 +813,12 @@ axe_bulk_read_callback(struct usb_xfer * err = EINVAL; break; } - err = uether_rxbuf(ue, pc, pos, len); + uether_rxbuf(ue, pc, pos, len); pos += len + (len % 2); } - } else { - err = uether_rxbuf(ue, pc, 0, actlen); - } + } else + uether_rxbuf(ue, pc, 0, actlen); if (err != 0) ifp->if_ierrors++; From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:26: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 DAF82106566B; Sun, 24 Oct 2010 21:26:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8F758FC1B; Sun, 24 Oct 2010 21:26: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 o9OLQf2p040715; Sun, 24 Oct 2010 21:26:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OLQfsL040713; Sun, 24 Oct 2010 21:26:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242126.o9OLQfsL040713@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:26: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: r214300 - stable/8/sys/dev/usb/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: Sun, 24 Oct 2010 21:26:42 -0000 Author: yongari Date: Sun Oct 24 21:26:41 2010 New Revision: 214300 URL: http://svn.freebsd.org/changeset/base/214300 Log: MFC r213438: RX buffer allocation failure is not an input error. Controller successfully received a frame but we failed to pass it to upper stack due to lack of resources. So update if_iqdrops counter instead of updating if_ierrors counter. Modified: stable/8/sys/dev/usb/net/usb_ethernet.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) Modified: stable/8/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- stable/8/sys/dev/usb/net/usb_ethernet.c Sun Oct 24 21:25:15 2010 (r214299) +++ stable/8/sys/dev/usb/net/usb_ethernet.c Sun Oct 24 21:26:41 2010 (r214300) @@ -558,7 +558,7 @@ uether_rxbuf(struct usb_ether *ue, struc m = uether_newbuf(); if (m == NULL) { - ifp->if_ierrors++; + ifp->if_iqdrops++; return (ENOMEM); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:28: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 6A8D8106564A; Sun, 24 Oct 2010 21:28:58 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 583718FC0A; Sun, 24 Oct 2010 21:28: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 o9OLSwZP040807; Sun, 24 Oct 2010 21:28:58 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OLSwri040804; Sun, 24 Oct 2010 21:28:58 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242128.o9OLSwri040804@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:28: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: r214301 - stable/8/sys/dev/usb/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: Sun, 24 Oct 2010 21:28:58 -0000 Author: yongari Date: Sun Oct 24 21:28:58 2010 New Revision: 214301 URL: http://svn.freebsd.org/changeset/base/214301 Log: MFC r213696: Do not setup interrupt endpoint for axe(4). It seems axe(4) controllers support interrupt endpoint such that enabling interrupt endpoint generates about 1000 interrupts/sec. Controllers transfer 8 bytes data through interrupt endpoint and the data include link UP/DOWN state as well as some PHY related information. Previously axe(4) didn't use the transferred data and didn't even try to read the data. Because axe(4) counts on mii(4) to detect link state changes there is no need to use interrupt endpoint here. This change fixes generation of unnecessary interrupts which was seen when interface is brought to UP. No objections from: hselasky Modified: stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/net/if_axereg.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) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:26:41 2010 (r214300) +++ stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:28:58 2010 (r214301) @@ -171,7 +171,6 @@ static device_probe_t axe_probe; static device_attach_t axe_attach; static device_detach_t axe_detach; -static usb_callback_t axe_intr_callback; static usb_callback_t axe_bulk_read_callback; static usb_callback_t axe_bulk_write_callback; @@ -215,15 +214,6 @@ static const struct usb_config axe_confi .callback = axe_bulk_read_callback, .timeout = 0, /* no timeout */ }, - - [AXE_INTR_DT_RD] = { - .type = UE_INTERRUPT, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .bufsize = 0, /* use wMaxPacketSize */ - .callback = axe_intr_callback, - }, }; static device_method_t axe_methods[] = { @@ -746,27 +736,6 @@ axe_detach(device_t dev) return (0); } -static void -axe_intr_callback(struct usb_xfer *xfer, usb_error_t error) -{ - switch (USB_GET_STATE(xfer)) { - case USB_ST_TRANSFERRED: - case USB_ST_SETUP: -tr_setup: - usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); - usbd_transfer_submit(xfer); - return; - - default: /* Error */ - if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - goto tr_setup; - } - return; - } -} - #if (AXE_BULK_BUF_SIZE >= 0x10000) #error "Please update axe_bulk_read_callback()!" #endif @@ -984,7 +953,6 @@ axe_start(struct usb_ether *ue) /* * start the USB transfers, if not already started: */ - usbd_transfer_start(sc->sc_xfer[AXE_INTR_DT_RD]); usbd_transfer_start(sc->sc_xfer[AXE_BULK_DT_RD]); usbd_transfer_start(sc->sc_xfer[AXE_BULK_DT_WR]); } @@ -1089,7 +1057,6 @@ axe_stop(struct usb_ether *ue) */ usbd_transfer_stop(sc->sc_xfer[AXE_BULK_DT_WR]); usbd_transfer_stop(sc->sc_xfer[AXE_BULK_DT_RD]); - usbd_transfer_stop(sc->sc_xfer[AXE_INTR_DT_RD]); axe_reset(sc); } Modified: stable/8/sys/dev/usb/net/if_axereg.h ============================================================================== --- stable/8/sys/dev/usb/net/if_axereg.h Sun Oct 24 21:26:41 2010 (r214300) +++ stable/8/sys/dev/usb/net/if_axereg.h Sun Oct 24 21:28:58 2010 (r214301) @@ -172,7 +172,6 @@ struct axe_sframe_hdr { enum { AXE_BULK_DT_WR, AXE_BULK_DT_RD, - AXE_INTR_DT_RD, AXE_N_TRANSFER, }; From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:59: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 4A46C10656C0; Sun, 24 Oct 2010 21:59:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38BA58FC1E; Sun, 24 Oct 2010 21:59: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 o9OLxq5B041472; Sun, 24 Oct 2010 21:59:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OLxqH6041470; Sun, 24 Oct 2010 21:59:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242159.o9OLxqH6041470@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:59: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: r214302 - head/sys/dev/fxp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 21:59:52 -0000 Author: yongari Date: Sun Oct 24 21:59:51 2010 New Revision: 214302 URL: http://svn.freebsd.org/changeset/base/214302 Log: Add TSO support over VLAN for i82550/i82551. Controller requires VLAN hardware tagging to make TSO work over VLAN. So if VLAN hardware tagging is disabled explicitly clear TSO over VLAN. While I'm here allow disabling VLAN TX checksum offloading. Tested by: Liudas < liudasb <> centras dot lt > MFC after: 10 days Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Sun Oct 24 21:28:58 2010 (r214301) +++ head/sys/dev/fxp/if_fxp.c Sun Oct 24 21:59:51 2010 (r214302) @@ -862,9 +862,9 @@ fxp_attach(device_t dev) ifp->if_capenable |= IFCAP_VLAN_MTU; /* the hw bits already set */ if ((sc->flags & FXP_FLAG_EXT_RFA) != 0) { ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_HWCSUM; + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_HWCSUM; + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; } /* @@ -2866,10 +2866,19 @@ fxp_ioctl(struct ifnet *ifp, u_long comm if (ifp->if_flags & IFF_UP) reinit++; } + if ((mask & IFCAP_VLAN_HWCSUM) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - reinit++; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= + ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); + reinit++; } if (reinit > 0 && ifp->if_flags & IFF_UP) fxp_init_body(sc); From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 22:02: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 2258F106564A; Sun, 24 Oct 2010 22:02:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 103F58FC0A; Sun, 24 Oct 2010 22:02: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 o9OM2aiV041609; Sun, 24 Oct 2010 22:02:36 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OM2aGo041606; Sun, 24 Oct 2010 22:02:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010242202.o9OM2aGo041606@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 24 Oct 2010 22:02: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: r214303 - in head/sys: conf 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, 24 Oct 2010 22:02:37 -0000 Author: bz Date: Sun Oct 24 22:02:36 2010 New Revision: 214303 URL: http://svn.freebsd.org/changeset/base/214303 Log: Add initial inet DDB support for show in_ifaddr and show sin commands which proved to be useful while debugging address list problems. MFC after: 6 days Added: head/sys/netinet/in_debug.c (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 24 21:59:51 2010 (r214302) +++ head/sys/conf/files Sun Oct 24 22:02:36 2010 (r214303) @@ -2559,6 +2559,7 @@ netinet/if_atm.c optional atm netinet/if_ether.c optional inet ether netinet/igmp.c optional inet netinet/in.c optional inet +netinet/in_debug.c optional inet ddb netinet/ip_carp.c optional inet carp | inet6 carp netinet/in_gif.c optional gif inet | netgraph_gif inet netinet/ip_gre.c optional gre inet Added: head/sys/netinet/in_debug.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/in_debug.c Sun Oct 24 22:02:36 2010 (r214303) @@ -0,0 +1,120 @@ +/*- + * Copyright (c) 2010 Bjoern A. Zeeb + * 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 "opt_ddb.h" + +#include +#include +#include + +#ifdef DDB +#include +#endif + +#include +#include + +#include +#include + +#ifdef DDB +static void +in_show_sockaddr_in(struct sockaddr_in *sin) +{ + +#define SIN_DB_RPINTF(f, e) db_printf("\t %s = " f "\n", #e, sin->e); + db_printf("\tsockaddr_in = %p\n", sin); + SIN_DB_RPINTF("%u", sin_len); + SIN_DB_RPINTF("%u", sin_family); + SIN_DB_RPINTF("%u", sin_port); + SIN_DB_RPINTF("0x%08x", sin_addr.s_addr); + db_printf("\t %s = %02x%02x%02x%02x%02x%02x%02x%02x\n", + "sin_zero[8]", + sin->sin_zero[0], sin->sin_zero[1], + sin->sin_zero[2], sin->sin_zero[3], + sin->sin_zero[4], sin->sin_zero[5], + sin->sin_zero[6], sin->sin_zero[7]); +#undef SIN_DB_RPINTF +} + +DB_SHOW_COMMAND(sin, db_show_sin) +{ + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)addr; + if (sin == NULL) { + /* usage: No need to confess if you didn't sin. */ + db_printf("usage: show sin \n"); + return; + } + + in_show_sockaddr_in(sin); +} + +static void +in_show_in_ifaddr(struct in_ifaddr *ia) +{ + +#define IA_DB_RPINTF(f, e) db_printf("\t %s = " f "\n", #e, ia->e); +#define IA_DB_RPINTF_PTR(f, e) db_printf("\t %s = " f "\n", #e, &ia->e); +#define IA_DB_RPINTF_DPTR(f, e) db_printf("\t *%s = " f "\n", #e, *ia->e); + db_printf("\tin_ifaddr = %p\n", ia); + IA_DB_RPINTF_PTR("%p", ia_ifa); + IA_DB_RPINTF("0x%08lx", ia_net); + IA_DB_RPINTF("0x%08lx", ia_netmask); + IA_DB_RPINTF("0x%08lx", ia_subnet); + IA_DB_RPINTF("0x%08lx", ia_subnetmask); + IA_DB_RPINTF("0x%08x", ia_netbroadcast.s_addr); + IA_DB_RPINTF("%p", ia_hash.le_next); + IA_DB_RPINTF("%p", ia_hash.le_prev); + IA_DB_RPINTF_DPTR("%p", ia_hash.le_prev); + IA_DB_RPINTF("%p", ia_link.tqe_next); + IA_DB_RPINTF("%p", ia_link.tqe_prev); + IA_DB_RPINTF_DPTR("%p", ia_link.tqe_prev); + IA_DB_RPINTF_PTR("%p", ia_addr); + IA_DB_RPINTF_PTR("%p", ia_dstaddr); + IA_DB_RPINTF_PTR("%p", ia_sockmask); +#undef IA_DB_RPINTF_DPTR +#undef IA_DB_RPINTF_PTR +#undef IA_DB_RPINTF +} + +DB_SHOW_COMMAND(in_ifaddr, db_show_in_ifaddr) +{ + struct in_ifaddr *ia; + + ia = (struct in_ifaddr *)addr; + if (ia == NULL) { + db_printf("usage: show in_ifaddr \n"); + return; + } + + in_show_in_ifaddr(ia); +} +#endif From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 22:03: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 ACD1C106566B; Sun, 24 Oct 2010 22:03:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 803E18FC0C; Sun, 24 Oct 2010 22:03: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 o9OM3LH2041682; Sun, 24 Oct 2010 22:03:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OM3LLd041679; Sun, 24 Oct 2010 22:03:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010242203.o9OM3LLd041679@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Oct 2010 22:03: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: r214304 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 22:03:21 -0000 Author: jilles Date: Sun Oct 24 22:03:21 2010 New Revision: 214304 URL: http://svn.freebsd.org/changeset/base/214304 Log: sh: Do not allow overriding a special builtin with a function. This is a syntax error. POSIX does not say explicitly whether defining a function with the same name as a special builtin is allowed, but it does say that it is impossible to call such a function. A special builtin can still be overridden with an alias. This commit is part of a set of changes that will ensure that when something looks like a special builtin to the parser, it is one. (Not the other way around, as it remains possible to call a special builtin named by a variable or other substitution.) Exp-run done by: pav (with some other sh(1) changes) Added: head/tools/regression/bin/sh/execution/func3.0 (contents, props changed) Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Oct 24 22:02:36 2010 (r214303) +++ head/bin/sh/parser.c Sun Oct 24 22:03:21 2010 (r214304) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include "alias.h" #include "show.h" #include "eval.h" +#include "exec.h" /* to check for special builtins */ #ifndef NO_HISTORY #include "myhistedit.h" #endif @@ -606,6 +607,7 @@ simplecmd(union node **rpp, union node * union node *args, **app; union node **orig_rpp = rpp; union node *n = NULL; + int special; /* If we don't have any redirections already, then we must reset */ /* rpp to be the address of the local redir variable. */ @@ -647,6 +649,9 @@ simplecmd(union node **rpp, union node * strchr(n->narg.text, '/')) synerror("Bad function name"); rmescapes(n->narg.text); + if (find_builtin(n->narg.text, &special) >= 0 && + special) + synerror("Cannot override a special builtin with a function"); n->type = NDEFUN; n->narg.next = command(); funclinno = 0; Added: head/tools/regression/bin/sh/execution/func3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/func3.0 Sun Oct 24 22:03:21 2010 (r214304) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# This may fail when parsing or when defining the function, or the definition +# may silently do nothing. In no event may the function be executed. + +sh -c 'unset() { echo overriding function executed, bad; }; v=1; unset v; exit "${v-0}"' 2>/dev/null +: From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 22:25: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 4645E106566C; Sun, 24 Oct 2010 22:25:39 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 349318FC12; Sun, 24 Oct 2010 22:25: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 o9OMPdiP042719; Sun, 24 Oct 2010 22:25:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OMPd8u042716; Sun, 24 Oct 2010 22:25:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010242225.o9OMPd8u042716@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Oct 2010 22:25: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: r214305 - 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, 24 Oct 2010 22:25:39 -0000 Author: jilles Date: Sun Oct 24 22:25:38 2010 New Revision: 214305 URL: http://svn.freebsd.org/changeset/base/214305 Log: sh: Ignore double-quotes in arithmetic rather than treating them as quotes. This provides similar behaviour, but allows a simpler parser. This changes r206473. Exp-run done by: pav (with some other sh(1) changes) Modified: head/bin/sh/mksyntax.c head/bin/sh/parser.c Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Sun Oct 24 22:03:21 2010 (r214304) +++ head/bin/sh/mksyntax.c Sun Oct 24 22:25:38 2010 (r214305) @@ -75,6 +75,7 @@ struct synclass synclass[] = { { "CEOF", "end of file" }, { "CCTL", "like CWORD, except it must be escaped" }, { "CSPCL", "these terminate a word" }, + { "CIGN", "character should be ignored" }, { NULL, NULL } }; @@ -232,7 +233,7 @@ main(int argc __unused, char **argv __un add("\n", "CNL"); add("\\", "CBACK"); add("`", "CBQUOTE"); - add("\"", "CDQUOTE"); + add("\"", "CIGN"); add("$", "CVAR"); add("}", "CENDVAR"); add("(", "CLP"); Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Oct 24 22:03:21 2010 (r214304) +++ head/bin/sh/parser.c Sun Oct 24 22:25:38 2010 (r214305) @@ -1224,10 +1224,7 @@ readtoken1(int firstc, char const *initi if (eofmark != NULL && newvarnest == 0) USTPUTC(c, out); else { - if (state[level].category == TSTATE_ARITH) - state[level].syntax = ARISYNTAX; - else - state[level].syntax = BASESYNTAX; + state[level].syntax = BASESYNTAX; quotef++; } break; @@ -1282,6 +1279,8 @@ readtoken1(int firstc, char const *initi break; case CEOF: goto endword; /* exit outer loop */ + case CIGN: + break; default: if (level == 0) goto endword; /* exit outer loop */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 22:59: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 E65EE106566B; Sun, 24 Oct 2010 22:59:38 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D37B38FC1A; Sun, 24 Oct 2010 22:59: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 o9OMxcdt043533; Sun, 24 Oct 2010 22:59:38 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OMxcH7043530; Sun, 24 Oct 2010 22:59:38 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201010242259.o9OMxcH7043530@svn.freebsd.org> From: Julian Elischer Date: Sun, 24 Oct 2010 22:59: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: r214306 - in head/share/examples: jails 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: Sun, 24 Oct 2010 22:59:39 -0000 Author: julian Date: Sun Oct 24 22:59:38 2010 New Revision: 214306 URL: http://svn.freebsd.org/changeset/base/214306 Log: Add two scripts that demonstrate how to make and hook together jails using teh vortual networking feature. Submitted by: Yavuz Gokirmak MFC after: 2 weeks Added: head/share/examples/jails/ head/share/examples/jails/README (contents, props changed) head/share/examples/netgraph/virtual.chain (contents, props changed) head/share/examples/netgraph/virtual.lan (contents, props changed) Added: head/share/examples/jails/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/jails/README Sun Oct 24 22:59:38 2010 (r214306) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +See under share/examples/netgraph for some examples of +making and hooking together jails using netgraph as the +virtual networking fabric. Added: head/share/examples/netgraph/virtual.chain ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/netgraph/virtual.chain Sun Oct 24 22:59:38 2010 (r214306) @@ -0,0 +1,373 @@ +#!/bin/sh +# +# Copyright (c) 2010, Yavuz Gokirmak +# +# All rights reserved. +# +# This source code may be used, modified, copied, distributed, and +# sold, in both source and binary form provided that the above +# copyright and these terms are retained, verbatim, as the first +# lines of this file. Under no circumstances is the author +# responsible for the proper functioning of the software nor does +# the author assume any responsibility for damages incurred with +# its use. +# +# $FreeBSD$ +# +# +# This script creates and connects n router like nodes. Complex wide +# area topologies can be created with the help of script. +# +# Virtual nodes are generated via jails and network connections are +# established using ng_eiface(4) node types. +# +# To use this script: +# +# 0. Make your own copy of this example script. +# +# 1. Edit the definition of ${TARGET_TOPOLOGY} to define your virtual +# nodes. Virtual topology definition includes node names and their +# IP address. Target top. sytax: ( name|ip<->name|ip ... ) +# Example 1: ( n1|10.0.2.1/30<->n2|10.0.2.2/30 ...) +# Example 2: ( n1|2001:b90::14a/125<->n1|2001:b90::14b/125 ...) +# +# 2. Run this script with "start" as the command line argument. +# +# 3. Add necessary static route commands for each virtual node. For +# example assume you have three virtual nodes connected each other +# llike a chain ( n1 is connected to n2, n2 is connecte to n3 ). +# In order to estabklish connectivity among these virtual nodes, +# you have to add default routes to node n1 and node n3. Example +# static route command is: +# STATIC_ROUTE0="jexec n1 route add -inet default 10.0.2.2" +# STATIC_ROUTE1="jexec n3 route add -inet default 10.0.2.5" +# After defining default routes with above format you have to set +# the total number of static route commands as: +# STATIC_ROUTE_CNT=2 +# +# 4. Stop bridging by running this script with "stop" as the +# command line argument. +# +# 5. This cript uses a template file in order to carry information +# between start and stop calls. +# In the start call, the netgraph interfaces and jails are created. +# At the stop phase, all created objects should be removed. +# DO NOT delete the temporary file between the start and stop phases. +# +# Target Topology: +# +# +---------------+ +---------------------------------------------+ +# | n1 (vimage) | | n2 (vimage) | +# | | | | +# | +-----------+ | | +-----------+ +-----------+ +-----------+ | +# | | ngeth0 | | | | ngeth1 | | ngeth2 | | ngeth4 | | +# | |(ng_eiface)| | | |(ng_eiface)| |(ng_eiface)| |(ng_eiface)| | +# | +--+-----+--+ | | +--+-----+--+ +--+-----+--+ +--+-----+--+ | +# | |ether| | | |ether| |ether| |ether| | +# | +-X---+ | | +--X--+ +--X--+ +--X--+ | +# +-------X-------+ +------X--------------X---------------X-------+ +# X X X X +# X X X X +# XXXXXXXXXXXXXXX X X +# X X +# +--------X------+ +--------X------+ +# | -+--X--+- | | -+--X--+- | +# | |ether| | | |ether| | +# | +--+-----+--+ | | +--+-----+--+ | +# | | ngeth3 | | | | ngeth5 | | +# | |(ng_eiface)| | | |(ng_eiface)| | +# | +-----------+ | | +-----------+ | +# | | | | +# | n3 (vimage) | | n4 (vimage) | +# +---------------+ +---------------+ +# +# +# + +# List the names of virtual nodes and their IP addresses. Use ':' +# character to seperate node name from node IP address and netmask. + +TARGET_TOPOLOGY="n1|10.0.2.1/30<->n2|10.0.2.2/30 n2|10.0.2.5/30<->n3|10.0.2.6/30 n2|10.0.2.9/30<->n4|10.0.2.10/30" +STATIC_ROUTE0="jexec n1 route add -inet default 10.0.2.2" +STATIC_ROUTE1="jexec n3 route add -inet default 10.0.2.5" +STATIC_ROUTE2="jexec n4 route add -inet default 10.0.2.9" +STATIC_ROUTE_CNT=3 + +# MAC manifacturer prefix. This can be modified according to needs. +MAC_PREFIX="00:1d:92" + +# Temporary file is important for proper execution of script. +TEMP_FILE="/var/tmp/.virtual.chain.tmp" + +# Set root directory for jails to be created. +JAIL_PATH="/usr/jails/router" + + +#################################################################### +#### Nothing below this point should need to be modified. #### +#################################################################### + + +# Start/restart routine. +virtual_chain_start() { + + # Load netgraph KLD's as necessary. + + for KLD in ng_ether ng_bridge ng_eiface; do + if ! kldstat -v | grep -qw ${KLD}; then + echo -n "Loading ${KLD}.ko... " + kldload ${KLD} || exit 1 + echo "done" + fi + done + + # Reset all interfaces and jails. If temporary file can not be found + # script assumes that there is no previous configuration. + + if [ ! -e ${TEMP_FILE} ]; then + echo "No previous configuration(${TEMP_FILE}) found to clean-up." + else + echo -n "Cleaning previous configuration..." + virtual_chain_stop + echo "done" + fi + + # Create temporary file for usage. This file includes generated + # interface names and jail names. All bridges, interfaces and jails + # are written to file while created. In clean-up process written + # objects are cleaned (i.e removed) from system. + + if [ -e ${TEMP_FILE} ]; then + touch ${TEMP_FILE} + fi + + + # Attach other interfaces as well. + for CONNECTION in ${TARGET_TOPOLOGY}; do + + # Virtual connections are defined in TARGET_TOPOLOGY variable. + # They have the form of 'nodeName|IPaddr'. Below two lines split + + PEER1=`echo ${CONNECTION} | awk -F"<->" '{print $1}'` + PEER1_NAME=`echo ${PEER1} | awk -F"|" '{print $1}'` + PEER1_IP=`echo ${PEER1} | awk -F"|" '{print $2}'` + + PEER2=`echo ${CONNECTION} | awk -F"<->" '{print $2}'` + PEER2_NAME=`echo ${PEER2} | awk -F"|" '{print $1}'` + PEER2_IP=`echo ${PEER2} | awk -F"|" '{print $2}'` + + # !!! if not created already.. + # Create virtual node (jail) with given name and using + # JAIL_PATH as root directory for jail. + + virtual_chain_create_peer_if_necessary ${PEER1_NAME} + virtual_chain_create_peer_if_necessary ${PEER2_NAME} + + # create an interface for peer with the given peer IP. Get interface + # for future use; you will connect this interface to the other + # peers' (PEER2) interface. + virtual_chain_create_interface_with_ip ${PEER1_NAME} ${PEER1_IP} + PEER1_INTERFACE=${RET_INTERFACE} + + # create an interface for peer with the given peer IP. Get interface + # for future use; you will connect this interface to the other + # peers' (PEER2) interface. + virtual_chain_create_interface_with_ip ${PEER2_NAME} ${PEER2_IP} + PEER2_INTERFACE=${RET_INTERFACE} + + # Connect virtual interface to other interface. Syntax is : + # ngctl connect INTERFACE1: INTERFACE2: ether ether. + + echo -n "Connecting ${PEER1_INTERFACE}:ether to ${PEER2_INTERFACE}:ether..." + ngctl connect ${PEER1_INTERFACE}: ${PEER2_INTERFACE}: ether ether \ + || exit 1 + echo "done" + + done + + # Executes static route add commands. + i=0 + while [ $i != $STATIC_ROUTE_CNT ]; do + eval ROUTE=\${STATIC_ROUTE${i}} + ret=`${ROUTE}` + i=`expr $i + 1` + done + + echo "Virtual WAN established succesfully!" +} + +virtual_chain_create_interface_with_ip() { + + NODE_NAME=$1 + NODE_IP=$2 + + # Create a ng_eiface object for virtual node. ng_eiface + # object has a hook that can be connected to one of bridge + # links. After creating interface get its automatically + # generated name for further usage. + + echo "Creating eiface interface for virtual node ${NODE_NAME}." + ngctl mkpeer eiface ether ether + EIFACE=`ngctl l | grep ngeth | tail -n 1| awk '{print $2}'` + echo "Interface ${EIFACE} is created." + + # Write name of the interface to temp file. Clean-up procedure + # will use this name to shutdown interface. + + echo "interface ${EIFACE}" >> ${TEMP_FILE} + + # Move virtual interface to virtual node. Note that Interface + # name will not be changed at the end of this movement. Moved + # interface can be seen at the output of ifconfig command in + # jail: 'jexec jailname ifconfig' + + echo "Moving ${EIFACE} to ${NODE_NAME}" + ifconfig ${EIFACE} vnet ${NODE_NAME} + + # Make lo0 interface localhost. + jexec ${NODE_NAME} ifconfig lo0 localhost + + # Generate a random mac address for virtual interface. First + # three octets can be changed by user. Last three octets are + # generated randomly. + M4=`od -An -N2 -i /dev/random | sed -e 's/ //g' | \ + awk '{ print $1 % 256 }'` + M5=`od -An -N2 -i /dev/random | sed -e 's/ //g' | \ + awk '{ print $1 % 256 }'` + M6=`od -An -N2 -i /dev/random | sed -e 's/ //g' | \ + awk '{ print $1 % 256 }'` + + MAC=`printf ${MAC_PREFIX}:%02x:%02x:%02x ${M4} ${M5} ${M6}` + + # Set the link address (mac address) of virtual interface in + # virtual node to randomly generated MAC. + echo "Setting MAC address of ${EIFACE} to '${MAC}'" + jexec ${NODE_NAME} ifconfig ${EIFACE} link $MAC + + # Either IPv4 or IPv6 can be used in this script. Ifconfig + # IP setting syntax differs slightly for two IP versions. + # For version 4 'inet' keyword is used whereas for version 6 + # 'inet6' is used. Below line tries to decide which IP version + # is given and sets IPVER to 'inet' or 'inet6'. + + IPVER=`echo ${NODE_IP} | awk -F"." '{ split($4,last,"/"); \ + if( NF==4 && $1>0 && $1<256 && $2<256 && $3<256 && \ + last[1]<256) print "inet"; else print "inet6"}'` + + # Set IP address of virtual interface in virtual node. + echo "Setting IP address of ${EIFACE} to '${NODE_IP}'" + jexec ${NODE_NAME} ifconfig ${EIFACE} ${IPVER} ${NODE_IP} + + RET_INTERFACE=${EIFACE} +} + +virtual_chain_create_peer_if_necessary() { + + if ! grep -q $1 ${TEMP_FILE} ; then + + echo -n "Creating virtual node (jail) ${1}..." + jail -c vnet name=${1} host.hostname=${1} \ + path=${JAIL_PATH} persist + jexec ${1} sysctl -w net.inet.ip.forwarding=1 + jexec ${1} sysctl -w net.inet6.ip6.forwarding=1 + echo "done" + + # Write name of the jail to temp file. Clean-up + # procedure will use this name to remove jail. + + echo "node ${1}" >> ${TEMP_FILE} + fi + +} + + +# Stop routine. +virtual_chain_stop() { + + if [ ! -e ${TEMP_FILE} ]; then + echo "Nothing to stop! ${TEMP_FILE}: temp file not found" + else + + echo -n "Shutdown bridge interface.." + OBJECTS=`cat ${TEMP_FILE} | grep bridge | awk '{print $2}'` + for BRIDGE in ${OBJECTS}; do + ngctl shutdown ${BRIDGE}: >/dev/null 2>&1 + done + echo "done" + + echo -n "Shutdown all eiface interfaces..." + OBJECTS=`cat ${TEMP_FILE} | grep interface | awk '{print $2}'` + for INTERFACE in ${OBJECTS}; do + ngctl shutdown ${INTERFACE}: >/dev/null 2>&1 + done + echo "done" + + echo -n "Removing all jails..." + OBJECTS=`cat ${TEMP_FILE} | grep node | awk '{print $2}'` + for NODE in ${OBJECTS}; do + jail -r ${NODE} + done + echo "done" + + echo "Removing tempfile ${TEMP_FILE}" + rm ${TEMP_FILE} + fi + echo "Virtual LAN objects removed succesfully!" + +} + +virtual_chain_usage() { + echo "usage: $0 start [target_topology]" + echo " : $0 [ stop | help ]" +} + + +# Main entry point. + + +case $# in + 1) + case $1 in + start) + echo -n "Creating default target topology:" + echo " ${TARGET_TOPOLOGY}" + virtual_chain_start + ;; + stop) + + if [ ! -e ${TEMP_FILE} ]; then + echo -n "Noting to stop! ${TEMP_FILE}:" + echo " temp file not found" + else + virtual_chain_stop + fi + ;; + help) + virtual_chain_usage + exit 1 + ;; + *) + virtual_chain_usage + exit 1 + + esac + ;; + 2) + case $1 in + start) + TARGET_TOPOLOGY=$2 + echo -n "Creating target topology:" + echo "${TARGET_TOPOLOGY}" + virtual_chain_start + ;; + *) + virtual_chain_usage + exit 1 + esac + ;; + + *) + virtual_chain_usage + exit 1 +esac + Added: head/share/examples/netgraph/virtual.lan ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/netgraph/virtual.lan Sun Oct 24 22:59:38 2010 (r214306) @@ -0,0 +1,360 @@ +#!/bin/sh +# +# Copyright (c) 2010, Yavuz Gokirmak +# +# All rights reserved. +# +# This source code may be used, modified, copied, distributed, and +# sold, in both source and binary form provided that the above +# copyright and these terms are retained, verbatim, as the first +# lines of this file. Under no circumstances is the author +# responsible for the proper functioning of the software nor does +# the author assume any responsibility for damages incurred with +# its use. +# +# $FreeBSD$ + +# +# This script adds virtual nodes to one of the physical interfaces +# visible on your local area network (LAN). Virtual nodes seems real +# to external observers. +# If traceroute is executed to one of virtual nodes, the IP +# address of the physical interface will not be seen in the output. +# Virtual nodes are generated via jails and network connections are +# established using ng_bridge(4) and ng_eiface(4) node types. +# +# To use this script: +# +# 0. Make your own copy of this example script. +# +# 1. Edit the definition of ${ETHER_INTF} as described below +# to define your real interface connected to the LAN. Virtual nodes +# will placed on the same physical network as this interface. +# +# 2. Edit the definition of ${TARGET_TOPOLOGY} to define your virtual +# nodes. Virtual topology definition includes node names and their +# IP address. Target top. sytax: ( node1|ip1/24 node2|ip2/24 ... ) +# Example 1: ( n1|122.122.122.12/24, n2|122.122.122.13/24 ...) +# Example 2: ( n1|2001:b90::14a/125, n1|2001:b90::14b/125 ...) +# +# 3. Run this script with "start" as the command line argument. +# +# 4. Stop bridging by running this script with "stop" as the +# command line argument. +# +# 5. This cript uses a template file in order to carry information +# between start and stop calls. +# In the start call, the netgraph interfaces and jails are created. +# At the stop phase, all created objects should be removed. +# DO NOT delete the temporary file between the start and stop phases. +# +# To add virtual nodes for multiple independent LANs, create multiple +# copies of this script with different variable definitions. +# +# Target Topology: +# +# +# +---------------+ +---------------+ +---------------+ +# | n0 (vimage) | | n1 (vimage) | | nk (vimage) | +# | | | | | | +# | +-----------+ | | +-----------+ | | +-----------+ | +# | | ngeth0 | | | | ngeth1 | | | | ngethk | | +# | |(ng_eiface)| | | |(ng_eiface)| | | |(ng_eiface)| | +# | +--+-----+--+ | | +--+-----+--+ | | +--+-----+--+ | +# | |ether| | | |ether| | | |ether| | +# | +--X--+ | | +--X--+ | | +---X-+ | +# +-----+ +--------\------+ +--------\------+ +-------/-------+ +# |upper|----\ \ip_addr \ip_addr /ip_addr +# +-+-----+--+ \ \ \ \ +# | em0 | \ +--------+ +-+ \ +# |(ng_ether)| +-----------+ \ \ \ +# +-+-----+--+ \ \ / \ +# |lower| +---------\ \ \ / / +# +--X--+ / O--X--O O-X---O O---X-O O--X--O O---X---O +# \ | |link0| |link1| |link2| |link3| |linkk+2| +# \ / +-O-----O-O-----O-O-----O-O-----O-----O-------O-+ +# +---+ | | +# | bridge (ng_bridge) | +# +-----------------------------------------------+ +# +# + +# Give the name of ethernet interface. Virtual nodes will be seen as +# local neighbours of this interface. + +ETHER_INTF="em0" + +# List the names of virtual nodes and their IP addresses. Use ':' +# character to seperate node name from node IP address and netmask. + +TARGET_TOPOLOGY="c1|10.0.2.20/24 c2|10.0.2.21/24 c3|10.0.2.22/24" + +# MAC manifacturer prefix. This can be modified according to needs. +MAC_PREFIX="00:1d:92" + +# Temporary file is important for proper execution of script. +TEMP_FILE="/var/tmp/.virtual.lan.tmp" + +# Set root directory for jails to be created. +JAIL_PATH="/usr/jails/node" + + +#################################################################### +#### Nothing below this point should need to be modified. #### +#################################################################### + + +# Start/restart routine. +virtual_lan_start() { + + # Load netgraph KLD's as necessary. + + for KLD in ng_ether ng_bridge ng_eiface; do + if ! kldstat -v | grep -qw ${KLD}; then + echo -n "Loading ${KLD}.ko... " + kldload ${KLD} || exit 1 + echo "done" + fi + done + + # Reset all interfaces and jails. If temporary file can not be found + # script assumes that there is no previous configuration. + + if [ ! -e ${TEMP_FILE} ]; then + echo "No previous configuration(${TEMP_FILE}) found to clean-up." + else + echo -n "Cleaning previous configuration..." + virtual_lan_stop + echo "done" + fi + + # Create temporary file for usage. This file includes generated + # interface names and jail names. All bridges, interfaces and jails + # are written to file while created. In clean-up process written + # objects are cleaned (i.e removed) from system. + + if [ -e ${TEMP_FILE} ]; then + touch ${TEMP_FILE} + fi + + echo -n "Verifying ethernet interface existence..." + # Verify ethernet interface exist. + if ! ngctl info ${ETHER_INTF}: >/dev/null 2>&1; then + echo "Error: interface ${ETHER_INTF} does not exist" + exit 1 + fi + ifconfig ${ETHER_INTF} up || exit 1 + echo "done" + + # Get current number of bridge interfaces in the system. This number + # is used to create a name for new bridge. + BRIDGE_COUNT=`ngctl l | grep bridge | wc -l | sed -e "s/ //g"` + BRIDGE_NAME="bridge${BRIDGE_COUNT}" + + # Create new ng_bridge(4) node and attach it to the ethernet interface. + # Connect ng_ether:lower hook to bridge:link0 when creating bridge and + # connect ng_ether:upper hook to bridge:link1 after bridge name is set. + + echo "Creating bridge interface: ${BRIDGE_NAME}..." + ngctl mkpeer ${ETHER_INTF}: bridge lower link0 || exit 1 + ngctl name ${ETHER_INTF}:lower ${BRIDGE_NAME} || exit 1 + ngctl connect ${ETHER_INTF}: ${BRIDGE_NAME}: upper link1 || exit 1 + echo "Bridge ${BRIDGE_NAME} is created and ${ETHER_INTF} is connected." + + # In the above code block two hooks are connected to bridge interface, + # therefore LINKNUM is set to 2 indicating total number of connected + # hooks on the bridge interface. + LINKNUM=2 + + # Write name of the bridge to temp file. Clean-up procedure will use + # this name to shutdown bridge interface. + echo "bridge ${BRIDGE_NAME}" > ${TEMP_FILE} + + + # Attach other interfaces as well. + for NODE in ${TARGET_TOPOLOGY}; do + + # Virtual nodes are defined in TARGET_TOPOLOGY variable. They + # have the form of 'nodeName|IPaddr'. Below two lines split + # node definition to get node name and node IP. + + NODE_NAME=`echo ${NODE} | awk -F"|" '{print $1}'` + NODE_IP=`echo ${NODE} | awk -F"|" '{print $2}'` + + # Create virtual node (jail) with given name and using + # JAIL_PATH as root directory for jail. + + echo -n "Creating virtual node (jail) ${NODE_NAME}..." + jail -c vnet name=${NODE_NAME} host.hostname=${NODE_NAME} \ + path=${JAIL_PATH} persist + echo "done" + + # Write name of the jail to temp file. Clean-up procedure will + # use this name to remove jail. + + echo "node ${NODE_NAME}" >> ${TEMP_FILE} + + # Create a ng_eiface object for virtual node. ng_eiface + # object has a hook that can be connected to one of bridge + # links. After creating interface get its automatically + # generated name for further usage. + + echo "Creating eiface interface for virtual node ${NODE_NAME}." + ngctl mkpeer eiface ether ether + EIFACE=`ngctl l | grep ngeth | tail -n 1| awk '{print $2}'` + echo "Interface ${EIFACE} is created." + + # Write name of the interface to temp file. Clean-up procedure + # will use this name to shutdown interface. + + echo "interface ${EIFACE}" >> ${TEMP_FILE} + + # Move virtual interface to virtual node. Note that Interface + # name will not be changed at the end of this movement. Moved + # interface can be seen at the output of ifconfig command in + # jail: 'jexec jailname ifconfig' + + echo "Moving ${EIFACE} to ${NODE_NAME}" + ifconfig ${EIFACE} vnet ${NODE_NAME} + + # Make lo0 interface localhost. + jexec ${NODE_NAME} ifconfig lo0 localhost + + # Generate a random mac address for virtual interface. First + # three octets can be changed by user. Last three octets are + # generated randomly. + M4=`od -An -N2 -i /dev/random | sed -e 's/ //g' | \ + awk '{ print $1 % 256 }'` + M5=`od -An -N2 -i /dev/random | sed -e 's/ //g' | \ + awk '{ print $1 % 256 }'` + M6=`od -An -N2 -i /dev/random | sed -e 's/ //g' | \ + awk '{ print $1 % 256 }'` + + MAC=`printf ${MAC_PREFIX}:%02x:%02x:%02x ${M4} ${M5} ${M6}` + + # Set the link address (mac address) of virtual interface in + # virtual node to randomly generated MAC. + echo "Setting MAC address of ${EIFACE} to '${MAC}'" + jexec ${NODE_NAME} ifconfig ${EIFACE} link $MAC + + # Either IPv4 or IPv6 can be used in this script. Ifconfig + # IP setting syntax differs slightly for two IP versions. + # For version 4 'inet' keyword is used whereas for version 6 + # 'inet6' is used. Below line tries to decide which IP version + # is given and sets IPVER to 'inet' or 'inet6'. + + IPVER=`echo ${NODE_IP} | awk -F"." '{ split($4,last,"/"); \ + if( NF==4 && $1>0 && $1<256 && $2<256 && $3<256 && \ + last[1]<256) print "inet"; else print "inet6"}'` + + # Set IP address of virtual interface in virtual node. + echo "Setting IP address of ${EIFACE} to '${NODE_IP}'" + jexec ${NODE_NAME} ifconfig ${EIFACE} ${IPVER} ${NODE_IP} + + # Connect virtual interface to bridge interface. Syntax is : + # ngctl connect INTERFACE: BRIDGE: INTERFACE_HOOK EMPTY_LINK. + # Interface has one hook named 'ether' and below line connects + # ether hook to bridge's first unconnected link. + + echo -n "Connecting ${EIFACE}:ether to ${BRIDGE_NAME}:link${LINKNUM}..." + ngctl connect ${EIFACE}: ${BRIDGE_NAME}: ether link${LINKNUM} \ + || exit 1 + echo "done" + + # Now, bridge has one more connected link thus link count is + # incremented. + LINKNUM=`expr ${LINKNUM} + 1` + done + echo "Virtual LAN established succesfully!" + +} + +# Stop routine. +virtual_lan_stop() { + + if [ ! -e ${TEMP_FILE} ]; then + echo "Nothing to stop! ${TEMP_FILE}: temp file not found" + else + + echo -n "Shutdown bridge interface.." + OBJECTS=`cat ${TEMP_FILE} | grep bridge | awk '{print $2}'` + for BRIDGE in ${OBJECTS}; do + ngctl shutdown ${BRIDGE}: >/dev/null 2>&1 + done + echo "done" + + echo -n "Shutdown all eiface interfaces..." + OBJECTS=`cat ${TEMP_FILE} | grep interface | awk '{print $2}'` + for INTERFACE in ${OBJECTS}; do + ngctl shutdown ${INTERFACE}: >/dev/null 2>&1 + done + echo "done" + + echo -n "Removing all jails..." + OBJECTS=`cat ${TEMP_FILE} | grep node | awk '{print $2}'` + for NODE in ${OBJECTS}; do + jail -r ${NODE} + done + echo "done" + + echo "Removing tempfile ${TEMP_FILE}" + rm ${TEMP_FILE} + fi + echo "Virtual LAN objects removed succesfully!" + +} + +virtual_lan_usage() { + echo "usage: $0 start [target_topology]" + echo " : $0 [ stop | help ]" +} + + +# Main entry point. + +case $# in + 1) + case $1 in + start) + echo -n "Creating default target topology:" + echo " ${TARGET_TOPOLOGY}" + virtual_lan_start + ;; + stop) + + if [ ! -e ${TEMP_FILE} ]; then + echo -n "Noting to stop! ${TEMP_FILE}:" + echo " temp file not found" + else + virtual_lan_stop + fi + ;; + help) + virtual_lan_usage + exit 1 + ;; + *) + virtual_lan_usage + exit 1 + + esac + ;; + 2) + case $1 in + start) + TARGET_TOPOLOGY=$2 + echo -n "Creating target topology:" + echo "${TARGET_TOPOLOGY}" + virtual_lan_start + ;; + *) + virtual_lan_usage + exit 1 + esac + ;; + + *) + virtual_lan_usage + exit 1 +esac + From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 23:09: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 A36681065674; Sun, 24 Oct 2010 23:09:00 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DD358FC15; Sun, 24 Oct 2010 23:09: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 o9ON90sw043787; Sun, 24 Oct 2010 23:09:00 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ON90uV043782; Sun, 24 Oct 2010 23:09:00 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010242309.o9ON90uV043782@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 24 Oct 2010 23:09:00 +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: r214307 - in stable/7: . bin/sh contrib/wpa_supplicant gnu/usr.bin/groff/tmac share/misc tools/regression/bin/sh/expansion tools/tools/nanobsd usr.sbin usr.sbin/makefs usr.sbin/makefs/f... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 23:09:00 -0000 Author: obrien Date: Sun Oct 24 23:09:00 2010 New Revision: 214307 URL: http://svn.freebsd.org/changeset/base/214307 Log: MFC r213814: Do not assume in growstackstr() that a "precious" character will be immediately written into the stack after the call. Instead let the caller manage the "space left". Added: stable/7/tools/regression/bin/sh/expansion/trim4.0 - copied unchanged from r213814, head/tools/regression/bin/sh/expansion/trim4.0 Modified: stable/7/bin/sh/histedit.c stable/7/bin/sh/memalloc.c stable/7/bin/sh/memalloc.h Directory Properties: stable/7/ (props changed) stable/7/COPYRIGHT (props changed) stable/7/Makefile (props changed) stable/7/Makefile.inc1 (props changed) stable/7/ObsoleteFiles.inc (props changed) stable/7/UPDATING (props changed) stable/7/bin/ (props changed) stable/7/bin/chflags/ (props changed) stable/7/bin/chio/ (props changed) stable/7/bin/cp/ (props changed) stable/7/bin/csh/ (props changed) stable/7/bin/dd/ (props changed) stable/7/bin/df/ (props changed) stable/7/bin/expr/ (props changed) stable/7/bin/kill/ (props changed) stable/7/bin/ln/ (props changed) stable/7/bin/ls/ (props changed) stable/7/bin/pax/ (props changed) stable/7/bin/ps/ (props changed) stable/7/bin/rm/ (props changed) stable/7/bin/sh/ (props changed) stable/7/bin/test/ (props changed) stable/7/cddl/contrib/opensolaris/ (props changed) stable/7/cddl/lib/libzpool/ (props changed) stable/7/contrib/bind9/ (props changed) stable/7/contrib/binutils/ (props changed) stable/7/contrib/bsnmp/ (props changed) stable/7/contrib/cpio/ (props changed) stable/7/contrib/csup/ (props changed) stable/7/contrib/expat/ (props changed) stable/7/contrib/gcc/ (props changed) stable/7/contrib/gdb/ (props changed) stable/7/contrib/gdtoa/ (props changed) stable/7/contrib/groff/ (props changed) stable/7/contrib/ipfilter/ (props changed) stable/7/contrib/less/ (props changed) stable/7/contrib/libpcap/ (props changed) stable/7/contrib/ncurses/ (props changed) stable/7/contrib/netcat/ (props changed) stable/7/contrib/ntp/ (props changed) stable/7/contrib/nvi/ (props changed) stable/7/contrib/pf/ (props changed) stable/7/contrib/sendmail/ (props changed) stable/7/contrib/smbfs/ (props changed) stable/7/contrib/tcp_wrappers/ (props changed) stable/7/contrib/tcsh/ (props changed) stable/7/contrib/telnet/ (props changed) stable/7/contrib/top/ (props changed) stable/7/contrib/traceroute/ (props changed) stable/7/contrib/wpa_supplicant/ (props changed) stable/7/contrib/wpa_supplicant/wpa_supplicant.conf (props changed) stable/7/crypto/openssh/ (props changed) stable/7/etc/ (props changed) stable/7/games/factor/ (props changed) stable/7/games/fortune/ (props changed) stable/7/games/grdc/ (props changed) stable/7/gnu/ (props changed) stable/7/gnu/lib/libstdc++/ (props changed) stable/7/gnu/usr.bin/ (props changed) stable/7/gnu/usr.bin/cc/ (props changed) stable/7/gnu/usr.bin/cpio/ (props changed) stable/7/gnu/usr.bin/cvs/ (props changed) stable/7/gnu/usr.bin/gdb/ (props changed) stable/7/gnu/usr.bin/gdb/kgdb/ (props changed) stable/7/gnu/usr.bin/grep/ (props changed) stable/7/gnu/usr.bin/groff/ (props changed) stable/7/gnu/usr.bin/groff/tmac/mdoc.local (props changed) stable/7/gnu/usr.bin/man/ (props changed) stable/7/gnu/usr.bin/sort/ (props changed) stable/7/include/ (props changed) stable/7/kerberos5/ (props changed) stable/7/lib/ (props changed) stable/7/lib/bind/ (props changed) stable/7/lib/csu/ (props changed) stable/7/lib/libarchive/ (props changed) stable/7/lib/libbluetooth/ (props changed) stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) stable/7/lib/libc_r/ (props changed) stable/7/lib/libcam/ (props changed) stable/7/lib/libdisk/ (props changed) stable/7/lib/libdwarf/ (props changed) stable/7/lib/libelf/ (props changed) stable/7/lib/libexpat/ (props changed) stable/7/lib/libfetch/ (props changed) stable/7/lib/libftpio/ (props changed) stable/7/lib/libgeom/ (props changed) stable/7/lib/libgssapi/ (props changed) stable/7/lib/libkse/ (props changed) stable/7/lib/libkvm/ (props changed) stable/7/lib/libmagic/ (props changed) stable/7/lib/libmemstat/ (props changed) stable/7/lib/libpmc/ (props changed) stable/7/lib/libradius/ (props changed) stable/7/lib/libsm/ (props changed) stable/7/lib/libstand/ (props changed) stable/7/lib/libthr/ (props changed) stable/7/lib/libthread_db/ (props changed) stable/7/lib/libufs/ (props changed) stable/7/lib/libutil/ (props changed) stable/7/lib/msun/ (props changed) stable/7/libexec/ (props changed) stable/7/libexec/ftpd/ (props changed) stable/7/libexec/rpc.rquotad/ (props changed) stable/7/libexec/rpc.rstatd/ (props changed) stable/7/libexec/rtld-elf/ (props changed) stable/7/libexec/tftpd/ (props changed) stable/7/release/ (props changed) stable/7/release/doc/ (props changed) stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/7/release/picobsd/tinyware/login/ (props changed) stable/7/rescue/ (props changed) stable/7/sbin/ (props changed) stable/7/sbin/atacontrol/ (props changed) stable/7/sbin/bsdlabel/ (props changed) stable/7/sbin/clri/ (props changed) stable/7/sbin/ddb/ (props changed) stable/7/sbin/devd/ (props changed) stable/7/sbin/devfs/ (props changed) stable/7/sbin/dhclient/ (props changed) stable/7/sbin/dumpfs/ (props changed) stable/7/sbin/fdisk/ (props changed) stable/7/sbin/fdisk_pc98/ (props changed) stable/7/sbin/fsck/ (props changed) stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/fsck_msdosfs/ (props changed) stable/7/sbin/geom/ (props changed) stable/7/sbin/geom/class/label/ (props changed) stable/7/sbin/geom/class/part/ (props changed) stable/7/sbin/geom/class/stripe/ (props changed) stable/7/sbin/geom/misc/ (props changed) stable/7/sbin/growfs/ (props changed) stable/7/sbin/ifconfig/ (props changed) stable/7/sbin/init/ (props changed) stable/7/sbin/ipf/ (props changed) stable/7/sbin/ipfw/ (props changed) stable/7/sbin/md5/ (props changed) stable/7/sbin/mdconfig/ (props changed) stable/7/sbin/mksnap_ffs/ (props changed) stable/7/sbin/mount/ (props changed) stable/7/sbin/mount_msdosfs/ (props changed) stable/7/sbin/natd/ (props changed) stable/7/sbin/newfs/ (props changed) stable/7/sbin/newfs_msdos/ (props changed) stable/7/sbin/ping6/ (props changed) stable/7/sbin/reboot/ (props changed) stable/7/sbin/restore/ (props changed) stable/7/sbin/route/ (props changed) stable/7/sbin/savecore/ (props changed) stable/7/sbin/sconfig/ (props changed) stable/7/sbin/shutdown/ (props changed) stable/7/sbin/sysctl/ (props changed) stable/7/sbin/tunefs/ (props changed) stable/7/secure/lib/libssh/ (props changed) stable/7/secure/libexec/sftp-server/ (props changed) stable/7/secure/usr.bin/bdes/ (props changed) stable/7/secure/usr.bin/ssh/ (props changed) stable/7/secure/usr.sbin/sshd/ (props changed) stable/7/share/ (props changed) stable/7/share/colldef/ (props changed) stable/7/share/dict/ (props changed) stable/7/share/doc/bind9/ (props changed) stable/7/share/examples/ (props changed) stable/7/share/man/ (props changed) stable/7/share/man/man1/ (props changed) stable/7/share/man/man3/ (props changed) stable/7/share/man/man4/ (props changed) stable/7/share/man/man5/ (props changed) stable/7/share/man/man7/ (props changed) stable/7/share/man/man8/ (props changed) stable/7/share/man/man9/ (props changed) stable/7/share/misc/ (props changed) stable/7/share/misc/iso639 (props changed) stable/7/share/misc/pci_vendors (props changed) stable/7/share/mk/ (props changed) stable/7/share/mklocale/ (props changed) stable/7/share/monetdef/ (props changed) stable/7/share/msgdef/ (props changed) stable/7/share/numericdef/ (props changed) stable/7/share/sendmail/ (props changed) stable/7/share/syscons/ (props changed) stable/7/share/syscons/keymaps/ (props changed) stable/7/share/termcap/ (props changed) stable/7/share/timedef/ (props changed) stable/7/share/zoneinfo/ (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) stable/7/tools/ (props changed) stable/7/tools/build/ (props changed) stable/7/tools/build/options/ (props changed) stable/7/tools/debugscripts/ (props changed) stable/7/tools/regression/atm/ (props changed) stable/7/tools/regression/bin/sh/ (props changed) stable/7/tools/regression/file/ (props changed) stable/7/tools/regression/file/flock/ (props changed) stable/7/tools/regression/usr.bin/ (props changed) stable/7/tools/regression/usr.bin/jot/ (props changed) stable/7/tools/regression/usr.bin/tr/ (props changed) stable/7/tools/sched/ (props changed) stable/7/tools/test/ (props changed) stable/7/tools/tools/ (props changed) stable/7/tools/tools/aac/ (props changed) stable/7/tools/tools/crypto/ (props changed) stable/7/tools/tools/editing/ (props changed) stable/7/tools/tools/nanobsd/ (props changed) stable/7/tools/tools/nanobsd/FlashDevice.sub (props changed) stable/7/tools/tools/nanobsd/nanobsd.sh (props changed) stable/7/tools/tools/netrate/ (props changed) stable/7/tools/tools/umastat/ (props changed) stable/7/tools/tools/usb/ (props changed) stable/7/usr.bin/ (props changed) stable/7/usr.bin/basename/ (props changed) stable/7/usr.bin/bluetooth/rfcomm_sppd/ (props changed) stable/7/usr.bin/calendar/ (props changed) stable/7/usr.bin/catman/ (props changed) stable/7/usr.bin/cksum/ (props changed) stable/7/usr.bin/comm/ (props changed) stable/7/usr.bin/cpuset/ (props changed) stable/7/usr.bin/csup/ (props changed) stable/7/usr.bin/dirname/ (props changed) stable/7/usr.bin/du/ (props changed) stable/7/usr.bin/fetch/ (props changed) stable/7/usr.bin/file/ (props changed) stable/7/usr.bin/find/ (props changed) stable/7/usr.bin/finger/ (props changed) stable/7/usr.bin/fstat/ (props changed) stable/7/usr.bin/gcore/ (props changed) stable/7/usr.bin/gprof/ (props changed) stable/7/usr.bin/gzip/ (props changed) stable/7/usr.bin/hexdump/ (props changed) stable/7/usr.bin/id/ (props changed) stable/7/usr.bin/indent/ (props changed) stable/7/usr.bin/ipcrm/ (props changed) stable/7/usr.bin/ipcs/ (props changed) stable/7/usr.bin/jot/ (props changed) stable/7/usr.bin/kdump/ (props changed) stable/7/usr.bin/ktrace/ (props changed) stable/7/usr.bin/ldd/ (props changed) stable/7/usr.bin/less/ (props changed) stable/7/usr.bin/locate/ (props changed) stable/7/usr.bin/lockf/ (props changed) stable/7/usr.bin/logger/ (props changed) stable/7/usr.bin/make/ (props changed) stable/7/usr.bin/ncal/ (props changed) stable/7/usr.bin/netstat/ (props changed) stable/7/usr.bin/newgrp/ (props changed) stable/7/usr.bin/nsupdate/ (props changed) stable/7/usr.bin/pkill/ (props changed) stable/7/usr.bin/procstat/ (props changed) stable/7/usr.bin/quota/ (props changed) stable/7/usr.bin/rpcgen/ (props changed) stable/7/usr.bin/ruptime/ (props changed) stable/7/usr.bin/script/ (props changed) stable/7/usr.bin/sed/ (props changed) stable/7/usr.bin/shar/ (props changed) stable/7/usr.bin/sockstat/ (props changed) stable/7/usr.bin/stat/ (props changed) stable/7/usr.bin/su/ (props changed) stable/7/usr.bin/systat/ (props changed) stable/7/usr.bin/tail/ (props changed) stable/7/usr.bin/tar/ (props changed) stable/7/usr.bin/tftp/ (props changed) stable/7/usr.bin/tip/ (props changed) stable/7/usr.bin/top/ (props changed) stable/7/usr.bin/truncate/ (props changed) stable/7/usr.bin/truss/ (props changed) stable/7/usr.bin/uname/ (props changed) stable/7/usr.bin/unifdef/ (props changed) stable/7/usr.bin/units/ (props changed) stable/7/usr.bin/vmstat/ (props changed) stable/7/usr.bin/w/ (props changed) stable/7/usr.bin/wc/ (props changed) stable/7/usr.bin/whereis/ (props changed) stable/7/usr.bin/whois/ (props changed) stable/7/usr.bin/window/ (props changed) stable/7/usr.bin/xargs/ (props changed) stable/7/usr.bin/ypcat/ (props changed) stable/7/usr.bin/ypmatch/ (props changed) stable/7/usr.bin/ypwhich/ (props changed) stable/7/usr.sbin/ (props changed) stable/7/usr.sbin/Makefile (props changed) stable/7/usr.sbin/acpi/ (props changed) stable/7/usr.sbin/adduser/ (props changed) stable/7/usr.sbin/arp/ (props changed) stable/7/usr.sbin/bluetooth/ (props changed) stable/7/usr.sbin/bluetooth/btpand/ (props changed) stable/7/usr.sbin/bluetooth/hcsecd/ (props changed) stable/7/usr.sbin/bluetooth/hcseriald/ (props changed) stable/7/usr.sbin/bluetooth/rfcomm_pppd/ (props changed) stable/7/usr.sbin/bluetooth/sdpd/ (props changed) stable/7/usr.sbin/boot0cfg/ (props changed) stable/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed) stable/7/usr.sbin/burncd/ (props changed) stable/7/usr.sbin/cdcontrol/ (props changed) stable/7/usr.sbin/chown/ (props changed) stable/7/usr.sbin/chroot/ (props changed) stable/7/usr.sbin/config/ (props changed) stable/7/usr.sbin/cpucontrol/ (props changed) stable/7/usr.sbin/crashinfo/ (props changed) stable/7/usr.sbin/cron/ (props changed) stable/7/usr.sbin/cron/cron/ (props changed) stable/7/usr.sbin/crunch/ (props changed) stable/7/usr.sbin/cxgbtool/ (props changed) stable/7/usr.sbin/eeprom/ (props changed) stable/7/usr.sbin/extattr/ (props changed) stable/7/usr.sbin/faithd/ (props changed) stable/7/usr.sbin/fdcontrol/ (props changed) stable/7/usr.sbin/fdformat/ (props changed) stable/7/usr.sbin/fdread/ (props changed) stable/7/usr.sbin/fdwrite/ (props changed) stable/7/usr.sbin/fifolog/ (props changed) stable/7/usr.sbin/freebsd-update/ (props changed) stable/7/usr.sbin/fwcontrol/ (props changed) stable/7/usr.sbin/gstat/ (props changed) stable/7/usr.sbin/iostat/ (props changed) stable/7/usr.sbin/jail/ (props changed) stable/7/usr.sbin/jexec/ (props changed) stable/7/usr.sbin/jls/ (props changed) stable/7/usr.sbin/lpr/ (props changed) stable/7/usr.sbin/mailwrapper/ (props changed) stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) stable/7/usr.sbin/mergemaster/ (props changed) stable/7/usr.sbin/mfiutil/ (props changed) stable/7/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/7/usr.sbin/mountd/ (props changed) stable/7/usr.sbin/mptutil/ (props changed) stable/7/usr.sbin/mtree/ (props changed) stable/7/usr.sbin/ndiscvt/ (props changed) stable/7/usr.sbin/ndp/ (props changed) stable/7/usr.sbin/newsyslog/ (props changed) stable/7/usr.sbin/nscd/ (props changed) stable/7/usr.sbin/ntp/ (props changed) stable/7/usr.sbin/pciconf/ (props changed) stable/7/usr.sbin/pkg_install/ (props changed) stable/7/usr.sbin/pmccontrol/ (props changed) stable/7/usr.sbin/pmcstat/ (props changed) stable/7/usr.sbin/portsnap/ (props changed) stable/7/usr.sbin/powerd/ (props changed) stable/7/usr.sbin/ppp/ (props changed) stable/7/usr.sbin/pstat/ (props changed) stable/7/usr.sbin/pw/ (props changed) stable/7/usr.sbin/pwd_mkdb/ (props changed) stable/7/usr.sbin/rpc.lockd/ (props changed) stable/7/usr.sbin/rpc.statd/ (props changed) stable/7/usr.sbin/rpc.yppasswdd/ (props changed) stable/7/usr.sbin/rtsold/ (props changed) stable/7/usr.sbin/sade/ (props changed) stable/7/usr.sbin/service/ (props changed) stable/7/usr.sbin/setfib/ (props changed) stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/syslogd/ (props changed) stable/7/usr.sbin/traceroute/ (props changed) stable/7/usr.sbin/traceroute6/ (props changed) stable/7/usr.sbin/tzsetup/ (props changed) stable/7/usr.sbin/ugidfw/ (props changed) stable/7/usr.sbin/wpa/wpa_supplicant/ (props changed) stable/7/usr.sbin/ypserv/ (props changed) stable/7/usr.sbin/zic/ (props changed) Modified: stable/7/bin/sh/histedit.c ============================================================================== --- stable/7/bin/sh/histedit.c Sun Oct 24 22:59:38 2010 (r214306) +++ stable/7/bin/sh/histedit.c Sun Oct 24 23:09:00 2010 (r214307) @@ -411,7 +411,7 @@ fc_replace(const char *s, char *p, char } else STPUTC(*s++, dest); } - STACKSTRNUL(dest); + STPUTC('\0', dest); dest = grabstackstr(dest); return (dest); Modified: stable/7/bin/sh/memalloc.c ============================================================================== --- stable/7/bin/sh/memalloc.c Sun Oct 24 22:59:38 2010 (r214306) +++ stable/7/bin/sh/memalloc.c Sun Oct 24 23:09:00 2010 (r214307) @@ -295,6 +295,13 @@ grabstackblock(int len) * is space for at least one character. */ +static char * +growstrstackblock(int n) +{ + growstackblock(); + sstrnleft = stackblocksize() - n; + return stackblock() + n; +} char * growstackstr(void) @@ -304,12 +311,10 @@ growstackstr(void) len = stackblocksize(); if (herefd >= 0 && len >= 1024) { xwrite(herefd, stackblock(), len); - sstrnleft = len - 1; + sstrnleft = len; return stackblock(); } - growstackblock(); - sstrnleft = stackblocksize() - len - 1; - return stackblock() + len; + return growstrstackblock(len); } @@ -323,9 +328,7 @@ makestrspace(void) int len; len = stackblocksize() - sstrnleft; - growstackblock(); - sstrnleft = stackblocksize() - len; - return stackblock() + len; + return growstrstackblock(len); } Modified: stable/7/bin/sh/memalloc.h ============================================================================== --- stable/7/bin/sh/memalloc.h Sun Oct 24 22:59:38 2010 (r214306) +++ stable/7/bin/sh/memalloc.h Sun Oct 24 23:09:00 2010 (r214307) @@ -65,9 +65,16 @@ void ungrabstackstr(char *, char *); #define stackblock() stacknxt #define stackblocksize() stacknleft #define STARTSTACKSTR(p) p = stackblock(), sstrnleft = stackblocksize() -#define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), *p++ = (c))) +#define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), --sstrnleft, *p++ = (c))) #define CHECKSTRSPACE(n, p) { if (sstrnleft < n) p = makestrspace(); } #define USTPUTC(c, p) (--sstrnleft, *p++ = (c)) +/* + * STACKSTRNUL's use is where we want to be able to turn a stack + * (non-sentinel, character counting string) into a C string, + * and later pretend the NUL is not there. + * Note: Because of STACKSTRNUL's semantics, STACKSTRNUL cannot be used + * on a stack that will grabstackstr()ed. + */ #define STACKSTRNUL(p) (sstrnleft == 0? (p = growstackstr(), *p = '\0') : (*p = '\0')) #define STUNPUTC(p) (++sstrnleft, --p) #define STTOPC(p) p[-1] Copied: stable/7/tools/regression/bin/sh/expansion/trim4.0 (from r213814, head/tools/regression/bin/sh/expansion/trim4.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/regression/bin/sh/expansion/trim4.0 Sun Oct 24 23:09:00 2010 (r214307, copy of r213814, head/tools/regression/bin/sh/expansion/trim4.0) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +v1=/homes/SOME_USER +v2= +v3=C123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 + +# Trigger bug in VSTRIMRIGHT processing STADJUST() call in expand.c:subevalvar() +while [ ${#v2} -lt 2000 ]; do + v4="${v2} ${v1%/*} $v3" + if [ ${#v4} -ne $((${#v2} + ${#v3} + 8)) ]; then + echo bad: ${#v4} -ne $((${#v2} + ${#v3} + 8)) + fi + v2=x$v2 + v3=y$v3 +done From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 23:19: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 AAF3E1065672; Sun, 24 Oct 2010 23:19:11 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 999668FC18; Sun, 24 Oct 2010 23:19: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 o9ONJBoQ044045; Sun, 24 Oct 2010 23:19:11 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ONJBHi044043; Sun, 24 Oct 2010 23:19:11 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201010242319.o9ONJBHi044043@svn.freebsd.org> From: Julian Elischer Date: Sun, 24 Oct 2010 23:19:11 +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: r214308 - head/etc/mtree X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 23:19:11 -0000 Author: julian Date: Sun Oct 24 23:19:11 2010 New Revision: 214308 URL: http://svn.freebsd.org/changeset/base/214308 Log: Add a jails directory in the examples section MFC after: 2 weeks Modified: head/etc/mtree/BSD.usr.dist Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sun Oct 24 23:09:00 2010 (r214307) +++ head/etc/mtree/BSD.usr.dist Sun Oct 24 23:19:11 2010 (r214308) @@ -227,6 +227,8 @@ .. iscsi .. + jails + .. kld cdev module From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 23:22:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id F27FB106566B for ; Sun, 24 Oct 2010 23:22:49 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 5F2C314F8FF for ; Sun, 24 Oct 2010 23:22:49 +0000 (UTC) Received: (qmail 52418 invoked from network); 24 Oct 2010 23:22:49 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2010 23:22:49 -0000 Message-ID: <4CC4BFC8.4010500@freebsd.org> Date: Sun, 24 Oct 2010 16:22:48 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.11) Gecko/20100803 Thunderbird/3.0.6 MIME-Version: 1.0 To: "David E. O'Brien" References: <201010242309.o9ON90uV043782@svn.freebsd.org> In-Reply-To: <201010242309.o9ON90uV043782@svn.freebsd.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r214307 - in stable/7: . bin/sh contrib/wpa_supplicant gnu/usr.bin/groff/tmac share/misc tools/regression/bin/sh/expansion tools/tools/nanobsd usr.sbin usr.sbin/makefs usr.sbin/makefs/f... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 23:22:50 -0000 On 10/24/10 16:09, David E. O'Brien wrote: > MFC r213814: Do not assume in growstackstr() that a "precious" character > will be immediately written into the stack after the call. Instead let > the caller manage the "space left". > > Added: > stable/7/tools/regression/bin/sh/expansion/trim4.0 > - copied unchanged from r213814, head/tools/regression/bin/sh/expansion/trim4.0 > Modified: > stable/7/bin/sh/histedit.c > stable/7/bin/sh/memalloc.c > stable/7/bin/sh/memalloc.h > Directory Properties: > stable/7/ (props changed) > [snip 362 lines of (props changed)] > stable/7/usr.sbin/zic/ (props changed) Did you read the 'Merging with Subversion' instructions http://wiki.freebsd.org/SubversionPrimer/Merging where it says "Because of mergeinfo propagation, it is important to choose the source and target for the merge carefully to minimize property changes on unrelated directories." ? This commit should not have been merged into stable/7. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 23:25: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 33A3F10656A8; Sun, 24 Oct 2010 23:25:15 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 221778FC17; Sun, 24 Oct 2010 23:25: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 o9ONPF2g044203; Sun, 24 Oct 2010 23:25:15 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ONPFpM044201; Sun, 24 Oct 2010 23:25:15 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201010242325.o9ONPFpM044201@svn.freebsd.org> From: Julian Elischer Date: Sun, 24 Oct 2010 23:25:15 +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: r214309 - head/share/examples X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Oct 2010 23:25:15 -0000 Author: julian Date: Sun Oct 24 23:25:14 2010 New Revision: 214309 URL: http://svn.freebsd.org/changeset/base/214309 Log: Add Makefile entry to install two new example files. MFC after: 2 weeks Modified: head/share/examples/Makefile Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Sun Oct 24 23:19:11 2010 (r214308) +++ head/share/examples/Makefile Sun Oct 24 23:25:14 2010 (r214309) @@ -17,6 +17,7 @@ LDIRS= BSD_daemon \ ibcs2 \ indent \ ipfw \ + jails \ kld \ libvgl \ mdoc \ @@ -80,6 +81,7 @@ XFILES= BSD_daemon/FreeBSD.pfa \ ibcs2/hello.uu \ indent/indent.pro \ ipfw/change_rules.sh \ + jails/README \ kld/Makefile \ kld/cdev/Makefile \ kld/cdev/README \ @@ -116,6 +118,8 @@ XFILES= BSD_daemon/FreeBSD.pfa \ netgraph/ngctl \ netgraph/raw \ netgraph/udp.tunnel \ + netgraph/virtual.chain \ + netgraph/virtual.lan \ nwclient/dot.nwfsrc \ nwclient/nwfs.sh.sample \ perfmon/Makefile \ From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 00:00: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 2CA63106564A; Mon, 25 Oct 2010 00:00:03 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from out-0.mx.aerioconnect.net (out-0-14.mx.aerioconnect.net [216.240.47.74]) by mx1.freebsd.org (Postfix) with ESMTP id F1E1A8FC0A; Mon, 25 Oct 2010 00:00:02 +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 o9ONZB6T000335; Sun, 24 Oct 2010 16:35:11 -0700 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 0CBD62D6011; Sun, 24 Oct 2010 16:35:09 -0700 (PDT) Message-ID: <4CC4C2E8.9020304@freebsd.org> Date: Sun, 24 Oct 2010 16:36:08 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201010242202.o9OM2aGo041606@svn.freebsd.org> In-Reply-To: <201010242202.o9OM2aGo041606@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214303 - in head/sys: conf 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, 25 Oct 2010 00:00:03 -0000 On 10/24/10 3:02 PM, Bjoern A. Zeeb wrote: > Author: bz > Date: Sun Oct 24 22:02:36 2010 > New Revision: 214303 > URL: http://svn.freebsd.org/changeset/base/214303 > > Log: > Add initial inet DDB support for show in_ifaddr and show sin commands which > proved to be useful while debugging address list problems. sin commands? really? "Covet thy neighbor's wife!" > > From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 01:02: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 A4107106564A; Mon, 25 Oct 2010 01:02:34 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 771CB8FC08; Mon, 25 Oct 2010 01:02: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 o9P12Y19046152; Mon, 25 Oct 2010 01:02:34 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P12YBM046148; Mon, 25 Oct 2010 01:02:34 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201010250102.o9P12YBM046148@svn.freebsd.org> From: Julian Elischer Date: Mon, 25 Oct 2010 01:02: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: r214310 - in stable/8/sys: ddb 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: Mon, 25 Oct 2010 01:02:34 -0000 Author: julian Date: Mon Oct 25 01:02:34 2010 New Revision: 214310 URL: http://svn.freebsd.org/changeset/base/214310 Log: MFC of svn change 206639. replace a couple of instances of the same definitions with one in an include file Modified: stable/8/sys/ddb/db_sym.c stable/8/sys/net/vnet.c stable/8/sys/net/vnet.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) Modified: stable/8/sys/ddb/db_sym.c ============================================================================== --- stable/8/sys/ddb/db_sym.c Sun Oct 24 23:25:14 2010 (r214309) +++ stable/8/sys/ddb/db_sym.c Mon Oct 25 01:02:34 2010 (r214310) @@ -64,12 +64,6 @@ static boolean_t db_line_at_pc(c_db_sym_ static int db_cpu = -1; #ifdef VIMAGE -extern uintptr_t *__start_set_vnet; -extern uintptr_t *__stop_set_vnet; - -#define VNET_START (uintptr_t)&__start_set_vnet -#define VNET_STOP (uintptr_t)&__stop_set_vnet - static void *db_vnet = NULL; #endif Modified: stable/8/sys/net/vnet.c ============================================================================== --- stable/8/sys/net/vnet.c Sun Oct 24 23:25:14 2010 (r214309) +++ stable/8/sys/net/vnet.c Mon Oct 25 01:02:34 2010 (r214310) @@ -154,15 +154,6 @@ struct vnet *vnet0; */ /* - * Location of the kernel's 'set_vnet' linker set. - */ -extern uintptr_t *__start_set_vnet; -extern uintptr_t *__stop_set_vnet; - -#define VNET_START (uintptr_t)&__start_set_vnet -#define VNET_STOP (uintptr_t)&__stop_set_vnet - -/* * Number of bytes of data in the 'set_vnet' linker set, and hence the total * size of all kernel virtualized global variables, and the malloc(9) type * that will be used to allocate it. Modified: stable/8/sys/net/vnet.h ============================================================================== --- stable/8/sys/net/vnet.h Sun Oct 24 23:25:14 2010 (r214309) +++ stable/8/sys/net/vnet.h Mon Oct 25 01:02:34 2010 (r214310) @@ -92,6 +92,15 @@ struct vnet { #include /* + * Location of the kernel's 'set_vnet' linker set. + */ +extern uintptr_t *__start_set_vnet; +extern uintptr_t *__stop_set_vnet; + +#define VNET_START (uintptr_t)&__start_set_vnet +#define VNET_STOP (uintptr_t)&__stop_set_vnet + +/* * Functions to allocate and destroy virtual network stacks. */ struct vnet *vnet_alloc(void); From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 01:13: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 32BB71065670; Mon, 25 Oct 2010 01:13:47 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 86E6A8FC08; Mon, 25 Oct 2010 01:13:46 +0000 (UTC) Received: by gwaa18 with SMTP id a18so1359257gwa.13 for ; Sun, 24 Oct 2010 18:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:in-reply-to :mime-version:content-transfer-encoding:content-type:message-id:cc :x-mailer:from:subject:date:to; bh=BUxsvBVttbm6N74TBjfbc3w6BXR187OU/oAXwgQcaBo=; b=DV4EpqC7Dye4yx/MugI299Mf9Q+feQQSYU41aSvxWOCUkfNWVZuTzCzcZqOlf2+MnU 55eUzyYNyc7wCt2IAoAWFYTRLUXimFqMu9/R8f8aqJ10gzMEgWJrb0MynIsqedNBz6Ca fLX63pNqA2HvhnfHYGLEWFORfvb3oeBcgczZk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=iD68LcUIMUrhauU0bCU1a6TMIScJMnA9OaxqOmHwO97vu8Q5qgm/AlF7WniB4tq7Vt mHXFvp1q4vbdI/evRI+wRz1sc/2qOP0nAOjsH/TwgWj0ygB3LRl2921LctvhDMKhfDMh ke1Oo9kqHsBQ0no1DSF57Y7vAPyvv8h3WpHOk= Received: by 10.150.198.8 with SMTP id v8mr55572ybf.115.1287969223919; Sun, 24 Oct 2010 18:13:43 -0700 (PDT) Received: from [10.84.243.115] ([166.205.136.210]) by mx.google.com with ESMTPS id x51sm4992557yhc.19.2010.10.24.18.13.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 24 Oct 2010 18:13:42 -0700 (PDT) References: <201010242202.o9OM2aGo041606@svn.freebsd.org> <4CC4C2E8.9020304@freebsd.org> In-Reply-To: <4CC4C2E8.9020304@freebsd.org> Mime-Version: 1.0 (iPhone Mail 8B117) Message-Id: X-Mailer: iPhone Mail (8B117) From: Garrett Cooper Date: Sun, 24 Oct 2010 18:13:48 -0700 To: Julian Elischer Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "Bjoern A. Zeeb" , "src-committers@freebsd.org" Subject: Re: svn commit: r214303 - in head/sys: conf 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, 25 Oct 2010 01:13:47 -0000 On Oct 24, 2010, at 4:36 PM, Julian Elischer wrote: > On 10/24/10 3:02 PM, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Sun Oct 24 22:02:36 2010 >> New Revision: 214303 >> URL: http://svn.freebsd.org/changeset/base/214303 >>=20 >> Log: >> Add initial inet DDB support for show in_ifaddr and show sin commands w= hich >> proved to be useful while debugging address list problems. >=20 > sin commands? really? "Covet thy neighbor's wife!" >>=20 >>=20 As long as DDB doesn't hold false WITNESS (LOR), we should be ok :)...= From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 01:22: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 0D2B1106564A; Mon, 25 Oct 2010 01:22:37 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEB598FC0A; Mon, 25 Oct 2010 01:22: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 o9P1MaDL046635; Mon, 25 Oct 2010 01:22:36 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P1Ma1A046633; Mon, 25 Oct 2010 01:22:36 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201010250122.o9P1Ma1A046633@svn.freebsd.org> From: Julian Elischer Date: Mon, 25 Oct 2010 01:22: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: r214311 - 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: Mon, 25 Oct 2010 01:22:37 -0000 Author: julian Date: Mon Oct 25 01:22:36 2010 New Revision: 214311 URL: http://svn.freebsd.org/changeset/base/214311 Log: MFC of 206632 If both ALQ and KTR are defined, allow KTR buffer to be used when ALQ is disabled by sysctl. Modified: stable/8/sys/kern/kern_ktr.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) Modified: stable/8/sys/kern/kern_ktr.c ============================================================================== --- stable/8/sys/kern/kern_ktr.c Mon Oct 25 01:02:34 2010 (r214310) +++ stable/8/sys/kern/kern_ktr.c Mon Oct 25 01:22:36 2010 (r214311) @@ -194,9 +194,8 @@ ktr_tracepoint(u_int mask, const char *f struct ktr_entry *entry; #ifdef KTR_ALQ struct ale *ale = NULL; -#else - int newindex, saveindex; #endif + int newindex, saveindex; #if defined(KTR_VERBOSE) || defined(KTR_ALQ) struct thread *td; #endif @@ -216,27 +215,30 @@ ktr_tracepoint(u_int mask, const char *f td->td_pflags |= TDP_INKTR; #endif #ifdef KTR_ALQ - if (ktr_alq_enabled && - td->td_critnest == 0 && - (td->td_flags & TDF_IDLETD) == 0 && - td != ald_thread) { - if (ktr_alq_max && ktr_alq_cnt > ktr_alq_max) - goto done; - if ((ale = alq_get(ktr_alq, ALQ_NOWAIT)) == NULL) { - ktr_alq_failed++; + if (ktr_alq_enabled) { + if (td->td_critnest == 0 && + (td->td_flags & TDF_IDLETD) == 0 && + td != ald_thread) { + if (ktr_alq_max && ktr_alq_cnt > ktr_alq_max) + goto done; + if ((ale = alq_get(ktr_alq, ALQ_NOWAIT)) == NULL) { + ktr_alq_failed++; + goto done; + } + ktr_alq_cnt++; + entry = (struct ktr_entry *)ale->ae_data; + } else { goto done; } - ktr_alq_cnt++; - entry = (struct ktr_entry *)ale->ae_data; } else - goto done; -#else - do { - saveindex = ktr_idx; - newindex = (saveindex + 1) & (KTR_ENTRIES - 1); - } while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0); - entry = &ktr_buf[saveindex]; #endif + { + do { + saveindex = ktr_idx; + newindex = (saveindex + 1) & (KTR_ENTRIES - 1); + } while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0); + entry = &ktr_buf[saveindex]; + } entry->ktr_timestamp = KTR_TIME; entry->ktr_cpu = cpu; entry->ktr_thread = curthread; @@ -266,7 +268,7 @@ ktr_tracepoint(u_int mask, const char *f entry->ktr_parms[4] = arg5; entry->ktr_parms[5] = arg6; #ifdef KTR_ALQ - if (ale) + if (ktr_alq_enabled && ale) alq_post(ktr_alq, ale); done: #endif @@ -290,7 +292,9 @@ DB_SHOW_COMMAND(ktr, db_ktr_all) tstate.cur = (ktr_idx - 1) & (KTR_ENTRIES - 1); tstate.first = -1; - db_ktr_verbose = index(modif, 'v') != NULL; + db_ktr_verbose = 0; + db_ktr_verbose |= (index(modif, 'v') != NULL) ? 2 : 0; + db_ktr_verbose |= (index(modif, 'V') != NULL) ? 1 : 0; /* just timestap please */ if (index(modif, 'a') != NULL) { db_disable_pager(); while (cncheckc() != -1) @@ -324,9 +328,11 @@ db_mach_vtrace(void) db_printf(":cpu%d", kp->ktr_cpu); #endif db_printf(")"); - if (db_ktr_verbose) { - db_printf(" %10.10lld %s.%d", (long long)kp->ktr_timestamp, - kp->ktr_file, kp->ktr_line); + if (db_ktr_verbose >= 1) { + db_printf(" %10.10lld", (long long)kp->ktr_timestamp); + } + if (db_ktr_verbose >= 2) { + db_printf(" %s.%d", kp->ktr_file, kp->ktr_line); } db_printf(": "); db_printf(kp->ktr_desc, kp->ktr_parms[0], kp->ktr_parms[1], From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 05:37: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 98F461065670; Mon, 25 Oct 2010 05:37:12 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 864A98FC18; Mon, 25 Oct 2010 05:37: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 o9P5bCTR051953; Mon, 25 Oct 2010 05:37:12 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P5bCTL051951; Mon, 25 Oct 2010 05:37:12 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201010250537.o9P5bCTL051951@svn.freebsd.org> From: Julian Elischer Date: Mon, 25 Oct 2010 05:37: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: r214315 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 05:37:13 -0000 Author: julian Date: Mon Oct 25 05:37:12 2010 New Revision: 214315 URL: http://svn.freebsd.org/changeset/base/214315 Log: MFC of 200614 make man page match the output of lock profiling. Modified: stable/8/share/man/man9/LOCK_PROFILING.9 Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/LOCK_PROFILING.9 ============================================================================== --- stable/8/share/man/man9/LOCK_PROFILING.9 Mon Oct 25 03:45:27 2010 (r214314) +++ stable/8/share/man/man9/LOCK_PROFILING.9 Mon Oct 25 05:37:12 2010 (r214315) @@ -114,6 +114,8 @@ The columns are as follows, from left to .Bl -tag -width ".Va cnt_hold" .It Va max The longest continuous hold time in microseconds. +.It Va wait_max +The longest continuous wait time in microseconds. .It Va total The total (accumulated) hold time in microseconds. .It Va wait_total From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 06:16: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 CA10C106566B; Mon, 25 Oct 2010 06:16:27 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7B648FC13; Mon, 25 Oct 2010 06:16: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 o9P6GRPX052896; Mon, 25 Oct 2010 06:16:27 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P6GR5R052894; Mon, 25 Oct 2010 06:16:27 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201010250616.o9P6GR5R052894@svn.freebsd.org> From: Kevin Lo Date: Mon, 25 Oct 2010 06:16:27 +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: r214316 - stable/8/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 06:16:27 -0000 Author: kevlo Date: Mon Oct 25 06:16:27 2010 New Revision: 214316 URL: http://svn.freebsd.org/changeset/base/214316 Log: MFC r214001: Fix a possible, but very unlikely race where the directory dirent is moved to the location that was used by ".." entry. Modified: stable/8/sys/fs/msdosfs/msdosfs_lookup.c Modified: stable/8/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_lookup.c Mon Oct 25 05:37:12 2010 (r214315) +++ stable/8/sys/fs/msdosfs/msdosfs_lookup.c Mon Oct 25 06:16:27 2010 (r214316) @@ -594,10 +594,15 @@ msdosfs_deget_dotdot(struct vnode *vp, u vfs_unbusy(mp); if (error == 0) *rvp = DETOV(rdp); - vn_lock(vp, ltype | LK_RETRY); + if (*rvp != vp) + vn_lock(vp, ltype | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { - if (error == 0) - vput(*rvp); + if (error == 0) { + if (*rvp == vp) + vunref(*rvp); + else + vput(*rvp); + } error = ENOENT; } return (error); From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 06:28: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 C0F26106564A; Mon, 25 Oct 2010 06:28:19 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE13F8FC0C; Mon, 25 Oct 2010 06:28: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 o9P6SJf8053256; Mon, 25 Oct 2010 06:28:19 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P6SJSf053254; Mon, 25 Oct 2010 06:28:19 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201010250628.o9P6SJSf053254@svn.freebsd.org> From: Julian Elischer Date: Mon, 25 Oct 2010 06:28:19 +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: r214317 - in stable/8/tools/tools: ath/common termcap tinybsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 06:28:19 -0000 Author: julian Date: Mon Oct 25 06:28:19 2010 New Revision: 214317 URL: http://svn.freebsd.org/changeset/base/214317 Log: MFC of 199812 allow tinybsd to abort of a step fails. Modified: stable/8/tools/tools/tinybsd/tinybsd Directory Properties: stable/8/tools/tools/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) Modified: stable/8/tools/tools/tinybsd/tinybsd ============================================================================== --- stable/8/tools/tools/tinybsd/tinybsd Mon Oct 25 06:16:27 2010 (r214316) +++ stable/8/tools/tools/tinybsd/tinybsd Mon Oct 25 06:28:19 2010 (r214317) @@ -393,7 +393,7 @@ create_etc() { cd /usr/src/etc/ mkdir -p ${WORKDIR}/var/named/etc/namedb - make distribution DESTDIR=${WORKDIR} + make distribution DESTDIR=${WORKDIR} || exit 1 } create_ssh_keys() { From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 06: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 34D5F106566C; Mon, 25 Oct 2010 06:33:20 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07D688FC08; Mon, 25 Oct 2010 06: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 o9P6XJij053415; Mon, 25 Oct 2010 06:33:19 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P6XJjP053413; Mon, 25 Oct 2010 06:33:19 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201010250633.o9P6XJjP053413@svn.freebsd.org> From: Julian Elischer Date: Mon, 25 Oct 2010 06:33:19 +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: r214318 - stable/8/sys/i386/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: Mon, 25 Oct 2010 06:33:20 -0000 Author: julian Date: Mon Oct 25 06:33:19 2010 New Revision: 214318 URL: http://svn.freebsd.org/changeset/base/214318 Log: MFC of 196811 Slight cleanup to pcpu macros to better match amd64 and to improve readability of the output. Modified: stable/8/sys/i386/include/pcpu.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) Modified: stable/8/sys/i386/include/pcpu.h ============================================================================== --- stable/8/sys/i386/include/pcpu.h Mon Oct 25 06:28:19 2010 (r214317) +++ stable/8/sys/i386/include/pcpu.h Mon Oct 25 06:33:19 2010 (r214318) @@ -137,7 +137,7 @@ extern struct pcpu *pcpup; #define __PCPU_GET(name) __extension__ ({ \ __pcpu_type(name) __res; \ struct __s { \ - u_char __b[MIN(sizeof(__pcpu_type(name)), 4)]; \ + u_char __b[MIN(sizeof(__res), 4)]; \ } __s; \ \ if (sizeof(__res) == 1 || sizeof(__res) == 2 || \ @@ -159,7 +159,7 @@ extern struct pcpu *pcpup; #define __PCPU_ADD(name, val) do { \ __pcpu_type(name) __val; \ struct __s { \ - u_char __b[MIN(sizeof(__pcpu_type(name)), 4)]; \ + u_char __b[MIN(sizeof(__val), 4)]; \ } __s; \ \ __val = (val); \ @@ -199,10 +199,10 @@ extern struct pcpu *pcpup; /* * Sets the value of the per-cpu variable name to value val. */ -#define __PCPU_SET(name, val) { \ +#define __PCPU_SET(name, val) do { \ __pcpu_type(name) __val; \ struct __s { \ - u_char __b[MIN(sizeof(__pcpu_type(name)), 4)]; \ + u_char __b[MIN(sizeof(__val), 4)]; \ } __s; \ \ __val = (val); \ @@ -215,7 +215,7 @@ extern struct pcpu *pcpup; } else { \ *__PCPU_PTR(name) = __val; \ } \ -} +} while (0) #define PCPU_GET(member) __PCPU_GET(pc_ ## member) #define PCPU_ADD(member, val) __PCPU_ADD(pc_ ## member, val) From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 07:06: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 582D8106564A; Mon, 25 Oct 2010 07:06:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4583D8FC0C; Mon, 25 Oct 2010 07:06: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 o9P76PQW054234; Mon, 25 Oct 2010 07:06:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P76PTQ054229; Mon, 25 Oct 2010 07:06:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010250706.o9P76PTQ054229@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Oct 2010 07:06:25 +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: r214319 - in stable/8: share/man/man9 sys/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: Mon, 25 Oct 2010 07:06:25 -0000 Author: avg Date: Mon Oct 25 07:06:24 2010 New Revision: 214319 URL: http://svn.freebsd.org/changeset/base/214319 Log: MFC r214095: PG_BUSY -> VPO_BUSY, PG_WANTED -> VPO_WANTED in manual pages and comments Modified: stable/8/share/man/man9/vm_page_io.9 stable/8/share/man/man9/vm_page_sleep_busy.9 stable/8/share/man/man9/vm_page_wakeup.9 stable/8/sys/vm/swap_pager.c Directory Properties: stable/8/share/man/man9/ (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) Modified: stable/8/share/man/man9/vm_page_io.9 ============================================================================== --- stable/8/share/man/man9/vm_page_io.9 Mon Oct 25 06:33:19 2010 (r214318) +++ stable/8/share/man/man9/vm_page_io.9 Mon Oct 25 07:06:24 2010 (r214319) @@ -52,9 +52,9 @@ function lowers the busy count on the pa count is zero, a .Xr wakeup 9 will be issued if the page has been marked -.Dv PG_WANTED . +.Dv VPO_WANTED . A page is typically marked -.Dv PG_WANTED +.Dv VPO_WANTED by a thread to register its interest in the page to either complete I/O or becoming available for general use. .Sh AUTHORS Modified: stable/8/share/man/man9/vm_page_sleep_busy.9 ============================================================================== --- stable/8/share/man/man9/vm_page_sleep_busy.9 Mon Oct 25 06:33:19 2010 (r214318) +++ stable/8/share/man/man9/vm_page_sleep_busy.9 Mon Oct 25 07:06:24 2010 (r214319) @@ -42,7 +42,7 @@ The .Fn vm_page_sleep_busy function waits until the -.Dv PG_BUSY +.Dv VPO_BUSY flag is cleared. If .Fa also_m_busy Modified: stable/8/share/man/man9/vm_page_wakeup.9 ============================================================================== --- stable/8/share/man/man9/vm_page_wakeup.9 Mon Oct 25 06:33:19 2010 (r214318) +++ stable/8/share/man/man9/vm_page_wakeup.9 Mon Oct 25 07:06:24 2010 (r214319) @@ -50,20 +50,20 @@ of a page. .Pp .Fn vm_page_busy sets the -.Dv PG_BUSY +.Dv VPO_BUSY flag in the page. .Pp .Fn vm_page_flash checks to see if there is anybody waiting on the page -.Dv ( PG_WANTED +.Dv ( VPO_WANTED will be set), and if so, clears the -.Dv PG_WANTED +.Dv VPO_WANTED flag and notifies whoever is waiting via .Fn wakeup . .Pp .Fn vm_page_wakeup clears the -.Dv PG_BUSY +.Dv VPO_BUSY flag on the page, and calls .Fn vm_page_flash in case somebody has been waiting for it. Modified: stable/8/sys/vm/swap_pager.c ============================================================================== --- stable/8/sys/vm/swap_pager.c Mon Oct 25 06:33:19 2010 (r214318) +++ stable/8/sys/vm/swap_pager.c Mon Oct 25 07:06:24 2010 (r214319) @@ -1456,8 +1456,8 @@ swap_pager_putpages(vm_object_t object, * Completion routine for asynchronous reads and writes from/to swap. * Also called manually by synchronous code to finish up a bp. * - * For READ operations, the pages are PG_BUSY'd. For WRITE operations, - * the pages are vm_page_t->busy'd. For READ operations, we PG_BUSY + * For READ operations, the pages are VPO_BUSY'd. For WRITE operations, + * the pages are vm_page_t->busy'd. For READ operations, we VPO_BUSY * unbusy all pages except the 'main' request page. For WRITE * operations, we vm_page_t->busy'd unbusy all pages ( we can do this * because we marked them all VM_PAGER_PEND on return from putpages ). From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 07:11: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 6BA80106566C; Mon, 25 Oct 2010 07:11:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F4148FC19; Mon, 25 Oct 2010 07:11: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 o9P7Bci3054406; Mon, 25 Oct 2010 07:11:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P7BcN5054404; Mon, 25 Oct 2010 07:11:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010250711.o9P7BcN5054404@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Oct 2010 07:11:38 +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: r214320 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 07:11:38 -0000 Author: avg Date: Mon Oct 25 07:11:37 2010 New Revision: 214320 URL: http://svn.freebsd.org/changeset/base/214320 Log: MFC r214096: VOP_GETPAGES.9: clarify and correct description of parameters and requirements Modified: stable/8/share/man/man9/VOP_GETPAGES.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/VOP_GETPAGES.9 ============================================================================== --- stable/8/share/man/man9/VOP_GETPAGES.9 Mon Oct 25 07:06:24 2010 (r214319) +++ stable/8/share/man/man9/VOP_GETPAGES.9 Mon Oct 25 07:11:37 2010 (r214320) @@ -41,9 +41,9 @@ .In sys/vnode.h .In vm/vm.h .Ft int -.Fn VOP_GETPAGES "struct vnode *vp" "vm_page_t *m" "int count" "int reqpage" "vm_ooffset_t offset" +.Fn VOP_GETPAGES "struct vnode *vp" "vm_page_t *ma" "int count" "int reqpage" "vm_ooffset_t offset" .Ft int -.Fn VOP_PUTPAGES "struct vnode *vp" "vm_page_t *m" "int count" "int sync" "int *rtvals" "vm_ooffset_t offset" +.Fn VOP_PUTPAGES "struct vnode *vp" "vm_page_t *ma" "int count" "int sync" "int *rtvals" "vm_ooffset_t offset" .Sh DESCRIPTION The .Fn VOP_GETPAGES @@ -66,11 +66,11 @@ The arguments are: .Bl -tag -width reqpage .It Fa vp The file to access. -.It Fa m -Pointer to the first element of an array of contiguous pages representing a +.It Fa ma +Pointer to the first element of an array of pages representing a contiguous region of the file to be read or written. .It Fa count -The number of pages in the array. +The number of bytes that should be read into the pages of the array. .It Fa sync .Dv VM_PAGER_PUT_SYNC if the write should be synchronous. @@ -123,22 +123,27 @@ The page was not handled by this request The .Fn VOP_GETPAGES method is expected to release any pages in -.Fa m +.Fa ma that it does not successfully handle, by calling .Xr vm_page_free 9 . When it succeeds, .Fn VOP_GETPAGES -must set the valid bits appropriately, clear the dirty bit -(using -.Xr vm_page_undirty 9 ) , -either activate the page (if its wanted bit is set) +must set the valid bits appropriately. +.Fn VOP_GETPAGES +must keep +.Fa reqpage +busy. +It must unbusy all other successfully handled pages and put them +on appropriate page queue(s). +For example, +.Fn VOP_GETPAGES +may either activate a page (if its wanted bit is set) or deactivate it (otherwise), and finally call .Xr vm_page_wakeup 9 -to arouse any threads currently waiting for the page to be faulted in, -for each page read. +to arouse any threads currently waiting for the page to be faulted in. .Sh RETURN VALUES If it successfully reads -.Fa m[reqpage] , +.Fa ma[reqpage] , .Fn VOP_GETPAGES returns .Dv VM_PAGER_OK ; From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 07:17: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 D409110656C7; Mon, 25 Oct 2010 07:17:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1B8D8FC17; Mon, 25 Oct 2010 07:17: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 o9P7H7vJ054561; Mon, 25 Oct 2010 07:17:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P7H7Uh054559; Mon, 25 Oct 2010 07:17:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010250717.o9P7H7Uh054559@svn.freebsd.org> From: Alexander Motin Date: Mon, 25 Oct 2010 07:17: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: r214321 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 07:17:07 -0000 Author: mav Date: Mon Oct 25 07:17:07 2010 New Revision: 214321 URL: http://svn.freebsd.org/changeset/base/214321 Log: Do some whitespace and `identify` output cleanup. Submitted by: arundel MFC after: 2 weeks Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Oct 25 07:11:37 2010 (r214320) +++ head/sbin/camcontrol/camcontrol.c Mon Oct 25 07:17:07 2010 (r214321) @@ -116,7 +116,7 @@ typedef enum { } cam_argmask; struct camcontrol_opts { - const char *optname; + const char *optname; cam_cmdmask cmdnum; cam_argmask argnum; const char *subopt; @@ -204,7 +204,7 @@ static int readdefects(struct cam_device char *combinedopt, int retry_count, int timeout); static void modepage(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); -static int scsicmd(struct cam_device *device, int argc, char **argv, +static int scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int tagcontrol(struct cam_device *device, int argc, char **argv, char *combinedopt); @@ -234,7 +234,7 @@ static int atapm(struct cam_device *devi #endif camcontrol_optret -getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, +getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, const char **subopt) { struct camcontrol_opts *opts; @@ -622,7 +622,7 @@ scsistart(struct cam_device *device, int else fprintf(stdout, "Error received from stop unit command\n"); - + if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); @@ -688,7 +688,7 @@ scsiinquiry(struct cam_device *device, i union ccb *ccb; struct scsi_inquiry_data *inq_buf; int error = 0; - + ccb = cam_getccb(device); if (ccb == NULL) { @@ -721,13 +721,13 @@ scsiinquiry(struct cam_device *device, i * scsi_inquiry() will convert an inq_len (which is passed in as * a u_int32_t, but the field in the CDB is only 1 byte) of 256 * to 0. Evidently, very few devices meet the spec in that - * regard. Some devices, like many Seagate disks, take the 0 as + * regard. Some devices, like many Seagate disks, take the 0 as * 0, and don't return any data. One Pioneer DVD-R drive * returns more data than the command asked for. * * So, since there are numerous devices that just don't work * right with the full inquiry size, we don't send the full size. - * + * * - The second reason not to use the full inquiry data length is * that we don't need it here. The only reason we issue a * standard inquiry is to get the vendor name, device name, @@ -1181,7 +1181,7 @@ atacapprint(struct ata_params *parm) } printf("\nFeature " - "Support Enable Value Vendor\n"); + "Support Enabled Value Vendor\n"); printf("read ahead %s %s\n", parm->support.command1 & ATA_SUPPORT_LOOKAHEAD ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_LOOKAHEAD ? "yes" : "no"); @@ -1201,16 +1201,13 @@ atacapprint(struct ata_params *parm) ATA_QUEUE_LEN(parm->queue) + 1); } else printf("\n"); - if (parm->satacapabilities && parm->satacapabilities != 0xffff) { - printf("Native Command Queuing (NCQ) %s ", - parm->satacapabilities & ATA_SUPPORT_NCQ ? - "yes" : "no"); - if (parm->satacapabilities & ATA_SUPPORT_NCQ) { - printf(" %d tags\n", - ATA_QUEUE_LEN(parm->queue) + 1); - } else - printf("\n"); - } + printf("Native Command Queuing (NCQ) "); + if (parm->satacapabilities != 0xffff && + (parm->satacapabilities & ATA_SUPPORT_NCQ)) { + printf("yes %d tags\n", + ATA_QUEUE_LEN(parm->queue) + 1); + } else + printf("no\n"); printf("SMART %s %s\n", parm->support.command1 & ATA_SUPPORT_SMART ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_SMART ? "yes" : "no"); @@ -1223,28 +1220,39 @@ atacapprint(struct ata_params *parm) printf("power management %s %s\n", parm->support.command1 & ATA_SUPPORT_POWERMGT ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_POWERMGT ? "yes" : "no"); - printf("advanced power management %s %s %d/0x%02X\n", + printf("advanced power management %s %s", parm->support.command2 & ATA_SUPPORT_APM ? "yes" : "no", - parm->enabled.command2 & ATA_SUPPORT_APM ? "yes" : "no", - parm->apm_value, parm->apm_value); - printf("automatic acoustic management %s %s " - "%d/0x%02X %d/0x%02X\n", + parm->enabled.command2 & ATA_SUPPORT_APM ? "yes" : "no"); + if (parm->support.command2 & ATA_SUPPORT_APM) { + printf(" %d/0x%02X\n", + parm->apm_value, parm->apm_value); + } else + printf("\n"); + printf("automatic acoustic management %s %s", parm->support.command2 & ATA_SUPPORT_AUTOACOUSTIC ? "yes" :"no", - parm->enabled.command2 & ATA_SUPPORT_AUTOACOUSTIC ? "yes" :"no", - ATA_ACOUSTIC_CURRENT(parm->acoustic), - ATA_ACOUSTIC_CURRENT(parm->acoustic), - ATA_ACOUSTIC_VENDOR(parm->acoustic), - ATA_ACOUSTIC_VENDOR(parm->acoustic)); + parm->enabled.command2 & ATA_SUPPORT_AUTOACOUSTIC ? "yes" :"no"); + if (parm->support.command2 & ATA_SUPPORT_AUTOACOUSTIC) { + printf(" %d/0x%02X %d/0x%02X\n", + ATA_ACOUSTIC_CURRENT(parm->acoustic), + ATA_ACOUSTIC_CURRENT(parm->acoustic), + ATA_ACOUSTIC_VENDOR(parm->acoustic), + ATA_ACOUSTIC_VENDOR(parm->acoustic)); + } else + printf("\n"); printf("media status notification %s %s\n", parm->support.command2 & ATA_SUPPORT_NOTIFY ? "yes" : "no", parm->enabled.command2 & ATA_SUPPORT_NOTIFY ? "yes" : "no"); printf("power-up in Standby %s %s\n", parm->support.command2 & ATA_SUPPORT_STANDBY ? "yes" : "no", parm->enabled.command2 & ATA_SUPPORT_STANDBY ? "yes" : "no"); - printf("write-read-verify %s %s %d/0x%x\n", + printf("write-read-verify %s %s", parm->support2 & ATA_SUPPORT_WRITEREADVERIFY ? "yes" : "no", - parm->enabled2 & ATA_SUPPORT_WRITEREADVERIFY ? "yes" : "no", - parm->wrv_mode, parm->wrv_mode); + parm->enabled2 & ATA_SUPPORT_WRITEREADVERIFY ? "yes" : "no"); + if (parm->support2 & ATA_SUPPORT_WRITEREADVERIFY) { + printf(" %d/0x%x\n", + parm->wrv_mode, parm->wrv_mode); + } else + printf("\n"); printf("unload %s %s\n", parm->support.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no", parm->enabled.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no"); @@ -1255,7 +1263,6 @@ atacapprint(struct ata_params *parm) parm->support_dsm & ATA_SUPPORT_DSM_TRIM ? "yes" : "no"); } - static int ataidentify(struct cam_device *device, int retry_count, int timeout) { @@ -1902,7 +1909,7 @@ readdefects(struct cam_device *device, i /* * XXX KDM I should probably clean up the printout format for the - * disk defects. + * disk defects. */ switch (returned_format & SRDDH10_DLIST_FORMAT_MASK){ case SRDDH10_PHYSICAL_SECTOR_FORMAT: @@ -2011,7 +2018,7 @@ void reassignblocks(struct cam_device *device, u_int32_t *blocks, int num_blocks) { union ccb *ccb; - + ccb = cam_getccb(device); cam_freeccb(ccb); @@ -2114,7 +2121,7 @@ mode_select(struct cam_device *device, i err(1, "error sending mode select command"); else errx(1, "error sending mode select command"); - + } cam_freeccb(ccb); @@ -2294,7 +2301,7 @@ scsicmd(struct cam_device *device, int a if (arglist & CAM_ARG_CMD_IN) { warnx("command must either be " "read or write, not both"); - error = 1; + error = 1; goto scsicmd_bailout; } arglist |= CAM_ARG_CMD_OUT; @@ -2611,7 +2618,7 @@ camdebug(int argc, char **argv, char *co warnx("bus:target, or bus:target:lun to debug"); } } - + if (error == 0) { ccb.ccb_h.func_code = XPT_DEBUG; @@ -2874,7 +2881,7 @@ cts_print(struct cam_device *device, str } /* - * Get a path inquiry CCB for the specified device. + * Get a path inquiry CCB for the specified device. */ static int get_cpi(struct cam_device *device, struct ccb_pathinq *cpi) @@ -2913,7 +2920,7 @@ get_cpi_bailout: } /* - * Get a get device CCB for the specified device. + * Get a get device CCB for the specified device. */ static int get_cgd(struct cam_device *device, struct ccb_getdev *cgd) @@ -3764,9 +3771,9 @@ doreport: fprintf(stdout, "\rFormatting: %ju.%02u %% " "(%d/%d) done", - (uintmax_t)(percentage / + (uintmax_t)(percentage / (0x10000 * 100)), - (unsigned)((percentage / + (unsigned)((percentage / 0x10000) % 100), val, 0x10000); fflush(stdout); @@ -3956,7 +3963,7 @@ retry: case RPL_LUNDATA_ATYP_PERIPH: if ((lundata->luns[i].lundata[j] & RPL_LUNDATA_PERIPH_BUS_MASK) != 0) - fprintf(stdout, "%d:", + fprintf(stdout, "%d:", lundata->luns[i].lundata[j] & RPL_LUNDATA_PERIPH_BUS_MASK); else if ((j == 0) @@ -3994,7 +4001,7 @@ retry: field_len_code = (lundata->luns[i].lundata[j] & RPL_LUNDATA_EXT_LEN_MASK) >> 4; field_len = field_len_code * 2; - + if ((eam_code == RPL_LUNDATA_EXT_EAM_WK) && (field_len_code == 0x00)) { fprintf(stdout, "%d", @@ -4352,7 +4359,7 @@ bailout: #endif /* MINIMALISTIC */ -void +void usage(int verbose) { fprintf(verbose ? stdout : stderr, @@ -4494,7 +4501,7 @@ usage(int verbose) #endif /* MINIMALISTIC */ } -int +int main(int argc, char **argv) { int c; @@ -4544,7 +4551,7 @@ main(int argc, char **argv) * this. getopt is kinda braindead, so you end up having to run * through the options twice, and give each invocation of getopt * the option string for the other invocation. - * + * * You would think that you could just have two groups of options. * The first group would get parsed by the first invocation of * getopt, and the second group would get parsed by the second @@ -4553,13 +4560,13 @@ main(int argc, char **argv) * to the argument _after_ the first argument in the second group. * So when the second invocation of getopt comes around, it doesn't * recognize the first argument it gets and then bails out. - * + * * A nice alternative would be to have a flag for getopt that says * "just keep parsing arguments even when you encounter an unknown * argument", but there isn't one. So there's no real clean way to * easily parse two sets of arguments without having one invocation * of getopt know about the other. - * + * * Without this hack, the first invocation of getopt would work as * long as the generic arguments are first, but the second invocation * (in the subfunction) would fail in one of two ways. In the case @@ -4573,14 +4580,14 @@ main(int argc, char **argv) * whether optind had been incremented one option too far. The * mechanics of that, however, are more daunting than just giving * both invocations all of the expect options for either invocation. - * + * * Needless to say, I wouldn't mind if someone invented a better * (non-GPL!) command line parsing interface than getopt. I * wouldn't mind if someone added more knobs to getopt to make it * work better. Who knows, I may talk myself into doing it someday, * if the standards weenies let me. As it is, it just leads to * hackery like this and causes people to avoid it in some cases. - * + * * KDM, September 8th, 1998 */ if (subopt != NULL) From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 07:30: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 7B7231065670; Mon, 25 Oct 2010 07:30:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 685888FC08; Mon, 25 Oct 2010 07:30: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 o9P7UEmx054963; Mon, 25 Oct 2010 07:30:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P7UEiw054958; Mon, 25 Oct 2010 07:30:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010250730.o9P7UEiw054958@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Oct 2010 07:30:14 +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: r214322 - in stable/8: . share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 07:30:14 -0000 Author: avg Date: Mon Oct 25 07:30:14 2010 New Revision: 214322 URL: http://svn.freebsd.org/changeset/base/214322 Log: MFC r214097: catch up manual pages with rename of vm_page_sleep_busy to vm_page_sleep_if_busy Added: stable/8/share/man/man9/vm_page_sleep_if_busy.9 - copied unchanged from r214097, head/share/man/man9/vm_page_sleep_if_busy.9 Deleted: stable/8/share/man/man9/vm_page_sleep_busy.9 Modified: stable/8/ObsoleteFiles.inc stable/8/share/man/man9/Makefile stable/8/share/man/man9/vm_page_wakeup.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Mon Oct 25 07:17:07 2010 (r214321) +++ stable/8/ObsoleteFiles.inc Mon Oct 25 07:30:14 2010 (r214322) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101025: catch up with vm_page_sleep_if_busy rename +OLD_FILES+=usr/share/man/man9/vm_page_sleep_busy.9.gz # 20100327: fusword.9 and susword.9 removed OLD_FILES+=usr/share/man/man9/fusword.9.gz OLD_FILES+=usr/share/man/man9/susword.9.gz Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Oct 25 07:17:07 2010 (r214321) +++ stable/8/share/man/man9/Makefile Mon Oct 25 07:30:14 2010 (r214322) @@ -324,7 +324,7 @@ MAN= accept_filter.9 \ vm_page_lookup.9 \ vm_page_protect.9 \ vm_page_rename.9 \ - vm_page_sleep_busy.9 \ + vm_page_sleep_if_busy.9 \ vm_page_wakeup.9 \ vm_page_wire.9 \ vm_page_zero_fill.9 \ Copied: stable/8/share/man/man9/vm_page_sleep_if_busy.9 (from r214097, head/share/man/man9/vm_page_sleep_if_busy.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man9/vm_page_sleep_if_busy.9 Mon Oct 25 07:30:14 2010 (r214322, copy of r214097, head/share/man/man9/vm_page_sleep_if_busy.9) @@ -0,0 +1,68 @@ +.\" +.\" Copyright (C) 2001 Chad David . 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(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), 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 HOLDER(S) ``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 HOLDER(S) 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 July 13, 2001 +.Dt VM_PAGE_SLEEP_IF_BUSY 9 +.Os +.Sh NAME +.Nm vm_page_sleep_if_busy +.Nd "wait for a busy page to become unbusy" +.Sh SYNOPSIS +.In sys/param.h +.In vm/vm.h +.In vm/vm_page.h +.Ft int +.Fn vm_page_sleep_if_busy "vm_page_t m" "int also_m_busy" "const char *wmesg" +.Sh DESCRIPTION +The +.Fn vm_page_sleep_if_busy +function waits until the +.Dv VPO_BUSY +flag is cleared. +If +.Fa also_m_busy +is non-zero, it also waits for +.Fa m->busy +to become zero. +.Sh RETURN VALUES +If +.Fn vm_page_sleep_if_busy +finds the page busy it returns +.Dv TRUE . +If not, it returns +.Dv FALSE . +Returning +.Dv TRUE +does not necessary mean that +.Fn vm_page_sleep_if_busy +slept, but only that +.Fn splvm +was called. +.Sh AUTHORS +This manual page was written by +.An Chad David Aq davidc@acns.ab.ca . Modified: stable/8/share/man/man9/vm_page_wakeup.9 ============================================================================== --- stable/8/share/man/man9/vm_page_wakeup.9 Mon Oct 25 07:17:07 2010 (r214321) +++ stable/8/share/man/man9/vm_page_wakeup.9 Mon Oct 25 07:30:14 2010 (r214322) @@ -68,7 +68,7 @@ flag on the page, and calls .Fn vm_page_flash in case somebody has been waiting for it. .Sh SEE ALSO -.Xr vm_page_sleep_busy 9 , +.Xr vm_page_sleep_if_busy 9 , .Xr wakeup 9 .Sh AUTHORS This manual page was written by From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 07:36: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 B6B0C106566B; Mon, 25 Oct 2010 07:36:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A53C68FC0C; Mon, 25 Oct 2010 07:36: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 o9P7adnr055140; Mon, 25 Oct 2010 07:36:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P7ad6R055138; Mon, 25 Oct 2010 07:36:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010250736.o9P7ad6R055138@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Oct 2010 07:36:39 +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: r214323 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 07:36:39 -0000 Author: avg Date: Mon Oct 25 07:36:39 2010 New Revision: 214323 URL: http://svn.freebsd.org/changeset/base/214323 Log: add dates along with revision numbers in UPDATING entry for 20101022 This is a direct commit. Modified: stable/8/UPDATING Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Mon Oct 25 07:30:14 2010 (r214322) +++ stable/8/UPDATING Mon Oct 25 07:36:39 2010 (r214323) @@ -18,8 +18,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. 20101022: A workaround for a fixed ld bug has been removed in kernel code, so make sure that your system ld is built from sources after - revision 211583 (r210245 if building stable/8 kernel on head, - r211584 for stable/7). A symptom of incorrect ld version is + revision 211583 from 2010-08-21 (r210245 from 2010-07-19 if + building stable/8 kernel on head, r211584 from 2010-08-21 for + stable/7). A symptom of incorrect ld version is different addresses for set_pcpu section and __start_set_pcpu symbol in kernel and/or modules. From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 07:39: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 DCD3F106564A; Mon, 25 Oct 2010 07:39:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC05F8FC0C; Mon, 25 Oct 2010 07:39: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 o9P7d5og055235; Mon, 25 Oct 2010 07:39:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P7d5vS055233; Mon, 25 Oct 2010 07:39:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010250739.o9P7d5vS055233@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Oct 2010 07:39: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: r214324 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 07:39:06 -0000 Author: avg Date: Mon Oct 25 07:39:05 2010 New Revision: 214324 URL: http://svn.freebsd.org/changeset/base/214324 Log: add dates along with revision numbers in UPDATING entry for 20100915 Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Oct 25 07:36:39 2010 (r214323) +++ head/UPDATING Mon Oct 25 07:39:05 2010 (r214324) @@ -35,10 +35,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. 20100915: A workaround for a fixed ld bug has been removed in kernel code, so make sure that your system ld is built from sources after - revision 210245 (r211583 if building head kernel on stable/8, - r211584 for stable/7). A symptom of incorrect ld version is - different addresses for set_pcpu section and __start_set_pcpu - symbol in kernel and/or modules. + revision 210245 from 2010-07-19 (r211583 if building head kernel + on stable/8, r211584 for stable/7; both from 2010-08-21). + A symptom of incorrect ld version is different addresses for + set_pcpu section and __start_set_pcpu symbol in kernel and/or modules. 20100913: The $ipv6_prefer variable in rc.conf(5) has been split into From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 07:41: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 C4BE4106566B; Mon, 25 Oct 2010 07:41:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B38628FC0A; Mon, 25 Oct 2010 07:41: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 o9P7fLD6055318; Mon, 25 Oct 2010 07:41:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P7fLJh055315; Mon, 25 Oct 2010 07:41:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010250741.o9P7fLJh055315@svn.freebsd.org> From: Alexander Motin Date: Mon, 25 Oct 2010 07:41: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: r214325 - in head/sys/dev: ahci siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 07:41:21 -0000 Author: mav Date: Mon Oct 25 07:41:21 2010 New Revision: 214325 URL: http://svn.freebsd.org/changeset/base/214325 Log: Add missing mtx_destroy() on channel attach failure. Modified: head/sys/dev/ahci/ahci.c head/sys/dev/siis/siis.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Mon Oct 25 07:39:05 2010 (r214324) +++ head/sys/dev/ahci/ahci.c Mon Oct 25 07:41:21 2010 (r214325) @@ -969,6 +969,7 @@ err1: err0: bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); mtx_unlock(&ch->mtx); + mtx_destroy(&ch->mtx); return (error); } Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Mon Oct 25 07:39:05 2010 (r214324) +++ head/sys/dev/siis/siis.c Mon Oct 25 07:41:21 2010 (r214325) @@ -527,6 +527,7 @@ err1: err0: bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); mtx_unlock(&ch->mtx); + mtx_destroy(&ch->mtx); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 07:58: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 64C92106566C; Mon, 25 Oct 2010 07:58:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51E5D8FC16; Mon, 25 Oct 2010 07:58: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 o9P7wc7o055725; Mon, 25 Oct 2010 07:58:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P7wcW2055718; Mon, 25 Oct 2010 07:58:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010250758.o9P7wcW2055718@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Oct 2010 07:58:38 +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: r214326 - in stable/8/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/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: Mon, 25 Oct 2010 07:58:38 -0000 Author: avg Date: Mon Oct 25 07:58:37 2010 New Revision: 214326 URL: http://svn.freebsd.org/changeset/base/214326 Log: stable/8: add options KDB and KDB_TRACE to GENERIC kernels Now that we have code for printing a stack trace on panic using stack(9) facility without any debugger backend configured, use this ability in GENERIC kernels to slightly increase amount of debugging information available in default installations. This change should not break anything for those who include GENERIC into a custom kernel config file and have the above options already enabled. They should only get a warning about duplicate options. This commit should not change behavior of GENERIC kernels for panics and traps with respect to core dumping and automatic reset. As no debugger backend is configured, enter-to-debugger key combination should still be ignored. With this commit the sizes of GENERIC kernels increase by one to two KB. This is a direct commit to the branch. Approved by: re No objections: core, secteam Modified: stable/8/sys/amd64/conf/GENERIC stable/8/sys/i386/conf/GENERIC stable/8/sys/ia64/conf/GENERIC stable/8/sys/pc98/conf/GENERIC stable/8/sys/powerpc/conf/GENERIC stable/8/sys/sparc64/conf/GENERIC Modified: stable/8/sys/amd64/conf/GENERIC ============================================================================== --- stable/8/sys/amd64/conf/GENERIC Mon Oct 25 07:41:21 2010 (r214325) +++ stable/8/sys/amd64/conf/GENERIC Mon Oct 25 07:58:37 2010 (r214326) @@ -77,6 +77,9 @@ options FLOWTABLE # per-cpu routing ca #options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel +options KDB # Kernel debugger related code +options KDB_TRACE # Print a stack trace for a panic + # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/8/sys/i386/conf/GENERIC ============================================================================== --- stable/8/sys/i386/conf/GENERIC Mon Oct 25 07:41:21 2010 (r214325) +++ stable/8/sys/i386/conf/GENERIC Mon Oct 25 07:58:37 2010 (r214326) @@ -77,6 +77,9 @@ options FLOWTABLE # per-cpu routing ca #options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel +options KDB # Kernel debugger related code +options KDB_TRACE # Print a stack trace for a panic + # To make an SMP kernel, the next two lines are needed options SMP # Symmetric MultiProcessor Kernel device apic # I/O APIC Modified: stable/8/sys/ia64/conf/GENERIC ============================================================================== --- stable/8/sys/ia64/conf/GENERIC Mon Oct 25 07:41:21 2010 (r214325) +++ stable/8/sys/ia64/conf/GENERIC Mon Oct 25 07:58:37 2010 (r214326) @@ -39,6 +39,8 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # required by INVARIANTS +options KDB # Kernel debugger related code +options KDB_TRACE # Print a stack trace for a panic options KTRACE # ktrace(1) syscall trace support options MAC # TrustedBSD MAC Framework options MD_ROOT # MD usable as root device Modified: stable/8/sys/pc98/conf/GENERIC ============================================================================== --- stable/8/sys/pc98/conf/GENERIC Mon Oct 25 07:41:21 2010 (r214325) +++ stable/8/sys/pc98/conf/GENERIC Mon Oct 25 07:58:37 2010 (r214326) @@ -77,6 +77,9 @@ options AUDIT # Security event auditi options MAC # TrustedBSD MAC Framework options INCLUDE_CONFIG_FILE # Include this file in kernel +options KDB # Kernel debugger related code +options KDB_TRACE # Print a stack trace for a panic + # To make an SMP kernel, the next two lines are needed #options SMP # Symmetric MultiProcessor Kernel #device apic # I/O APIC Modified: stable/8/sys/powerpc/conf/GENERIC ============================================================================== --- stable/8/sys/powerpc/conf/GENERIC Mon Oct 25 07:41:21 2010 (r214325) +++ stable/8/sys/powerpc/conf/GENERIC Mon Oct 25 07:58:37 2010 (r214326) @@ -68,6 +68,9 @@ options AUDIT # Security event auditi options MAC # TrustedBSD MAC Framework options INCLUDE_CONFIG_FILE # Include this file in kernel +options KDB # Kernel debugger related code +options KDB_TRACE # Print a stack trace for a panic + # To make an SMP kernel, the next line is needed #options SMP # Symmetric MultiProcessor Kernel Modified: stable/8/sys/sparc64/conf/GENERIC ============================================================================== --- stable/8/sys/sparc64/conf/GENERIC Mon Oct 25 07:41:21 2010 (r214325) +++ stable/8/sys/sparc64/conf/GENERIC Mon Oct 25 07:58:37 2010 (r214326) @@ -74,6 +74,9 @@ options AUDIT # Security event auditi options MAC # TrustedBSD MAC Framework options INCLUDE_CONFIG_FILE # Include this file in kernel +options KDB # Kernel debugger related code +options KDB_TRACE # Print a stack trace for a panic + # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 08:07: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 85434106566B; Mon, 25 Oct 2010 08:07:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72E9E8FC1E; Mon, 25 Oct 2010 08:07: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 o9P87vYE056071; Mon, 25 Oct 2010 08:07:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P87vOG056066; Mon, 25 Oct 2010 08:07:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010250807.o9P87vOG056066@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Oct 2010 08:07:57 +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: r214327 - in stable/7: share/man/man9 sys/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: Mon, 25 Oct 2010 08:07:57 -0000 Author: avg Date: Mon Oct 25 08:07:57 2010 New Revision: 214327 URL: http://svn.freebsd.org/changeset/base/214327 Log: MFC r214095: PG_BUSY -> VPO_BUSY, PG_WANTED -> VPO_WANTED in manual pages and comments Modified: stable/7/share/man/man9/vm_page_io.9 stable/7/share/man/man9/vm_page_sleep_busy.9 stable/7/share/man/man9/vm_page_wakeup.9 stable/7/sys/vm/swap_pager.c Directory Properties: stable/7/share/man/man9/ (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/share/man/man9/vm_page_io.9 ============================================================================== --- stable/7/share/man/man9/vm_page_io.9 Mon Oct 25 07:58:37 2010 (r214326) +++ stable/7/share/man/man9/vm_page_io.9 Mon Oct 25 08:07:57 2010 (r214327) @@ -52,9 +52,9 @@ function lowers the busy count on the pa count is zero, a .Xr wakeup 9 will be issued if the page has been marked -.Dv PG_WANTED . +.Dv VPO_WANTED . A page is typically marked -.Dv PG_WANTED +.Dv VPO_WANTED by a thread to register its interest in the page to either complete I/O or becoming available for general use. .Sh AUTHORS Modified: stable/7/share/man/man9/vm_page_sleep_busy.9 ============================================================================== --- stable/7/share/man/man9/vm_page_sleep_busy.9 Mon Oct 25 07:58:37 2010 (r214326) +++ stable/7/share/man/man9/vm_page_sleep_busy.9 Mon Oct 25 08:07:57 2010 (r214327) @@ -42,7 +42,7 @@ The .Fn vm_page_sleep_busy function waits until the -.Dv PG_BUSY +.Dv VPO_BUSY flag is cleared. If .Fa also_m_busy Modified: stable/7/share/man/man9/vm_page_wakeup.9 ============================================================================== --- stable/7/share/man/man9/vm_page_wakeup.9 Mon Oct 25 07:58:37 2010 (r214326) +++ stable/7/share/man/man9/vm_page_wakeup.9 Mon Oct 25 08:07:57 2010 (r214327) @@ -50,20 +50,20 @@ of a page. .Pp .Fn vm_page_busy sets the -.Dv PG_BUSY +.Dv VPO_BUSY flag in the page. .Pp .Fn vm_page_flash checks to see if there is anybody waiting on the page -.Dv ( PG_WANTED +.Dv ( VPO_WANTED will be set), and if so, clears the -.Dv PG_WANTED +.Dv VPO_WANTED flag and notifies whoever is waiting via .Fn wakeup . .Pp .Fn vm_page_wakeup clears the -.Dv PG_BUSY +.Dv VPO_BUSY flag on the page, and calls .Fn vm_page_flash in case somebody has been waiting for it. Modified: stable/7/sys/vm/swap_pager.c ============================================================================== --- stable/7/sys/vm/swap_pager.c Mon Oct 25 07:58:37 2010 (r214326) +++ stable/7/sys/vm/swap_pager.c Mon Oct 25 08:07:57 2010 (r214327) @@ -1311,8 +1311,8 @@ swap_pager_putpages(vm_object_t object, * Completion routine for asynchronous reads and writes from/to swap. * Also called manually by synchronous code to finish up a bp. * - * For READ operations, the pages are PG_BUSY'd. For WRITE operations, - * the pages are vm_page_t->busy'd. For READ operations, we PG_BUSY + * For READ operations, the pages are VPO_BUSY'd. For WRITE operations, + * the pages are vm_page_t->busy'd. For READ operations, we VPO_BUSY * unbusy all pages except the 'main' request page. For WRITE * operations, we vm_page_t->busy'd unbusy all pages ( we can do this * because we marked them all VM_PAGER_PEND on return from putpages ). From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 08:09: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 25CD71065674; Mon, 25 Oct 2010 08:09:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDF558FC13; Mon, 25 Oct 2010 08:09: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 o9P89JQC056153; Mon, 25 Oct 2010 08:09:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P89J3D056151; Mon, 25 Oct 2010 08:09:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010250809.o9P89J3D056151@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Oct 2010 08:09:19 +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: r214328 - stable/7/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 08:09:20 -0000 Author: avg Date: Mon Oct 25 08:09:19 2010 New Revision: 214328 URL: http://svn.freebsd.org/changeset/base/214328 Log: MFC r214096: VOP_GETPAGES.9: clarify and correct description of parameters and requirements Modified: stable/7/share/man/man9/VOP_GETPAGES.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/VOP_GETPAGES.9 ============================================================================== --- stable/7/share/man/man9/VOP_GETPAGES.9 Mon Oct 25 08:07:57 2010 (r214327) +++ stable/7/share/man/man9/VOP_GETPAGES.9 Mon Oct 25 08:09:19 2010 (r214328) @@ -41,9 +41,9 @@ .In sys/vnode.h .In vm/vm.h .Ft int -.Fn VOP_GETPAGES "struct vnode *vp" "vm_page_t *m" "int count" "int reqpage" "vm_ooffset_t offset" +.Fn VOP_GETPAGES "struct vnode *vp" "vm_page_t *ma" "int count" "int reqpage" "vm_ooffset_t offset" .Ft int -.Fn VOP_PUTPAGES "struct vnode *vp" "vm_page_t *m" "int count" "int sync" "int *rtvals" "vm_ooffset_t offset" +.Fn VOP_PUTPAGES "struct vnode *vp" "vm_page_t *ma" "int count" "int sync" "int *rtvals" "vm_ooffset_t offset" .Sh DESCRIPTION The .Fn VOP_GETPAGES @@ -66,11 +66,11 @@ The arguments are: .Bl -tag -width reqpage .It Fa vp The file to access. -.It Fa m -Pointer to the first element of an array of contiguous pages representing a +.It Fa ma +Pointer to the first element of an array of pages representing a contiguous region of the file to be read or written. .It Fa count -The number of pages in the array. +The number of bytes that should be read into the pages of the array. .It Fa sync .Dv VM_PAGER_PUT_SYNC if the write should be synchronous. @@ -123,22 +123,27 @@ The page was not handled by this request The .Fn VOP_GETPAGES method is expected to release any pages in -.Fa m +.Fa ma that it does not successfully handle, by calling .Xr vm_page_free 9 . When it succeeds, .Fn VOP_GETPAGES -must set the valid bits appropriately, clear the dirty bit -(using -.Xr vm_page_undirty 9 ) , -either activate the page (if its wanted bit is set) +must set the valid bits appropriately. +.Fn VOP_GETPAGES +must keep +.Fa reqpage +busy. +It must unbusy all other successfully handled pages and put them +on appropriate page queue(s). +For example, +.Fn VOP_GETPAGES +may either activate a page (if its wanted bit is set) or deactivate it (otherwise), and finally call .Xr vm_page_wakeup 9 -to arouse any threads currently waiting for the page to be faulted in, -for each page read. +to arouse any threads currently waiting for the page to be faulted in. .Sh RETURN VALUES If it successfully reads -.Fa m[reqpage] , +.Fa ma[reqpage] , .Fn VOP_GETPAGES returns .Dv VM_PAGER_OK ; From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 08:11: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 3DE54106564A; Mon, 25 Oct 2010 08:11:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B43B8FC12; Mon, 25 Oct 2010 08:11: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 o9P8BqAg056344; Mon, 25 Oct 2010 08:11:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P8BpCW056339; Mon, 25 Oct 2010 08:11:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010250811.o9P8BpCW056339@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Oct 2010 08:11:51 +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: r214329 - in stable/7: . share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 08:11:52 -0000 Author: avg Date: Mon Oct 25 08:11:51 2010 New Revision: 214329 URL: http://svn.freebsd.org/changeset/base/214329 Log: MFC r214097: catch up manual pages with rename of vm_page_sleep_busy to vm_page_sleep_if_busy Added: stable/7/share/man/man9/vm_page_sleep_if_busy.9 - copied unchanged from r214097, head/share/man/man9/vm_page_sleep_if_busy.9 Deleted: stable/7/share/man/man9/vm_page_sleep_busy.9 Modified: stable/7/ObsoleteFiles.inc stable/7/share/man/man9/Makefile stable/7/share/man/man9/vm_page_wakeup.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/ObsoleteFiles.inc ============================================================================== --- stable/7/ObsoleteFiles.inc Mon Oct 25 08:09:19 2010 (r214328) +++ stable/7/ObsoleteFiles.inc Mon Oct 25 08:11:51 2010 (r214329) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101025: catch up with vm_page_sleep_if_busy rename +OLD_FILES+=usr/share/man/man9/vm_page_sleep_busy.9.gz # 20091129: pecoff image activator removed .if ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/pecoff_machdep.h Modified: stable/7/share/man/man9/Makefile ============================================================================== --- stable/7/share/man/man9/Makefile Mon Oct 25 08:09:19 2010 (r214328) +++ stable/7/share/man/man9/Makefile Mon Oct 25 08:11:51 2010 (r214329) @@ -307,7 +307,7 @@ MAN= accept_filter.9 \ vm_page_lookup.9 \ vm_page_protect.9 \ vm_page_rename.9 \ - vm_page_sleep_busy.9 \ + vm_page_sleep_if_busy.9 \ vm_page_wakeup.9 \ vm_page_wire.9 \ vm_page_zero_fill.9 \ Copied: stable/7/share/man/man9/vm_page_sleep_if_busy.9 (from r214097, head/share/man/man9/vm_page_sleep_if_busy.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man9/vm_page_sleep_if_busy.9 Mon Oct 25 08:11:51 2010 (r214329, copy of r214097, head/share/man/man9/vm_page_sleep_if_busy.9) @@ -0,0 +1,68 @@ +.\" +.\" Copyright (C) 2001 Chad David . 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(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), 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 HOLDER(S) ``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 HOLDER(S) 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 July 13, 2001 +.Dt VM_PAGE_SLEEP_IF_BUSY 9 +.Os +.Sh NAME +.Nm vm_page_sleep_if_busy +.Nd "wait for a busy page to become unbusy" +.Sh SYNOPSIS +.In sys/param.h +.In vm/vm.h +.In vm/vm_page.h +.Ft int +.Fn vm_page_sleep_if_busy "vm_page_t m" "int also_m_busy" "const char *wmesg" +.Sh DESCRIPTION +The +.Fn vm_page_sleep_if_busy +function waits until the +.Dv VPO_BUSY +flag is cleared. +If +.Fa also_m_busy +is non-zero, it also waits for +.Fa m->busy +to become zero. +.Sh RETURN VALUES +If +.Fn vm_page_sleep_if_busy +finds the page busy it returns +.Dv TRUE . +If not, it returns +.Dv FALSE . +Returning +.Dv TRUE +does not necessary mean that +.Fn vm_page_sleep_if_busy +slept, but only that +.Fn splvm +was called. +.Sh AUTHORS +This manual page was written by +.An Chad David Aq davidc@acns.ab.ca . Modified: stable/7/share/man/man9/vm_page_wakeup.9 ============================================================================== --- stable/7/share/man/man9/vm_page_wakeup.9 Mon Oct 25 08:09:19 2010 (r214328) +++ stable/7/share/man/man9/vm_page_wakeup.9 Mon Oct 25 08:11:51 2010 (r214329) @@ -68,7 +68,7 @@ flag on the page, and calls .Fn vm_page_flash in case somebody has been waiting for it. .Sh SEE ALSO -.Xr vm_page_sleep_busy 9 , +.Xr vm_page_sleep_if_busy 9 , .Xr wakeup 9 .Sh AUTHORS This manual page was written by From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 08: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 84277106564A; Mon, 25 Oct 2010 08:18:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 581EB8FC16; Mon, 25 Oct 2010 08: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 o9P8IT9e056571; Mon, 25 Oct 2010 08:18:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P8ITKn056569; Mon, 25 Oct 2010 08:18:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010250818.o9P8ITKn056569@svn.freebsd.org> From: Alexander Motin Date: Mon, 25 Oct 2010 08:18: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: r214330 - stable/8/sys/geom/concat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 08:18:29 -0000 Author: mav Date: Mon Oct 25 08:18:29 2010 New Revision: 214330 URL: http://svn.freebsd.org/changeset/base/214330 Log: MFC r212754: Add support for dumping kernel to gconcat. Dumping goes to the component, where dump partition begins. Modified: stable/8/sys/geom/concat/g_concat.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) Modified: stable/8/sys/geom/concat/g_concat.c ============================================================================== --- stable/8/sys/geom/concat/g_concat.c Mon Oct 25 08:11:51 2010 (r214329) +++ stable/8/sys/geom/concat/g_concat.c Mon Oct 25 08:18:29 2010 (r214330) @@ -212,6 +212,39 @@ g_concat_access(struct g_provider *pp, i } static void +g_concat_kernel_dump(struct bio *bp) +{ + struct g_concat_softc *sc; + struct g_concat_disk *disk; + struct bio *cbp; + struct g_kerneldump *gkd; + u_int i; + + sc = bp->bio_to->geom->softc; + gkd = (struct g_kerneldump *)bp->bio_data; + for (i = 0; i < sc->sc_ndisks; i++) { + if (sc->sc_disks[i].d_start <= gkd->offset && + sc->sc_disks[i].d_end > gkd->offset) + break; + } + if (i == sc->sc_ndisks) + g_io_deliver(bp, EOPNOTSUPP); + disk = &sc->sc_disks[i]; + gkd->offset -= disk->d_start; + if (gkd->length > disk->d_end - disk->d_start - gkd->offset) + gkd->length = disk->d_end - disk->d_start - gkd->offset; + cbp = g_clone_bio(bp); + if (cbp == NULL) { + g_io_deliver(bp, ENOMEM); + return; + } + cbp->bio_done = g_std_done; + g_io_request(cbp, disk->d_consumer); + G_CONCAT_DEBUG(1, "Kernel dump will go to %s.", + disk->d_consumer->provider->name); +} + +static void g_concat_flush(struct g_concat_softc *sc, struct bio *bp) { struct bio_queue_head queue; @@ -280,7 +313,12 @@ g_concat_start(struct bio *bp) g_concat_flush(sc, bp); return; case BIO_GETATTR: + if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { + g_concat_kernel_dump(bp); + return; + } /* To which provider it should be delivered? */ + /* FALLTHROUGH */ default: g_io_deliver(bp, EOPNOTSUPP); return; From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 08:23: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 9D3F41065672; Mon, 25 Oct 2010 08:23:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 711138FC19; Mon, 25 Oct 2010 08:23: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 o9P8NcHG056838; Mon, 25 Oct 2010 08:23:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P8NcMj056836; Mon, 25 Oct 2010 08:23:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010250823.o9P8NcMj056836@svn.freebsd.org> From: Alexander Motin Date: Mon, 25 Oct 2010 08:23:38 +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: r214331 - stable/7/sys/geom/concat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 08:23:38 -0000 Author: mav Date: Mon Oct 25 08:23:38 2010 New Revision: 214331 URL: http://svn.freebsd.org/changeset/base/214331 Log: MFC r212754: Add support for dumping kernel to gconcat. Dumping goes to the component, where dump partition begins. Modified: stable/7/sys/geom/concat/g_concat.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/concat/g_concat.c ============================================================================== --- stable/7/sys/geom/concat/g_concat.c Mon Oct 25 08:18:29 2010 (r214330) +++ stable/7/sys/geom/concat/g_concat.c Mon Oct 25 08:23:38 2010 (r214331) @@ -212,6 +212,39 @@ g_concat_access(struct g_provider *pp, i } static void +g_concat_kernel_dump(struct bio *bp) +{ + struct g_concat_softc *sc; + struct g_concat_disk *disk; + struct bio *cbp; + struct g_kerneldump *gkd; + u_int i; + + sc = bp->bio_to->geom->softc; + gkd = (struct g_kerneldump *)bp->bio_data; + for (i = 0; i < sc->sc_ndisks; i++) { + if (sc->sc_disks[i].d_start <= gkd->offset && + sc->sc_disks[i].d_end > gkd->offset) + break; + } + if (i == sc->sc_ndisks) + g_io_deliver(bp, EOPNOTSUPP); + disk = &sc->sc_disks[i]; + gkd->offset -= disk->d_start; + if (gkd->length > disk->d_end - disk->d_start - gkd->offset) + gkd->length = disk->d_end - disk->d_start - gkd->offset; + cbp = g_clone_bio(bp); + if (cbp == NULL) { + g_io_deliver(bp, ENOMEM); + return; + } + cbp->bio_done = g_std_done; + g_io_request(cbp, disk->d_consumer); + G_CONCAT_DEBUG(1, "Kernel dump will go to %s.", + disk->d_consumer->provider->name); +} + +static void g_concat_flush(struct g_concat_softc *sc, struct bio *bp) { struct bio_queue_head queue; @@ -280,7 +313,12 @@ g_concat_start(struct bio *bp) g_concat_flush(sc, bp); return; case BIO_GETATTR: + if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { + g_concat_kernel_dump(bp); + return; + } /* To which provider it should be delivered? */ + /* FALLTHROUGH */ default: g_io_deliver(bp, EOPNOTSUPP); return; From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 08:25: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 684391065674; Mon, 25 Oct 2010 08:25:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5724B8FC18; Mon, 25 Oct 2010 08:25: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 o9P8Pif5056918; Mon, 25 Oct 2010 08:25:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P8PiqJ056916; Mon, 25 Oct 2010 08:25:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010250825.o9P8PiqJ056916@svn.freebsd.org> From: Alexander Motin Date: Mon, 25 Oct 2010 08:25: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: r214332 - head/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 08:25:44 -0000 Author: mav Date: Mon Oct 25 08:25:44 2010 New Revision: 214332 URL: http://svn.freebsd.org/changeset/base/214332 Log: Make hw.snd.vpc_0db to be also a loader tunable. Modified: head/sys/dev/sound/pcm/channel.c Modified: head/sys/dev/sound/pcm/channel.c ============================================================================== --- head/sys/dev/sound/pcm/channel.c Mon Oct 25 08:23:38 2010 (r214331) +++ head/sys/dev/sound/pcm/channel.c Mon Oct 25 08:25:44 2010 (r214332) @@ -124,6 +124,7 @@ SYSCTL_INT(_hw_snd, OID_AUTO, vpc_autore &chn_vpc_autoreset, 0, "automatically reset channels volume to 0db"); static int chn_vol_0db_pcm = SND_VOL_0DB_PCM; +TUNABLE_INT("hw.snd.vpc_0db", &chn_vol_0db_pcm); static void chn_vpc_proc(int reset, int db) From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 08:30: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 3FD531065673; Mon, 25 Oct 2010 08:30:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D5118FC14; Mon, 25 Oct 2010 08:30: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 o9P8UKCY057039; Mon, 25 Oct 2010 08:30:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P8UK39057035; Mon, 25 Oct 2010 08:30:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010250830.o9P8UK39057035@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 25 Oct 2010 08:30: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: r214333 - in head/sys: conf 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: Mon, 25 Oct 2010 08:30:20 -0000 Author: bz Date: Mon Oct 25 08:30:19 2010 New Revision: 214333 URL: http://svn.freebsd.org/changeset/base/214333 Log: Factor out DDB commands from r204145, r204279 into if_debug.c for further enhancements (1). Switch to a standard 2-clause BSD license for this (2). Unfortunately we have to un-static the ifindex_table for this but do not publicly export it. Suggested by: rwatson (1) a while back. Approved by: thompsa (2) for the change from r204279. MFC after: 6 days Added: head/sys/net/if_debug.c (contents, props changed) Modified: head/sys/conf/files head/sys/net/if.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 25 08:25:44 2010 (r214332) +++ head/sys/conf/files Mon Oct 25 08:30:19 2010 (r214333) @@ -2384,6 +2384,7 @@ net/if_atmsubr.c optional atm net/if_bridge.c optional bridge inet | if_bridge inet net/if_clone.c standard net/if_dead.c standard +net/if_debug.c optional ddb net/if_disc.c optional disc net/if_edsc.c optional edsc net/if_ef.c optional ef Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Oct 25 08:25:44 2010 (r214332) +++ head/sys/net/if.c Mon Oct 25 08:30:19 2010 (r214333) @@ -33,7 +33,6 @@ #include "opt_compat.h" #include "opt_inet6.h" #include "opt_inet.h" -#include "opt_ddb.h" #include #include @@ -62,10 +61,6 @@ #include #include -#ifdef DDB -#include -#endif - #include #include #include @@ -191,7 +186,7 @@ VNET_DEFINE(struct ifgrouphead, ifg_head static VNET_DEFINE(int, if_indexlim) = 8; /* Table of ifnet by index. */ -static VNET_DEFINE(struct ifindex_entry *, ifindex_table); +VNET_DEFINE(struct ifindex_entry *, ifindex_table); #define V_if_indexlim VNET(if_indexlim) #define V_ifindex_table VNET(ifindex_table) @@ -3366,79 +3361,3 @@ if_deregister_com_alloc(u_char type) if_com_alloc[type] = NULL; if_com_free[type] = NULL; } - -#ifdef DDB -static void -if_show_ifnet(struct ifnet *ifp) -{ - - if (ifp == NULL) - return; - db_printf("%s:\n", ifp->if_xname); -#define IF_DB_PRINTF(f, e) db_printf(" %s = " f "\n", #e, ifp->e); - IF_DB_PRINTF("%s", if_dname); - IF_DB_PRINTF("%d", if_dunit); - IF_DB_PRINTF("%s", if_description); - IF_DB_PRINTF("%u", if_index); - IF_DB_PRINTF("%u", if_refcount); - IF_DB_PRINTF("%d", if_index_reserved); - IF_DB_PRINTF("%p", if_softc); - IF_DB_PRINTF("%p", if_l2com); - IF_DB_PRINTF("%p", if_vnet); - IF_DB_PRINTF("%p", if_home_vnet); - IF_DB_PRINTF("%p", if_addr); - IF_DB_PRINTF("%p", if_llsoftc); - IF_DB_PRINTF("%p", if_label); - IF_DB_PRINTF("%u", if_pcount); - IF_DB_PRINTF("0x%08x", if_flags); - IF_DB_PRINTF("0x%08x", if_drv_flags); - IF_DB_PRINTF("0x%08x", if_capabilities); - IF_DB_PRINTF("0x%08x", if_capenable); - IF_DB_PRINTF("%p", if_snd.ifq_head); - IF_DB_PRINTF("%p", if_snd.ifq_tail); - IF_DB_PRINTF("%d", if_snd.ifq_len); - IF_DB_PRINTF("%d", if_snd.ifq_maxlen); - IF_DB_PRINTF("%d", if_snd.ifq_drops); - IF_DB_PRINTF("%p", if_snd.ifq_drv_head); - IF_DB_PRINTF("%p", if_snd.ifq_drv_tail); - IF_DB_PRINTF("%d", if_snd.ifq_drv_len); - IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); - IF_DB_PRINTF("%d", if_snd.altq_type); - IF_DB_PRINTF("%x", if_snd.altq_flags); -#undef IF_DB_PRINTF -} - -DB_SHOW_COMMAND(ifnet, db_show_ifnet) -{ - - if (!have_addr) { - db_printf("usage: show ifnet \n"); - return; - } - - if_show_ifnet((struct ifnet *)addr); -} - -DB_SHOW_ALL_COMMAND(ifnets, db_show_all_ifnets) -{ - VNET_ITERATOR_DECL(vnet_iter); - struct ifnet *ifp; - u_short idx; - - VNET_FOREACH(vnet_iter) { - CURVNET_SET_QUIET(vnet_iter); -#ifdef VIMAGE - db_printf("vnet=%p\n", curvnet); -#endif - for (idx = 1; idx <= V_if_index; idx++) { - ifp = V_ifindex_table[idx].ife_ifnet; - if (ifp == NULL) - continue; - db_printf( "%20s ifp=%p\n", ifp->if_xname, ifp); - if (db_pager_quit) - break; - } - CURVNET_RESTORE(); - } -} -#endif Added: head/sys/net/if_debug.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/if_debug.c Mon Oct 25 08:30:19 2010 (r214333) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2010 Bjoern A. Zeeb + * 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 "opt_ddb.h" + +#include +#include +#include + +#ifdef DDB +#include +#endif + +#include +#include +#include +#include + +#ifdef DDB +struct ifindex_entry { + struct ifnet *ife_ifnet; +}; +VNET_DECLARE(struct ifindex_entry *, ifindex_table); +#define V_ifindex_table VNET(ifindex_table) + +static void +if_show_ifnet(struct ifnet *ifp) +{ + + if (ifp == NULL) + return; + db_printf("%s:\n", ifp->if_xname); +#define IF_DB_PRINTF(f, e) db_printf(" %s = " f "\n", #e, ifp->e); + IF_DB_PRINTF("%s", if_dname); + IF_DB_PRINTF("%d", if_dunit); + IF_DB_PRINTF("%s", if_description); + IF_DB_PRINTF("%u", if_index); + IF_DB_PRINTF("%u", if_refcount); + IF_DB_PRINTF("%d", if_index_reserved); + IF_DB_PRINTF("%p", if_softc); + IF_DB_PRINTF("%p", if_l2com); + IF_DB_PRINTF("%p", if_vnet); + IF_DB_PRINTF("%p", if_home_vnet); + IF_DB_PRINTF("%p", if_addr); + IF_DB_PRINTF("%p", if_llsoftc); + IF_DB_PRINTF("%p", if_label); + IF_DB_PRINTF("%u", if_pcount); + IF_DB_PRINTF("0x%08x", if_flags); + IF_DB_PRINTF("0x%08x", if_drv_flags); + IF_DB_PRINTF("0x%08x", if_capabilities); + IF_DB_PRINTF("0x%08x", if_capenable); + IF_DB_PRINTF("%p", if_snd.ifq_head); + IF_DB_PRINTF("%p", if_snd.ifq_tail); + IF_DB_PRINTF("%d", if_snd.ifq_len); + IF_DB_PRINTF("%d", if_snd.ifq_maxlen); + IF_DB_PRINTF("%d", if_snd.ifq_drops); + IF_DB_PRINTF("%p", if_snd.ifq_drv_head); + IF_DB_PRINTF("%p", if_snd.ifq_drv_tail); + IF_DB_PRINTF("%d", if_snd.ifq_drv_len); + IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); + IF_DB_PRINTF("%d", if_snd.altq_type); + IF_DB_PRINTF("%x", if_snd.altq_flags); +#undef IF_DB_PRINTF +} + +DB_SHOW_COMMAND(ifnet, db_show_ifnet) +{ + + if (!have_addr) { + db_printf("usage: show ifnet \n"); + return; + } + + if_show_ifnet((struct ifnet *)addr); +} + +DB_SHOW_ALL_COMMAND(ifnets, db_show_all_ifnets) +{ + VNET_ITERATOR_DECL(vnet_iter); + struct ifnet *ifp; + u_short idx; + + VNET_FOREACH(vnet_iter) { + CURVNET_SET_QUIET(vnet_iter); +#ifdef VIMAGE + db_printf("vnet=%p\n", curvnet); +#endif + for (idx = 1; idx <= V_if_index; idx++) { + ifp = V_ifindex_table[idx].ife_ifnet; + if (ifp == NULL) + continue; + db_printf( "%20s ifp=%p\n", ifp->if_xname, ifp); + if (db_pager_quit) + break; + } + CURVNET_RESTORE(); + } +} +#endif From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 09:16: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 C24C01065674; Mon, 25 Oct 2010 09:16:04 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A56538FC0C; Mon, 25 Oct 2010 09:16: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 o9P9G41f058180; Mon, 25 Oct 2010 09:16:04 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P9G4YO058177; Mon, 25 Oct 2010 09:16:04 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010250916.o9P9G4YO058177@svn.freebsd.org> From: David Xu Date: Mon, 25 Oct 2010 09:16: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: r214334 - head/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: Mon, 25 Oct 2010 09:16:05 -0000 Author: davidxu Date: Mon Oct 25 09:16:04 2010 New Revision: 214334 URL: http://svn.freebsd.org/changeset/base/214334 Log: Get cpuset in pthread_attr_get_np() and free it in pthread_attr_destroy(). MFC after: 7 days Modified: head/lib/libthr/thread/thr_attr.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_attr.c ============================================================================== --- head/lib/libthr/thread/thr_attr.c Mon Oct 25 08:30:19 2010 (r214333) +++ head/lib/libthr/thread/thr_attr.c Mon Oct 25 09:16:04 2010 (r214334) @@ -104,6 +104,8 @@ #include "thr_private.h" +static size_t _get_kern_cpuset_size(void); + __weak_reference(_pthread_attr_destroy, pthread_attr_destroy); int @@ -116,6 +118,8 @@ _pthread_attr_destroy(pthread_attr_t *at /* Invalid argument: */ ret = EINVAL; else { + if ((*attr)->cpuset != NULL) + free((*attr)->cpuset); /* Free the memory allocated to the attribute object: */ free(*attr); @@ -132,28 +136,43 @@ _pthread_attr_destroy(pthread_attr_t *at __weak_reference(_pthread_attr_get_np, pthread_attr_get_np); int -_pthread_attr_get_np(pthread_t pthread, pthread_attr_t *dst) +_pthread_attr_get_np(pthread_t pthread, pthread_attr_t *dstattr) { struct pthread *curthread; - struct pthread_attr attr; + struct pthread_attr attr, *dst; int ret; + size_t cpusetsize; - if (pthread == NULL || dst == NULL || *dst == NULL) + if (pthread == NULL || dst_attr == NULL || (dst = *dstattr) == NULL) return (EINVAL); - + cpusetsize = _get_kern_cpuset_size(); + if (dst->cpusetsize < cpusetsize) { + char *newset = realloc(dst->cpuset, cpusetsize); + if (newset == NULL) + return (errno); + memset(newset + dst->cpusetsize, 0, cpusetsize - + dst->cpusetsize); + dst->cpuset = (cpuset_t *)newset; + dst->cpusetsize = cpusetsize; + } curthread = _get_curthread(); if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)) != 0) return (ret); attr = pthread->attr; if (pthread->flags & THR_FLAGS_DETACHED) attr.flags |= PTHREAD_DETACHED; + ret = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, TID(pthread), + dst->cpusetsize, dst->cpuset); + if (ret == -1) + ret = errno; THR_THREAD_UNLOCK(curthread, pthread); - - memcpy(*dst, &attr, sizeof(struct pthread_attr)); - /* XXX */ - (*dst)->cpuset = NULL; - (*dst)->cpusetsize = 0; - return (0); + if (ret == 0) { + memcpy(&dst->pthread_attr_start_copy, + &attr.pthread_attr_start_copy, + offsetof(struct pthread_attr, pthread_attr_end_copy) - + offsetof(struct pthread_attr, pthread_attr_start_copy)); + } + return (ret); } __weak_reference(_pthread_attr_getdetachstate, pthread_attr_getdetachstate); Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Oct 25 08:30:19 2010 (r214333) +++ head/lib/libthr/thread/thr_private.h Mon Oct 25 09:16:04 2010 (r214334) @@ -230,6 +230,7 @@ struct pthread_atfork { }; struct pthread_attr { +#define pthread_attr_start_copy sched_policy int sched_policy; int sched_inherit; int prio; @@ -239,6 +240,7 @@ struct pthread_attr { void *stackaddr_attr; size_t stacksize_attr; size_t guardsize_attr; +#define pthread_attr_end_copy cpuset cpuset_t *cpuset; size_t cpusetsize; }; From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 11:16: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 D00B7106564A; Mon, 25 Oct 2010 11:16:50 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEA278FC12; Mon, 25 Oct 2010 11:16: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 o9PBGorO063078; Mon, 25 Oct 2010 11:16:50 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PBGoiY063076; Mon, 25 Oct 2010 11:16:50 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010251116.o9PBGoiY063076@svn.freebsd.org> From: David Xu Date: Mon, 25 Oct 2010 11:16: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: r214335 - head/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: Mon, 25 Oct 2010 11:16:50 -0000 Author: davidxu Date: Mon Oct 25 11:16:50 2010 New Revision: 214335 URL: http://svn.freebsd.org/changeset/base/214335 Log: Fix typo. Modified: head/lib/libthr/thread/thr_attr.c Modified: head/lib/libthr/thread/thr_attr.c ============================================================================== --- head/lib/libthr/thread/thr_attr.c Mon Oct 25 09:16:04 2010 (r214334) +++ head/lib/libthr/thread/thr_attr.c Mon Oct 25 11:16:50 2010 (r214335) @@ -143,7 +143,7 @@ _pthread_attr_get_np(pthread_t pthread, int ret; size_t cpusetsize; - if (pthread == NULL || dst_attr == NULL || (dst = *dstattr) == NULL) + if (pthread == NULL || dstattr == NULL || (dst = *dstattr) == NULL) return (EINVAL); cpusetsize = _get_kern_cpuset_size(); if (dst->cpusetsize < cpusetsize) { From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 13:01: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 0F3721065670; Mon, 25 Oct 2010 13:01:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0A3E8FC1E; Mon, 25 Oct 2010 13:01: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 o9PD1Jq7065623; Mon, 25 Oct 2010 13:01:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PD1JUv065620; Mon, 25 Oct 2010 13:01:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010251301.o9PD1JUv065620@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 13:01:19 +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: r214336 - stable/8/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 13:01:20 -0000 Author: attilio Date: Mon Oct 25 13:01:19 2010 New Revision: 214336 URL: http://svn.freebsd.org/changeset/base/214336 Log: MFC r212661 and r212756: Implement correct refcounting of cdevsw open/close pair and detach stopping for it. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aacvar.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) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Mon Oct 25 11:16:50 2010 (r214335) +++ stable/8/sys/dev/aac/aac.c Mon Oct 25 13:01:19 2010 (r214336) @@ -189,9 +189,9 @@ static char *aac_describe_code(struct aa /* Management Interface */ static d_open_t aac_open; -static d_close_t aac_close; static d_ioctl_t aac_ioctl; static d_poll_t aac_poll; +static void aac_cdevpriv_dtor(void *arg); static int aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib); static int aac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t arg); static void aac_handle_aif(struct aac_softc *sc, @@ -214,7 +214,6 @@ static struct cdevsw aac_cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDGIANT, .d_open = aac_open, - .d_close = aac_close, .d_ioctl = aac_ioctl, .d_poll = aac_poll, .d_name = "aac", @@ -660,9 +659,6 @@ aac_detach(device_t dev) sc = device_get_softc(dev); fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - if (sc->aac_state & AAC_STATE_OPEN) - return(EBUSY); - callout_drain(&sc->aac_daemontime); /* Remove the child containers */ @@ -2804,23 +2800,8 @@ aac_open(struct cdev *dev, int flags, in sc = dev->si_drv1; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - sc->aac_open_cnt++; - sc->aac_state |= AAC_STATE_OPEN; - - return 0; -} - -static int -aac_close(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct aac_softc *sc; - - sc = dev->si_drv1; - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - sc->aac_open_cnt--; - /* Mark this unit as no longer open */ - if (sc->aac_open_cnt == 0) - sc->aac_state &= ~AAC_STATE_OPEN; + device_busy(sc->aac_dev); + devfs_set_cdevpriv(sc, aac_cdevpriv_dtor); return 0; } @@ -3208,6 +3189,21 @@ out: } /* + * cdevpriv interface private destructor. + */ +static void +aac_cdevpriv_dtor(void *arg) +{ + struct aac_softc *sc; + + sc = arg; + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + mtx_lock(&Giant); + device_unbusy(sc->aac_dev); + mtx_unlock(&Giant); +} + +/* * Handle an AIF sent to us by the controller; queue it for later reference. * If the queue fills up, then drop the older entries. */ Modified: stable/8/sys/dev/aac/aacvar.h ============================================================================== --- stable/8/sys/dev/aac/aacvar.h Mon Oct 25 11:16:50 2010 (r214335) +++ stable/8/sys/dev/aac/aacvar.h Mon Oct 25 13:01:19 2010 (r214336) @@ -319,10 +319,9 @@ struct aac_softc /* controller features, limits and status */ int aac_state; #define AAC_STATE_SUSPEND (1<<0) -#define AAC_STATE_OPEN (1<<1) +#define AAC_STATE_UNUSED0 (1<<1) #define AAC_STATE_INTERRUPTS_ON (1<<2) #define AAC_STATE_AIF_SLEEPER (1<<3) - int aac_open_cnt; struct FsaRevision aac_revision; /* controller hardware interface */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 13:13: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 2D4351065670; Mon, 25 Oct 2010 13:13:17 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BCAA8FC1A; Mon, 25 Oct 2010 13:13: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 o9PDDHNg065931; Mon, 25 Oct 2010 13:13:17 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PDDG6C065929; Mon, 25 Oct 2010 13:13:17 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010251313.o9PDDG6C065929@svn.freebsd.org> From: David Xu Date: Mon, 25 Oct 2010 13:13: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: r214337 - 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, 25 Oct 2010 13:13:17 -0000 Author: davidxu Date: Mon Oct 25 13:13:16 2010 New Revision: 214337 URL: http://svn.freebsd.org/changeset/base/214337 Log: Use function tdfind() to find a thread. Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Mon Oct 25 13:01:19 2010 (r214336) +++ head/sys/kern/kern_cpuset.c Mon Oct 25 13:13:16 2010 (r214337) @@ -416,19 +416,10 @@ cpuset_which(cpuwhich_t which, id_t id, td = curthread; break; } - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - FOREACH_THREAD_IN_PROC(p, td) - if (td->td_tid == id) - break; - if (td != NULL) - break; - PROC_UNLOCK(p); - } - sx_sunlock(&allproc_lock); + td = tdfind(id, -1); if (td == NULL) return (ESRCH); + p = td->td_proc; break; case CPU_WHICH_CPUSET: if (id == -1) { From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 13:16: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 7D6DB10656A4; Mon, 25 Oct 2010 13:16:11 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AF6E8FC13; Mon, 25 Oct 2010 13:16: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 o9PDGBsX066140; Mon, 25 Oct 2010 13:16:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PDGB4L066137; Mon, 25 Oct 2010 13:16:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010251316.o9PDGB4L066137@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 13:16:11 +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: r214338 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 13:16:11 -0000 Author: attilio Date: Mon Oct 25 13:16:11 2010 New Revision: 214338 URL: http://svn.freebsd.org/changeset/base/214338 Log: IP_BINDANY is not correctly handled in getsockopt() case. Fix it by specifying the correct bits. Modified: stable/8/sys/netinet/ip_output.c stable/8/sys/netinet6/ip6_output.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) Modified: stable/8/sys/netinet/ip_output.c ============================================================================== --- stable/8/sys/netinet/ip_output.c Mon Oct 25 13:13:16 2010 (r214337) +++ stable/8/sys/netinet/ip_output.c Mon Oct 25 13:16:11 2010 (r214338) @@ -1127,6 +1127,7 @@ ip_ctloutput(struct socket *so, struct s case IP_FAITH: case IP_ONESBCAST: case IP_DONTFRAG: + case IP_BINDANY: switch (sopt->sopt_name) { case IP_TOS: @@ -1182,6 +1183,9 @@ ip_ctloutput(struct socket *so, struct s case IP_DONTFRAG: optval = OPTBIT(INP_DONTFRAG); break; + case IP_BINDANY: + optval = OPTBIT(INP_BINDANY); + break; } error = sooptcopyout(sopt, &optval, sizeof optval); break; Modified: stable/8/sys/netinet6/ip6_output.c ============================================================================== --- stable/8/sys/netinet6/ip6_output.c Mon Oct 25 13:13:16 2010 (r214337) +++ stable/8/sys/netinet6/ip6_output.c Mon Oct 25 13:16:11 2010 (r214338) @@ -1798,6 +1798,7 @@ do { \ case IPV6_PORTRANGE: case IPV6_RECVTCLASS: case IPV6_AUTOFLOWLABEL: + case IPV6_BINDANY: switch (optname) { case IPV6_RECVHOPOPTS: From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 13:34: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 C61D41065785; Mon, 25 Oct 2010 13:34:55 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B28FE8FC14; Mon, 25 Oct 2010 13:34: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 o9PDYtpK066688; Mon, 25 Oct 2010 13:34:55 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PDYtK0066681; Mon, 25 Oct 2010 13:34:55 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010251334.o9PDYtK0066681@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 13:34: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: r214339 - in stable/8/sys: conf modules/krpc netinet nlm rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 13:34:55 -0000 Author: attilio Date: Mon Oct 25 13:34:55 2010 New Revision: 214339 URL: http://svn.freebsd.org/changeset/base/214339 Log: MFC r213103: Make the RPC specific __rpc_inet_ntop() and __rpc_inet_pton() general in the kernel. Sponsored by: Sandvine Incorporated Deleted: stable/8/sys/rpc/inet_ntop.c stable/8/sys/rpc/inet_pton.c Modified: stable/8/sys/conf/files stable/8/sys/modules/krpc/Makefile stable/8/sys/netinet/in.h stable/8/sys/nlm/nlm_prot_impl.c stable/8/sys/rpc/rpc_com.h stable/8/sys/rpc/rpc_generic.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) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Oct 25 13:16:11 2010 (r214338) +++ stable/8/sys/conf/files Mon Oct 25 13:34:55 2010 (r214339) @@ -2283,6 +2283,8 @@ libkern/iconv_xlat16.c optional libicon libkern/index.c standard libkern/inet_aton.c standard libkern/inet_ntoa.c standard +libkern/inet_ntop.c standard +libkern/inet_pton.c standard libkern/mcount.c optional profiling-routine libkern/memcmp.c standard libkern/qsort.c standard @@ -2689,8 +2691,6 @@ rpc/clnt_dg.c optional krpc | nfslockd rpc/clnt_rc.c optional krpc | nfslockd | nfsclient | nfscl | nfsd rpc/clnt_vc.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd rpc/getnetconfig.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd -rpc/inet_ntop.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd -rpc/inet_pton.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd rpc/replay.c optional krpc | nfslockd | nfsserver | nfscl | nfsd rpc/rpc_callmsg.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd rpc/rpc_generic.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd Modified: stable/8/sys/modules/krpc/Makefile ============================================================================== --- stable/8/sys/modules/krpc/Makefile Mon Oct 25 13:16:11 2010 (r214338) +++ stable/8/sys/modules/krpc/Makefile Mon Oct 25 13:34:55 2010 (r214339) @@ -9,8 +9,6 @@ SRCS= auth_none.c \ clnt_rc.c \ clnt_vc.c \ getnetconfig.c \ - inet_ntop.c \ - inet_pton.c \ rpc_callmsg.c \ rpc_generic.c \ rpc_prot.c \ Modified: stable/8/sys/netinet/in.h ============================================================================== --- stable/8/sys/netinet/in.h Mon Oct 25 13:16:11 2010 (r214338) +++ stable/8/sys/netinet/in.h Mon Oct 25 13:34:55 2010 (r214339) @@ -744,6 +744,8 @@ int in_localip(struct in_addr); int inet_aton(const char *, struct in_addr *); /* in libkern */ char *inet_ntoa(struct in_addr); /* in libkern */ char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ +char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */ +int inet_pton(int af, const char *, void *); /* in libkern */ void in_ifdetach(struct ifnet *); #define in_hosteq(s, t) ((s).s_addr == (t).s_addr) Modified: stable/8/sys/nlm/nlm_prot_impl.c ============================================================================== --- stable/8/sys/nlm/nlm_prot_impl.c Mon Oct 25 13:16:11 2010 (r214338) +++ stable/8/sys/nlm/nlm_prot_impl.c Mon Oct 25 13:34:55 2010 (r214339) @@ -1003,13 +1003,13 @@ nlm_find_host_by_addr(const struct socka switch (addr->sa_family) { case AF_INET: - __rpc_inet_ntop(AF_INET, + inet_ntop(AF_INET, &((const struct sockaddr_in *) addr)->sin_addr, tmp, sizeof tmp); break; #ifdef INET6 case AF_INET6: - __rpc_inet_ntop(AF_INET6, + inet_ntop(AF_INET6, &((const struct sockaddr_in6 *) addr)->sin6_addr, tmp, sizeof tmp); break; Modified: stable/8/sys/rpc/rpc_com.h ============================================================================== --- stable/8/sys/rpc/rpc_com.h Mon Oct 25 13:16:11 2010 (r214338) +++ stable/8/sys/rpc/rpc_com.h Mon Oct 25 13:34:55 2010 (r214339) @@ -111,10 +111,6 @@ extern struct netbuf *__rpc_uaddr2taddr_ extern int __rpc_seman2socktype(int); extern int __rpc_socktype2seman(int); extern int __rpc_sockisbound(struct socket*); -extern const char *__rpc_inet_ntop(int af, const void * __restrict src, - char * __restrict dst, socklen_t size); -extern int __rpc_inet_pton(int af, const char * __restrict src, - void * __restrict dst); extern int bindresvport(struct socket *so, struct sockaddr *sa); struct xucred; Modified: stable/8/sys/rpc/rpc_generic.c ============================================================================== --- stable/8/sys/rpc/rpc_generic.c Mon Oct 25 13:16:11 2010 (r214338) +++ stable/8/sys/rpc/rpc_generic.c Mon Oct 25 13:34:55 2010 (r214339) @@ -306,7 +306,7 @@ __rpc_taddr2uaddr_af(int af, const struc switch (af) { case AF_INET: sin = nbuf->buf; - if (__rpc_inet_ntop(af, &sin->sin_addr, namebuf, sizeof namebuf) + if (inet_ntop(af, &sin->sin_addr, namebuf, sizeof namebuf) == NULL) return NULL; port = ntohs(sin->sin_port); @@ -318,7 +318,7 @@ __rpc_taddr2uaddr_af(int af, const struc #ifdef INET6 case AF_INET6: sin6 = nbuf->buf; - if (__rpc_inet_ntop(af, &sin6->sin6_addr, namebuf6, sizeof namebuf6) + if (inet_ntop(af, &sin6->sin6_addr, namebuf6, sizeof namebuf6) == NULL) return NULL; port = ntohs(sin6->sin6_port); @@ -396,7 +396,7 @@ __rpc_uaddr2taddr_af(int af, const char memset(sin, 0, sizeof *sin); sin->sin_family = AF_INET; sin->sin_port = htons(port); - if (__rpc_inet_pton(AF_INET, addrstr, &sin->sin_addr) <= 0) { + if (inet_pton(AF_INET, addrstr, &sin->sin_addr) <= 0) { free(sin, M_RPC); free(ret, M_RPC); ret = NULL; @@ -414,7 +414,7 @@ __rpc_uaddr2taddr_af(int af, const char memset(sin6, 0, sizeof *sin6); sin6->sin6_family = AF_INET6; sin6->sin6_port = htons(port); - if (__rpc_inet_pton(AF_INET6, addrstr, &sin6->sin6_addr) <= 0) { + if (inet_pton(AF_INET6, addrstr, &sin6->sin6_addr) <= 0) { free(sin6, M_RPC); free(ret, M_RPC); ret = NULL; From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 14:02: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 6E7CC106566C; Mon, 25 Oct 2010 14:02:14 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C1BB8FC0C; Mon, 25 Oct 2010 14:02: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 o9PE2EHP067398; Mon, 25 Oct 2010 14:02:14 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PE2EdA067396; Mon, 25 Oct 2010 14:02:14 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010251402.o9PE2EdA067396@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 14:02:14 +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: r214340 - 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: Mon, 25 Oct 2010 14:02:14 -0000 Author: attilio Date: Mon Oct 25 14:02:14 2010 New Revision: 214340 URL: http://svn.freebsd.org/changeset/base/214340 Log: MFC r212096 by emaste: As long as we are going to panic anyway, there's no need to hide additional information behind DIAGNOSTIC. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/kern/vfs_subr.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) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Mon Oct 25 13:34:55 2010 (r214339) +++ stable/8/sys/kern/vfs_subr.c Mon Oct 25 14:02:14 2010 (r214340) @@ -2203,9 +2203,7 @@ vputx(struct vnode *vp, int func) } if (vp->v_usecount != 1) { -#ifdef DIAGNOSTIC vprint("vputx: negative ref count", vp); -#endif panic("vputx: negative ref cnt"); } CTR2(KTR_VFS, "%s: return vnode %p to the freelist", __func__, vp); From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 14:04: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 105961065670; Mon, 25 Oct 2010 14:04:22 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F252C8FC19; Mon, 25 Oct 2010 14:04: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 o9PE4L47067481; Mon, 25 Oct 2010 14:04:21 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PE4LOJ067479; Mon, 25 Oct 2010 14:04:21 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010251404.o9PE4LOJ067479@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 14:04: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: r214341 - stable/8/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: Mon, 25 Oct 2010 14:04:22 -0000 Author: attilio Date: Mon Oct 25 14:04:21 2010 New Revision: 214341 URL: http://svn.freebsd.org/changeset/base/214341 Log: MFC r212148 by emaste: Remove trailing whitespace. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/sys/copyright.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) Modified: stable/8/sys/sys/copyright.h ============================================================================== --- stable/8/sys/sys/copyright.h Mon Oct 25 14:02:14 2010 (r214340) +++ stable/8/sys/sys/copyright.h Mon Oct 25 14:04:21 2010 (r214341) @@ -27,7 +27,7 @@ /* Copyrights macros */ - + /* FreeBSD */ #define COPYRIGHT_FreeBSD \ "Copyright (c) 1992-2010 The FreeBSD Project.\n" From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 14:05: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 588D71065674; Mon, 25 Oct 2010 14:05:25 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4711D8FC15; Mon, 25 Oct 2010 14:05: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 o9PE5P8R067538; Mon, 25 Oct 2010 14:05:25 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PE5PRm067536; Mon, 25 Oct 2010 14:05:25 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201010251405.o9PE5PRm067536@svn.freebsd.org> From: Ivan Voras Date: Mon, 25 Oct 2010 14:05: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: r214342 - 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, 25 Oct 2010 14:05:25 -0000 Author: ivoras Date: Mon Oct 25 14:05:25 2010 New Revision: 214342 URL: http://svn.freebsd.org/changeset/base/214342 Log: Reduce the difference between hirunningspace and lorunningspace, it should help interactivity in edge cases. Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Oct 25 14:04:21 2010 (r214341) +++ head/sys/kern/vfs_bio.c Mon Oct 25 14:05:25 2010 (r214342) @@ -623,16 +623,16 @@ bufinit(void) lobufspace = hibufspace - MAXBSIZE; /* - * Note: The 16 MB upper limit for hirunningspace was chosen + * Note: The 16 MiB upper limit for hirunningspace was chosen * arbitrarily and may need further tuning. It corresponds to * 128 outstanding write IO requests (if IO size is 128 KiB), * which fits with many RAID controllers' tagged queuing limits. - * The lower 1 MB limit is the historical upper limit for + * The lower 1 MiB limit is the historical upper limit for * hirunningspace. */ hirunningspace = lmax(lmin(roundup(hibufspace / 64, MAXBSIZE), 16 * 1024 * 1024), 1024 * 1024); - lorunningspace = roundup(hirunningspace / 2, MAXBSIZE); + lorunningspace = roundup((hirunningspace * 2) / 3, MAXBSIZE); /* * Limit the amount of malloc memory since it is wired permanently into From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 15:01: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 166A51065672; Mon, 25 Oct 2010 15:01:41 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 041558FC0A; Mon, 25 Oct 2010 15:01: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 o9PF1eVX068764; Mon, 25 Oct 2010 15:01:40 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PF1euH068762; Mon, 25 Oct 2010 15:01:40 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010251501.o9PF1euH068762@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 15:01:40 +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: r214343 - stable/8/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 15:01:41 -0000 Author: attilio Date: Mon Oct 25 15:01:40 2010 New Revision: 214343 URL: http://svn.freebsd.org/changeset/base/214343 Log: MFC r213012 by emaste: Correct sort order. Sponsored by: Sandvine Incorporated Modified: stable/8/bin/ps/extern.h Directory Properties: stable/8/bin/ps/ (props changed) Modified: stable/8/bin/ps/extern.h ============================================================================== --- stable/8/bin/ps/extern.h Mon Oct 25 14:05:25 2010 (r214342) +++ stable/8/bin/ps/extern.h Mon Oct 25 15:01:40 2010 (r214343) @@ -79,8 +79,8 @@ int s_uname(KINFO *); void showkey(void); void started(KINFO *, VARENT *); void state(KINFO *, VARENT *); -void tdnam(KINFO *, VARENT *); void tdev(KINFO *, VARENT *); +void tdnam(KINFO *, VARENT *); void tname(KINFO *, VARENT *); void ucomm(KINFO *, VARENT *); void uname(KINFO *, VARENT *); From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 15:11: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 3B7F0106566B; Mon, 25 Oct 2010 15:11:11 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27F008FC1C; Mon, 25 Oct 2010 15:11: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 o9PFBBdM069023; Mon, 25 Oct 2010 15:11:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PFBBk1069022; Mon, 25 Oct 2010 15:11:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010251511.o9PFBBk1069022@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 15:11:11 +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: r214344 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 15:11:11 -0000 Author: attilio Date: Mon Oct 25 15:11:10 2010 New Revision: 214344 URL: http://svn.freebsd.org/changeset/base/214344 Log: MFC r213080 by emaste: merge metadata of a revision that could have been included into r214339 MFC's time. Sponsored by: Sandvine Incorporated 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) From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 15:17: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 9963E106564A; Mon, 25 Oct 2010 15:17:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86E7D8FC08; Mon, 25 Oct 2010 15:17: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 o9PFHVbs069188; Mon, 25 Oct 2010 15:17:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PFHVT2069186; Mon, 25 Oct 2010 15:17:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010251517.o9PFHVT2069186@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 15:17: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: r214345 - stable/8/usr.sbin/watchdogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 15:17:31 -0000 Author: attilio Date: Mon Oct 25 15:17:31 2010 New Revision: 214345 URL: http://svn.freebsd.org/changeset/base/214345 Log: MFC r213181 by emaste: Protect the watchdog daemon against swap OOM killer. Sponsored by: Sandvine Incorporated Modified: stable/8/usr.sbin/watchdogd/watchdogd.c Directory Properties: stable/8/usr.sbin/watchdogd/ (props changed) Modified: stable/8/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- stable/8/usr.sbin/watchdogd/watchdogd.c Mon Oct 25 15:11:10 2010 (r214344) +++ stable/8/usr.sbin/watchdogd/watchdogd.c Mon Oct 25 15:17:31 2010 (r214345) @@ -31,6 +31,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -117,6 +118,8 @@ main(int argc, char *argv[]) signal(SIGTERM, sighandler); pidfile_write(pfh); + if (madvise(0, 0, MADV_PROTECT) != 0) + warn("madvise failed"); watchdog_loop(); From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 15:28: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 391931065698; Mon, 25 Oct 2010 15:28:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 263788FC17; Mon, 25 Oct 2010 15:28: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 o9PFS4v7069423; Mon, 25 Oct 2010 15:28:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PFS35p069416; Mon, 25 Oct 2010 15:28:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010251528.o9PFS35p069416@svn.freebsd.org> From: John Baldwin Date: Mon, 25 Oct 2010 15:28: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: r214346 - in head/sys: amd64/include i386/i386 i386/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: Mon, 25 Oct 2010 15:28:04 -0000 Author: jhb Date: Mon Oct 25 15:28:03 2010 New Revision: 214346 URL: http://svn.freebsd.org/changeset/base/214346 Log: Use intr_disable() and intr_restore() instead of frobbing the flags register directly to disable interrupts. Reviewed by: bde (earlier version) MFC after: 2 weeks Modified: head/sys/amd64/include/profile.h head/sys/i386/i386/elan-mmcr.c head/sys/i386/i386/identcpu.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/longrun.c head/sys/i386/include/profile.h Modified: head/sys/amd64/include/profile.h ============================================================================== --- head/sys/amd64/include/profile.h Mon Oct 25 15:17:31 2010 (r214345) +++ head/sys/amd64/include/profile.h Mon Oct 25 15:28:03 2010 (r214346) @@ -77,17 +77,17 @@ #error this file needs to be ported to your compiler #endif /* !__GNUCLIKE_ASM */ #else /* !GUPROF */ -#define MCOUNT_DECL(s) u_long s; +#define MCOUNT_DECL(s) register_t s; #ifdef SMP extern int mcount_lock; -#define MCOUNT_ENTER(s) { s = read_rflags(); disable_intr(); \ +#define MCOUNT_ENTER(s) { s = intr_disable(); \ while (!atomic_cmpset_acq_int(&mcount_lock, 0, 1)) \ /* nothing */ ; } #define MCOUNT_EXIT(s) { atomic_store_rel_int(&mcount_lock, 0); \ - write_rflags(s); } + intr_restore(s); } #else -#define MCOUNT_ENTER(s) { s = read_rflags(); disable_intr(); } -#define MCOUNT_EXIT(s) (write_rflags(s)) +#define MCOUNT_ENTER(s) { s = intr_disable(); } +#define MCOUNT_EXIT(s) (intr_restore(s)) #endif #endif /* GUPROF */ Modified: head/sys/i386/i386/elan-mmcr.c ============================================================================== --- head/sys/i386/i386/elan-mmcr.c Mon Oct 25 15:17:31 2010 (r214345) +++ head/sys/i386/i386/elan-mmcr.c Mon Oct 25 15:28:03 2010 (r214346) @@ -228,19 +228,18 @@ elan_poll_pps(struct timecounter *tc) static int state; int i; uint16_t u, x, y, z; - u_long eflags; + register_t saveintr; /* * Grab the HW state as quickly and compactly as we can. Disable * interrupts to avoid measuring our interrupt service time on * hw with quality clock sources. */ - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); x = *pps_ap[0]; /* state, must be first, see below */ y = *pps_ap[1]; /* timer2 */ z = *pps_ap[2]; /* timer1 */ - write_eflags(eflags); + intr_restore(saveintr); /* * Order is important here. We need to check the state of the GPIO Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Mon Oct 25 15:17:31 2010 (r214345) +++ head/sys/i386/i386/identcpu.c Mon Oct 25 15:28:03 2010 (r214346) @@ -1037,12 +1037,11 @@ identblue(void) static void identifycyrix(void) { - u_int eflags; + register_t saveintr; int ccr2_test = 0, dir_test = 0; u_char ccr2, ccr3; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); ccr2 = read_cyrix_reg(CCR2); write_cyrix_reg(CCR2, ccr2 ^ CCR2_LOCK_NW); @@ -1067,7 +1066,7 @@ identifycyrix(void) else cyrix_did = 0x00ff; /* Old 486SLC/DLC and TI486SXLC/SXL */ - write_eflags(eflags); + intr_restore(saveintr); } /* Update TSC freq with the value indicated by the caller. */ Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Oct 25 15:17:31 2010 (r214345) +++ head/sys/i386/i386/initcpu.c Mon Oct 25 15:28:03 2010 (r214346) @@ -116,14 +116,13 @@ u_int cpu_mxcsr_mask; /* valid bits in static void init_bluelightning(void) { - u_long eflags; + register_t saveintr; #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) need_post_dma_flush = 1; #endif - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); invd(); @@ -144,7 +143,7 @@ init_bluelightning(void) /* Enable caching in CR0. */ load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); /* CD = 0 and NW = 0 */ invd(); - write_eflags(eflags); + intr_restore(saveintr); } /* @@ -153,11 +152,10 @@ init_bluelightning(void) static void init_486dlc(void) { - u_long eflags; + register_t saveintr; u_char ccr0; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); invd(); ccr0 = read_cyrix_reg(CCR0); @@ -189,7 +187,7 @@ init_486dlc(void) load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); /* CD = 0 and NW = 0 */ invd(); #endif /* !CYRIX_CACHE_WORKS */ - write_eflags(eflags); + intr_restore(saveintr); } @@ -199,11 +197,10 @@ init_486dlc(void) static void init_cy486dx(void) { - u_long eflags; + register_t saveintr; u_char ccr2; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); invd(); ccr2 = read_cyrix_reg(CCR2); @@ -220,7 +217,7 @@ init_cy486dx(void) #endif write_cyrix_reg(CCR2, ccr2); - write_eflags(eflags); + intr_restore(saveintr); } @@ -230,11 +227,10 @@ init_cy486dx(void) static void init_5x86(void) { - u_long eflags; + register_t saveintr; u_char ccr2, ccr3, ccr4, pcr0; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); wbinvd(); @@ -320,29 +316,28 @@ init_5x86(void) /* Lock NW bit in CR0. */ write_cyrix_reg(CCR2, read_cyrix_reg(CCR2) | CCR2_LOCK_NW); - write_eflags(eflags); + intr_restore(saveintr); } #ifdef CPU_I486_ON_386 /* * There are i486 based upgrade products for i386 machines. - * In this case, BIOS doesn't enables CPU cache. + * In this case, BIOS doesn't enable CPU cache. */ static void init_i486_on_386(void) { - u_long eflags; + register_t saveintr; #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) need_post_dma_flush = 1; #endif - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); /* CD = 0, NW = 0 */ - write_eflags(eflags); + intr_restore(saveintr); } #endif @@ -354,11 +349,10 @@ init_i486_on_386(void) static void init_6x86(void) { - u_long eflags; + register_t saveintr; u_char ccr3, ccr4; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); wbinvd(); @@ -422,7 +416,7 @@ init_6x86(void) /* Lock NW bit in CR0. */ write_cyrix_reg(CCR2, read_cyrix_reg(CCR2) | CCR2_LOCK_NW); - write_eflags(eflags); + intr_restore(saveintr); } #endif /* I486_CPU */ @@ -435,11 +429,10 @@ init_6x86(void) static void init_6x86MX(void) { - u_long eflags; + register_t saveintr; u_char ccr3, ccr4; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); wbinvd(); @@ -489,7 +482,7 @@ init_6x86MX(void) /* Lock NW bit in CR0. */ write_cyrix_reg(CCR2, read_cyrix_reg(CCR2) | CCR2_LOCK_NW); - write_eflags(eflags); + intr_restore(saveintr); } static void @@ -513,11 +506,10 @@ static void init_mendocino(void) { #ifdef CPU_PPRO2CELERON - u_long eflags; + register_t saveintr; u_int64_t bbl_cr_ctl3; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); wbinvd(); @@ -541,7 +533,7 @@ init_mendocino(void) } load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); - write_eflags(eflags); + intr_restore(saveintr); #endif /* CPU_PPRO2CELERON */ } @@ -842,10 +834,9 @@ enable_K6_wt_alloc(void) { quad_t size; u_int64_t whcr; - u_long eflags; + register_t saveintr; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); wbinvd(); #ifdef CPU_DISABLE_CACHE @@ -895,7 +886,7 @@ enable_K6_wt_alloc(void) #endif wrmsr(0x0c0000082, whcr); - write_eflags(eflags); + intr_restore(saveintr); } void @@ -903,10 +894,9 @@ enable_K6_2_wt_alloc(void) { quad_t size; u_int64_t whcr; - u_long eflags; + register_t saveintr; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); wbinvd(); #ifdef CPU_DISABLE_CACHE @@ -956,7 +946,7 @@ enable_K6_2_wt_alloc(void) #endif wrmsr(0x0c0000082, whcr); - write_eflags(eflags); + intr_restore(saveintr); } #endif /* I585_CPU && CPU_WT_ALLOC */ @@ -966,15 +956,14 @@ enable_K6_2_wt_alloc(void) DB_SHOW_COMMAND(cyrixreg, cyrixreg) { - u_long eflags; + register_t saveintr; u_int cr0; u_char ccr1, ccr2, ccr3; u_char ccr0 = 0, ccr4 = 0, ccr5 = 0, pcr0 = 0; cr0 = rcr0(); if (cpu_vendor_id == CPU_VENDOR_CYRIX) { - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); if ((cpu != CPU_M1SC) && (cpu != CPU_CY486DX)) { @@ -992,7 +981,7 @@ DB_SHOW_COMMAND(cyrixreg, cyrixreg) pcr0 = read_cyrix_reg(PCR0); write_cyrix_reg(CCR3, ccr3); /* Restore CCR3. */ } - write_eflags(eflags); + intr_restore(saveintr); if ((cpu != CPU_M1SC) && (cpu != CPU_CY486DX)) printf("CCR0=%x, ", (u_int)ccr0); Modified: head/sys/i386/i386/longrun.c ============================================================================== --- head/sys/i386/i386/longrun.c Mon Oct 25 15:17:31 2010 (r214345) +++ head/sys/i386/i386/longrun.c Mon Oct 25 15:28:03 2010 (r214346) @@ -84,12 +84,11 @@ static u_int32_t longrun_modes[LONGRUN_M static u_int tmx86_get_longrun_mode(void) { - u_long eflags; + register_t saveintr; union msrinfo msrinfo; u_int low, high, flags, mode; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); msrinfo.msr = rdmsr(MSR_TMx86_LONGRUN); low = LONGRUN_MODE_MASK(msrinfo.regs[0]); @@ -105,40 +104,38 @@ tmx86_get_longrun_mode(void) } mode = LONGRUN_MODE_UNKNOWN; out: - write_eflags(eflags); + intr_restore(saveintr); return (mode); } static u_int tmx86_get_longrun_status(u_int * frequency, u_int * voltage, u_int * percentage) { - u_long eflags; + register_t saveintr; u_int regs[4]; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); do_cpuid(0x80860007, regs); *frequency = regs[0]; *voltage = regs[1]; *percentage = regs[2]; - write_eflags(eflags); + intr_restore(saveintr); return (1); } static u_int tmx86_set_longrun_mode(u_int mode) { - u_long eflags; + register_t saveintr; union msrinfo msrinfo; if (mode >= LONGRUN_MODE_UNKNOWN) { return (0); } - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); /* Write LongRun mode values to Model Specific Register. */ msrinfo.msr = rdmsr(MSR_TMx86_LONGRUN); @@ -153,7 +150,7 @@ tmx86_set_longrun_mode(u_int mode) msrinfo.regs[0] = (msrinfo.regs[0] & ~0x01) | longrun_modes[mode][2]; wrmsr(MSR_TMx86_LONGRUN_FLAGS, msrinfo.msr); - write_eflags(eflags); + intr_restore(saveintr); return (1); } Modified: head/sys/i386/include/profile.h ============================================================================== --- head/sys/i386/include/profile.h Mon Oct 25 15:17:31 2010 (r214345) +++ head/sys/i386/include/profile.h Mon Oct 25 15:28:03 2010 (r214346) @@ -77,17 +77,17 @@ #error #endif /* !__GNUCLIKE_ASM */ #else /* !GUPROF */ -#define MCOUNT_DECL(s) u_long s; +#define MCOUNT_DECL(s) register_t s; #ifdef SMP extern int mcount_lock; -#define MCOUNT_ENTER(s) { s = read_eflags(); disable_intr(); \ +#define MCOUNT_ENTER(s) { s = intr_disable(); \ while (!atomic_cmpset_acq_int(&mcount_lock, 0, 1)) \ /* nothing */ ; } #define MCOUNT_EXIT(s) { atomic_store_rel_int(&mcount_lock, 0); \ - write_eflags(s); } + intr_restore(s); } #else -#define MCOUNT_ENTER(s) { s = read_eflags(); disable_intr(); } -#define MCOUNT_EXIT(s) (write_eflags(s)) +#define MCOUNT_ENTER(s) { s = intr_disable(); } +#define MCOUNT_EXIT(s) (intr_restore(s)) #endif #endif /* GUPROF */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 15:31: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 5AF05106564A; Mon, 25 Oct 2010 15:31:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 485258FC08; Mon, 25 Oct 2010 15:31: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 o9PFVEKU069521; Mon, 25 Oct 2010 15:31:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PFVEDj069515; Mon, 25 Oct 2010 15:31:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010251531.o9PFVEDj069515@svn.freebsd.org> From: John Baldwin Date: Mon, 25 Oct 2010 15:31: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: r214347 - in head/sys: amd64/amd64 i386/i386 i386/isa 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: Mon, 25 Oct 2010 15:31:14 -0000 Author: jhb Date: Mon Oct 25 15:31:13 2010 New Revision: 214347 URL: http://svn.freebsd.org/changeset/base/214347 Log: Use 'saveintr' instead of 'savecrit' or 'eflags' to hold the state returned by intr_disable(). Requested by: bde Modified: head/sys/amd64/amd64/fpu.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/perfmon.c head/sys/i386/isa/npx.c head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Mon Oct 25 15:28:03 2010 (r214346) +++ head/sys/amd64/amd64/fpu.c Mon Oct 25 15:31:13 2010 (r214347) @@ -113,14 +113,14 @@ static struct savefpu fpu_initialstate; void fpuinit(void) { - register_t savecrit; + register_t saveintr; u_int mxcsr; u_short control; /* * It is too early for critical_enter() to work on AP. */ - savecrit = intr_disable(); + saveintr = intr_disable(); stop_emulating(); fninit(); control = __INITIAL_FPUCW__; @@ -137,7 +137,7 @@ fpuinit(void) bzero(fpu_initialstate.sv_xmm, sizeof(fpu_initialstate.sv_xmm)); } start_emulating(); - intr_restore(savecrit); + intr_restore(saveintr); } /* Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Oct 25 15:28:03 2010 (r214346) +++ head/sys/i386/i386/initcpu.c Mon Oct 25 15:31:13 2010 (r214347) @@ -787,14 +787,14 @@ void enable_K5_wt_alloc(void) { u_int64_t msr; - register_t savecrit; + register_t saveintr; /* * Write allocate is supported only on models 1, 2, and 3, with * a stepping of 4 or greater. */ if (((cpu_id & 0xf0) > 0) && ((cpu_id & 0x0f) > 3)) { - savecrit = intr_disable(); + saveintr = intr_disable(); msr = rdmsr(0x83); /* HWCR */ wrmsr(0x83, msr & !(0x10)); @@ -825,7 +825,7 @@ enable_K5_wt_alloc(void) msr=rdmsr(0x83); wrmsr(0x83, msr|0x10); /* enable write allocate */ - intr_restore(savecrit); + intr_restore(saveintr); } } Modified: head/sys/i386/i386/perfmon.c ============================================================================== --- head/sys/i386/i386/perfmon.c Mon Oct 25 15:28:03 2010 (r214346) +++ head/sys/i386/i386/perfmon.c Mon Oct 25 15:31:13 2010 (r214347) @@ -128,18 +128,18 @@ perfmon_avail(void) int perfmon_setup(int pmc, unsigned int control) { - register_t savecrit; + register_t saveintr; if (pmc < 0 || pmc >= NPMC) return EINVAL; perfmon_inuse |= (1 << pmc); control &= ~(PMCF_SYS_FLAGS << 16); - savecrit = intr_disable(); + saveintr = intr_disable(); ctl_shadow[pmc] = control; writectl(pmc); wrmsr(msr_pmc[pmc], pmc_shadow[pmc] = 0); - intr_restore(savecrit); + intr_restore(saveintr); return 0; } @@ -174,17 +174,17 @@ perfmon_fini(int pmc) int perfmon_start(int pmc) { - register_t savecrit; + register_t saveintr; if (pmc < 0 || pmc >= NPMC) return EINVAL; if (perfmon_inuse & (1 << pmc)) { - savecrit = intr_disable(); + saveintr = intr_disable(); ctl_shadow[pmc] |= (PMCF_EN << 16); wrmsr(msr_pmc[pmc], pmc_shadow[pmc]); writectl(pmc); - intr_restore(savecrit); + intr_restore(saveintr); return 0; } return EBUSY; @@ -193,17 +193,17 @@ perfmon_start(int pmc) int perfmon_stop(int pmc) { - register_t savecrit; + register_t saveintr; if (pmc < 0 || pmc >= NPMC) return EINVAL; if (perfmon_inuse & (1 << pmc)) { - savecrit = intr_disable(); + saveintr = intr_disable(); pmc_shadow[pmc] = rdmsr(msr_pmc[pmc]) & 0xffffffffffULL; ctl_shadow[pmc] &= ~(PMCF_EN << 16); writectl(pmc); - intr_restore(savecrit); + intr_restore(saveintr); return 0; } return EBUSY; Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Mon Oct 25 15:28:03 2010 (r214346) +++ head/sys/i386/isa/npx.c Mon Oct 25 15:31:13 2010 (r214347) @@ -343,7 +343,7 @@ void npxinit(void) { static union savefpu dummy; - register_t savecrit; + register_t saveintr; u_short control; if (!hw_float) @@ -355,7 +355,7 @@ npxinit(void) * * It is too early for critical_enter() to work on AP. */ - savecrit = intr_disable(); + saveintr = intr_disable(); npxsave(&dummy); stop_emulating(); #ifdef CPU_ENABLE_SSE @@ -366,7 +366,7 @@ npxinit(void) control = __INITIAL_NPXCW__; fldcw(control); start_emulating(); - intr_restore(savecrit); + intr_restore(saveintr); } /* Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Oct 25 15:28:03 2010 (r214346) +++ head/sys/x86/x86/local_apic.c Mon Oct 25 15:31:13 2010 (r214347) @@ -341,12 +341,12 @@ lapic_setup(int boot) { struct lapic *la; u_int32_t maxlvt; - register_t eflags; + register_t saveintr; char buf[MAXCOMLEN + 1]; la = &lapics[lapic_id()]; KASSERT(la->la_present, ("missing APIC structure")); - eflags = intr_disable(); + saveintr = intr_disable(); maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; /* Initialize the TPR to allow all interrupts. */ @@ -393,7 +393,7 @@ lapic_setup(int boot) if (maxlvt >= LVT_CMCI) lapic->lvt_cmci = lvt_mode(la, LVT_CMCI, lapic->lvt_cmci); - intr_restore(eflags); + intr_restore(saveintr); } void @@ -1415,7 +1415,7 @@ lapic_ipi_wait(int delay) void lapic_ipi_raw(register_t icrlo, u_int dest) { - register_t value, eflags; + register_t value, saveintr; /* XXX: Need more sanity checking of icrlo? */ KASSERT(lapic != NULL, ("%s called too early", __func__)); @@ -1425,7 +1425,7 @@ lapic_ipi_raw(register_t icrlo, u_int de ("%s: reserved bits set in ICR LO register", __func__)); /* Set destination in ICR HI register if it is being used. */ - eflags = intr_disable(); + saveintr = intr_disable(); if ((icrlo & APIC_DEST_MASK) == APIC_DEST_DESTFLD) { value = lapic->icr_hi; value &= ~APIC_ID_MASK; @@ -1438,7 +1438,7 @@ lapic_ipi_raw(register_t icrlo, u_int de value &= APIC_ICRLO_RESV_MASK; value |= icrlo; lapic->icr_lo = value; - intr_restore(eflags); + intr_restore(saveintr); } #define BEFORE_SPIN 1000000 From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 15:41: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 81EA1106566C; Mon, 25 Oct 2010 15:41:12 +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 703278FC0C; Mon, 25 Oct 2010 15:41: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 o9PFfC8W069766; Mon, 25 Oct 2010 15:41:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PFfCDI069764; Mon, 25 Oct 2010 15:41:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010251541.o9PFfCDI069764@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 25 Oct 2010 15:41: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: r214348 - head/sys/powerpc/mambo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 15:41:12 -0000 Author: nwhitehorn Date: Mon Oct 25 15:41:12 2010 New Revision: 214348 URL: http://svn.freebsd.org/changeset/base/214348 Log: Don't create spurious /dev entries. Submitted by: andreast Modified: head/sys/powerpc/mambo/mambo_console.c Modified: head/sys/powerpc/mambo/mambo_console.c ============================================================================== --- head/sys/powerpc/mambo/mambo_console.c Mon Oct 25 15:31:13 2010 (r214347) +++ head/sys/powerpc/mambo/mambo_console.c Mon Oct 25 15:41:12 2010 (r214348) @@ -86,7 +86,6 @@ cn_drvinit(void *unused) tp = tty_alloc(&mambo_ttydevsw, NULL); tty_init_console(tp, 0); tty_makedev(tp, NULL, "%s", "mambocons"); - tty_makealias(tp, "mambocons"); polltime = 1; From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 15:51: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 2EF071065675; Mon, 25 Oct 2010 15:51:44 +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 025C08FC2B; Mon, 25 Oct 2010 15:51: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 o9PFph9V070088; Mon, 25 Oct 2010 15:51:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PFphYS070084; Mon, 25 Oct 2010 15:51:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010251551.o9PFphYS070084@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 25 Oct 2010 15:51: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: r214349 - in head/sys/dev: pci usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 15:51:44 -0000 Author: nwhitehorn Date: Mon Oct 25 15:51:43 2010 New Revision: 214349 URL: http://svn.freebsd.org/changeset/base/214349 Log: The EHCI_CAPLENGTH and EHCI_HCIVERSION registers are actually sub-registers within the first 4 bytes of the EHCI memory space. For controllers that use big-endian MMIO, reading them with 1- and 2-byte reads would then return the wrong values. Instead, read the combined register with a 4-byte read and mask out the interesting quantities. Modified: head/sys/dev/pci/pci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehcireg.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Oct 25 15:41:12 2010 (r214348) +++ head/sys/dev/pci/pci.c Mon Oct 25 15:51:43 2010 (r214349) @@ -2803,7 +2803,7 @@ ehci_early_takeover(device_t self) "SMM does not respond\n"); } /* Disable interrupts */ - offs = bus_read_1(res, EHCI_CAPLENGTH); + offs = EHCI_CAPLENGTH(bus_read_4(res, EHCI_CAPLEN_HCIVERSION)); bus_write_4(res, offs + EHCI_USBINTR, 0); } bus_release_resource(self, SYS_RES_MEMORY, rid, res); Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon Oct 25 15:41:12 2010 (r214348) +++ head/sys/dev/usb/controller/ehci.c Mon Oct 25 15:51:43 2010 (r214349) @@ -270,9 +270,9 @@ ehci_init(ehci_softc_t *sc) } #endif - sc->sc_offs = EREAD1(sc, EHCI_CAPLENGTH); + sc->sc_offs = EHCI_CAPLENGTH(EREAD4(sc, EHCI_CAPLEN_HCIVERSION)); - version = EREAD2(sc, EHCI_HCIVERSION); + version = EHCI_HCIVERSION(EREAD4(sc, EHCI_CAPLEN_HCIVERSION)); device_printf(sc->sc_bus.bdev, "EHCI version %x.%x\n", version >> 8, version & 0xff); Modified: head/sys/dev/usb/controller/ehcireg.h ============================================================================== --- head/sys/dev/usb/controller/ehcireg.h Mon Oct 25 15:41:12 2010 (r214348) +++ head/sys/dev/usb/controller/ehcireg.h Mon Oct 25 15:51:43 2010 (r214349) @@ -54,9 +54,13 @@ #define EHCI_LEGSUP_USBLEGCTLSTS 0x04 /* EHCI capability registers */ -#define EHCI_CAPLENGTH 0x00 /* RO Capability register length field */ -#define EHCI_RESERVED 0x01 /* Reserved register */ -#define EHCI_HCIVERSION 0x02 /* RO Interface version number */ +#define EHCI_CAPLEN_HCIVERSION 0x00 /* RO Capability register length + * (least-significant byte) and + * interface version number (two + * most significant) + */ +#define EHCI_CAPLENGTH(x) ((x) & 0xff) +#define EHCI_HCIVERSION(x) (((x) >> 16) & 0xffff) #define EHCI_HCSPARAMS 0x04 /* RO Structural parameters */ #define EHCI_HCS_DEBUGPORT(x) (((x) >> 20) & 0xf) #define EHCI_HCS_P_INDICATOR(x) ((x) & 0x10000) From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 16:11: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 6835A1065672; Mon, 25 Oct 2010 16:11:37 +0000 (UTC) (envelope-from thomas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56C358FC1D; Mon, 25 Oct 2010 16:11: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 o9PGBb5p070664; Mon, 25 Oct 2010 16:11:37 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PGBb60070662; Mon, 25 Oct 2010 16:11:37 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201010251611.o9PGBb60070662@svn.freebsd.org> From: Thomas Quinot Date: Mon, 25 Oct 2010 16:11: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: r214351 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 16:11:37 -0000 Author: thomas Date: Mon Oct 25 16:11:37 2010 New Revision: 214351 URL: http://svn.freebsd.org/changeset/base/214351 Log: Fix typo in comment. Modified: head/sys/netipsec/ipsec_input.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Mon Oct 25 15:58:31 2010 (r214350) +++ head/sys/netipsec/ipsec_input.c Mon Oct 25 16:11:37 2010 (r214351) @@ -108,7 +108,7 @@ static void ipsec4_common_ctlinput(int, /* * ipsec_common_input gets called when an IPsec-protected packet - * is received by IPv4 or IPv6. It's job is to find the right SA + * is received by IPv4 or IPv6. Its job is to find the right SA * and call the appropriate transform. The transform callback * takes care of further processing (like ingress filtering). */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 16:23: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 6C1B71065675; Mon, 25 Oct 2010 16:23:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58A188FC13; Mon, 25 Oct 2010 16:23: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 o9PGNZiM070933; Mon, 25 Oct 2010 16:23:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PGNZ3V070926; Mon, 25 Oct 2010 16:23:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201010251623.o9PGNZ3V070926@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 25 Oct 2010 16:23: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: r214352 - in head: sbin/geom/class/part 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, 25 Oct 2010 16:23:35 -0000 Author: ae Date: Mon Oct 25 16:23:35 2010 New Revision: 214352 URL: http://svn.freebsd.org/changeset/base/214352 Log: Reimplemented "gpart destroy -F". Now it does all work in kernel. This was needed for recover implementation. Implement the recover command for GPT. Now GPT will marked as corrupt when any of three types of corruption will be detected: 1. Damaged primary GPT header or table 2. Damaged secondary GPT header or table 3. Secondary header is not located in the last LBA Marked GPT becomes read-only. Any changes with corrupt table are prohibited. Only "destroy" and "recover" commands are allowed. Discussed with: geom@ (mostly silence) Tested by: Ilya A. Arhipov Approved by: mav (mentor) MFC after: 2 weeks Modified: head/sbin/geom/class/part/geom_part.c head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_if.m Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Oct 25 16:11:37 2010 (r214351) +++ head/sbin/geom/class/part/geom_part.c Mon Oct 25 16:23:35 2010 (r214352) @@ -67,7 +67,6 @@ static char ssize[32]; #define GPART_PARAM_BOOTCODE "bootcode" #define GPART_PARAM_INDEX "index" #define GPART_PARAM_PARTCODE "partcode" -#define GPART_PARAM_FORCE "force" static struct gclass *find_class(struct gmesh *, const char *); static struct ggeom * find_geom(struct gclass *, const char *); @@ -85,7 +84,6 @@ static void gpart_show_geom(struct ggeom 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 *); -static void gpart_destroy(struct gctl_req *, unsigned int); static void gpart_print_error(const char *); struct g_command PUBSYM(class_commands)[] = { @@ -123,8 +121,8 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "-i index [-f flags] geom" }, - { "destroy", 0, gpart_destroy, { - { 'F', GPART_PARAM_FORCE, NULL, G_TYPE_BOOL }, + { "destroy", 0, gpart_issue, { + { 'F', "force", NULL, G_TYPE_BOOL }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "[-F] [-f flags] geom" @@ -167,6 +165,11 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "[-s size] -i index [-f flags] geom" }, + { "recover", 0, gpart_issue, { + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, + G_OPT_SENTINEL }, + "[-f flags] geom" + }, G_CMD_SENTINEL }; @@ -539,13 +542,17 @@ gpart_show_geom(struct ggeom *gp, const s = find_geomcfg(gp, "last"); last = (off_t)strtoimax(s, NULL, 0); wblocks = strlen(s); + s = find_geomcfg(gp, "state"); + if (s != NULL && *s != 'C') + s = NULL; wname = strlen(gp->lg_name); pp = LIST_FIRST(&gp->lg_consumer)->lg_provider; secsz = pp->lg_sectorsize; - printf("=>%*jd %*jd %*s %s (%s)\n", + printf("=>%*jd %*jd %*s %s (%s)%s\n", wblocks, (intmax_t)first, wblocks, (intmax_t)(last - first + 1), wname, gp->lg_name, - scheme, fmtsize(pp->lg_mediasize)); + scheme, fmtsize(pp->lg_mediasize), + s ? " [CORRUPT]": ""); while ((pp = find_provider(gp, first)) != NULL) { s = find_provcfg(pp, "start"); @@ -858,83 +865,6 @@ gpart_bootcode(struct gctl_req *req, uns } static void -gpart_destroy(struct gctl_req *req, unsigned int fl) -{ - struct gmesh mesh; - struct gclass *classp; - struct gctl_req *req2; - struct ggeom *gp; - struct gprovider *pp; - const char *s; - int error, val; - intmax_t idx; - - if (gctl_has_param(req, GPART_PARAM_FORCE)) { - val = gctl_get_int(req, GPART_PARAM_FORCE); - error = gctl_delete_param(req, GPART_PARAM_FORCE); - if (error) - errc(EXIT_FAILURE, error, "internal error"); - if (val == 0) - goto done; - 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, "arg0"); - if (s == NULL) - abort(); - gp = find_geom(classp, s); - if (gp == NULL) - errx(EXIT_FAILURE, "No such geom: %s.", s); - val = 0; - LIST_FOREACH(pp, &gp->lg_provider, lg_provider){ - s = find_provcfg(pp, "index"); - if (s == NULL) - errx(EXIT_FAILURE, "Index not found for %s.", - pp->lg_name); - idx = strtoimax(s, NULL, 0); - req2 = gctl_get_handle(); - gctl_ro_param(req2, "class", -1, classp->lg_name); - gctl_ro_param(req2, "arg0", -1, gp->lg_name); - gctl_ro_param(req2, "verb", -1, "delete"); - gctl_ro_param(req2, GPART_PARAM_INDEX, - sizeof(intmax_t), &idx); - gctl_ro_param(req2, "flags", -1, "X"); - s = gctl_issue(req2); - if (s != NULL && s[0] != '\0') { - gpart_print_error(s); - gctl_free(req2); - if (val) { /* try to undo changes */ - req2 = gctl_get_handle(); - gctl_ro_param(req2, "verb", -1, - "undo"); - gctl_ro_param(req2, "class", -1, - classp->lg_name); - gctl_ro_param(req2, "arg0", -1, - gp->lg_name); - gctl_issue(req2); - gctl_free(req2); - } - geom_deletetree(&mesh); - exit(EXIT_FAILURE); - } - gctl_free(req2); - val = 1; - } - geom_deletetree(&mesh); - } -done: - gpart_issue(req, fl); -} - -static void gpart_print_error(const char *errstr) { char *errmsg; Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Mon Oct 25 16:11:37 2010 (r214351) +++ head/sbin/geom/class/part/gpart.8 Mon Oct 25 16:23:35 2010 (r214352) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2010 +.Dd October 25, 2010 .Dt GPART 8 .Os .Sh NAME @@ -129,6 +129,11 @@ utility: .Op Fl t Ar type .Op Fl f Ar flags .Ar geom +.\" ==== RECOVER ==== +.Nm +.Cm recover +.Op Fl f Ar flags +.Ar geom .\" ==== RESIZE ==== .Nm .Cm resize @@ -353,6 +358,23 @@ See the section entitled below for a discussion about its use. .El +.\" ==== RECOVER ==== +.It Cm recover +Recover corrupt partition's scheme metadata on the geom +.Ar geom . +See the section entitled +.Sx "RECOVERING" +below for the additional information. +.Pp +Additional options include: +.Bl -tag -width 10n +.It Fl f Ar flags +Additional operational flags. +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion +about its use. +.El .\" ==== RESIZE ==== .It Cm resize Resize a partition from geom @@ -629,6 +651,68 @@ the action or reverted with the .Cm undo action. +.Sh RECOVERING +The GEOM class PART supports recovering of partition tables only for GPT. +The GUID partition table has a primary and secondary (backup) copy of +metadata for redundance. They are stored in the begining and in the end +of device respectively. Therefore it is acceptable to have some corruptions +in the metadata that are not fatal to work with GPT. When kernel detects +corrupt metadata it marks this table as corrupt and reports about corruption. +Any changes in corrupt table are prohibited except +.Cm destroy +and +.Cm recover . +.Pp +In case when only first sector is corrupt kernel can not detect GPT even +if partition table is not corrupt. You can write protective MBR with +.Xr dd 1 +command to restore ability of GPT detection. The copy of protective MBR is +usually located in the +.Pa /boot/pmbr +file. +.Pp +In case when some of metadata is corrupt you will get to know about this +from kernel's messages like these: +.Bd -literal -offset indent +GEOM: provider: the primary GPT table is corrupt or invalid. +GEOM: provider: using the secondary instead -- recovery strongly advised. +.Ed +.Pp +or +.Bd -literal -offset indent +GEOM: provider: the secondary GPT table is corrupt or invalid. +GEOM: provider: using the primary only -- recovery suggested. +.Ed +.Pp +Also +.Cm gpart +commands like +.Cm show , +.Cm status +and +.Cm list +will report about corrupt table. +.Pp +In case when the size of device has changed (e.g. volume expansion) the +secondary GPT header will become located not in the last sector. This is +not a metadata corruption, but it is dangerous because any corruption of +the primary GPT will lead to lost of partition table. Kernel reports about +this problem with message: +.Bd -literal -offset indent +GEOM: provider: the secondary GPT header is not in the last LBA. +.Ed +.Pp +A corrupt table can be recovered with +.Cm gpart recover +command. This command does reconstruction of corrupt metadata using +known valid metadata. Also it can relocate secondary GPT to the end of +device. +.Pp +.Pa NOTE : +The GEOM class PART can detect the same partition table on different GEOM +providers and some of them will marked as corrupt. Be careful when choising +a provider for recovering. If you did incorrect choise you can destroy +metadata of another GEOM class, e.g. GEOM MIRROR or GEOM LABEL. .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES @@ -687,6 +771,7 @@ After having created all required partit /sbin/gpart bootcode -p /boot/boot1 da0 .Ed .Sh SEE ALSO +.Xr dd 1 , .Xr geom 4 , .Xr geom 8 .Sh HISTORY Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Mon Oct 25 16:11:37 2010 (r214351) +++ head/sys/geom/part/g_part.c Mon Oct 25 16:23:35 2010 (r214352) @@ -924,7 +924,7 @@ g_part_ctl_destroy(struct gctl_req *req, struct g_consumer *cp; struct g_geom *gp; struct g_provider *pp; - struct g_part_entry *entry; + struct g_part_entry *entry, *tmp; struct g_part_table *null, *table; struct sbuf *sb; int error; @@ -934,13 +934,34 @@ g_part_ctl_destroy(struct gctl_req *req, g_topology_assert(); table = gp->softc; + /* Check for busy providers. */ LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { if (entry->gpe_deleted || entry->gpe_internal) continue; + if (gpp->gpp_force) { + pp = entry->gpe_pp; + if (pp == NULL) + continue; + if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) + continue; + } gctl_error(req, "%d", EBUSY); return (EBUSY); } + if (gpp->gpp_force) { + /* Destroy all providers. */ + LIST_FOREACH_SAFE(entry, &table->gpt_entry, gpe_entry, tmp) { + pp = entry->gpe_pp; + if (pp != NULL) { + pp->private = NULL; + g_wither_provider(pp, ENXIO); + } + LIST_REMOVE(entry, gpe_entry); + g_free(entry); + } + } + error = G_PART_DESTROY(table, gpp); if (error) { gctl_error(req, "%d", error); @@ -1037,8 +1058,39 @@ g_part_ctl_move(struct gctl_req *req, st static int g_part_ctl_recover(struct gctl_req *req, struct g_part_parms *gpp) { - gctl_error(req, "%d verb 'recover'", ENOSYS); - return (ENOSYS); + struct g_part_table *table; + struct g_geom *gp; + struct sbuf *sb; + int error, recovered; + + gp = gpp->gpp_geom; + G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, gp->name)); + g_topology_assert(); + table = gp->softc; + error = recovered = 0; + + if (table->gpt_corrupt) { + error = G_PART_RECOVER(table); + if (error) { + gctl_error(req, "%d recovering '%s' failed", + error, gp->name); + return (error); + } + recovered = 1; + } + /* Provide feedback if so requested. */ + if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { + sb = sbuf_new_auto(); + if (recovered) + sbuf_printf(sb, "%s recovered\n", gp->name); + else + sbuf_printf(sb, "%s recovering is not needed\n", + gp->name); + sbuf_finish(sb); + gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); + sbuf_delete(sb); + } + return (0); } static int @@ -1341,6 +1393,7 @@ g_part_ctlreq(struct gctl_req *req, stru } else if (!strcmp(verb, "destroy")) { ctlreq = G_PART_CTL_DESTROY; mparms |= G_PART_PARM_GEOM; + oparms |= G_PART_PARM_FORCE; } break; case 'm': @@ -1415,6 +1468,8 @@ g_part_ctlreq(struct gctl_req *req, stru case 'f': if (!strcmp(ap->name, "flags")) parm = G_PART_PARM_FLAGS; + else if (!strcmp(ap->name, "force")) + parm = G_PART_PARM_FORCE; break; case 'i': if (!strcmp(ap->name, "index")) @@ -1453,7 +1508,8 @@ g_part_ctlreq(struct gctl_req *req, stru } switch (parm) { case G_PART_PARM_ATTRIB: - error = g_part_parm_str(req, ap->name, &gpp.gpp_attrib); + error = g_part_parm_str(req, ap->name, + &gpp.gpp_attrib); break; case G_PART_PARM_BOOTCODE: error = g_part_parm_bootcode(req, ap->name, @@ -1466,11 +1522,16 @@ g_part_ctlreq(struct gctl_req *req, stru case G_PART_PARM_FLAGS: error = g_part_parm_str(req, ap->name, &gpp.gpp_flags); break; + case G_PART_PARM_FORCE: + error = g_part_parm_uint32(req, ap->name, + &gpp.gpp_force); + break; case G_PART_PARM_GEOM: error = g_part_parm_geom(req, ap->name, &gpp.gpp_geom); break; case G_PART_PARM_INDEX: - error = g_part_parm_intmax(req, ap->name, &gpp.gpp_index); + error = g_part_parm_intmax(req, ap->name, + &gpp.gpp_index); break; case G_PART_PARM_LABEL: error = g_part_parm_str(req, ap->name, &gpp.gpp_label); @@ -1490,7 +1551,8 @@ g_part_ctlreq(struct gctl_req *req, stru error = g_part_parm_quad(req, ap->name, &gpp.gpp_size); break; case G_PART_PARM_START: - error = g_part_parm_quad(req, ap->name, &gpp.gpp_start); + error = g_part_parm_quad(req, ap->name, + &gpp.gpp_start); break; case G_PART_PARM_TYPE: error = g_part_parm_str(req, ap->name, &gpp.gpp_type); @@ -1524,6 +1586,13 @@ g_part_ctlreq(struct gctl_req *req, stru table = NULL; if (modifies && (gpp.gpp_parms & G_PART_PARM_GEOM)) { table = gpp.gpp_geom->softc; + if (table != NULL && table->gpt_corrupt && + ctlreq != G_PART_CTL_DESTROY && + ctlreq != G_PART_CTL_RECOVER) { + gctl_error(req, "%d table '%s' is corrupt", + EPERM, gpp.gpp_geom->name); + return; + } if (table != NULL && !table->gpt_opened) { error = g_access(LIST_FIRST(&gpp.gpp_geom->consumer), 1, 1, 1); @@ -1789,6 +1858,8 @@ g_part_dumpconf(struct sbuf *sb, const c table->gpt_sectors); sbuf_printf(sb, "%s%u\n", indent, table->gpt_heads); + sbuf_printf(sb, "%s%s\n", indent, + table->gpt_corrupt ? "CORRUPT": "OK"); G_PART_DUMPCONF(table, NULL, sb, indent); } } Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Mon Oct 25 16:11:37 2010 (r214351) +++ head/sys/geom/part/g_part.h Mon Oct 25 16:23:35 2010 (r214352) @@ -132,6 +132,7 @@ struct g_part_table { int gpt_modified:1; /* Table changes have been made. */ int gpt_opened:1; /* Permissions obtained. */ int gpt_fixgeom:1; /* Geometry is fixed. */ + int gpt_corrupt:1; /* Table is corrupt. */ }; struct g_part_entry *g_part_new_entry(struct g_part_table *, int, quad_t, @@ -169,6 +170,7 @@ enum g_part_ctl { #define G_PART_PARM_VERSION 0x0800 #define G_PART_PARM_BOOTCODE 0x1000 #define G_PART_PARM_ATTRIB 0x2000 +#define G_PART_PARM_FORCE 0x4000 struct g_part_parms { unsigned int gpp_parms; @@ -186,6 +188,7 @@ struct g_part_parms { const void *gpp_codeptr; unsigned int gpp_codesize; const char *gpp_attrib; + unsigned int gpp_force; }; void g_part_geometry_heads(off_t, u_int, off_t *, u_int *); Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Mon Oct 25 16:11:37 2010 (r214351) +++ head/sys/geom/part/g_part_gpt.c Mon Oct 25 16:23:35 2010 (r214352) @@ -94,7 +94,7 @@ static int g_part_gpt_destroy(struct g_p static void g_part_gpt_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_gpt_dumpto(struct g_part_table *, struct g_part_entry *); -static int g_part_gpt_modify(struct g_part_table *, struct g_part_entry *, +static int g_part_gpt_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static const char *g_part_gpt_name(struct g_part_table *, struct g_part_entry *, char *, size_t); @@ -107,6 +107,7 @@ static const char *g_part_gpt_type(struc static int g_part_gpt_write(struct g_part_table *, struct g_consumer *); static int g_part_gpt_resize(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); +static int g_part_gpt_recover(struct g_part_table *); static kobj_method_t g_part_gpt_methods[] = { KOBJMETHOD(g_part_add, g_part_gpt_add), @@ -120,6 +121,7 @@ static kobj_method_t g_part_gpt_methods[ KOBJMETHOD(g_part_name, g_part_gpt_name), KOBJMETHOD(g_part_probe, g_part_gpt_probe), KOBJMETHOD(g_part_read, g_part_gpt_read), + KOBJMETHOD(g_part_recover, g_part_gpt_recover), KOBJMETHOD(g_part_setunset, g_part_gpt_setunset), KOBJMETHOD(g_part_type, g_part_gpt_type), KOBJMETHOD(g_part_write, g_part_gpt_write), @@ -170,7 +172,7 @@ static struct uuid gpt_uuid_unused = GPT static struct g_part_uuid_alias { struct uuid *uuid; - int alias; + int alias; } gpt_uuid_alias_match[] = { { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT }, { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS }, @@ -217,8 +219,16 @@ gpt_read_hdr(struct g_part_gpt_table *ta pp = cp->provider; last = (pp->mediasize / pp->sectorsize) - 1; - table->lba[elt] = (elt == GPT_ELT_PRIHDR) ? 1 : last; table->state[elt] = GPT_STATE_MISSING; + /* + * If the primary header is valid look for secondary + * header in AlternateLBA, otherwise in the last medium's LBA. + */ + if (elt == GPT_ELT_SECHDR) { + if (table->state[GPT_ELT_PRIHDR] != GPT_STATE_OK) + table->lba[elt] = last; + } else + table->lba[elt] = 1; buf = g_read_data(cp, table->lba[elt] * pp->sectorsize, pp->sectorsize, &error); if (buf == NULL) @@ -244,12 +254,15 @@ gpt_read_hdr(struct g_part_gpt_table *ta table->state[elt] = GPT_STATE_INVALID; hdr->hdr_revision = le32toh(buf->hdr_revision); - if (hdr->hdr_revision < 0x00010000) + if (hdr->hdr_revision < GPT_HDR_REVISION) goto fail; hdr->hdr_lba_self = le64toh(buf->hdr_lba_self); if (hdr->hdr_lba_self != table->lba[elt]) goto fail; hdr->hdr_lba_alt = le64toh(buf->hdr_lba_alt); + if (hdr->hdr_lba_alt == hdr->hdr_lba_self || + hdr->hdr_lba_alt > last) + goto fail; /* Check the managed area. */ hdr->hdr_lba_start = le64toh(buf->hdr_lba_start); @@ -283,6 +296,10 @@ gpt_read_hdr(struct g_part_gpt_table *ta le_uuid_dec(&buf->hdr_uuid, &hdr->hdr_uuid); hdr->hdr_crc_table = le32toh(buf->hdr_crc_table); + /* save LBA for secondary header */ + if (elt == GPT_ELT_PRIHDR) + table->lba[GPT_ELT_SECHDR] = hdr->hdr_lba_alt; + g_free(buf); return (hdr); @@ -490,18 +507,21 @@ static int g_part_gpt_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { struct g_part_gpt_table *table; + struct g_provider *pp; table = (struct g_part_gpt_table *)basetable; - if (table->hdr != NULL) - g_free(table->hdr); + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + g_free(table->hdr); table->hdr = NULL; /* - * Wipe the first 2 sectors as well as the last to clear the - * partitioning. + * Wipe the first 2 sectors to clear the partitioning. Wipe the last + * sector only if it has valid secondary header. */ basetable->gpt_smhead |= 3; - basetable->gpt_smtail |= 1; + if (table->state[GPT_ELT_SECHDR] == GPT_STATE_OK && + table->lba[GPT_ELT_SECHDR] == pp->mediasize / pp->sectorsize - 1) + basetable->gpt_smtail |= 1; return (0); } @@ -665,10 +685,12 @@ g_part_gpt_read(struct g_part_table *bas struct g_part_gpt_table *table; struct g_part_gpt_entry *entry; u_char *buf; + uint64_t last; int error, index; table = (struct g_part_gpt_table *)basetable; pp = cp->provider; + last = (pp->mediasize / pp->sectorsize) - 1; /* Read the PMBR */ buf = g_read_data(cp, 0, pp->sectorsize, &error); @@ -732,6 +754,7 @@ g_part_gpt_read(struct g_part_table *bas printf("GEOM: %s: using the secondary instead -- recovery " "strongly advised.\n", pp->name); table->hdr = sechdr; + basetable->gpt_corrupt = 1; if (prihdr != NULL) g_free(prihdr); tbl = sectbl; @@ -743,6 +766,11 @@ g_part_gpt_read(struct g_part_table *bas "or invalid.\n", pp->name); printf("GEOM: %s: using the primary only -- recovery " "suggested.\n", pp->name); + basetable->gpt_corrupt = 1; + } else if (table->lba[GPT_ELT_SECHDR] != last) { + printf( "GEOM: %s: the secondary GPT header is not in " + "the last LBA.\n", pp->name); + basetable->gpt_corrupt = 1; } table->hdr = prihdr; if (sechdr != NULL) @@ -759,8 +787,9 @@ g_part_gpt_read(struct g_part_table *bas for (index = basetable->gpt_entries - 1; index >= 0; index--) { if (EQUUID(&tbl[index].ent_type, &gpt_uuid_unused)) continue; - entry = (struct g_part_gpt_entry *)g_part_new_entry(basetable, - index+1, tbl[index].ent_lba_start, tbl[index].ent_lba_end); + entry = (struct g_part_gpt_entry *)g_part_new_entry( + basetable, index + 1, tbl[index].ent_lba_start, + tbl[index].ent_lba_end); entry->ent = tbl[index]; } @@ -769,6 +798,38 @@ g_part_gpt_read(struct g_part_table *bas } static int +g_part_gpt_recover(struct g_part_table *basetable) +{ + struct g_part_gpt_table *table; + struct g_provider *pp; + uint64_t last; + size_t tblsz; + + table = (struct g_part_gpt_table *)basetable; + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + last = pp->mediasize / pp->sectorsize - 1; + tblsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz + + pp->sectorsize - 1) / pp->sectorsize; + + table->lba[GPT_ELT_PRIHDR] = 1; + table->lba[GPT_ELT_PRITBL] = 2; + table->lba[GPT_ELT_SECHDR] = last; + table->lba[GPT_ELT_SECTBL] = last - tblsz; + table->state[GPT_ELT_PRIHDR] = GPT_STATE_OK; + table->state[GPT_ELT_PRITBL] = GPT_STATE_OK; + table->state[GPT_ELT_SECHDR] = GPT_STATE_OK; + table->state[GPT_ELT_SECTBL] = GPT_STATE_OK; + table->hdr->hdr_lba_start = 2 + tblsz; + table->hdr->hdr_lba_end = last - tblsz - 1; + + basetable->gpt_first = table->hdr->hdr_lba_start; + basetable->gpt_last = table->hdr->hdr_lba_end; + basetable->gpt_corrupt = 0; + + return (0); +} + +static int g_part_gpt_setunset(struct g_part_table *table, struct g_part_entry *baseentry, const char *attrib, unsigned int set) { @@ -867,13 +928,13 @@ g_part_gpt_write(struct g_part_table *ba struct g_part_entry *baseentry; struct g_part_gpt_entry *entry; struct g_part_gpt_table *table; - size_t tlbsz; + size_t tblsz; uint32_t crc; int error, index; pp = cp->provider; table = (struct g_part_gpt_table *)basetable; - tlbsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz + + tblsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz + pp->sectorsize - 1) / pp->sectorsize; /* Write the PMBR */ @@ -885,7 +946,7 @@ g_part_gpt_write(struct g_part_table *ba return (error); /* Allocate space for the header and entries. */ - buf = g_malloc((tlbsz + 1) * pp->sectorsize, M_WAITOK | M_ZERO); + buf = g_malloc((tblsz + 1) * pp->sectorsize, M_WAITOK | M_ZERO); memcpy(buf, table->hdr->hdr_sig, sizeof(table->hdr->hdr_sig)); le32enc(buf + 8, table->hdr->hdr_revision); @@ -924,7 +985,7 @@ g_part_gpt_write(struct g_part_table *ba le32enc(buf + 16, crc); error = g_write_data(cp, table->lba[GPT_ELT_PRITBL] * pp->sectorsize, - buf + pp->sectorsize, tlbsz * pp->sectorsize); + buf + pp->sectorsize, tblsz * pp->sectorsize); if (error) goto out; error = g_write_data(cp, table->lba[GPT_ELT_PRIHDR] * pp->sectorsize, @@ -941,7 +1002,7 @@ g_part_gpt_write(struct g_part_table *ba le32enc(buf + 16, crc); error = g_write_data(cp, table->lba[GPT_ELT_SECTBL] * pp->sectorsize, - buf + pp->sectorsize, tlbsz * pp->sectorsize); + buf + pp->sectorsize, tblsz * pp->sectorsize); if (error) goto out; error = g_write_data(cp, table->lba[GPT_ELT_SECHDR] * pp->sectorsize, Modified: head/sys/geom/part/g_part_if.m ============================================================================== --- head/sys/geom/part/g_part_if.m Mon Oct 25 16:11:37 2010 (r214351) +++ head/sys/geom/part/g_part_if.m Mon Oct 25 16:23:35 2010 (r214352) @@ -65,6 +65,12 @@ CODE { { return (ENOSYS); } + + static int + default_recover(struct g_part_table *t __unused) + { + return (ENOSYS); + } }; # add() - scheme specific processing for the add verb. @@ -163,6 +169,11 @@ METHOD int read { struct g_consumer *cp; }; +# recover() - scheme specific processing for the recover verb. +METHOD int recover { + struct g_part_table *table; +} DEFAULT default_recover; + # setunset() - set or unset partition entry attributes. METHOD int setunset { struct g_part_table *table; From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 17:05: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 CC9A0106564A; Mon, 25 Oct 2010 17:05:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9AE48FC17; Mon, 25 Oct 2010 17:05: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 o9PH5EeJ071834; Mon, 25 Oct 2010 17:05:14 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PH5EW4071832; Mon, 25 Oct 2010 17:05:14 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201010251705.o9PH5EW4071832@svn.freebsd.org> From: Rick Macklem Date: Mon, 25 Oct 2010 17:05:14 +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: r214353 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 17:05:15 -0000 Author: rmacklem Date: Mon Oct 25 17:05:14 2010 New Revision: 214353 URL: http://svn.freebsd.org/changeset/base/214353 Log: MFC: r213712 Try and make the nfsrv_localunlock() function in the experimental NFSv4 server more readable. Mostly changes to comments, but a case of >= is changed to >, since == can never happen. Also, I've added a couple of KASSERT()s and a slight optimization, since once the "else if" case happens, subsequent locks in the list can't have any effect. None of these changes fixes a known bug. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.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) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Mon Oct 25 16:23:35 2010 (r214352) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Mon Oct 25 17:05:14 2010 (r214353) @@ -4957,31 +4957,56 @@ nfsrv_locallock(vnode_t vp, struct nfslo /* * Local lock unlock. Unlock all byte ranges that are no longer locked - * by NFSv4. + * by NFSv4. To do this, unlock any subranges of first-->end that + * do not overlap with the byte ranges of any lock in the lfp->lf_lock + * list. This list has all locks for the file held by other + * tuples. The list is ordered by increasing + * lo_first value, but may have entries that overlap each other, for + * the case of read locks. */ static void nfsrv_localunlock(vnode_t vp, struct nfslockfile *lfp, uint64_t init_first, uint64_t init_end, NFSPROC_T *p) { struct nfslock *lop; - - uint64_t first, end; + uint64_t first, end, prevfirst; first = init_first; end = init_end; while (first < init_end) { /* Loop through all nfs locks, adjusting first and end */ + prevfirst = 0; LIST_FOREACH(lop, &lfp->lf_lock, lo_lckfile) { + KASSERT(prevfirst <= lop->lo_first, + ("nfsv4 locks out of order")); + KASSERT(lop->lo_first < lop->lo_end, + ("nfsv4 bogus lock")); + prevfirst = lop->lo_first; if (first >= lop->lo_first && first < lop->lo_end) - /* Overlaps initial part */ + /* + * Overlaps with initial part, so trim + * off that initial part by moving first past + * it. + */ first = lop->lo_end; else if (end > lop->lo_first && - lop->lo_first >= first) - /* Begins before end and past first */ + lop->lo_first > first) { + /* + * This lock defines the end of the + * segment to unlock, so set end to the + * start of it and break out of the loop. + */ end = lop->lo_first; + break; + } if (first >= end) - /* shrunk to 0 so this iteration is done */ + /* + * There is no segment left to do, so + * break out of this loop and then exit + * the outer while() since first will be set + * to end, which must equal init_end here. + */ break; } if (first < end) { @@ -4991,7 +5016,10 @@ nfsrv_localunlock(vnode_t vp, struct nfs nfsrv_locallock_commit(lfp, NFSLCK_UNLOCK, first, end); } - /* and move on to the rest of the range */ + /* + * Now move past this segment and look for any further + * segment in the range, if there is one. + */ first = end; end = init_end; } From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 20:29: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 9835F1065674; Mon, 25 Oct 2010 20:29:41 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 368F28FC22; Mon, 25 Oct 2010 20:29:40 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id C51A445CAC; Mon, 25 Oct 2010 22:29:39 +0200 (CEST) Received: from localhost (chello089073192049.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3A7C945C99; Mon, 25 Oct 2010 22:29:34 +0200 (CEST) Date: Mon, 25 Oct 2010 22:29:01 +0200 From: Pawel Jakub Dawidek To: "Andrey V. Elsukov" Message-ID: <20101025202901.GB1811@garage.freebsd.pl> References: <201010251623.o9PGNZ3V070926@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H+4ONPRPur6+Ovig" Content-Disposition: inline In-Reply-To: <201010251623.o9PGNZ3V070926@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: r214352 - in head: sbin/geom/class/part 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, 25 Oct 2010 20:29:41 -0000 --H+4ONPRPur6+Ovig Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 25, 2010 at 04:23:35PM +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Mon Oct 25 16:23:35 2010 > New Revision: 214352 > URL: http://svn.freebsd.org/changeset/base/214352 >=20 > Log: > Reimplemented "gpart destroy -F". Now it does all work in kernel. > This was needed for recover implementation. > =20 > Implement the recover command for GPT. Now GPT will marked as > corrupt when any of three types of corruption will be detected: > 1. Damaged primary GPT header or table > 2. Damaged secondary GPT header or table > 3. Secondary header is not located in the last LBA > Marked GPT becomes read-only. Any changes with corrupt table > are prohibited. Only "destroy" and "recover" commands are allowed. Another corruption worth mentioning is when primary and secondary GPT header/table differ. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --H+4ONPRPur6+Ovig Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkzF6IwACgkQForvXbEpPzTa9gCg9nSuHEEu9DVkl1ypSfcr8ACK GtQAoJ0kuMSP/b+66LiWbbkbMFFEZFuM =/qoC -----END PGP SIGNATURE----- --H+4ONPRPur6+Ovig-- From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 20:52: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 AD0431065673; Mon, 25 Oct 2010 20:52:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B5BC8FC0A; Mon, 25 Oct 2010 20:52: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 o9PKqXNf076955; Mon, 25 Oct 2010 20:52:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PKqXFt076953; Mon, 25 Oct 2010 20:52:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010252052.o9PKqXFt076953@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Oct 2010 20:52: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: r214358 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 20:52:33 -0000 Author: marius Date: Mon Oct 25 20:52:33 2010 New Revision: 214358 URL: http://svn.freebsd.org/changeset/base/214358 Log: - Given that in one-shot mode tick_et_start() also is called frequently introduce function pointers once set up to the respective implementation for reading the (S)TICK and writing the (S)STICK_COMPARE registers as a compromise between duplicating code and selecting between different implementations during execution over and over again, similar to what is done elsewhere in the MD in order to support different CPU models that won't ever change at runtime. - In the remaining tick interrupt handler further push down disabling of interrupts to the periodic case as it isn't necessary here in one-shot mode at all. Modified: head/sys/sparc64/sparc64/tick.c Modified: head/sys/sparc64/sparc64/tick.c ============================================================================== --- head/sys/sparc64/sparc64/tick.c Mon Oct 25 19:58:28 2010 (r214357) +++ head/sys/sparc64/sparc64/tick.c Mon Oct 25 20:52:33 2010 (r214358) @@ -78,28 +78,69 @@ u_int tick_et_use_stick = 0; SYSCTL_INT(_machdep_tick, OID_AUTO, tick_et_use_stick, CTLFLAG_RD, &tick_et_use_stick, 0, "tick event timer uses STICK instead of TICK"); +typedef uint64_t rd_tick_t(void); +static rd_tick_t *rd_tick; +typedef void wr_tick_cmpr_t(uint64_t); +static wr_tick_cmpr_t *wr_tick_cmpr; + static struct timecounter stick_tc; -static struct timecounter tick_tc; static struct eventtimer tick_et; +static struct timecounter tick_tc; -static uint64_t tick_cputicks(void); -static timecounter_get_t stick_get_timecount_up; #ifdef SMP static timecounter_get_t stick_get_timecount_mp; #endif -static timecounter_get_t tick_get_timecount_up; +static timecounter_get_t stick_get_timecount_up; +static rd_tick_t stick_rd; +static wr_tick_cmpr_t stick_wr_cmpr; +static int tick_et_start(struct eventtimer *et, struct bintime *first, + struct bintime *period); +static int tick_et_stop(struct eventtimer *et); #ifdef SMP static timecounter_get_t tick_get_timecount_mp; #endif -static int tick_et_start(struct eventtimer *et, - struct bintime *first, struct bintime *period); -static int tick_et_stop(struct eventtimer *et); +static timecounter_get_t tick_get_timecount_up; static void tick_intr(struct trapframe *tf); -static void tick_intr_bbwar(struct trapframe *tf); static inline void tick_process(struct trapframe *tf); -static inline void tick_process_periodic(struct trapframe *tf, u_long tick, - u_long tick_increment, u_long adj); -static void stick_intr(struct trapframe *tf); +static rd_tick_t tick_rd; +static wr_tick_cmpr_t tick_wr_cmpr; +static wr_tick_cmpr_t tick_wr_cmpr_bbwar; +static uint64_t tick_cputicks(void); + +static uint64_t +stick_rd(void) +{ + + return (rdstick()); +} + +static void +stick_wr_cmpr(uint64_t tick) +{ + + wrstickcmpr(tick, 0); +} + +static uint64_t +tick_rd(void) +{ + + return (rd(tick)); +} + +static void +tick_wr_cmpr(uint64_t tick_cmpr) +{ + + wr(tick_cmpr, tick_cmpr, 0); +} + +static void +tick_wr_cmpr_bbwar(uint64_t tick_cmpr) +{ + + wrtickcmpr(tick_cmpr, 0); +} static uint64_t tick_cputicks(void) @@ -128,17 +169,22 @@ cpu_initclocks(void) * frequencies they shouldn't be used except when really necessary. */ if (tick_et_use_stick != 0) { - intr_setup(PIL_TICK, stick_intr, -1, NULL, NULL); + rd_tick = stick_rd; + wr_tick_cmpr = stick_wr_cmpr; /* * We don't provide a CPU ticker as long as the frequency * supplied isn't actually used per-CPU. */ } else { - intr_setup(PIL_TICK, PCPU_GET(impl) >= CPU_IMPL_ULTRASPARCI && - PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? - tick_intr_bbwar : tick_intr, -1, NULL, NULL); + rd_tick = tick_rd; + if (PCPU_GET(impl) >= CPU_IMPL_ULTRASPARCI && + PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII) + wr_tick_cmpr = tick_wr_cmpr_bbwar; + else + wr_tick_cmpr = tick_wr_cmpr; set_cputicker(tick_cputicks, clock, 0); } + intr_setup(PIL_TICK, tick_intr, -1, NULL, NULL); /* * Initialize the (S)TICK-based timecounter(s). @@ -214,106 +260,56 @@ tick_process(struct trapframe *tf) critical_exit(); } -/* - * NB: the sequence of reading the (S)TICK register, calculating the value - * of the next tick and writing it to the (S)TICK_COMPARE register must not - * be interrupted, not even by an IPI, otherwise a value that is in the past - * could be written in the worst case, causing the periodic timer to stop. - */ - static void tick_intr(struct trapframe *tf) { - u_long adj, tick, tick_increment; - register_t s; - - s = intr_disable(); - tick_increment = PCPU_GET(tickincrement); - if (tick_increment != 0) { - adj = PCPU_GET(tickadj); - tick = rd(tick); - wr(tick_cmpr, tick + tick_increment - adj, 0); - intr_restore(s); - tick_process_periodic(tf, tick, tick_increment, adj); - } else { - intr_restore(s); - tick_process(tf); - } -} - -static void -tick_intr_bbwar(struct trapframe *tf) -{ - u_long adj, tick, tick_increment; - register_t s; - - s = intr_disable(); - tick_increment = PCPU_GET(tickincrement); - if (tick_increment != 0) { - adj = PCPU_GET(tickadj); - tick = rd(tick); - wrtickcmpr(tick + tick_increment - adj, 0); - intr_restore(s); - tick_process_periodic(tf, tick, tick_increment, adj); - } else { - intr_restore(s); - tick_process(tf); - } -} - -static void -stick_intr(struct trapframe *tf) -{ - u_long adj, stick, tick_increment; + u_long adj, ref, tick, tick_increment; + long delta; register_t s; + int count; - s = intr_disable(); tick_increment = PCPU_GET(tickincrement); if (tick_increment != 0) { + /* + * NB: the sequence of reading the (S)TICK register, + * calculating the value of the next tick and writing it to + * the (S)TICK_COMPARE register must not be interrupted, not + * even by an IPI, otherwise a value that is in the past could + * be written in the worst case and thus causing the periodic + * timer to stop. + */ + s = intr_disable(); adj = PCPU_GET(tickadj); - stick = rdstick(); - wrstickcmpr(stick + tick_increment - adj, 0); + tick = rd_tick(); + wr_tick_cmpr(tick + tick_increment - adj); intr_restore(s); - tick_process_periodic(tf, stick, tick_increment, adj); - } else { - intr_restore(s); - tick_process(tf); - } -} - -static inline void -tick_process_periodic(struct trapframe *tf, u_long tick, - u_long tick_increment, u_long adj) -{ - u_long ref; - long delta; - int count; - - ref = PCPU_GET(tickref); - delta = tick - ref; - count = 0; - while (delta >= tick_increment) { - tick_process(tf); - delta -= tick_increment; - ref += tick_increment; - if (adj != 0) - adjust_ticks++; - count++; - } - if (count > 0) { - adjust_missed += count - 1; - if (delta > (tick_increment >> 3)) { - if (adj == 0) - adjust_edges++; - adj = tick_increment >> 4; - } else + ref = PCPU_GET(tickref); + delta = tick - ref; + count = 0; + while (delta >= tick_increment) { + tick_process(tf); + delta -= tick_increment; + ref += tick_increment; + if (adj != 0) + adjust_ticks++; + count++; + } + if (count > 0) { + adjust_missed += count - 1; + if (delta > (tick_increment >> 3)) { + if (adj == 0) + adjust_edges++; + adj = tick_increment >> 4; + } else + adj = 0; + } else { adj = 0; - } else { - adj = 0; - adjust_excess++; - } - PCPU_SET(tickref, ref); - PCPU_SET(tickadj, adj); + adjust_excess++; + } + PCPU_SET(tickref, ref); + PCPU_SET(tickadj, adj); + } else + tick_process(tf); } static u_int @@ -387,19 +383,13 @@ tick_et_start(struct eventtimer *et, str * out one tick to make sure that it is not missed. */ s = intr_disable(); - if (tick_et_use_stick != 0) - base = rdstick(); - else - base = rd(tick); + base = rd_tick(); if (div != 0) { PCPU_SET(tickadj, 0); base = roundup(base, div); } PCPU_SET(tickref, base); - if (tick_et_use_stick != 0) - wrstickcmpr(base + fdiv, 0); - else - wrtickcmpr(base + fdiv, 0); + wr_tick_cmpr(base + fdiv); intr_restore(s); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 21:46: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 7691F1065679; Mon, 25 Oct 2010 21:46:23 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 656C58FC12; Mon, 25 Oct 2010 21:46: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 o9PLkNii078106; Mon, 25 Oct 2010 21:46:23 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PLkNNu078104; Mon, 25 Oct 2010 21:46:23 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201010252146.o9PLkNNu078104@svn.freebsd.org> From: Ivan Voras Date: Mon, 25 Oct 2010 21:46: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: r214359 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 21:46:23 -0000 Author: ivoras Date: Mon Oct 25 21:46:23 2010 New Revision: 214359 URL: http://svn.freebsd.org/changeset/base/214359 Log: Bring vfs.ufs.dirhash_maxmem into the age of the fruitbat and make it autotuned. It is only an upper bound (the memory is not always allocated) and the system contains a vm_lowmem handler so nothing will crash and burn if it's tuned too high. Reviewed by: mckusick Modified: head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Mon Oct 25 20:52:33 2010 (r214358) +++ head/sys/ufs/ufs/ufs_dirhash.c Mon Oct 25 21:46:23 2010 (r214359) @@ -72,7 +72,8 @@ static int ufs_mindirhashsize = DIRBLKSI SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_minsize, CTLFLAG_RW, &ufs_mindirhashsize, 0, "minimum directory size in bytes for which to use hashed lookup"); -static int ufs_dirhashmaxmem = 2 * 1024 * 1024; +static int ufs_dirhashmaxmem = 2 * 1024 * 1024; /* NOTE: initial value. It is + tuned in ufsdirhash_init() */ SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_maxmem, CTLFLAG_RW, &ufs_dirhashmaxmem, 0, "maximum allowed dirhash memory usage"); static int ufs_dirhashmem; @@ -1290,6 +1291,9 @@ ufsdirhash_lowmem() void ufsdirhash_init() { + ufs_dirhashmaxmem = lmax(roundup(hibufspace / 64, PAGE_SIZE), + 2 * 1024 * 1024); + ufsdirhash_zone = uma_zcreate("DIRHASH", DH_NBLKOFF * sizeof(doff_t), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); mtx_init(&ufsdirhash_mtx, "dirhash list", NULL, MTX_DEF); From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 23:58: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 D4E11106566B; Mon, 25 Oct 2010 23:58:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2A1D8FC0A; Mon, 25 Oct 2010 23:58: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 o9PNwGev081063; Mon, 25 Oct 2010 23:58:16 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PNwGQH081061; Mon, 25 Oct 2010 23:58:16 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010252358.o9PNwGQH081061@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 23:58:16 +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: r214361 - stable/8/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Oct 2010 23:58:16 -0000 Author: attilio Date: Mon Oct 25 23:58:16 2010 New Revision: 214361 URL: http://svn.freebsd.org/changeset/base/214361 Log: MFC r213235 by emaste: Increase maximum network timeout from 20s to 120s. Sponsored by: Sandvine Incorporated Modified: stable/8/lib/libstand/net.h Directory Properties: stable/8/lib/libstand/ (props changed) Modified: stable/8/lib/libstand/net.h ============================================================================== --- stable/8/lib/libstand/net.h Mon Oct 25 21:49:59 2010 (r214360) +++ stable/8/lib/libstand/net.h Mon Oct 25 23:58:16 2010 (r214361) @@ -50,7 +50,7 @@ #define MACPY(s, d) bcopy((char *)s, (char *)d, 6) -#define MAXTMO 20 /* seconds */ +#define MAXTMO 120 /* seconds */ #define MINTMO 2 /* seconds */ #define FNAME_SIZE 128 From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 23:59: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 63098106564A; Mon, 25 Oct 2010 23:59:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50D168FC19; Mon, 25 Oct 2010 23:59: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 o9PNxuPn081144; Mon, 25 Oct 2010 23:59:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PNxudt081142; Mon, 25 Oct 2010 23:59:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010252359.o9PNxudt081142@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 23:59:56 +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: r214362 - 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: Mon, 25 Oct 2010 23:59:56 -0000 Author: attilio Date: Mon Oct 25 23:59:56 2010 New Revision: 214362 URL: http://svn.freebsd.org/changeset/base/214362 Log: MFC r213236 by emaste: Style fix. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/kern/subr_trap.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) Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Mon Oct 25 23:58:16 2010 (r214361) +++ stable/8/sys/kern/subr_trap.c Mon Oct 25 23:59:56 2010 (r214362) @@ -115,9 +115,8 @@ userret(struct thread *td, struct trapfr /* * Charge system time if profiling. */ - if (p->p_flag & P_PROFIL) { + if (p->p_flag & P_PROFIL) addupc_task(td, TRAPF_PC(frame), td->td_pticks * psratio); - } /* * Let the scheduler adjust our priority etc. */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 00:07: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 99156106566B; Tue, 26 Oct 2010 00:07:58 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 862548FC15; Tue, 26 Oct 2010 00:07: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 o9Q07wOk081425; Tue, 26 Oct 2010 00:07:58 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9Q07wpP081422; Tue, 26 Oct 2010 00:07:58 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201010260007.o9Q07wpP081422@svn.freebsd.org> From: Jack F Vogel Date: Tue, 26 Oct 2010 00:07: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: r214363 - 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: Tue, 26 Oct 2010 00:07:58 -0000 Author: jfv Date: Tue Oct 26 00:07:58 2010 New Revision: 214363 URL: http://svn.freebsd.org/changeset/base/214363 Log: Bug fix delta to the em driver: - Chasin down bogus watchdogs has led to an improved design to this handling, the hang decision takes place in the tx cleanup, with only a simple report check in local_timer. Our tests have shown no false watchdogs with this code. - VLAN fixes from jhb, the shadow vfta should be per interface, but as global it was not. Thanks John. - Bug fixes in the support for new PCH2 hardware. - Thanks for all the help and feedback on the driver, changes to lem with be coming shortly as well. Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Oct 25 23:59:56 2010 (r214362) +++ head/sys/dev/e1000/if_em.c Tue Oct 26 00:07:58 2010 (r214363) @@ -93,8 +93,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.0.8"; - +char em_driver_version[] = "7.1.6"; /********************************************************************* * PCI Device ID Table @@ -170,6 +169,8 @@ static em_vendor_info_t em_vendor_info_a { 0x8086, E1000_DEV_ID_PCH_M_HV_LC, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_PCH_D_HV_DM, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_PCH_D_HV_DC, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH2_LV_LM, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH2_LV_V, PCI_ANY_ID, PCI_ANY_ID, 0}, /* required last entry */ { 0, 0, 0, 0, 0} }; @@ -256,6 +257,8 @@ static int em_dma_malloc(struct adapter static void em_dma_free(struct adapter *, struct em_dma_alloc *); static int em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); static void em_print_nvm_info(struct adapter *); +static int em_sysctl_debug_info(SYSCTL_HANDLER_ARGS); +static void em_print_debug_info(struct adapter *); static int em_is_valid_ether_addr(u8 *); static int em_sysctl_int_delay(SYSCTL_HANDLER_ARGS); static void em_add_int_delay_sysctl(struct adapter *, const char *, @@ -282,6 +285,8 @@ static void em_handle_link(void *context static void em_add_rx_process_limit(struct adapter *, const char *, const char *, int *, int); +static void em_set_flow_cntrl(struct adapter *, const char *, + const char *, int *, int); static __inline void em_rx_discard(struct rx_ring *, int); @@ -359,14 +364,6 @@ TUNABLE_INT("hw.em.rx_process_limit", &e static int em_fc_setting = e1000_fc_full; TUNABLE_INT("hw.em.fc_setting", &em_fc_setting); -/* -** Shadow VFTA table, this is needed because -** the real vlan filter table gets cleared during -** a soft reset and the driver needs to be able -** to repopulate it. -*/ -static u32 em_shadow_vfta[EM_VFTA_SIZE]; - /* Global used in WOL setup with multiport cards */ static int global_quad_port_a = 0; @@ -449,6 +446,11 @@ em_attach(device_t dev) OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, em_sysctl_nvm_info, "I", "NVM Information"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, + em_sysctl_debug_info, "I", "Debug Information"); + callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); /* Determine hardware and mac info */ @@ -468,9 +470,10 @@ em_attach(device_t dev) ** identified */ if ((adapter->hw.mac.type == e1000_ich8lan) || - (adapter->hw.mac.type == e1000_pchlan) || (adapter->hw.mac.type == e1000_ich9lan) || - (adapter->hw.mac.type == e1000_ich10lan)) { + (adapter->hw.mac.type == e1000_ich10lan) || + (adapter->hw.mac.type == e1000_pchlan) || + (adapter->hw.mac.type == e1000_pch2lan)) { int rid = EM_BAR_TYPE_FLASH; adapter->flash = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -514,11 +517,16 @@ em_attach(device_t dev) E1000_REGISTER(&adapter->hw, E1000_TADV), em_tx_abs_int_delay_dflt); - /* Sysctls for limiting the amount of work done in the taskqueue */ + /* Sysctl for limiting the amount of work done in the taskqueue */ em_add_rx_process_limit(adapter, "rx_processing_limit", "max number of rx packets to process", &adapter->rx_process_limit, em_rx_process_limit); + /* Sysctl for setting the interface flow control */ + em_set_flow_cntrl(adapter, "flow_control", + "max number of rx packets to process", + &adapter->fc_setting, em_fc_setting); + /* * Validate number of transmit and receive descriptors. It * must not exceed hardware maximum, and must be multiple @@ -581,6 +589,11 @@ em_attach(device_t dev) goto err_late; } + /* Check SOL/IDER usage */ + if (e1000_check_reset_block(&adapter->hw)) + device_printf(dev, "PHY reset is blocked" + " due to SOL/IDER session.\n"); + /* ** Start from a known state, this is ** important in reading the nvm and @@ -644,11 +657,6 @@ em_attach(device_t dev) adapter->hw.mac.get_link_status = 1; em_update_link_status(adapter); - /* Indicate SOL/IDER usage */ - if (e1000_check_reset_block(&adapter->hw)) - device_printf(dev, - "PHY reset is blocked due to SOL/IDER session.\n"); - /* Register for VLAN events */ adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, em_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); @@ -857,7 +865,7 @@ em_mq_start_locked(struct ifnet *ifp, st if (enq > 0) { /* Set the watchdog */ - txr->watchdog_check = TRUE; + txr->queue_status = EM_QUEUE_WORKING; txr->watchdog_time = ticks; } return (err); @@ -870,14 +878,8 @@ static int em_mq_start(struct ifnet *ifp, struct mbuf *m) { struct adapter *adapter = ifp->if_softc; - struct tx_ring *txr; - int i = 0, error = 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]; + struct tx_ring *txr = adapter->tx_rings; + int error; if (EM_TX_TRYLOCK(txr)) { error = em_mq_start_locked(ifp, txr, m); @@ -953,7 +955,7 @@ em_start_locked(struct ifnet *ifp, struc /* Set timeout in case hardware has problems transmitting. */ txr->watchdog_time = ticks; - txr->watchdog_check = TRUE; + txr->queue_status = EM_QUEUE_WORKING; } return; @@ -1029,6 +1031,7 @@ em_ioctl(struct ifnet *ifp, u_long comma case e1000_82572: case e1000_ich9lan: case e1000_ich10lan: + case e1000_pch2lan: case e1000_82574: case e1000_80003es2lan: /* 9K Jumbo Frame size */ max_frame_size = 9234; @@ -1092,6 +1095,11 @@ em_ioctl(struct ifnet *ifp, u_long comma } break; case SIOCSIFMEDIA: + /* + ** As the speed/duplex settings are being + ** changed, we need to reset the PHY. + */ + adapter->hw.phy.reset_disable = FALSE; /* Check SOL/IDER usage */ EM_CORE_LOCK(adapter); if (e1000_check_reset_block(&adapter->hw)) { @@ -1101,6 +1109,7 @@ em_ioctl(struct ifnet *ifp, u_long comma break; } EM_CORE_UNLOCK(adapter); + /* falls thru */ case SIOCGIFMEDIA: IOCTL_DEBUGOUT("ioctl rcv'd: \ SIOCxIFMEDIA (Get/Set Interface Media)"); @@ -1215,13 +1224,16 @@ em_init_locked(struct adapter *adapter) case e1000_82583: pba = E1000_PBA_20K; /* 20K for Rx, 20K for Tx */ break; + case e1000_ich8lan: + pba = E1000_PBA_8K; + break; case e1000_ich9lan: case e1000_ich10lan: case e1000_pchlan: pba = E1000_PBA_10K; break; - case e1000_ich8lan: - pba = E1000_PBA_8K; + case e1000_pch2lan: + pba = E1000_PBA_26K; break; default: if (adapter->max_frame_size > 8192) @@ -1259,19 +1271,6 @@ em_init_locked(struct adapter *adapter) /* Setup VLAN support, basic and offload if available */ E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN); - /* Use real VLAN Filter support? */ - if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { - if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) - /* Use real VLAN Filter support */ - em_setup_vlan_hw_support(adapter); - else { - u32 ctrl; - ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); - ctrl |= E1000_CTRL_VME; - E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); - } - } - /* Set hardware offload abilities */ ifp->if_hwassist = 0; if (ifp->if_capenable & IFCAP_TXCSUM) @@ -1289,6 +1288,17 @@ em_init_locked(struct adapter *adapter) /* Setup Multicast table */ em_set_multi(adapter); + /* + ** Figure out the desired mbuf + ** pool for doing jumbos + */ + if (adapter->max_frame_size <= 2048) + adapter->rx_mbuf_sz = MCLBYTES; + else if (adapter->max_frame_size <= 4096) + adapter->rx_mbuf_sz = MJUMPAGESIZE; + else + adapter->rx_mbuf_sz = MJUM9BYTES; + /* Prepare receive descriptors and buffers */ if (em_setup_receive_structures(adapter)) { device_printf(dev, "Could not setup receive structures\n"); @@ -1297,6 +1307,19 @@ em_init_locked(struct adapter *adapter) } em_initialize_receive_unit(adapter); + /* Use real VLAN Filter support? */ + if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) + /* Use real VLAN Filter support */ + em_setup_vlan_hw_support(adapter); + else { + u32 ctrl; + ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); + ctrl |= E1000_CTRL_VME; + E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); + } + } + /* Don't lose promiscuous settings */ em_set_promisc(adapter); @@ -1707,11 +1730,6 @@ em_media_change(struct ifnet *ifp) device_printf(adapter->dev, "Unsupported media type\n"); } - /* As the speed/duplex settings my have changed we need to - * reset the PHY. - */ - adapter->hw.phy.reset_disable = FALSE; - em_init_locked(adapter); EM_CORE_UNLOCK(adapter); @@ -1929,15 +1947,12 @@ em_xmit(struct tx_ring *txr, struct mbuf m_head = *m_headp; /* Do hardware assists */ -#if __FreeBSD_version >= 700000 if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { - em_tso_setup(txr, m_head, ip_off, ip, tp, &txd_upper, - &txd_lower); + em_tso_setup(txr, m_head, ip_off, ip, tp, + &txd_upper, &txd_lower); /* we need to make a final sentinel transmit desc */ tso_desc = TRUE; - } else -#endif - if (m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD) + } else if (m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD) em_transmit_checksum_setup(txr, m_head, ip_off, ip, &txd_upper, &txd_lower); @@ -2164,34 +2179,30 @@ em_local_timer(void *arg) em_update_stats_counters(adapter); /* Reset LAA into RAR[0] on 82571 */ - if (e1000_get_laa_state_82571(&adapter->hw) == TRUE) + if ((adapter->hw.mac.type == e1000_82571) && + e1000_get_laa_state_82571(&adapter->hw)) e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0); /* - ** If flow control has paused us since last checking - ** it invalidates the watchdog timing, so dont run it. + ** Don't do TX watchdog check if we've been paused */ if (adapter->pause_frames) { adapter->pause_frames = 0; goto out; } /* - ** Check for time since any descriptor was cleaned + ** Check on the state of the TX queue(s), this + ** can be done without the lock because its RO + ** and the HUNG state will be static if set. */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { - EM_TX_LOCK(txr); - if (txr->watchdog_check == FALSE) { - EM_TX_UNLOCK(txr); - continue; - } - if ((ticks - txr->watchdog_time) > EM_WATCHDOG) + for (int i = 0; i < adapter->num_queues; i++, txr++) + if (txr->queue_status == EM_QUEUE_HUNG) goto hung; - EM_TX_UNLOCK(txr); - } out: callout_reset(&adapter->timer, hz, em_local_timer, adapter); return; hung: + /* Looks like we're hung */ device_printf(adapter->dev, "Watchdog timeout -- resetting\n"); device_printf(adapter->dev, "Queue(%d) tdh = %d, hw tdt = %d\n", txr->me, @@ -2272,7 +2283,7 @@ em_update_link_status(struct adapter *ad adapter->link_active = 0; /* Link down, disable watchdog */ for (int i = 0; i < adapter->num_queues; i++, txr++) - txr->watchdog_check = FALSE; + txr->queue_status = EM_QUEUE_IDLE; if_link_state_change(ifp, LINK_STATE_DOWN); } } @@ -2306,7 +2317,7 @@ em_stop(void *arg) /* Unarm watchdog timer. */ for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); - txr->watchdog_check = FALSE; + txr->queue_status = EM_QUEUE_IDLE; EM_TX_UNLOCK(txr); } @@ -2571,6 +2582,9 @@ em_free_pci_resources(struct adapter *ad for (int i = 0; i < adapter->num_queues; i++) { txr = &adapter->tx_rings[i]; rxr = &adapter->rx_rings[i]; + /* an early abort? */ + if ((txr == NULL) || (rxr == NULL)) + break; rid = txr->msix +1; if (txr->tag != NULL) { bus_teardown_intr(dev, txr->res, txr->tag); @@ -2689,6 +2703,7 @@ static void em_reset(struct adapter *adapter) { device_t dev = adapter->dev; + struct ifnet *ifp = adapter->ifp; struct e1000_hw *hw = &adapter->hw; u16 rx_buffer_size; @@ -2733,15 +2748,25 @@ em_reset(struct adapter *adapter) hw->fc.send_xon = TRUE; /* Set Flow control, use the tunable location if sane */ - if ((em_fc_setting >= 0) || (em_fc_setting < 4)) - hw->fc.requested_mode = em_fc_setting; - else - hw->fc.requested_mode = e1000_fc_none; + hw->fc.requested_mode = adapter->fc_setting; - /* Override - workaround for PCHLAN issue */ + /* Workaround: no TX flow ctrl for PCH */ if (hw->mac.type == e1000_pchlan) hw->fc.requested_mode = e1000_fc_rx_pause; + /* Override - settings for PCH2LAN, ya its magic :) */ + if (hw->mac.type == e1000_pch2lan) { + hw->fc.high_water = 0x5C20; + hw->fc.low_water = 0x5048; + hw->fc.pause_time = 0x0650; + hw->fc.refresh_time = 0x0400; + /* Jumbos need adjusted PBA */ + if (ifp->if_mtu > ETHERMTU) + E1000_WRITE_REG(hw, E1000_PBA, 12); + else + E1000_WRITE_REG(hw, E1000_PBA, 26); + } + /* Issue a global reset */ e1000_reset_hw(hw); E1000_WRITE_REG(hw, E1000_WUC, 0); @@ -3173,6 +3198,7 @@ em_setup_transmit_ring(struct tx_ring *t /* Set number of descriptors available */ txr->tx_avail = adapter->num_tx_desc; + txr->queue_status = EM_QUEUE_IDLE; /* Clear checksum offload context. */ txr->last_hw_offload = 0; @@ -3233,7 +3259,7 @@ em_initialize_transmit_unit(struct adapt E1000_READ_REG(&adapter->hw, E1000_TDBAL(i)), E1000_READ_REG(&adapter->hw, E1000_TDLEN(i))); - txr->watchdog_check = FALSE; + txr->queue_status = EM_QUEUE_IDLE; } /* Set the default values for the Tx Inter Packet Gap timer */ @@ -3610,16 +3636,20 @@ static bool em_txeof(struct tx_ring *txr) { struct adapter *adapter = txr->adapter; - int first, last, done; + int first, last, done, processed; struct em_buffer *tx_buffer; struct e1000_tx_desc *tx_desc, *eop_desc; struct ifnet *ifp = adapter->ifp; EM_TX_LOCK_ASSERT(txr); - if (txr->tx_avail == adapter->num_tx_desc) + /* No work, make sure watchdog is off */ + if (txr->tx_avail == adapter->num_tx_desc) { + txr->queue_status = EM_QUEUE_IDLE; return (FALSE); + } + processed = 0; first = txr->next_to_clean; tx_desc = &txr->tx_base[first]; tx_buffer = &txr->tx_buffers[first]; @@ -3646,6 +3676,7 @@ em_txeof(struct tx_ring *txr) tx_desc->lower.data = 0; tx_desc->buffer_addr = 0; ++txr->tx_avail; + ++processed; if (tx_buffer->m_head) { bus_dmamap_sync(txr->txtag, @@ -3681,6 +3712,16 @@ em_txeof(struct tx_ring *txr) txr->next_to_clean = first; + /* + ** Watchdog calculation, we know there's + ** work outstanding or the first return + ** would have been taken, so none processed + ** for too long indicates a hang. local timer + ** will examine this and do a reset if needed. + */ + if ((!processed) && ((ticks - txr->watchdog_time) > EM_WATCHDOG)) + txr->queue_status = EM_QUEUE_HUNG; + /* * If we have enough room, clear IFF_DRV_OACTIVE * to tell the stack that it is OK to send packets. @@ -3689,7 +3730,7 @@ em_txeof(struct tx_ring *txr) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* Disable watchdog if all clean */ if (txr->tx_avail == adapter->num_tx_desc) { - txr->watchdog_check = FALSE; + txr->queue_status = EM_QUEUE_IDLE; return (FALSE); } } @@ -3723,7 +3764,8 @@ em_refresh_mbufs(struct rx_ring *rxr, in */ if (rxbuf->m_head != NULL) goto reuse; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getjcl(M_DONTWAIT, MT_DATA, + M_PKTHDR, adapter->rx_mbuf_sz); /* ** If we have a temporary resource shortage ** that causes a failure, just abort refresh @@ -3732,10 +3774,7 @@ em_refresh_mbufs(struct rx_ring *rxr, in */ if (m == NULL) goto update; - m->m_len = m->m_pkthdr.len = MCLBYTES; - - if (adapter->max_frame_size <= (MCLBYTES - ETHER_ALIGN)) - m_adj(m, ETHER_ALIGN); + m->m_len = m->m_pkthdr.len = adapter->rx_mbuf_sz; /* Use bus_dma machinery to setup the memory mapping */ error = bus_dmamap_load_mbuf_sg(rxr->rxtag, rxbuf->map, @@ -3801,9 +3840,9 @@ em_allocate_receive_buffers(struct rx_ri BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MCLBYTES, /* maxsize */ + MJUM9BYTES, /* maxsize */ 1, /* nsegments */ - MCLBYTES, /* maxsegsize */ + MJUM9BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ @@ -3871,12 +3910,13 @@ em_setup_receive_ring(struct rx_ring *rx for (int j = 0; j != adapter->num_rx_desc; ++j) { rxbuf = &rxr->rx_buffers[j]; - rxbuf->m_head = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + rxbuf->m_head = m_getjcl(M_DONTWAIT, MT_DATA, + M_PKTHDR, adapter->rx_mbuf_sz); if (rxbuf->m_head == NULL) return (ENOBUFS); - rxbuf->m_head->m_len = MCLBYTES; + rxbuf->m_head->m_len = adapter->rx_mbuf_sz; rxbuf->m_head->m_flags &= ~M_HASFCS; /* we strip it */ - rxbuf->m_head->m_pkthdr.len = MCLBYTES; + rxbuf->m_head->m_pkthdr.len = adapter->rx_mbuf_sz; /* Get the memory mapping */ error = bus_dmamap_load_mbuf_sg(rxr->rxtag, @@ -4082,6 +4122,23 @@ em_initialize_receive_unit(struct adapte E1000_WRITE_REG(hw, E1000_RDT(i), adapter->num_rx_desc - 1); } + /* Set early receive threshold on appropriate hw */ + if (((adapter->hw.mac.type == e1000_ich9lan) || + (adapter->hw.mac.type == e1000_pch2lan) || + (adapter->hw.mac.type == e1000_ich10lan)) && + (ifp->if_mtu > ETHERMTU)) { + u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); + E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); + E1000_WRITE_REG(hw, E1000_ERT, 0x100 | (1 << 13)); + } + + if (adapter->hw.mac.type == e1000_pch2lan) { + if (ifp->if_mtu > ETHERMTU) + e1000_lv_jumbo_workaround_ich8lan(hw, TRUE); + else + e1000_lv_jumbo_workaround_ich8lan(hw, FALSE); + } + /* Setup the Receive Control Register */ rctl &= ~(3 << E1000_RCTL_MO_SHIFT); rctl |= E1000_RCTL_EN | E1000_RCTL_BAM | @@ -4094,7 +4151,14 @@ em_initialize_receive_unit(struct adapte /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; rctl &= ~E1000_RCTL_SBP; - rctl |= E1000_RCTL_SZ_2048; + + if (adapter->rx_mbuf_sz == MCLBYTES) + rctl |= E1000_RCTL_SZ_2048; + else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) + rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX; + else if (adapter->rx_mbuf_sz > MJUMPAGESIZE) + rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX; + if (ifp->if_mtu > ETHERMTU) rctl |= E1000_RCTL_LPE; else @@ -4190,7 +4254,7 @@ em_rxeof(struct rx_ring *rxr, int count, rxr->fmp->m_flags |= M_VLANTAG; } #ifdef EM_MULTIQUEUE - rxr->fmp->m_pkthdr.flowid = curcpu; + rxr->fmp->m_pkthdr.flowid = rxr->msix; rxr->fmp->m_flags |= M_FLOWID; #endif #ifndef __NO_STRICT_ALIGNMENT @@ -4253,6 +4317,7 @@ skip: static __inline void em_rx_discard(struct rx_ring *rxr, int i) { + struct adapter *adapter = rxr->adapter; struct em_buffer *rbuf; struct mbuf *m; @@ -4267,7 +4332,7 @@ em_rx_discard(struct rx_ring *rxr, int i /* Reset state, keep loaded DMA map and reuse */ m = rbuf->m_head; - m->m_len = m->m_pkthdr.len = MCLBYTES; + m->m_len = m->m_pkthdr.len = adapter->rx_mbuf_sz; m->m_flags |= M_PKTHDR; m->m_data = m->m_ext.ext_buf; m->m_next = NULL; @@ -4378,12 +4443,15 @@ em_register_vlan(void *arg, struct ifnet if ((vtag == 0) || (vtag > 4095)) /* Invalid ID */ return; + EM_CORE_LOCK(adapter); index = (vtag >> 5) & 0x7F; bit = vtag & 0x1F; - em_shadow_vfta[index] |= (1 << bit); + adapter->shadow_vfta[index] |= (1 << bit); ++adapter->num_vlans; /* Re-init to load the changes */ - em_init(adapter); + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) + em_init_locked(adapter); + EM_CORE_UNLOCK(adapter); } /* @@ -4402,12 +4470,15 @@ em_unregister_vlan(void *arg, struct ifn if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; + EM_CORE_LOCK(adapter); index = (vtag >> 5) & 0x7F; bit = vtag & 0x1F; - em_shadow_vfta[index] &= ~(1 << bit); + adapter->shadow_vfta[index] &= ~(1 << bit); --adapter->num_vlans; /* Re-init to load the changes */ - em_init(adapter); + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) + em_init_locked(adapter); + EM_CORE_UNLOCK(adapter); } static void @@ -4430,9 +4501,9 @@ em_setup_vlan_hw_support(struct adapter ** we need to repopulate it now. */ for (int i = 0; i < EM_VFTA_SIZE; i++) - if (em_shadow_vfta[i] != 0) + if (adapter->shadow_vfta[i] != 0) E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, - i, em_shadow_vfta[i]); + i, adapter->shadow_vfta[i]); reg = E1000_READ_REG(hw, E1000_CTRL); reg |= E1000_CTRL_VME; @@ -4443,10 +4514,6 @@ em_setup_vlan_hw_support(struct adapter reg &= ~E1000_RCTL_CFIEN; reg |= E1000_RCTL_VFE; E1000_WRITE_REG(hw, E1000_RCTL, reg); - - /* Update the frame size */ - E1000_WRITE_REG(&adapter->hw, E1000_RLPML, - adapter->max_frame_size + VLAN_TAG_SIZE); } static void @@ -4615,6 +4682,7 @@ em_get_wakeup(device_t dev) case e1000_ich9lan: case e1000_ich10lan: case e1000_pchlan: + case e1000_pch2lan: apme_mask = E1000_WUC_APME; adapter->has_amt = TRUE; eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC); @@ -4706,7 +4774,8 @@ em_enable_wakeup(device_t dev) E1000_WRITE_REG(&adapter->hw, E1000_RCTL, rctl); } - if (adapter->hw.mac.type == e1000_pchlan) { + if ((adapter->hw.mac.type == e1000_pchlan) || + (adapter->hw.mac.type == e1000_pch2lan)) { if (em_enable_phy_wakeup(adapter)) return; } else { @@ -4739,16 +4808,7 @@ em_enable_phy_wakeup(struct adapter *ada u16 preg; /* copy MAC RARs to PHY RARs */ - for (int i = 0; i < adapter->hw.mac.rar_entry_count; i++) { - mreg = E1000_READ_REG(hw, E1000_RAL(i)); - e1000_write_phy_reg(hw, BM_RAR_L(i), (u16)(mreg & 0xFFFF)); - e1000_write_phy_reg(hw, BM_RAR_M(i), - (u16)((mreg >> 16) & 0xFFFF)); - mreg = E1000_READ_REG(hw, E1000_RAH(i)); - e1000_write_phy_reg(hw, BM_RAR_H(i), (u16)(mreg & 0xFFFF)); - e1000_write_phy_reg(hw, BM_RAR_CTRL(i), - (u16)((mreg >> 16) & 0xFFFF)); - } + e1000_copy_rx_addrs_to_phy_ich8lan(hw); /* copy MAC MTA to PHY MTA */ for (int i = 0; i < adapter->hw.mac.mta_reg_count; i++) { @@ -5359,4 +5419,70 @@ em_add_rx_process_limit(struct adapter * OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); } +static void +em_set_flow_cntrl(struct adapter *adapter, const char *name, + const char *description, int *limit, int value) +{ + *limit = value; + SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), + OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); +} + +static int +em_sysctl_debug_info(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter; + int error; + int result; + + result = -1; + error = sysctl_handle_int(oidp, &result, 0, req); + + if (error || !req->newptr) + return (error); + + if (result == 1) { + adapter = (struct adapter *)arg1; + em_print_debug_info(adapter); + } + + return (error); +} + +/* +** This routine is meant to be fluid, add whatever is +** needed for debugging a problem. -jfv +*/ +static void +em_print_debug_info(struct adapter *adapter) +{ + device_t dev = adapter->dev; + struct tx_ring *txr = adapter->tx_rings; + struct rx_ring *rxr = adapter->rx_rings; + if (adapter->ifp->if_drv_flags & IFF_DRV_RUNNING) + printf("Interface is RUNNING "); + else + printf("Interface is NOT RUNNING\n"); + if (adapter->ifp->if_drv_flags & IFF_DRV_OACTIVE) + printf("and ACTIVE\n"); + else + printf("and INACTIVE\n"); + + device_printf(dev, "hw tdh = %d, hw tdt = %d\n", + E1000_READ_REG(&adapter->hw, E1000_TDH(0)), + E1000_READ_REG(&adapter->hw, E1000_TDT(0))); + device_printf(dev, "hw rdh = %d, hw rdt = %d\n", + E1000_READ_REG(&adapter->hw, E1000_RDH(0)), + E1000_READ_REG(&adapter->hw, E1000_RDT(0))); + device_printf(dev, "Tx Queue Status = %d\n", txr->queue_status); + device_printf(dev, "TX descriptors avail = %d\n", + txr->tx_avail); + device_printf(dev, "Tx Descriptors avail failure = %ld\n", + txr->no_desc_avail); + device_printf(dev, "RX discarded packets = %ld\n", + rxr->rx_discarded); + device_printf(dev, "RX Next to Check = %d\n", rxr->next_to_check); + device_printf(dev, "RX Next to Refresh = %d\n", rxr->next_to_refresh); +} Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Mon Oct 25 23:59:56 2010 (r214362) +++ head/sys/dev/e1000/if_em.h Tue Oct 26 00:07:58 2010 (r214363) @@ -188,6 +188,10 @@ #define EM_EEPROM_APME 0x400; #define EM_82544_APME 0x0004; +#define EM_QUEUE_IDLE 0 +#define EM_QUEUE_WORKING 1 +#define EM_QUEUE_HUNG 2 + /* * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be * multiple of 128 bytes. So we align TDBA/RDBA on 128 byte boundary. This will @@ -272,7 +276,7 @@ struct tx_ring { u32 me; u32 msix; u32 ims; - bool watchdog_check; + int queue_status; int watchdog_time; struct em_dma_alloc txdma; struct e1000_tx_desc *tx_base; @@ -391,6 +395,7 @@ struct adapter { struct rx_ring *rx_rings; int num_rx_desc; u32 rx_process_limit; + u32 rx_mbuf_sz; /* Management and WOL features */ u32 wol; @@ -400,11 +405,21 @@ struct adapter { /* Multicast array memory */ u8 *mta; - /* Info about the board itself */ - uint8_t link_active; - uint16_t link_speed; - uint16_t link_duplex; - uint32_t smartspeed; + /* + ** Shadow VFTA table, this is needed because + ** the real vlan filter table gets cleared during + ** a soft reset and the driver needs to be able + ** to repopulate it. + */ + u32 shadow_vfta[EM_VFTA_SIZE]; + + /* Info about the interface */ + u8 link_active; + u16 link_speed; + u16 link_duplex; + u32 smartspeed; + u32 fc_setting; + struct em_int_delay_info tx_int_delay; struct em_int_delay_info tx_abs_int_delay; struct em_int_delay_info rx_int_delay; From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 00:21: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 9BB3B106564A; Tue, 26 Oct 2010 00:21:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E49B8FC1A; Tue, 26 Oct 2010 00:21: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 o9Q0LVgc081773; Tue, 26 Oct 2010 00:21:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9Q0LVf9081768; Tue, 26 Oct 2010 00:21:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010260021.o9Q0LVf9081768@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 00:21: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: r214364 - in stable/8: bin/ps sys/kern 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: Tue, 26 Oct 2010 00:21:31 -0000 Author: attilio Date: Tue Oct 26 00:21:31 2010 New Revision: 214364 URL: http://svn.freebsd.org/changeset/base/214364 Log: MFC r213536 by emaste: Make a thread's address available via the kern proc sysctl, just like the process address. Modified: stable/8/bin/ps/keyword.c stable/8/bin/ps/ps.1 stable/8/sys/kern/kern_proc.c stable/8/sys/sys/user.h Directory Properties: stable/8/bin/ps/ (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) Modified: stable/8/bin/ps/keyword.c ============================================================================== --- stable/8/bin/ps/keyword.c Tue Oct 26 00:07:58 2010 (r214363) +++ stable/8/bin/ps/keyword.c Tue Oct 26 00:21:31 2010 (r214364) @@ -186,6 +186,8 @@ static VAR var[] = { UINT, UIDFMT, 0}, {"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid), UINT, UIDFMT, 0}, + {"tdaddr", "TDADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, + KOFF(ki_tdaddr), KPTR, "lx", 0}, {"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0}, {"tdnam", "TDNAM", NULL, LJUST, tdnam, NULL, COMMLEN, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, USER, cputime, NULL, 9, 0, CHAR, NULL, 0}, Modified: stable/8/bin/ps/ps.1 ============================================================================== --- stable/8/bin/ps/ps.1 Tue Oct 26 00:07:58 2010 (r214363) +++ stable/8/bin/ps/ps.1 Tue Oct 26 00:21:31 2010 (r214364) @@ -586,6 +586,8 @@ symbolic process state (alias saved gid from a setgid executable .It Cm svuid saved UID from a setuid executable +.It Cm tdaddr +thread address .It Cm tdev control terminal device number .It Cm time Modified: stable/8/sys/kern/kern_proc.c ============================================================================== --- stable/8/sys/kern/kern_proc.c Tue Oct 26 00:07:58 2010 (r214363) +++ stable/8/sys/kern/kern_proc.c Tue Oct 26 00:21:31 2010 (r214364) @@ -847,6 +847,7 @@ fill_kinfo_thread(struct thread *td, str struct proc *p; p = td->td_proc; + kp->ki_tdaddr = td; PROC_LOCK_ASSERT(p, MA_OWNED); thread_lock(td); Modified: stable/8/sys/sys/user.h ============================================================================== --- stable/8/sys/sys/user.h Tue Oct 26 00:07:58 2010 (r214363) +++ stable/8/sys/sys/user.h Tue Oct 26 00:21:31 2010 (r214364) @@ -85,7 +85,7 @@ */ #define KI_NSPARE_INT 9 #define KI_NSPARE_LONG 12 -#define KI_NSPARE_PTR 7 +#define KI_NSPARE_PTR 6 #ifndef _KERNEL #ifndef KINFO_PROC_SIZE @@ -188,6 +188,7 @@ struct kinfo_proc { struct pcb *ki_pcb; /* kernel virtual addr of pcb */ void *ki_kstack; /* kernel virtual addr of stack */ void *ki_udata; /* User convenience pointer */ + struct thread *ki_tdaddr; /* address of thread */ /* * When adding new variables, take space for pointers from the * front of ki_spareptrs, and longs from the end of ki_sparelongs. From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 00:42: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 16EB4106566B; Tue, 26 Oct 2010 00:42:35 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id D494E8FC13; Tue, 26 Oct 2010 00:42:33 +0000 (UTC) Received: by wwb24 with SMTP id 24so3970842wwb.31 for ; Mon, 25 Oct 2010 17:42:32 -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=NEmA+qlVX1W3uISHR5faPGo7aAAHvI1k1y3J76TgcZ0=; b=pAbN1ojTt1GCRvqIqlaph5qWxHxUtPd2SRh0aG69FmnayldyxtaH1+NnGvRpNVf8hN VeV0ki0qmiJghV+MibWmtiyt+t0NXXWASoBLXM7/+ui5Sla1Lq2plv4zzRSYiSKCzAAP NEXOob6GGIXqeFoNLUn5yX2kFXR5Wl8wMY1ws= 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=haMdlguC8fThYuVguWNIrPYWlOcp6hEzPUwtGhI9LkgaST27eXwCmKURDJToipm/oc nee1B9x3uqa4FUJ8pJEmzDUP0ZrY2SUsTk1jySYBteCLHltgQaljT27K/1kk1PGJqydd jEt4IUzQmVe07mk23CVd1wtE0o5uhUAeTZhFI= MIME-Version: 1.0 Received: by 10.227.163.7 with SMTP id y7mr7177005wbx.35.1288052245316; Mon, 25 Oct 2010 17:17:25 -0700 (PDT) Received: by 10.216.232.132 with HTTP; Mon, 25 Oct 2010 17:17:25 -0700 (PDT) In-Reply-To: <201010260007.o9Q07wpP081422@svn.freebsd.org> References: <201010260007.o9Q07wpP081422@svn.freebsd.org> Date: Mon, 25 Oct 2010 17:17:25 -0700 Message-ID: From: Jack Vogel To: Jack F Vogel Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214363 - 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: Tue, 26 Oct 2010 00:42:35 -0000 Always forget a couple items when I list changes and since some people are about such things let me add: - Also add 3 tier mbuf cluster size, based on the MTU, so as you increase beyond standard you go 4K, and once over that you get 9K clusters now. - Add a sysctl to change the flow control setting, this came up while debugging an issue with PCH hardware, and it had long been needed anyway. - I added back the debug print routine that got removed with gnn's cool stats code, I just still find it helpful when I'm tracking down problems so it seems worth keeping around to me :) OK, I think that covers it all. Please give this code some testing, its what I would like to see in 8.2 Cheers, Jack On Mon, Oct 25, 2010 at 5:07 PM, Jack F Vogel wrote: > Author: jfv > Date: Tue Oct 26 00:07:58 2010 > New Revision: 214363 > URL: http://svn.freebsd.org/changeset/base/214363 > > Log: > Bug fix delta to the em driver: > - Chasin down bogus watchdogs has led to an improved > design to this handling, the hang decision takes > place in the tx cleanup, with only a simple report > check in local_timer. Our tests have shown no false > watchdogs with this code. > - VLAN fixes from jhb, the shadow vfta should be per > interface, but as global it was not. Thanks John. > - Bug fixes in the support for new PCH2 hardware. > - Thanks for all the help and feedback on the driver, > changes to lem with be coming shortly as well. > > Modified: > head/sys/dev/e1000/if_em.c > head/sys/dev/e1000/if_em.h > > Modified: head/sys/dev/e1000/if_em.c > > ============================================================================== > --- head/sys/dev/e1000/if_em.c Mon Oct 25 23:59:56 2010 (r214362) > +++ head/sys/dev/e1000/if_em.c Tue Oct 26 00:07:58 2010 (r214363) > @@ -93,8 +93,7 @@ int em_display_debug_stats = 0; > /********************************************************************* > * Driver version: > *********************************************************************/ > -char em_driver_version[] = "7.0.8"; > - > +char em_driver_version[] = "7.1.6"; > > /********************************************************************* > * PCI Device ID Table > @@ -170,6 +169,8 @@ static em_vendor_info_t em_vendor_info_a > { 0x8086, E1000_DEV_ID_PCH_M_HV_LC, PCI_ANY_ID, PCI_ANY_ID, 0}, > { 0x8086, E1000_DEV_ID_PCH_D_HV_DM, PCI_ANY_ID, PCI_ANY_ID, 0}, > { 0x8086, E1000_DEV_ID_PCH_D_HV_DC, PCI_ANY_ID, PCI_ANY_ID, 0}, > + { 0x8086, E1000_DEV_ID_PCH2_LV_LM, PCI_ANY_ID, PCI_ANY_ID, 0}, > + { 0x8086, E1000_DEV_ID_PCH2_LV_V, PCI_ANY_ID, PCI_ANY_ID, 0}, > /* required last entry */ > { 0, 0, 0, 0, 0} > }; > @@ -256,6 +257,8 @@ static int em_dma_malloc(struct adapter > static void em_dma_free(struct adapter *, struct em_dma_alloc *); > static int em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); > static void em_print_nvm_info(struct adapter *); > +static int em_sysctl_debug_info(SYSCTL_HANDLER_ARGS); > +static void em_print_debug_info(struct adapter *); > static int em_is_valid_ether_addr(u8 *); > static int em_sysctl_int_delay(SYSCTL_HANDLER_ARGS); > static void em_add_int_delay_sysctl(struct adapter *, const char *, > @@ -282,6 +285,8 @@ static void em_handle_link(void *context > > static void em_add_rx_process_limit(struct adapter *, const char *, > const char *, int *, int); > +static void em_set_flow_cntrl(struct adapter *, const char *, > + const char *, int *, int); > > static __inline void em_rx_discard(struct rx_ring *, int); > > @@ -359,14 +364,6 @@ TUNABLE_INT("hw.em.rx_process_limit", &e > static int em_fc_setting = e1000_fc_full; > TUNABLE_INT("hw.em.fc_setting", &em_fc_setting); > > -/* > -** Shadow VFTA table, this is needed because > -** the real vlan filter table gets cleared during > -** a soft reset and the driver needs to be able > -** to repopulate it. > -*/ > -static u32 em_shadow_vfta[EM_VFTA_SIZE]; > - > /* Global used in WOL setup with multiport cards */ > static int global_quad_port_a = 0; > > @@ -449,6 +446,11 @@ em_attach(device_t dev) > OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, > em_sysctl_nvm_info, "I", "NVM Information"); > > + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > + OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, > + em_sysctl_debug_info, "I", "Debug Information"); > + > callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); > > /* Determine hardware and mac info */ > @@ -468,9 +470,10 @@ em_attach(device_t dev) > ** identified > */ > if ((adapter->hw.mac.type == e1000_ich8lan) || > - (adapter->hw.mac.type == e1000_pchlan) || > (adapter->hw.mac.type == e1000_ich9lan) || > - (adapter->hw.mac.type == e1000_ich10lan)) { > + (adapter->hw.mac.type == e1000_ich10lan) || > + (adapter->hw.mac.type == e1000_pchlan) || > + (adapter->hw.mac.type == e1000_pch2lan)) { > int rid = EM_BAR_TYPE_FLASH; > adapter->flash = bus_alloc_resource_any(dev, > SYS_RES_MEMORY, &rid, RF_ACTIVE); > @@ -514,11 +517,16 @@ em_attach(device_t dev) > E1000_REGISTER(&adapter->hw, E1000_TADV), > em_tx_abs_int_delay_dflt); > > - /* Sysctls for limiting the amount of work done in the taskqueue */ > + /* Sysctl for limiting the amount of work done in the taskqueue */ > em_add_rx_process_limit(adapter, "rx_processing_limit", > "max number of rx packets to process", > &adapter->rx_process_limit, > em_rx_process_limit); > > + /* Sysctl for setting the interface flow control */ > + em_set_flow_cntrl(adapter, "flow_control", > + "max number of rx packets to process", > + &adapter->fc_setting, em_fc_setting); > + > /* > * Validate number of transmit and receive descriptors. It > * must not exceed hardware maximum, and must be multiple > @@ -581,6 +589,11 @@ em_attach(device_t dev) > goto err_late; > } > > + /* Check SOL/IDER usage */ > + if (e1000_check_reset_block(&adapter->hw)) > + device_printf(dev, "PHY reset is blocked" > + " due to SOL/IDER session.\n"); > + > /* > ** Start from a known state, this is > ** important in reading the nvm and > @@ -644,11 +657,6 @@ em_attach(device_t dev) > adapter->hw.mac.get_link_status = 1; > em_update_link_status(adapter); > > - /* Indicate SOL/IDER usage */ > - if (e1000_check_reset_block(&adapter->hw)) > - device_printf(dev, > - "PHY reset is blocked due to SOL/IDER session.\n"); > - > /* Register for VLAN events */ > adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, > em_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); > @@ -857,7 +865,7 @@ em_mq_start_locked(struct ifnet *ifp, st > > if (enq > 0) { > /* Set the watchdog */ > - txr->watchdog_check = TRUE; > + txr->queue_status = EM_QUEUE_WORKING; > txr->watchdog_time = ticks; > } > return (err); > @@ -870,14 +878,8 @@ static int > em_mq_start(struct ifnet *ifp, struct mbuf *m) > { > struct adapter *adapter = ifp->if_softc; > - struct tx_ring *txr; > - int i = 0, error = 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]; > + struct tx_ring *txr = adapter->tx_rings; > + int error; > > if (EM_TX_TRYLOCK(txr)) { > error = em_mq_start_locked(ifp, txr, m); > @@ -953,7 +955,7 @@ em_start_locked(struct ifnet *ifp, struc > > /* Set timeout in case hardware has problems transmitting. > */ > txr->watchdog_time = ticks; > - txr->watchdog_check = TRUE; > + txr->queue_status = EM_QUEUE_WORKING; > } > > return; > @@ -1029,6 +1031,7 @@ em_ioctl(struct ifnet *ifp, u_long comma > case e1000_82572: > case e1000_ich9lan: > case e1000_ich10lan: > + case e1000_pch2lan: > case e1000_82574: > case e1000_80003es2lan: /* 9K Jumbo Frame size */ > max_frame_size = 9234; > @@ -1092,6 +1095,11 @@ em_ioctl(struct ifnet *ifp, u_long comma > } > break; > case SIOCSIFMEDIA: > + /* > + ** As the speed/duplex settings are being > + ** changed, we need to reset the PHY. > + */ > + adapter->hw.phy.reset_disable = FALSE; > /* Check SOL/IDER usage */ > EM_CORE_LOCK(adapter); > if (e1000_check_reset_block(&adapter->hw)) { > @@ -1101,6 +1109,7 @@ em_ioctl(struct ifnet *ifp, u_long comma > break; > } > EM_CORE_UNLOCK(adapter); > + /* falls thru */ > case SIOCGIFMEDIA: > IOCTL_DEBUGOUT("ioctl rcv'd: \ > SIOCxIFMEDIA (Get/Set Interface Media)"); > @@ -1215,13 +1224,16 @@ em_init_locked(struct adapter *adapter) > case e1000_82583: > pba = E1000_PBA_20K; /* 20K for Rx, 20K for Tx */ > break; > + case e1000_ich8lan: > + pba = E1000_PBA_8K; > + break; > case e1000_ich9lan: > case e1000_ich10lan: > case e1000_pchlan: > pba = E1000_PBA_10K; > break; > - case e1000_ich8lan: > - pba = E1000_PBA_8K; > + case e1000_pch2lan: > + pba = E1000_PBA_26K; > break; > default: > if (adapter->max_frame_size > 8192) > @@ -1259,19 +1271,6 @@ em_init_locked(struct adapter *adapter) > /* Setup VLAN support, basic and offload if available */ > E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN); > > - /* Use real VLAN Filter support? */ > - if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { > - if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) > - /* Use real VLAN Filter support */ > - em_setup_vlan_hw_support(adapter); > - else { > - u32 ctrl; > - ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); > - ctrl |= E1000_CTRL_VME; > - E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); > - } > - } > - > /* Set hardware offload abilities */ > ifp->if_hwassist = 0; > if (ifp->if_capenable & IFCAP_TXCSUM) > @@ -1289,6 +1288,17 @@ em_init_locked(struct adapter *adapter) > /* Setup Multicast table */ > em_set_multi(adapter); > > + /* > + ** Figure out the desired mbuf > + ** pool for doing jumbos > + */ > + if (adapter->max_frame_size <= 2048) > + adapter->rx_mbuf_sz = MCLBYTES; > + else if (adapter->max_frame_size <= 4096) > + adapter->rx_mbuf_sz = MJUMPAGESIZE; > + else > + adapter->rx_mbuf_sz = MJUM9BYTES; > + > /* Prepare receive descriptors and buffers */ > if (em_setup_receive_structures(adapter)) { > device_printf(dev, "Could not setup receive structures\n"); > @@ -1297,6 +1307,19 @@ em_init_locked(struct adapter *adapter) > } > em_initialize_receive_unit(adapter); > > + /* Use real VLAN Filter support? */ > + if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { > + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) > + /* Use real VLAN Filter support */ > + em_setup_vlan_hw_support(adapter); > + else { > + u32 ctrl; > + ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); > + ctrl |= E1000_CTRL_VME; > + E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); > + } > + } > + > /* Don't lose promiscuous settings */ > em_set_promisc(adapter); > > @@ -1707,11 +1730,6 @@ em_media_change(struct ifnet *ifp) > device_printf(adapter->dev, "Unsupported media type\n"); > } > > - /* As the speed/duplex settings my have changed we need to > - * reset the PHY. > - */ > - adapter->hw.phy.reset_disable = FALSE; > - > em_init_locked(adapter); > EM_CORE_UNLOCK(adapter); > > @@ -1929,15 +1947,12 @@ em_xmit(struct tx_ring *txr, struct mbuf > m_head = *m_headp; > > /* Do hardware assists */ > -#if __FreeBSD_version >= 700000 > if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { > - em_tso_setup(txr, m_head, ip_off, ip, tp, &txd_upper, > - &txd_lower); > + em_tso_setup(txr, m_head, ip_off, ip, tp, > + &txd_upper, &txd_lower); > /* we need to make a final sentinel transmit desc */ > tso_desc = TRUE; > - } else > -#endif > - if (m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD) > + } else if (m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD) > em_transmit_checksum_setup(txr, m_head, > ip_off, ip, &txd_upper, &txd_lower); > > @@ -2164,34 +2179,30 @@ em_local_timer(void *arg) > em_update_stats_counters(adapter); > > /* Reset LAA into RAR[0] on 82571 */ > - if (e1000_get_laa_state_82571(&adapter->hw) == TRUE) > + if ((adapter->hw.mac.type == e1000_82571) && > + e1000_get_laa_state_82571(&adapter->hw)) > e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0); > > /* > - ** If flow control has paused us since last checking > - ** it invalidates the watchdog timing, so dont run it. > + ** Don't do TX watchdog check if we've been paused > */ > if (adapter->pause_frames) { > adapter->pause_frames = 0; > goto out; > } > /* > - ** Check for time since any descriptor was cleaned > + ** Check on the state of the TX queue(s), this > + ** can be done without the lock because its RO > + ** and the HUNG state will be static if set. > */ > - for (int i = 0; i < adapter->num_queues; i++, txr++) { > - EM_TX_LOCK(txr); > - if (txr->watchdog_check == FALSE) { > - EM_TX_UNLOCK(txr); > - continue; > - } > - if ((ticks - txr->watchdog_time) > EM_WATCHDOG) > + for (int i = 0; i < adapter->num_queues; i++, txr++) > + if (txr->queue_status == EM_QUEUE_HUNG) > goto hung; > - EM_TX_UNLOCK(txr); > - } > out: > callout_reset(&adapter->timer, hz, em_local_timer, adapter); > return; > hung: > + /* Looks like we're hung */ > device_printf(adapter->dev, "Watchdog timeout -- resetting\n"); > device_printf(adapter->dev, > "Queue(%d) tdh = %d, hw tdt = %d\n", txr->me, > @@ -2272,7 +2283,7 @@ em_update_link_status(struct adapter *ad > adapter->link_active = 0; > /* Link down, disable watchdog */ > for (int i = 0; i < adapter->num_queues; i++, txr++) > - txr->watchdog_check = FALSE; > + txr->queue_status = EM_QUEUE_IDLE; > if_link_state_change(ifp, LINK_STATE_DOWN); > } > } > @@ -2306,7 +2317,7 @@ em_stop(void *arg) > /* Unarm watchdog timer. */ > for (int i = 0; i < adapter->num_queues; i++, txr++) { > EM_TX_LOCK(txr); > - txr->watchdog_check = FALSE; > + txr->queue_status = EM_QUEUE_IDLE; > EM_TX_UNLOCK(txr); > } > > @@ -2571,6 +2582,9 @@ em_free_pci_resources(struct adapter *ad > for (int i = 0; i < adapter->num_queues; i++) { > txr = &adapter->tx_rings[i]; > rxr = &adapter->rx_rings[i]; > + /* an early abort? */ > + if ((txr == NULL) || (rxr == NULL)) > + break; > rid = txr->msix +1; > if (txr->tag != NULL) { > bus_teardown_intr(dev, txr->res, txr->tag); > @@ -2689,6 +2703,7 @@ static void > em_reset(struct adapter *adapter) > { > device_t dev = adapter->dev; > + struct ifnet *ifp = adapter->ifp; > struct e1000_hw *hw = &adapter->hw; > u16 rx_buffer_size; > > @@ -2733,15 +2748,25 @@ em_reset(struct adapter *adapter) > hw->fc.send_xon = TRUE; > > /* Set Flow control, use the tunable location if sane */ > - if ((em_fc_setting >= 0) || (em_fc_setting < 4)) > - hw->fc.requested_mode = em_fc_setting; > - else > - hw->fc.requested_mode = e1000_fc_none; > + hw->fc.requested_mode = adapter->fc_setting; > > - /* Override - workaround for PCHLAN issue */ > + /* Workaround: no TX flow ctrl for PCH */ > if (hw->mac.type == e1000_pchlan) > hw->fc.requested_mode = e1000_fc_rx_pause; > > + /* Override - settings for PCH2LAN, ya its magic :) */ > + if (hw->mac.type == e1000_pch2lan) { > + hw->fc.high_water = 0x5C20; > + hw->fc.low_water = 0x5048; > + hw->fc.pause_time = 0x0650; > + hw->fc.refresh_time = 0x0400; > + /* Jumbos need adjusted PBA */ > + if (ifp->if_mtu > ETHERMTU) > + E1000_WRITE_REG(hw, E1000_PBA, 12); > + else > + E1000_WRITE_REG(hw, E1000_PBA, 26); > + } > + > /* Issue a global reset */ > e1000_reset_hw(hw); > E1000_WRITE_REG(hw, E1000_WUC, 0); > @@ -3173,6 +3198,7 @@ em_setup_transmit_ring(struct tx_ring *t > > /* Set number of descriptors available */ > txr->tx_avail = adapter->num_tx_desc; > + txr->queue_status = EM_QUEUE_IDLE; > > /* Clear checksum offload context. */ > txr->last_hw_offload = 0; > @@ -3233,7 +3259,7 @@ em_initialize_transmit_unit(struct adapt > E1000_READ_REG(&adapter->hw, E1000_TDBAL(i)), > E1000_READ_REG(&adapter->hw, E1000_TDLEN(i))); > > - txr->watchdog_check = FALSE; > + txr->queue_status = EM_QUEUE_IDLE; > } > > /* Set the default values for the Tx Inter Packet Gap timer */ > @@ -3610,16 +3636,20 @@ static bool > em_txeof(struct tx_ring *txr) > { > struct adapter *adapter = txr->adapter; > - int first, last, done; > + int first, last, done, processed; > struct em_buffer *tx_buffer; > struct e1000_tx_desc *tx_desc, *eop_desc; > struct ifnet *ifp = adapter->ifp; > > EM_TX_LOCK_ASSERT(txr); > > - if (txr->tx_avail == adapter->num_tx_desc) > + /* No work, make sure watchdog is off */ > + if (txr->tx_avail == adapter->num_tx_desc) { > + txr->queue_status = EM_QUEUE_IDLE; > return (FALSE); > + } > > + processed = 0; > first = txr->next_to_clean; > tx_desc = &txr->tx_base[first]; > tx_buffer = &txr->tx_buffers[first]; > @@ -3646,6 +3676,7 @@ em_txeof(struct tx_ring *txr) > tx_desc->lower.data = 0; > tx_desc->buffer_addr = 0; > ++txr->tx_avail; > + ++processed; > > if (tx_buffer->m_head) { > bus_dmamap_sync(txr->txtag, > @@ -3681,6 +3712,16 @@ em_txeof(struct tx_ring *txr) > > txr->next_to_clean = first; > > + /* > + ** Watchdog calculation, we know there's > + ** work outstanding or the first return > + ** would have been taken, so none processed > + ** for too long indicates a hang. local timer > + ** will examine this and do a reset if needed. > + */ > + if ((!processed) && ((ticks - txr->watchdog_time) > EM_WATCHDOG)) > + txr->queue_status = EM_QUEUE_HUNG; > + > /* > * If we have enough room, clear IFF_DRV_OACTIVE > * to tell the stack that it is OK to send packets. > @@ -3689,7 +3730,7 @@ em_txeof(struct tx_ring *txr) > ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; > /* Disable watchdog if all clean */ > if (txr->tx_avail == adapter->num_tx_desc) { > - txr->watchdog_check = FALSE; > + txr->queue_status = EM_QUEUE_IDLE; > return (FALSE); > } > } > @@ -3723,7 +3764,8 @@ em_refresh_mbufs(struct rx_ring *rxr, in > */ > if (rxbuf->m_head != NULL) > goto reuse; > - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); > + m = m_getjcl(M_DONTWAIT, MT_DATA, > + M_PKTHDR, adapter->rx_mbuf_sz); > /* > ** If we have a temporary resource shortage > ** that causes a failure, just abort refresh > @@ -3732,10 +3774,7 @@ em_refresh_mbufs(struct rx_ring *rxr, in > */ > if (m == NULL) > goto update; > - m->m_len = m->m_pkthdr.len = MCLBYTES; > - > - if (adapter->max_frame_size <= (MCLBYTES - ETHER_ALIGN)) > - m_adj(m, ETHER_ALIGN); > + m->m_len = m->m_pkthdr.len = adapter->rx_mbuf_sz; > > /* Use bus_dma machinery to setup the memory mapping */ > error = bus_dmamap_load_mbuf_sg(rxr->rxtag, rxbuf->map, > @@ -3801,9 +3840,9 @@ em_allocate_receive_buffers(struct rx_ri > BUS_SPACE_MAXADDR, /* lowaddr */ > BUS_SPACE_MAXADDR, /* highaddr */ > NULL, NULL, /* filter, filterarg > */ > - MCLBYTES, /* maxsize */ > + MJUM9BYTES, /* maxsize */ > 1, /* nsegments */ > - MCLBYTES, /* maxsegsize */ > + MJUM9BYTES, /* maxsegsize */ > 0, /* flags */ > NULL, /* lockfunc */ > NULL, /* lockarg */ > @@ -3871,12 +3910,13 @@ em_setup_receive_ring(struct rx_ring *rx > for (int j = 0; j != adapter->num_rx_desc; ++j) { > > rxbuf = &rxr->rx_buffers[j]; > - rxbuf->m_head = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); > + rxbuf->m_head = m_getjcl(M_DONTWAIT, MT_DATA, > + M_PKTHDR, adapter->rx_mbuf_sz); > if (rxbuf->m_head == NULL) > return (ENOBUFS); > - rxbuf->m_head->m_len = MCLBYTES; > + rxbuf->m_head->m_len = adapter->rx_mbuf_sz; > rxbuf->m_head->m_flags &= ~M_HASFCS; /* we strip it */ > - rxbuf->m_head->m_pkthdr.len = MCLBYTES; > + rxbuf->m_head->m_pkthdr.len = adapter->rx_mbuf_sz; > > /* Get the memory mapping */ > error = bus_dmamap_load_mbuf_sg(rxr->rxtag, > @@ -4082,6 +4122,23 @@ em_initialize_receive_unit(struct adapte > E1000_WRITE_REG(hw, E1000_RDT(i), adapter->num_rx_desc - 1); > } > > + /* Set early receive threshold on appropriate hw */ > + if (((adapter->hw.mac.type == e1000_ich9lan) || > + (adapter->hw.mac.type == e1000_pch2lan) || > + (adapter->hw.mac.type == e1000_ich10lan)) && > + (ifp->if_mtu > ETHERMTU)) { > + u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); > + E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); > + E1000_WRITE_REG(hw, E1000_ERT, 0x100 | (1 << 13)); > + } > + > + if (adapter->hw.mac.type == e1000_pch2lan) { > + if (ifp->if_mtu > ETHERMTU) > + e1000_lv_jumbo_workaround_ich8lan(hw, TRUE); > + else > + e1000_lv_jumbo_workaround_ich8lan(hw, FALSE); > + } > + > /* Setup the Receive Control Register */ > rctl &= ~(3 << E1000_RCTL_MO_SHIFT); > rctl |= E1000_RCTL_EN | E1000_RCTL_BAM | > @@ -4094,7 +4151,14 @@ em_initialize_receive_unit(struct adapte > /* Make sure VLAN Filters are off */ > rctl &= ~E1000_RCTL_VFE; > rctl &= ~E1000_RCTL_SBP; > - rctl |= E1000_RCTL_SZ_2048; > + > + if (adapter->rx_mbuf_sz == MCLBYTES) > + rctl |= E1000_RCTL_SZ_2048; > + else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) > + rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX; > + else if (adapter->rx_mbuf_sz > MJUMPAGESIZE) > + rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX; > + > if (ifp->if_mtu > ETHERMTU) > rctl |= E1000_RCTL_LPE; > else > @@ -4190,7 +4254,7 @@ em_rxeof(struct rx_ring *rxr, int count, > rxr->fmp->m_flags |= M_VLANTAG; > } > #ifdef EM_MULTIQUEUE > - rxr->fmp->m_pkthdr.flowid = curcpu; > + rxr->fmp->m_pkthdr.flowid = rxr->msix; > rxr->fmp->m_flags |= M_FLOWID; > #endif > #ifndef __NO_STRICT_ALIGNMENT > @@ -4253,6 +4317,7 @@ skip: > static __inline void > em_rx_discard(struct rx_ring *rxr, int i) > { > + struct adapter *adapter = rxr->adapter; > struct em_buffer *rbuf; > struct mbuf *m; > > @@ -4267,7 +4332,7 @@ em_rx_discard(struct rx_ring *rxr, int i > > /* Reset state, keep loaded DMA map and reuse */ > m = rbuf->m_head; > - m->m_len = m->m_pkthdr.len = MCLBYTES; > + m->m_len = m->m_pkthdr.len = adapter->rx_mbuf_sz; > m->m_flags |= M_PKTHDR; > m->m_data = m->m_ext.ext_buf; > m->m_next = NULL; > @@ -4378,12 +4443,15 @@ em_register_vlan(void *arg, struct ifnet > if ((vtag == 0) || (vtag > 4095)) /* Invalid ID */ > return; > > + EM_CORE_LOCK(adapter); > index = (vtag >> 5) & 0x7F; > bit = vtag & 0x1F; > - em_shadow_vfta[index] |= (1 << bit); > + adapter->shadow_vfta[index] |= (1 << bit); > ++adapter->num_vlans; > /* Re-init to load the changes */ > - em_init(adapter); > + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) > + em_init_locked(adapter); > + EM_CORE_UNLOCK(adapter); > } > > /* > @@ -4402,12 +4470,15 @@ em_unregister_vlan(void *arg, struct ifn > if ((vtag == 0) || (vtag > 4095)) /* Invalid */ > return; > > + EM_CORE_LOCK(adapter); > index = (vtag >> 5) & 0x7F; > bit = vtag & 0x1F; > - em_shadow_vfta[index] &= ~(1 << bit); > + adapter->shadow_vfta[index] &= ~(1 << bit); > --adapter->num_vlans; > /* Re-init to load the changes */ > - em_init(adapter); > + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) > + em_init_locked(adapter); > + EM_CORE_UNLOCK(adapter); > } > > static void > @@ -4430,9 +4501,9 @@ em_setup_vlan_hw_support(struct adapter > ** we need to repopulate it now. > */ > for (int i = 0; i < EM_VFTA_SIZE; i++) > - if (em_shadow_vfta[i] != 0) > + if (adapter->shadow_vfta[i] != 0) > E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, > - i, em_shadow_vfta[i]); > + i, adapter->shadow_vfta[i]); > > reg = E1000_READ_REG(hw, E1000_CTRL); > reg |= E1000_CTRL_VME; > @@ -4443,10 +4514,6 @@ em_setup_vlan_hw_support(struct adapter > reg &= ~E1000_RCTL_CFIEN; > reg |= E1000_RCTL_VFE; > E1000_WRITE_REG(hw, E1000_RCTL, reg); > - > - /* Update the frame size */ > - E1000_WRITE_REG(&adapter->hw, E1000_RLPML, > - adapter->max_frame_size + VLAN_TAG_SIZE); > } > > static void > @@ -4615,6 +4682,7 @@ em_get_wakeup(device_t dev) > case e1000_ich9lan: > case e1000_ich10lan: > case e1000_pchlan: > + case e1000_pch2lan: > apme_mask = E1000_WUC_APME; > adapter->has_amt = TRUE; > eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC); > @@ -4706,7 +4774,8 @@ em_enable_wakeup(device_t dev) > E1000_WRITE_REG(&adapter->hw, E1000_RCTL, rctl); > } > > - if (adapter->hw.mac.type == e1000_pchlan) { > + if ((adapter->hw.mac.type == e1000_pchlan) || > + (adapter->hw.mac.type == e1000_pch2lan)) { > if (em_enable_phy_wakeup(adapter)) > return; > } else { > @@ -4739,16 +4808,7 @@ em_enable_phy_wakeup(struct adapter *ada > u16 preg; > > /* copy MAC RARs to PHY RARs */ > - for (int i = 0; i < adapter->hw.mac.rar_entry_count; i++) { > - mreg = E1000_READ_REG(hw, E1000_RAL(i)); > - e1000_write_phy_reg(hw, BM_RAR_L(i), (u16)(mreg & 0xFFFF)); > - e1000_write_phy_reg(hw, BM_RAR_M(i), > - (u16)((mreg >> 16) & 0xFFFF)); > - mreg = E1000_READ_REG(hw, E1000_RAH(i)); > - e1000_write_phy_reg(hw, BM_RAR_H(i), (u16)(mreg & 0xFFFF)); > - e1000_write_phy_reg(hw, BM_RAR_CTRL(i), > - (u16)((mreg >> 16) & 0xFFFF)); > - } > + e1000_copy_rx_addrs_to_phy_ich8lan(hw); > > /* copy MAC MTA to PHY MTA */ > for (int i = 0; i < adapter->hw.mac.mta_reg_count; i++) { > @@ -5359,4 +5419,70 @@ em_add_rx_process_limit(struct adapter * > OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, > description); > } > > +static void > +em_set_flow_cntrl(struct adapter *adapter, const char *name, > + const char *description, int *limit, int value) > +{ > + *limit = value; > + SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), > + SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), > + OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, > description); > +} > + > +static int > +em_sysctl_debug_info(SYSCTL_HANDLER_ARGS) > +{ > + struct adapter *adapter; > + int error; > + int result; > + > + result = -1; > + error = sysctl_handle_int(oidp, &result, 0, req); > + > + if (error || !req->newptr) > + return (error); > + > + if (result == 1) { > + adapter = (struct adapter *)arg1; > + em_print_debug_info(adapter); > + } > + > + return (error); > +} > + > +/* > +** This routine is meant to be fluid, add whatever is > +** needed for debugging a problem. -jfv > +*/ > +static void > +em_print_debug_info(struct adapter *adapter) > +{ > + device_t dev = adapter->dev; > + struct tx_ring *txr = adapter->tx_rings; > + struct rx_ring *rxr = adapter->rx_rings; > > + if (adapter->ifp->if_drv_flags & IFF_DRV_RUNNING) > + printf("Interface is RUNNING "); > + else > + printf("Interface is NOT RUNNING\n"); > + if (adapter->ifp->if_drv_flags & IFF_DRV_OACTIVE) > + printf("and ACTIVE\n"); > + else > + printf("and INACTIVE\n"); > + > + device_printf(dev, "hw tdh = %d, hw tdt = %d\n", > + E1000_READ_REG(&adapter->hw, E1000_TDH(0)), > + E1000_READ_REG(&adapter->hw, E1000_TDT(0))); > + device_printf(dev, "hw rdh = %d, hw rdt = %d\n", > + E1000_READ_REG(&adapter->hw, E1000_RDH(0)), > + E1000_READ_REG(&adapter->hw, E1000_RDT(0))); > + device_printf(dev, "Tx Queue Status = %d\n", txr->queue_status); > + device_printf(dev, "TX descriptors avail = %d\n", > + txr->tx_avail); > + device_printf(dev, "Tx Descriptors avail failure = %ld\n", > + txr->no_desc_avail); > + device_printf(dev, "RX discarded packets = %ld\n", > + rxr->rx_discarded); > + device_printf(dev, "RX Next to Check = %d\n", rxr->next_to_check); > + device_printf(dev, "RX Next to Refresh = %d\n", > rxr->next_to_refresh); > +} > > Modified: head/sys/dev/e1000/if_em.h > > ============================================================================== > --- head/sys/dev/e1000/if_em.h Mon Oct 25 23:59:56 2010 (r214362) > +++ head/sys/dev/e1000/if_em.h Tue Oct 26 00:07:58 2010 (r214363) > @@ -188,6 +188,10 @@ > #define EM_EEPROM_APME 0x400; > #define EM_82544_APME 0x0004; > > +#define EM_QUEUE_IDLE 0 > +#define EM_QUEUE_WORKING 1 > +#define EM_QUEUE_HUNG 2 > + > /* > * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should > be > * multiple of 128 bytes. So we align TDBA/RDBA on 128 byte boundary. This > will > @@ -272,7 +276,7 @@ struct tx_ring { > u32 me; > u32 msix; > u32 ims; > - bool watchdog_check; > + int queue_status; > int watchdog_time; > struct em_dma_alloc txdma; > struct e1000_tx_desc *tx_base; > @@ -391,6 +395,7 @@ struct adapter { > struct rx_ring *rx_rings; > int num_rx_desc; > u32 rx_process_limit; > + u32 rx_mbuf_sz; > > /* Management and WOL features */ > u32 wol; > @@ -400,11 +405,21 @@ struct adapter { > /* Multicast array memory */ > u8 *mta; > > - /* Info about the board itself */ > - uint8_t link_active; > - uint16_t link_speed; > - uint16_t link_duplex; > - uint32_t smartspeed; > + /* > + ** Shadow VFTA table, this is needed because > + ** the real vlan filter table gets cleared during > + ** a soft reset and the driver needs to be able > + ** to repopulate it. > + */ > + u32 shadow_vfta[EM_VFTA_SIZE]; > + > + /* Info about the interface */ > + u8 link_active; > + u16 link_speed; > + u16 link_duplex; > + u32 smartspeed; > + u32 fc_setting; > + > struct em_int_delay_info tx_int_delay; > struct em_int_delay_info tx_abs_int_delay; > struct em_int_delay_info rx_int_delay; > From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 00:46: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 1BD87106566C; Tue, 26 Oct 2010 00:46:03 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08F508FC1C; Tue, 26 Oct 2010 00:46: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 o9Q0k2Wf082399; Tue, 26 Oct 2010 00:46:02 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9Q0k2dj082394; Tue, 26 Oct 2010 00:46:02 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010260046.o9Q0k2dj082394@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 00:46:02 +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: r214365 - stable/8/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 00:46:03 -0000 Author: attilio Date: Tue Oct 26 00:46:02 2010 New Revision: 214365 URL: http://svn.freebsd.org/changeset/base/214365 Log: MFC r206540 by emaste: Sync some minor items with the upstream driver. Should have no functional change. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aac_pci.c stable/8/sys/dev/aac/aac_tables.h stable/8/sys/dev/aac/aacreg.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) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Tue Oct 26 00:21:31 2010 (r214364) +++ stable/8/sys/dev/aac/aac.c Tue Oct 26 00:46:02 2010 (r214365) @@ -1881,7 +1881,7 @@ aac_init(struct aac_softc *sc) ip->InitFlags = 0; if (sc->flags & AAC_FLAGS_NEW_COMM) { - ip->InitFlags = INITFLAGS_NEW_COMM_SUPPORTED; + ip->InitFlags |= AAC_INITFLAGS_NEW_COMM_SUPPORTED; device_printf(sc->aac_dev, "New comm. interface enabled\n"); } Modified: stable/8/sys/dev/aac/aac_pci.c ============================================================================== --- stable/8/sys/dev/aac/aac_pci.c Tue Oct 26 00:21:31 2010 (r214364) +++ stable/8/sys/dev/aac/aac_pci.c Tue Oct 26 00:46:02 2010 (r214365) @@ -177,7 +177,7 @@ struct aac_ident {0x9005, 0x0285, 0x1014, 0x0312, AAC_HWIF_I960RX, 0, "IBM ServeRAID 8i"}, {0x9005, 0x0285, 0x9005, 0x0298, AAC_HWIF_I960RX, 0, - "Adaptec SAS RAID 4000SAS"}, + "Adaptec RAID 4000"}, {0x9005, 0x0285, 0x9005, 0x0299, AAC_HWIF_I960RX, 0, "Adaptec SAS RAID 4800SAS"}, {0x9005, 0x0285, 0x9005, 0x029a, AAC_HWIF_I960RX, 0, Modified: stable/8/sys/dev/aac/aac_tables.h ============================================================================== --- stable/8/sys/dev/aac/aac_tables.h Tue Oct 26 00:21:31 2010 (r214364) +++ stable/8/sys/dev/aac/aac_tables.h Tue Oct 26 00:46:02 2010 (r214365) @@ -57,6 +57,7 @@ static struct aac_code_lookup aac_comman {"quota exceeded", 69}, {"stale file handle", 70}, {"too many levels of remote in path", 71}, + {"device busy (spinning up)", 72}, {"bad file handle", 10001}, {"not sync", 10002}, {"bad cookie", 10003}, @@ -68,6 +69,7 @@ static struct aac_code_lookup aac_comman {"not mounted", 10009}, {"in maintenance mode", 10010}, {"stale ACL", 10011}, + {"bus reset - command aborted", 20001}, {NULL, 0}, {"unknown command status", 0} }; Modified: stable/8/sys/dev/aac/aacreg.h ============================================================================== --- stable/8/sys/dev/aac/aacreg.h Tue Oct 26 00:21:31 2010 (r214364) +++ stable/8/sys/dev/aac/aacreg.h Tue Oct 26 00:46:02 2010 (r214365) @@ -306,7 +306,7 @@ struct aac_adapter_init { u_int32_t HostElapsedSeconds; /* ADAPTER_INIT_STRUCT_REVISION_4 begins here */ u_int32_t InitFlags; /* flags for supported features */ -#define INITFLAGS_NEW_COMM_SUPPORTED 1 +#define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1 u_int32_t MaxIoCommands; /* max outstanding commands */ u_int32_t MaxIoSize; /* largest I/O command */ u_int32_t MaxFibSize; /* largest FIB to adapter */ @@ -1081,6 +1081,7 @@ typedef enum { ST_DQUOT = 69, ST_STALE = 70, ST_REMOTE = 71, + ST_NOT_READY = 72, ST_BADHANDLE = 10001, ST_NOT_SYNC = 10002, ST_BAD_COOKIE = 10003, @@ -1091,7 +1092,8 @@ typedef enum { ST_JUKEBOX = 10008, ST_NOTMOUNTED = 10009, ST_MAINTMODE = 10010, - ST_STALEACL = 10011 + ST_STALEACL = 10011, + ST_BUS_RESET = 20001 } AAC_FSAStatus; /* From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 00:56: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 3E80F106564A; Tue, 26 Oct 2010 00:56:24 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1163E8FC12; Tue, 26 Oct 2010 00:56: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 o9Q0uNIA082668; Tue, 26 Oct 2010 00:56:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9Q0uNPJ082666; Tue, 26 Oct 2010 00:56:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010260056.o9Q0uNPJ082666@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 00:56: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: r214366 - stable/8/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 00:56:24 -0000 Author: attilio Date: Tue Oct 26 00:56:23 2010 New Revision: 214366 URL: http://svn.freebsd.org/changeset/base/214366 Log: MFC r212628 by emaste: Add some enums and constants from Adaptec's driver. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/aac/aacreg.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) Modified: stable/8/sys/dev/aac/aacreg.h ============================================================================== --- stable/8/sys/dev/aac/aacreg.h Tue Oct 26 00:46:02 2010 (r214365) +++ stable/8/sys/dev/aac/aacreg.h Tue Oct 26 00:56:23 2010 (r214366) @@ -306,7 +306,9 @@ struct aac_adapter_init { u_int32_t HostElapsedSeconds; /* ADAPTER_INIT_STRUCT_REVISION_4 begins here */ u_int32_t InitFlags; /* flags for supported features */ -#define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1 +#define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1 +#define AAC_INITFLAGS_DRIVER_USES_UTC_TIME 0x10 +#define AAC_INITFLAGS_DRIVER_SUPPORTS_PM 0x20 u_int32_t MaxIoCommands; /* max outstanding commands */ u_int32_t MaxIoSize; /* largest I/O command */ u_int32_t MaxFibSize; /* largest FIB to adapter */ @@ -885,6 +887,17 @@ typedef enum { AifEnBatteryNeedsRecond, /* The battery needs reconditioning */ AifEnClusterEvent, /* Some cluster event */ AifEnDiskSetEvent, /* A disk set event occured. */ + AifEnContainerScsiEvent, /* a container event with no. and scsi id */ + AifEnPicBatteryEvent, /* An event gen. by pic_battery.c for an ABM */ + AifEnExpEvent, /* Exp. Event Type to replace CTPopUp messages */ + AifEnRAID6RebuildDone, /* RAID6 rebuild finished */ + AifEnSensorOverHeat, /* Heat Sensor indicate overheat */ + AifEnSensorCoolDown, /* Heat Sensor ind. cooled down after overheat */ + AifFeatureKeysModified, /* notif. of updated feature keys */ + AifApplicationExpirationEvent, /* notif. on app. expiration status */ + AifEnBackgroundConsistencyCheck,/* BCC notif. for NEC - DDTS 94700 */ + AifEnAddJBOD, /* A new JBOD type drive was created (30) */ + AifEnDeleteJBOD, /* A JBOD type drive was deleted (31) */ AifDriverNotifyStart=199, /* Notifies for host driver go here */ /* Host driver notifications start here */ AifDenMorphComplete, /* A morph operation completed */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 00:58: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 B47FE106566B; Tue, 26 Oct 2010 00:58:15 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9756F8FC0A; Tue, 26 Oct 2010 00:58: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 o9Q0wFKb082764; Tue, 26 Oct 2010 00:58:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9Q0wFST082760; Tue, 26 Oct 2010 00:58:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010260058.o9Q0wFST082760@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 00:58: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: r214367 - stable/8/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 00:58:15 -0000 Author: attilio Date: Tue Oct 26 00:58:15 2010 New Revision: 214367 URL: http://svn.freebsd.org/changeset/base/214367 Log: MFC r212773 by emaste: Use device_printf where possible, and otherwise at least include the driver name in printf strings. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aac_cam.c stable/8/sys/dev/aac/aac_disk.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) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Tue Oct 26 00:56:23 2010 (r214366) +++ stable/8/sys/dev/aac/aac.c Tue Oct 26 00:58:15 2010 (r214367) @@ -391,7 +391,7 @@ aac_get_container_info(struct aac_softc if (aac_sync_fib(sc, ContainerCommand, 0, fib, sizeof(struct aac_mntinfo))) { - printf("Error probing container %d\n", cid); + device_printf(sc->aac_dev, "Error probing container %d\n", cid); return (NULL); } Modified: stable/8/sys/dev/aac/aac_cam.c ============================================================================== --- stable/8/sys/dev/aac/aac_cam.c Tue Oct 26 00:56:23 2010 (r214366) +++ stable/8/sys/dev/aac/aac_cam.c Tue Oct 26 00:58:15 2010 (r214367) @@ -569,7 +569,7 @@ aac_cam_reset_bus(struct cam_sim *sim, u sc = camsc->inf->aac_sc; if (sc == NULL) { - printf("Null sc?\n"); + printf("aac: Null sc?\n"); return (CAM_REQ_ABORTED); } Modified: stable/8/sys/dev/aac/aac_disk.c ============================================================================== --- stable/8/sys/dev/aac/aac_disk.c Tue Oct 26 00:56:23 2010 (r214366) +++ stable/8/sys/dev/aac/aac_disk.c Tue Oct 26 00:58:15 2010 (r214367) @@ -106,8 +106,9 @@ aac_disk_open(struct disk *dp) /* check that the controller is up and running */ if (sc->ad_controller->aac_state & AAC_STATE_SUSPEND) { - printf("Controller Suspended controller state = 0x%x\n", - sc->ad_controller->aac_state); + device_printf(sc->ad_controller->aac_dev, + "Controller Suspended controller state = 0x%x\n", + sc->ad_controller->aac_state); return(ENXIO); } @@ -252,7 +253,8 @@ aac_disk_dump(void *arg, void *virtual, if (!first) { first = 1; if (bus_dmamap_create(sc->aac_buffer_dmat, 0, &dump_datamap)) { - printf("bus_dmamap_create failed\n"); + device_printf(sc->aac_dev, + "bus_dmamap_create failed\n"); return (ENOMEM); } } @@ -305,8 +307,9 @@ aac_disk_dump(void *arg, void *virtual, size += fib->Header.Size; if (aac_sync_fib(sc, command, 0, fib, size)) { - printf("Error dumping block 0x%jx\n", - (uintmax_t)physical); + device_printf(sc->aac_dev, + "Error dumping block 0x%jx\n", + (uintmax_t)physical); return (EIO); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 01:20: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 5AC72106564A; Tue, 26 Oct 2010 01:20:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47A3B8FC0C; Tue, 26 Oct 2010 01:20: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 o9Q1KVgF083281; Tue, 26 Oct 2010 01:20:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9Q1KVhW083276; Tue, 26 Oct 2010 01:20:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010260120.o9Q1KVhW083276@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 01:20: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: r214368 - stable/8/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 01:20:31 -0000 Author: attilio Date: Tue Oct 26 01:20:30 2010 New Revision: 214368 URL: http://svn.freebsd.org/changeset/base/214368 Log: MFC r213272 by emaste: Previously, the aac driver did not handle enclosure management AIFs, which were raised during hot-swap events. Now such events trigger cam rescans. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aac_cam.c stable/8/sys/dev/aac/aacreg.h stable/8/sys/dev/aac/aacvar.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) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Tue Oct 26 00:58:15 2010 (r214367) +++ stable/8/sys/dev/aac/aac.c Tue Oct 26 01:20:30 2010 (r214368) @@ -3216,6 +3216,7 @@ aac_handle_aif(struct aac_softc *sc, str struct aac_mntinforesp *mir; int next, current, found; int count = 0, added = 0, i = 0; + uint32_t channel; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -3324,6 +3325,27 @@ aac_handle_aif(struct aac_softc *sc, str break; + case AifEnEnclosureManagement: + switch (aif->data.EN.data.EEE.eventType) { + case AIF_EM_DRIVE_INSERTION: + case AIF_EM_DRIVE_REMOVAL: + channel = aif->data.EN.data.EEE.unitID; + if (sc->cam_rescan_cb != NULL) + sc->cam_rescan_cb(sc, + (channel >> 24) & 0xF, + (channel & 0xFFFF)); + break; + } + break; + + case AifEnAddJBOD: + case AifEnDeleteJBOD: + channel = aif->data.EN.data.ECE.container; + if (sc->cam_rescan_cb != NULL) + sc->cam_rescan_cb(sc, (channel >> 24) & 0xF, + AAC_CAM_TARGET_WILDCARD); + break; + default: break; } Modified: stable/8/sys/dev/aac/aac_cam.c ============================================================================== --- stable/8/sys/dev/aac/aac_cam.c Tue Oct 26 00:58:15 2010 (r214367) +++ stable/8/sys/dev/aac/aac_cam.c Tue Oct 26 01:20:30 2010 (r214368) @@ -37,12 +37,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include +#include #include #include #include @@ -76,6 +79,9 @@ static int aac_cam_detach(device_t dev); static void aac_cam_action(struct cam_sim *, union ccb *); static void aac_cam_poll(struct cam_sim *); static void aac_cam_complete(struct aac_command *); +static void aac_cam_rescan(struct aac_softc *sc, uint32_t channel, + uint32_t target_id); + static u_int32_t aac_cam_reset_bus(struct cam_sim *, union ccb *); static u_int32_t aac_cam_abort_ccb(struct cam_sim *, union ccb *); static u_int32_t aac_cam_term_io(struct cam_sim *, union ccb *); @@ -101,6 +107,43 @@ MODULE_DEPEND(aacp, cam, 1, 1, 1); MALLOC_DEFINE(M_AACCAM, "aaccam", "AAC CAM info"); static void +aac_cam_rescan(struct aac_softc *sc, uint32_t channel, uint32_t target_id) +{ + union ccb *ccb; + struct aac_sim *sim; + struct aac_cam *camsc; + + if (target_id == AAC_CAM_TARGET_WILDCARD) + target_id = CAM_TARGET_WILDCARD; + + TAILQ_FOREACH(sim, &sc->aac_sim_tqh, sim_link) { + camsc = sim->aac_cam; + if (camsc == NULL || camsc->inf == NULL || + camsc->inf->BusNumber != channel) + continue; + + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + device_printf(sc->aac_dev, + "Cannot allocate ccb for bus rescan.\n"); + return; + } + + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(camsc->sim), + target_id, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + xpt_free_ccb(ccb); + device_printf(sc->aac_dev, + "Cannot create path for bus rescan.\n"); + return; + } + xpt_rescan(ccb); + break; + } +} + + +static void aac_cam_event(struct aac_softc *sc, struct aac_event *event, void *arg) { union ccb *ccb; @@ -141,6 +184,7 @@ aac_cam_detach(device_t dev) camsc = (struct aac_cam *)device_get_softc(dev); sc = camsc->inf->aac_sc; + camsc->inf->aac_cam = NULL; mtx_lock(&sc->aac_io_lock); @@ -149,6 +193,8 @@ aac_cam_detach(device_t dev) xpt_bus_deregister(cam_sim_path(camsc->sim)); cam_sim_free(camsc->sim, /*free_devq*/TRUE); + sc->cam_rescan_cb = NULL; + mtx_unlock(&sc->aac_io_lock); return (0); @@ -171,6 +217,7 @@ aac_cam_attach(device_t dev) camsc = (struct aac_cam *)device_get_softc(dev); inf = (struct aac_sim *)device_get_ivars(dev); camsc->inf = inf; + camsc->inf->aac_cam = camsc; devq = cam_simq_alloc(inf->TargetsPerBus); if (devq == NULL) @@ -198,6 +245,7 @@ aac_cam_attach(device_t dev) mtx_unlock(&inf->aac_sc->aac_io_lock); return (EIO); } + inf->aac_sc->cam_rescan_cb = aac_cam_rescan; mtx_unlock(&inf->aac_sc->aac_io_lock); camsc->sim = sim; Modified: stable/8/sys/dev/aac/aacreg.h ============================================================================== --- stable/8/sys/dev/aac/aacreg.h Tue Oct 26 00:58:15 2010 (r214367) +++ stable/8/sys/dev/aac/aacreg.h Tue Oct 26 01:20:30 2010 (r214368) @@ -935,6 +935,11 @@ struct aac_AifEnsEnclosureEvent { u_int32_t eventType; /* event type */ } __packed; +typedef enum { + AIF_EM_DRIVE_INSERTION=31, + AIF_EM_DRIVE_REMOVAL +} aac_AifEMEventType; + struct aac_AifEnsBatteryEvent { AAC_NVBATT_TRANSITION transition_type; /* eg from low to ok */ AAC_NVBATTSTATUS current_state; /* current batt state */ Modified: stable/8/sys/dev/aac/aacvar.h ============================================================================== --- stable/8/sys/dev/aac/aacvar.h Tue Oct 26 00:58:15 2010 (r214367) +++ stable/8/sys/dev/aac/aacvar.h Tue Oct 26 01:20:30 2010 (r214368) @@ -113,6 +113,7 @@ struct aac_container /* * Per-SIM data structure */ +struct aac_cam; struct aac_sim { device_t sim_dev; @@ -120,6 +121,7 @@ struct aac_sim int BusNumber; int InitiatorBusId; struct aac_softc *aac_sc; + struct aac_cam *aac_cam; TAILQ_ENTRY(aac_sim) sim_link; }; @@ -420,6 +422,9 @@ struct aac_softc u_int32_t aac_max_fib_size; /* max. FIB size */ u_int32_t aac_sg_tablesize; /* max. sg count from host */ u_int32_t aac_max_sectors; /* max. I/O size from host (blocks) */ +#define AAC_CAM_TARGET_WILDCARD ~0 + void (*cam_rescan_cb)(struct aac_softc *, uint32_t, + uint32_t); }; /* From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 03:34: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 57558106567A; Tue, 26 Oct 2010 03:34:34 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id AD6C48FC1C; Tue, 26 Oct 2010 03:34:33 +0000 (UTC) Received: by gwaa18 with SMTP id a18so2231031gwa.13 for ; Mon, 25 Oct 2010 20:34:33 -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 :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=4+3yJmsIK3BzjinVoDKPmOeqbYuXSnhPspPtgzTdi3E=; b=BGH7R1IajaWUH7/pPA94ZN4epDMO0s8e8VNMitkvf0EWyrMlh3MMgw8ercyU+mbooy e0lz26flSBQyWWmyVpS1qrDYTrGlDptiroBSDaPOnwWq25vE+vlKyEpKBOJhkrh+k/yu pz3PupajADb7zCJnihHzk6fPTkMIzfc8YiabU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=jsoh7Mt42LzffqFNlK0W3R1QXFxxuvq7oGxgEAtIKJfpTTDEZqnkEXfxuJ+g9QVkVX ki9yuSeziRiB6dVdExBN5zx2r/uOA5SnYt3kuFsHkxAfALdEOzoqeSbD0GTvyBS/QeQM G8BJ99GhKIvUKXWvU5W2ew4OCcPd+fbZrgLrY= Received: by 10.150.96.9 with SMTP id t9mr4083289ybb.4.1288063653655; Mon, 25 Oct 2010 20:27:33 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-136-243.dsl.klmzmi.sbcglobal.net [99.181.136.243]) by mx.google.com with ESMTPS id r25sm6193311yhc.0.2010.10.25.20.27.31 (version=SSLv3 cipher=RC4-MD5); Mon, 25 Oct 2010 20:27:32 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4CC64AA2.8060309@DataIX.net> Date: Mon, 25 Oct 2010 23:27:30 -0400 From: jhell Organization: http://www.DataIX.net User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.11) Gecko/20101021 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: Attilio Rao References: <201010251501.o9PF1euH068762@svn.freebsd.org> <4CC648E3.6000307@DataIX.net> In-Reply-To: <4CC648E3.6000307@DataIX.net> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: r214343 - stable/8/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 03:34:34 -0000 On 10/25/2010 23:20, jhell wrote: Oops this seems to have been introduced by 214364 rather than the subject listed revision. > > cc -O2 -pipe -DLAZY_PS -std=gnu99 -fstack-protector -Wsystem-headers > -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type > -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align > -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs > -Wredundant-decls -Wno-pointer-sign -c /usr/src/bin/ps/keyword.c > /usr/src/bin/ps/keyword.c:190: error: 'struct kinfo_proc' has no member > named 'ki_tdaddr' > *** Error code 1 > > ??? > -- jhell,v From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 03:51: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 5AB2C1065670; Tue, 26 Oct 2010 03:51:01 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id ADA528FC13; Tue, 26 Oct 2010 03:51:00 +0000 (UTC) Received: by ywc21 with SMTP id 21so1679199ywc.13 for ; Mon, 25 Oct 2010 20:50:59 -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 :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=nHSquUEa5qD9mctnYSfMc0KT5pyKVGeQxPhAhBITcd4=; b=MOuaAjH7Hd4eRTq+HA4FrkY3wKwfsIvtUgQ+8YrFnA4mNtGR8Hq4qqHX+3QzbBr9xh c4wS6RupOQdAiCp8gMpCSazN9HHk0/he35zcM+lOy/oFqH4gH1tgMR0jyXrDhOyejRvo KudhZ8oL2wajzNPtZttY4JSFnScrT0+DeZDgE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=hbpstNZVAflSfjk2z+r9IEObKt6Md7Zx1xNvEMtEWMBXHhLyXt39gXUKZDAZv18F4b K5rIrH6o3rLaSmmSNz3LG3cbiNLFIxwtpFkwWyjH8qIsAea4y/poiOGiAX0qTa1MSu95 3FqLWD0PXyYxxsajCi7PDXIcZxgtSkHnn5QB0= Received: by 10.151.14.5 with SMTP id r5mr920324ybi.343.1288063206594; Mon, 25 Oct 2010 20:20:06 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-136-243.dsl.klmzmi.sbcglobal.net [99.181.136.243]) by mx.google.com with ESMTPS id p30sm7268489ybk.8.2010.10.25.20.20.04 (version=SSLv3 cipher=RC4-MD5); Mon, 25 Oct 2010 20:20:05 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4CC648E3.6000307@DataIX.net> Date: Mon, 25 Oct 2010 23:20:03 -0400 From: jhell Organization: http://www.DataIX.net User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.11) Gecko/20101021 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: Attilio Rao References: <201010251501.o9PF1euH068762@svn.freebsd.org> In-Reply-To: <201010251501.o9PF1euH068762@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: r214343 - stable/8/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 03:51:01 -0000 On 10/25/2010 11:01, Attilio Rao wrote: > Author: attilio > Date: Mon Oct 25 15:01:40 2010 > New Revision: 214343 > URL: http://svn.freebsd.org/changeset/base/214343 > > Log: > MFC r213012 by emaste: > Correct sort order. > > Sponsored by: Sandvine Incorporated > > Modified: > stable/8/bin/ps/extern.h > Directory Properties: > stable/8/bin/ps/ (props changed) > > Modified: stable/8/bin/ps/extern.h > ============================================================================== > --- stable/8/bin/ps/extern.h Mon Oct 25 14:05:25 2010 (r214342) > +++ stable/8/bin/ps/extern.h Mon Oct 25 15:01:40 2010 (r214343) > @@ -79,8 +79,8 @@ int s_uname(KINFO *); > void showkey(void); > void started(KINFO *, VARENT *); > void state(KINFO *, VARENT *); > -void tdnam(KINFO *, VARENT *); > void tdev(KINFO *, VARENT *); > +void tdnam(KINFO *, VARENT *); > void tname(KINFO *, VARENT *); > void ucomm(KINFO *, VARENT *); > void uname(KINFO *, VARENT *); > _______________________________________________ cc -O2 -pipe -DLAZY_PS -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/src/bin/ps/keyword.c /usr/src/bin/ps/keyword.c:190: error: 'struct kinfo_proc' has no member named 'ki_tdaddr' *** Error code 1 ??? -- jhell,v From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 03:57: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 8CE8C106566C; Tue, 26 Oct 2010 03:57:23 +0000 (UTC) (envelope-from jhellenthal@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 E5B468FC08; Tue, 26 Oct 2010 03:57:22 +0000 (UTC) Received: by gya6 with SMTP id 6so2675698gya.13 for ; Mon, 25 Oct 2010 20:57:22 -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 :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=Wsm+ZHD9TezslOUa6qFRvAqcPF5nqox7RIaly79neiE=; b=A5SHEWWy3jT5Qfo2EkbMzf32Vwm+AKAdr/RyxJbOuBpt/x2DALWti9hYiONB1OXc+h 4Z95+IzStvlFoQquO3DLwIkxX+JZMGPsQI7eKWTA9BCj8lmzrY18KybN9jdy5i0AVkNh wu5A+aQ5sSP4XCKsYoOfCu1zbO1ZmlsLoSSpg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=lpilT0y5AbEMa8O99T9u54ImwOGF3Nvspev7DF0djHWGiozPqJYJCsp1cxsTC1ENdC wn1ExsluSiDlHyH341BxxfexclXW0kedC4KF7R98I98EE9TaBqdadCX3mFEieQuMuFQt mg1GTGq4hW9AqpafePxsrs6WI6VT7y1GKYWCU= Received: by 10.151.27.1 with SMTP id e1mr14653422ybj.250.1288065440494; Mon, 25 Oct 2010 20:57:20 -0700 (PDT) Received: from centel.dataix.local ([99.181.136.243]) by mx.google.com with ESMTPS id n48sm3272572yha.7.2010.10.25.20.57.18 (version=SSLv3 cipher=RC4-MD5); Mon, 25 Oct 2010 20:57:19 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4CC6519D.8070505@DataIX.net> Date: Mon, 25 Oct 2010 23:57:17 -0400 From: jhell Organization: http://www.DataIX.net User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.11) Gecko/20101021 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: Attilio Rao References: <201010251501.o9PF1euH068762@svn.freebsd.org> <4CC648E3.6000307@DataIX.net> In-Reply-To: <4CC648E3.6000307@DataIX.net> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: r214343 - stable/8/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 03:57:23 -0000 On 10/25/2010 23:20, jhell wrote: > On 10/25/2010 11:01, Attilio Rao wrote: >> Author: attilio >> Date: Mon Oct 25 15:01:40 2010 >> New Revision: 214343 >> URL: http://svn.freebsd.org/changeset/base/214343 >> >> Log: >> MFC r213012 by emaste: >> Correct sort order. >> >> Sponsored by: Sandvine Incorporated >> >> Modified: >> stable/8/bin/ps/extern.h >> Directory Properties: >> stable/8/bin/ps/ (props changed) >> >> Modified: stable/8/bin/ps/extern.h >> ============================================================================== >> --- stable/8/bin/ps/extern.h Mon Oct 25 14:05:25 2010 (r214342) >> +++ stable/8/bin/ps/extern.h Mon Oct 25 15:01:40 2010 (r214343) >> @@ -79,8 +79,8 @@ int s_uname(KINFO *); >> void showkey(void); >> void started(KINFO *, VARENT *); >> void state(KINFO *, VARENT *); >> -void tdnam(KINFO *, VARENT *); >> void tdev(KINFO *, VARENT *); >> +void tdnam(KINFO *, VARENT *); >> void tname(KINFO *, VARENT *); >> void ucomm(KINFO *, VARENT *); >> void uname(KINFO *, VARENT *); >> _______________________________________________ > > cc -O2 -pipe -DLAZY_PS -std=gnu99 -fstack-protector -Wsystem-headers > -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type > -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align > -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs > -Wredundant-decls -Wno-pointer-sign -c /usr/src/bin/ps/keyword.c > /usr/src/bin/ps/keyword.c:190: error: 'struct kinfo_proc' has no member > named 'ki_tdaddr' > *** Error code 1 > > ??? > Ugh! please ignore this. As Ive been here once already now surprised myself by making the same mistake twice! Once, twice, three time a lady! hopefully it won't come to that. -- jhell,v From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 04:57: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 5A555106564A; Tue, 26 Oct 2010 04:57:44 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5.mail.yandex.net (forward5.mail.yandex.net [77.88.46.21]) by mx1.freebsd.org (Postfix) with ESMTP id F3E368FC19; Tue, 26 Oct 2010 04:57:43 +0000 (UTC) Received: from smtp1.mail.yandex.net (smtp1.mail.yandex.net [77.88.46.101]) by forward5.mail.yandex.net (Yandex) with ESMTP id EA8A314D0462; Tue, 26 Oct 2010 08:57:41 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1288069061; bh=qC6IIa/I3tNbOcFSnqANrfibWSIaKKHUChWSkWlv5bQ=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=WhFs/YSmiMp6lQO0eHsR/2qsZRtIUtEeZ/sw9aGvS4Finiq0aqZ2tWBSDAHdqJ2Q0 JuCy/F27djTkBOmCVx/GyptHIpopx4BUkTmv5m6SY1xGG4QVCD92DolhYxotcXmNB5 Gcxb3K1zxPX/hWXmtlhSW/6YXwN+NL5kfLYcauDQ= Received: from [127.0.0.1] (ns.kirov.so-ups.ru [77.72.136.145]) by smtp1.mail.yandex.net (Yandex) with ESMTPSA id 98C8D290065; Tue, 26 Oct 2010 08:57:41 +0400 (MSD) Message-ID: <4CC65FC1.3040605@yandex.ru> Date: Tue, 26 Oct 2010 08:57:37 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201010251623.o9PGNZ3V070926@svn.freebsd.org> <20101025202901.GB1811@garage.freebsd.pl> In-Reply-To: <20101025202901.GB1811@garage.freebsd.pl> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig6C726D0883614CA9242C20D1" X-Yandex-TimeMark: 1288069061 X-Yandex-Spam: 1 X-Yandex-Front: smtp1.mail.yandex.net Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214352 - in head: sbin/geom/class/part 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: Tue, 26 Oct 2010 04:57:44 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig6C726D0883614CA9242C20D1 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 26.10.2010 0:29, Pawel Jakub Dawidek wrote: > Another corruption worth mentioning is when primary and secondary GPT > header/table differ. Yes. If both headers are correct then primary GPT will be used. --=20 WBR, Andrey V. Elsukov --------------enig6C726D0883614CA9242C20D1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJMxl/EAAoJEAHF6gQQyKF6UEAIAKlxCEBTzBzyMKcYulf/m7cw 0i4akrw8uAfLhnw/tjDxKglToHIZnrusMeCkLgnNWmLbotvNHsNDBwvZQ8t0WDfB cu3S0w4GmplN4FhpJs/b2VFMoaukI2bZ+TTzBVzsHENzt+WZecv01VHyobawu+ne usioYRLEZw4RZ70w7rZ90nHjHk5PUrPjuRdfoWSPrjmoWdv4u3oUxn5rjqCDEhzN JXIQp9DLTeKpgErnnBAPkF6CCX0iwamMWKoWs8TTzdo3yNtbw1pjK1JJjtJbOOn2 9drvuhDQAumFl46IxP+4EUbk8/PDbpz3lXCgrd6ii4GMPVsZ347jqmErItDGO+I= =GeYh -----END PGP SIGNATURE----- --------------enig6C726D0883614CA9242C20D1-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 08:50: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 8341A106566C; Tue, 26 Oct 2010 08:50:09 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FE0E8FC15; Tue, 26 Oct 2010 08:50: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 o9Q8o9mZ007530; Tue, 26 Oct 2010 08:50:09 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9Q8o9K1007526; Tue, 26 Oct 2010 08:50:09 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010260850.o9Q8o9K1007526@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 08:50:09 +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: r214370 - stable/8/sys/libkern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 08:50:09 -0000 Author: attilio Date: Tue Oct 26 08:50:09 2010 New Revision: 214370 URL: http://svn.freebsd.org/changeset/base/214370 Log: MFC part of r213103: Introduce the new files that were left behind in actual merge. Sponsored by: Sandvine Incorporated Added: stable/8/sys/libkern/inet_ntop.c (contents, props changed) stable/8/sys/libkern/inet_pton.c (contents, props changed) Added: stable/8/sys/libkern/inet_ntop.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/libkern/inet_ntop.c Tue Oct 26 08:50:09 2010 (r214370) @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 1996-1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char rcsid[] = "$Id: inet_ntop.c,v 1.3.18.2 2005/11/03 23:02:22 marka Exp $"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +/*% + * WARNING: Don't even consider trying to compile this on a system where + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. + */ + +static char *inet_ntop4(const u_char *src, char *dst, socklen_t size); +static char *inet_ntop6(const u_char *src, char *dst, socklen_t size); + +/* char * + * inet_ntop(af, src, dst, size) + * convert a network format address to presentation format. + * return: + * pointer to presentation format address (`dst'), or NULL (see errno). + * author: + * Paul Vixie, 1996. + */ +char * +inet_ntop(int af, const void *src, char *dst, socklen_t size) +{ + switch (af) { + case AF_INET: + return (inet_ntop4(src, dst, size)); + case AF_INET6: + return (inet_ntop6(src, dst, size)); + default: + return (NULL); + } + /* NOTREACHED */ +} + +/* const char * + * inet_ntop4(src, dst, size) + * format an IPv4 address + * return: + * `dst' (as a const) + * notes: + * (1) uses no statics + * (2) takes a u_char* not an in_addr as input + * author: + * Paul Vixie, 1996. + */ +static char * +inet_ntop4(const u_char *src, char *dst, socklen_t size) +{ + static const char fmt[] = "%u.%u.%u.%u"; + char tmp[sizeof "255.255.255.255"]; + int l; + + l = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]); + if (l <= 0 || (socklen_t) l >= size) { + return (NULL); + } + strlcpy(dst, tmp, size); + return (dst); +} + +/* const char * + * inet_ntop6(src, dst, size) + * convert IPv6 binary address into presentation (printable) format + * author: + * Paul Vixie, 1996. + */ +static char * +inet_ntop6(const u_char *src, char *dst, socklen_t size) +{ + /* + * Note that int32_t and int16_t need only be "at least" large enough + * to contain a value of the specified size. On some systems, like + * Crays, there is no such thing as an integer variable with 16 bits. + * Keep this in mind if you think this function should have been coded + * to use pointer overlays. All the world's not a VAX. + */ + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; + struct { int base, len; } best, cur; +#define NS_IN6ADDRSZ 16 +#define NS_INT16SZ 2 + u_int words[NS_IN6ADDRSZ / NS_INT16SZ]; + int i; + + /* + * Preprocess: + * Copy the input (bytewise) array into a wordwise array. + * Find the longest run of 0x00's in src[] for :: shorthanding. + */ + memset(words, '\0', sizeof words); + for (i = 0; i < NS_IN6ADDRSZ; i++) + words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); + best.base = -1; + best.len = 0; + cur.base = -1; + cur.len = 0; + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { + if (words[i] == 0) { + if (cur.base == -1) + cur.base = i, cur.len = 1; + else + cur.len++; + } else { + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) + best = cur; + cur.base = -1; + } + } + } + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) + best = cur; + } + if (best.base != -1 && best.len < 2) + best.base = -1; + + /* + * Format the result. + */ + tp = tmp; + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { + /* Are we inside the best run of 0x00's? */ + if (best.base != -1 && i >= best.base && + i < (best.base + best.len)) { + if (i == best.base) + *tp++ = ':'; + continue; + } + /* Are we following an initial run of 0x00s or any real hex? */ + if (i != 0) + *tp++ = ':'; + /* Is this address an encapsulated IPv4? */ + if (i == 6 && best.base == 0 && (best.len == 6 || + (best.len == 7 && words[7] != 0x0001) || + (best.len == 5 && words[5] == 0xffff))) { + if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) + return (NULL); + tp += strlen(tp); + break; + } + tp += sprintf(tp, "%x", words[i]); + } + /* Was it a trailing run of 0x00's? */ + if (best.base != -1 && (best.base + best.len) == + (NS_IN6ADDRSZ / NS_INT16SZ)) + *tp++ = ':'; + *tp++ = '\0'; + + /* + * Check for overflow, copy, and we're done. + */ + if ((socklen_t)(tp - tmp) > size) { + return (NULL); + } + strcpy(dst, tmp); + return (dst); +} + +/*! \file */ Added: stable/8/sys/libkern/inet_pton.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/libkern/inet_pton.c Tue Oct 26 08:50:09 2010 (r214370) @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 1996,1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char rcsid[] = "$Id: inet_pton.c,v 1.3.18.2 2005/07/28 07:38:07 marka Exp $"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#if __FreeBSD_version < 700000 +#define strchr index +#endif + +/*% + * WARNING: Don't even consider trying to compile this on a system where + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. + */ + +static int inet_pton4(const char *src, u_char *dst); +static int inet_pton6(const char *src, u_char *dst); + +/* int + * inet_pton(af, src, dst) + * convert from presentation format (which usually means ASCII printable) + * to network format (which is usually some kind of binary format). + * return: + * 1 if the address was valid for the specified address family + * 0 if the address wasn't valid (`dst' is untouched in this case) + * -1 if some other error occurred (`dst' is untouched in this case, too) + * author: + * Paul Vixie, 1996. + */ +int +inet_pton(int af, const char *src, void *dst) +{ + switch (af) { + case AF_INET: + return (inet_pton4(src, dst)); + case AF_INET6: + return (inet_pton6(src, dst)); + default: + return (-1); + } + /* NOTREACHED */ +} + +/* int + * inet_pton4(src, dst) + * like inet_aton() but without all the hexadecimal and shorthand. + * return: + * 1 if `src' is a valid dotted quad, else 0. + * notice: + * does not touch `dst' unless it's returning 1. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton4(const char *src, u_char *dst) +{ + static const char digits[] = "0123456789"; + int saw_digit, octets, ch; +#define NS_INADDRSZ 4 + u_char tmp[NS_INADDRSZ], *tp; + + saw_digit = 0; + octets = 0; + *(tp = tmp) = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr(digits, ch)) != NULL) { + u_int new = *tp * 10 + (pch - digits); + + if (saw_digit && *tp == 0) + return (0); + if (new > 255) + return (0); + *tp = new; + if (!saw_digit) { + if (++octets > 4) + return (0); + saw_digit = 1; + } + } else if (ch == '.' && saw_digit) { + if (octets == 4) + return (0); + *++tp = 0; + saw_digit = 0; + } else + return (0); + } + if (octets < 4) + return (0); + memcpy(dst, tmp, NS_INADDRSZ); + return (1); +} + +/* int + * inet_pton6(src, dst) + * convert presentation level address to network order binary form. + * return: + * 1 if `src' is a valid [RFC1884 2.2] address, else 0. + * notice: + * (1) does not touch `dst' unless it's returning 1. + * (2) :: in a full address is silently ignored. + * credit: + * inspired by Mark Andrews. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton6(const char *src, u_char *dst) +{ + static const char xdigits_l[] = "0123456789abcdef", + xdigits_u[] = "0123456789ABCDEF"; +#define NS_IN6ADDRSZ 16 +#define NS_INT16SZ 2 + u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; + const char *xdigits, *curtok; + int ch, seen_xdigits; + u_int val; + + memset((tp = tmp), '\0', NS_IN6ADDRSZ); + endp = tp + NS_IN6ADDRSZ; + colonp = NULL; + /* Leading :: requires some special handling. */ + if (*src == ':') + if (*++src != ':') + return (0); + curtok = src; + seen_xdigits = 0; + val = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) + pch = strchr((xdigits = xdigits_u), ch); + if (pch != NULL) { + val <<= 4; + val |= (pch - xdigits); + if (++seen_xdigits > 4) + return (0); + continue; + } + if (ch == ':') { + curtok = src; + if (!seen_xdigits) { + if (colonp) + return (0); + colonp = tp; + continue; + } else if (*src == '\0') { + return (0); + } + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + seen_xdigits = 0; + val = 0; + continue; + } + if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && + inet_pton4(curtok, tp) > 0) { + tp += NS_INADDRSZ; + seen_xdigits = 0; + break; /*%< '\\0' was seen by inet_pton4(). */ + } + return (0); + } + if (seen_xdigits) { + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + } + if (colonp != NULL) { + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + int i; + + if (tp == endp) + return (0); + for (i = 1; i <= n; i++) { + endp[- i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + if (tp != endp) + return (0); + memcpy(dst, tmp, NS_IN6ADDRSZ); + return (1); +} + +/*! \file */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 09:25: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 8460C1065693; Tue, 26 Oct 2010 09:25:29 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70F7D8FC18; Tue, 26 Oct 2010 09:25: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 o9Q9PT6H010232; Tue, 26 Oct 2010 09:25:29 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9Q9PTr2010224; Tue, 26 Oct 2010 09:25:29 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010260925.o9Q9PTr2010224@svn.freebsd.org> From: David Xu Date: Tue, 26 Oct 2010 09:25: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: r214371 - in stable/8: include 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: Tue, 26 Oct 2010 09:25:29 -0000 Author: davidxu Date: Tue Oct 26 09:25:29 2010 New Revision: 214371 URL: http://svn.freebsd.org/changeset/base/214371 Log: MFC r213241, r213257: In current code, statically initialized and destroyed object have same null value, the code can not distinguish between them, to fix the problem, now a destroyed object is assigned to a non-null value, and it will be rejected by some pthread functions. PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP is changed to number 1, so that adaptive mutex can be statically initialized correctly. Modified: stable/8/include/pthread.h stable/8/lib/libthr/thread/thr_cond.c stable/8/lib/libthr/thread/thr_init.c stable/8/lib/libthr/thread/thr_mutex.c stable/8/lib/libthr/thread/thr_private.h stable/8/lib/libthr/thread/thr_rwlock.c Directory Properties: stable/8/include/ (props changed) stable/8/lib/libthr/ (props changed) Modified: stable/8/include/pthread.h ============================================================================== --- stable/8/include/pthread.h Tue Oct 26 08:50:09 2010 (r214370) +++ stable/8/include/pthread.h Tue Oct 26 09:25:29 2010 (r214371) @@ -98,7 +98,7 @@ * Static initialization values. */ #define PTHREAD_MUTEX_INITIALIZER NULL -#define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP NULL +#define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP ((pthread_mutex_t)1) #define PTHREAD_COND_INITIALIZER NULL #define PTHREAD_RWLOCK_INITIALIZER NULL Modified: stable/8/lib/libthr/thread/thr_cond.c ============================================================================== --- stable/8/lib/libthr/thread/thr_cond.c Tue Oct 26 08:50:09 2010 (r214370) +++ stable/8/lib/libthr/thread/thr_cond.c Tue Oct 26 09:25:29 2010 (r214371) @@ -104,6 +104,19 @@ init_static(struct pthread *thread, pthr return (ret); } +#define CHECK_AND_INIT_COND \ + if (__predict_false((cv = (*cond)) <= THR_COND_DESTROYED)) { \ + if (cv == THR_COND_INITIALIZER) { \ + int ret; \ + ret = init_static(_get_curthread(), cond); \ + if (ret) \ + return (ret); \ + } else if (cv == THR_COND_DESTROYED) { \ + return (EINVAL); \ + } \ + cv = *cond; \ + } + int _pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *cond_attr) { @@ -119,16 +132,14 @@ _pthread_cond_destroy(pthread_cond_t *co struct pthread_cond *cv; int rval = 0; - if (*cond == NULL) + if ((cv = *cond) == THR_COND_INITIALIZER) + rval = 0; + else if (cv == THR_COND_DESTROYED) rval = EINVAL; else { cv = *cond; THR_UMUTEX_LOCK(curthread, &cv->c_lock); - /* - * NULL the caller's pointer now that the condition - * variable has been destroyed: - */ - *cond = NULL; + *cond = THR_COND_DESTROYED; THR_UMUTEX_UNLOCK(curthread, &cv->c_lock); /* @@ -137,7 +148,6 @@ _pthread_cond_destroy(pthread_cond_t *co */ free(cv); } - /* Return the completion status: */ return (rval); } @@ -170,20 +180,18 @@ cond_wait_common(pthread_cond_t *cond, p struct timespec ts, ts2, *tsp; struct cond_cancel_info info; pthread_cond_t cv; - int ret = 0; + int ret; /* * If the condition variable is statically initialized, * perform the dynamic initialization: */ - if (__predict_false(*cond == NULL && - (ret = init_static(curthread, cond)) != 0)) - return (ret); + CHECK_AND_INIT_COND cv = *cond; THR_UMUTEX_LOCK(curthread, &cv->c_lock); ret = _mutex_cv_unlock(mutex, &info.count); - if (ret) { + if (__predict_false(ret != 0)) { THR_UMUTEX_UNLOCK(curthread, &cv->c_lock); return (ret); } @@ -263,11 +271,8 @@ cond_signal_common(pthread_cond_t *cond, * If the condition variable is statically initialized, perform dynamic * initialization. */ - if (__predict_false(*cond == NULL && - (ret = init_static(curthread, cond)) != 0)) - return (ret); + CHECK_AND_INIT_COND - cv = *cond; THR_UMUTEX_LOCK(curthread, &cv->c_lock); if (!broadcast) ret = _thr_ucond_signal(&cv->c_kerncv); Modified: stable/8/lib/libthr/thread/thr_init.c ============================================================================== --- stable/8/lib/libthr/thread/thr_init.c Tue Oct 26 08:50:09 2010 (r214370) +++ stable/8/lib/libthr/thread/thr_init.c Tue Oct 26 09:25:29 2010 (r214371) @@ -92,6 +92,12 @@ struct pthread_mutex_attr _pthread_mutex .m_ceiling = 0 }; +struct pthread_mutex_attr _pthread_mutexattr_adaptive_default = { + .m_type = PTHREAD_MUTEX_ADAPTIVE_NP, + .m_protocol = PTHREAD_PRIO_NONE, + .m_ceiling = 0 +}; + /* Default condition variable attributes: */ struct pthread_cond_attr _pthread_condattr_default = { .c_pshared = PTHREAD_PROCESS_PRIVATE, Modified: stable/8/lib/libthr/thread/thr_mutex.c ============================================================================== --- stable/8/lib/libthr/thread/thr_mutex.c Tue Oct 26 08:50:09 2010 (r214370) +++ stable/8/lib/libthr/thread/thr_mutex.c Tue Oct 26 09:25:29 2010 (r214371) @@ -124,7 +124,7 @@ __weak_reference(_pthread_mutex_isowned_ static int mutex_init(pthread_mutex_t *mutex, - const pthread_mutexattr_t *mutex_attr, + const struct pthread_mutex_attr *mutex_attr, void *(calloc_cb)(size_t, size_t)) { const struct pthread_mutex_attr *attr; @@ -133,7 +133,7 @@ mutex_init(pthread_mutex_t *mutex, if (mutex_attr == NULL) { attr = &_pthread_mutexattr_default; } else { - attr = *mutex_attr; + attr = mutex_attr; if (attr->m_type < PTHREAD_MUTEX_ERRORCHECK || attr->m_type >= PTHREAD_MUTEX_TYPE_MAX) return (EINVAL); @@ -153,6 +153,10 @@ mutex_init(pthread_mutex_t *mutex, pmutex->m_yieldloops = 0; MUTEX_INIT_LINK(pmutex); switch(attr->m_protocol) { + case PTHREAD_PRIO_NONE: + pmutex->m_lock.m_owner = UMUTEX_UNOWNED; + pmutex->m_lock.m_flags = 0; + break; case PTHREAD_PRIO_INHERIT: pmutex->m_lock.m_owner = UMUTEX_UNOWNED; pmutex->m_lock.m_flags = UMUTEX_PRIO_INHERIT; @@ -162,9 +166,6 @@ mutex_init(pthread_mutex_t *mutex, pmutex->m_lock.m_flags = UMUTEX_PRIO_PROTECT; pmutex->m_lock.m_ceilings[0] = attr->m_ceiling; break; - case PTHREAD_PRIO_NONE: - pmutex->m_lock.m_owner = UMUTEX_UNOWNED; - pmutex->m_lock.m_flags = 0; } if (pmutex->m_type == PTHREAD_MUTEX_ADAPTIVE_NP) { @@ -184,11 +185,12 @@ init_static(struct pthread *thread, pthr THR_LOCK_ACQUIRE(thread, &_mutex_static_lock); - if (*mutex == NULL) - ret = mutex_init(mutex, NULL, calloc); + if (*mutex == THR_MUTEX_INITIALIZER) + ret = mutex_init(mutex, &_pthread_mutexattr_default, calloc); + else if (*mutex == THR_ADAPTIVE_MUTEX_INITIALIZER) + ret = mutex_init(mutex, &_pthread_mutexattr_adaptive_default, calloc); else ret = 0; - THR_LOCK_RELEASE(thread, &_mutex_static_lock); return (ret); @@ -210,7 +212,7 @@ int __pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutex_attr) { - return mutex_init(mutex, mutex_attr, calloc); + return mutex_init(mutex, mutex_attr ? *mutex_attr : NULL, calloc); } /* This function is used internally by malloc. */ @@ -223,9 +225,8 @@ _pthread_mutex_init_calloc_cb(pthread_mu .m_protocol = PTHREAD_PRIO_NONE, .m_ceiling = 0 }; - static const struct pthread_mutex_attr *pattr = &attr; - return mutex_init(mutex, (pthread_mutexattr_t *)&pattr, calloc_cb); + return mutex_init(mutex, &attr, calloc_cb); } void @@ -257,19 +258,21 @@ _pthread_mutex_destroy(pthread_mutex_t * uint32_t id; int ret = 0; - if (__predict_false(*mutex == NULL)) + m = *mutex; + if (m < THR_MUTEX_DESTROYED) { + ret = 0; + } else if (m == THR_MUTEX_DESTROYED) { ret = EINVAL; - else { + } else { id = TID(curthread); /* * Try to lock the mutex structure, we only need to * try once, if failed, the mutex is in used. */ - ret = _thr_umutex_trylock(&(*mutex)->m_lock, id); + ret = _thr_umutex_trylock(&m->m_lock, id); if (ret) return (ret); - m = *mutex; /* * Check mutex other fields to see if this mutex is * in use. Mostly for prority mutex types, or there @@ -281,11 +284,7 @@ _pthread_mutex_destroy(pthread_mutex_t * _thr_umutex_unlock(&m->m_lock, id); ret = EBUSY; } else { - /* - * Save a pointer to the mutex so it can be free'd - * and set the caller's pointer to NULL. - */ - *mutex = NULL; + *mutex = THR_MUTEX_DESTROYED; if (m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) set_inherited_priority(curthread, m); @@ -310,17 +309,28 @@ _pthread_mutex_destroy(pthread_mutex_t * TAILQ_INSERT_TAIL(&curthread->pp_mutexq, (m), m_qe);\ } while (0) +#define CHECK_AND_INIT_MUTEX \ + if (__predict_false((m = *mutex) <= THR_MUTEX_DESTROYED)) { \ + if (m == THR_MUTEX_DESTROYED) \ + return (EINVAL); \ + int ret; \ + ret = init_static(_get_curthread(), mutex); \ + if (ret) \ + return (ret); \ + m = *mutex; \ + } + static int -mutex_trylock_common(struct pthread *curthread, pthread_mutex_t *mutex) +mutex_trylock_common(pthread_mutex_t *mutex) { - struct pthread_mutex *m; + struct pthread *curthread = _get_curthread(); + struct pthread_mutex *m = *mutex; uint32_t id; int ret; id = TID(curthread); - m = *mutex; ret = _thr_umutex_trylock(&m->m_lock, id); - if (ret == 0) { + if (__predict_true(ret == 0)) { ENQUEUE_MUTEX(curthread, m); } else if (m->m_owner == curthread) { ret = mutex_self_trylock(m); @@ -332,19 +342,11 @@ mutex_trylock_common(struct pthread *cur int __pthread_mutex_trylock(pthread_mutex_t *mutex) { - struct pthread *curthread = _get_curthread(); - int ret; + struct pthread_mutex *m; - /* - * If the mutex is statically initialized, perform the dynamic - * initialization: - */ - if (__predict_false(*mutex == NULL)) { - ret = init_static(curthread, mutex); - if (__predict_false(ret)) - return (ret); - } - return (mutex_trylock_common(curthread, mutex)); + CHECK_AND_INIT_MUTEX + + return (mutex_trylock_common(mutex)); } static int @@ -365,8 +367,10 @@ mutex_lock_sleep(struct pthread *curthre * the lock is likely to be released quickly and it is * faster than entering the kernel */ - if (m->m_lock.m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) - goto sleep_in_kernel; + if (__predict_false( + (m->m_lock.m_flags & + (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) != 0)) + goto sleep_in_kernel; if (!_thr_is_smp) goto yield_loop; @@ -414,9 +418,10 @@ done: } static inline int -mutex_lock_common(struct pthread *curthread, struct pthread_mutex *m, +mutex_lock_common(struct pthread_mutex *m, const struct timespec *abstime) { + struct pthread *curthread = _get_curthread(); if (_thr_umutex_trylock2(&m->m_lock, TID(curthread)) == 0) { ENQUEUE_MUTEX(curthread, m); @@ -429,50 +434,25 @@ mutex_lock_common(struct pthread *curthr int __pthread_mutex_lock(pthread_mutex_t *mutex) { - struct pthread *curthread; - struct pthread_mutex *m; - int ret; + struct pthread_mutex *m; _thr_check_init(); - curthread = _get_curthread(); - - /* - * If the mutex is statically initialized, perform the dynamic - * initialization: - */ - if (__predict_false((m = *mutex) == NULL)) { - ret = init_static(curthread, mutex); - if (__predict_false(ret)) - return (ret); - m = *mutex; - } + CHECK_AND_INIT_MUTEX - return (mutex_lock_common(curthread, m, NULL)); + return (mutex_lock_common(m, NULL)); } int __pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abstime) { - struct pthread *curthread; - struct pthread_mutex *m; - int ret; + struct pthread_mutex *m; _thr_check_init(); - curthread = _get_curthread(); + CHECK_AND_INIT_MUTEX - /* - * If the mutex is statically initialized, perform the dynamic - * initialization: - */ - if (__predict_false((m = *mutex) == NULL)) { - ret = init_static(curthread, mutex); - if (__predict_false(ret)) - return (ret); - m = *mutex; - } - return (mutex_lock_common(curthread, m, abstime)); + return (mutex_lock_common(m, abstime)); } int @@ -482,20 +462,22 @@ _pthread_mutex_unlock(pthread_mutex_t *m } int -_mutex_cv_lock(pthread_mutex_t *m, int count) +_mutex_cv_lock(pthread_mutex_t *mutex, int count) { + struct pthread_mutex *m; int ret; - ret = mutex_lock_common(_get_curthread(), *m, NULL); + m = *mutex; + ret = mutex_lock_common(m, NULL); if (ret == 0) { - (*m)->m_refcount--; - (*m)->m_count += count; + m->m_refcount--; + m->m_count += count; } return (ret); } static int -mutex_self_trylock(pthread_mutex_t m) +mutex_self_trylock(struct pthread_mutex *m) { int ret; @@ -523,7 +505,7 @@ mutex_self_trylock(pthread_mutex_t m) } static int -mutex_self_lock(pthread_mutex_t m, const struct timespec *abstime) +mutex_self_lock(struct pthread_mutex *m, const struct timespec *abstime) { struct timespec ts1, ts2; int ret; @@ -598,8 +580,12 @@ mutex_unlock_common(pthread_mutex_t *mut struct pthread_mutex *m; uint32_t id; - if (__predict_false((m = *mutex) == NULL)) - return (EINVAL); + m = *mutex; + if (__predict_false(m <= THR_MUTEX_DESTROYED)) { + if (m == THR_MUTEX_DESTROYED) + return (EINVAL); + return (EPERM); + } /* * Check if the running thread is not the owner of the mutex. @@ -616,7 +602,7 @@ mutex_unlock_common(pthread_mutex_t *mut m->m_owner = NULL; /* Remove the mutex from the threads queue. */ MUTEX_ASSERT_IS_OWNED(m); - if ((m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0) + if (__predict_true((m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0)) TAILQ_REMOVE(&curthread->mutexq, m, m_qe); else { TAILQ_REMOVE(&curthread->pp_mutexq, m, m_qe); @@ -634,8 +620,12 @@ _mutex_cv_unlock(pthread_mutex_t *mutex, struct pthread *curthread = _get_curthread(); struct pthread_mutex *m; - if (__predict_false((m = *mutex) == NULL)) - return (EINVAL); + m = *mutex; + if (__predict_false(m <= THR_MUTEX_DESTROYED)) { + if (m == THR_MUTEX_DESTROYED) + return (EINVAL); + return (EPERM); + } /* * Check if the running thread is not the owner of the mutex. @@ -652,7 +642,7 @@ _mutex_cv_unlock(pthread_mutex_t *mutex, m->m_owner = NULL; /* Remove the mutex from the threads queue. */ MUTEX_ASSERT_IS_OWNED(m); - if ((m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0) + if (__predict_true((m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0)) TAILQ_REMOVE(&curthread->mutexq, m, m_qe); else { TAILQ_REMOVE(&curthread->pp_mutexq, m, m_qe); @@ -667,18 +657,19 @@ int _pthread_mutex_getprioceiling(pthread_mutex_t *mutex, int *prioceiling) { + struct pthread_mutex *m; int ret; - if (*mutex == NULL) - ret = EINVAL; - else if (((*mutex)->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0) + m = *mutex; + if ((m <= THR_MUTEX_DESTROYED) || + (m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0) ret = EINVAL; else { - *prioceiling = (*mutex)->m_lock.m_ceilings[0]; + *prioceiling = m->m_lock.m_ceilings[0]; ret = 0; } - return(ret); + return (ret); } int @@ -690,7 +681,8 @@ _pthread_mutex_setprioceiling(pthread_mu int ret; m = *mutex; - if (m == NULL || (m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0) + if ((m <= THR_MUTEX_DESTROYED) || + (m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0) return (EINVAL); ret = __thr_umutex_set_ceiling(&m->m_lock, ceiling, old_ceiling); @@ -719,61 +711,54 @@ _pthread_mutex_setprioceiling(pthread_mu int _pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count) { - if (*mutex == NULL) - return (EINVAL); - *count = (*mutex)->m_spinloops; + struct pthread_mutex *m; + + CHECK_AND_INIT_MUTEX + + *count = m->m_spinloops; return (0); } int __pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count) { - struct pthread *curthread = _get_curthread(); - int ret; + struct pthread_mutex *m; - if (__predict_false(*mutex == NULL)) { - ret = init_static(curthread, mutex); - if (__predict_false(ret)) - return (ret); - } - (*mutex)->m_spinloops = count; + CHECK_AND_INIT_MUTEX + + m->m_spinloops = count; return (0); } int _pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count) { - if (*mutex == NULL) - return (EINVAL); - *count = (*mutex)->m_yieldloops; + struct pthread_mutex *m; + + CHECK_AND_INIT_MUTEX + + *count = m->m_yieldloops; return (0); } int __pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count) { - struct pthread *curthread = _get_curthread(); - int ret; + struct pthread_mutex *m; - if (__predict_false(*mutex == NULL)) { - ret = init_static(curthread, mutex); - if (__predict_false(ret)) - return (ret); - } - (*mutex)->m_yieldloops = count; + CHECK_AND_INIT_MUTEX + + m->m_yieldloops = count; return (0); } int _pthread_mutex_isowned_np(pthread_mutex_t *mutex) { - struct pthread *curthread = _get_curthread(); - int ret; + struct pthread_mutex *m; - if (__predict_false(*mutex == NULL)) { - ret = init_static(curthread, mutex); - if (__predict_false(ret)) - return (ret); - } - return ((*mutex)->m_owner == curthread); + m = *mutex; + if (m <= THR_MUTEX_DESTROYED) + return (0); + return (m->m_owner == _get_curthread()); } Modified: stable/8/lib/libthr/thread/thr_private.h ============================================================================== --- stable/8/lib/libthr/thread/thr_private.h Tue Oct 26 08:50:09 2010 (r214370) +++ stable/8/lib/libthr/thread/thr_private.h Tue Oct 26 09:25:29 2010 (r214371) @@ -107,6 +107,15 @@ TAILQ_HEAD(mutex_queue, pthread_mutex); } \ } while (0) +/* XXX These values should be same as those defined in pthread.h */ +#define THR_MUTEX_INITIALIZER ((struct pthread_mutex *)NULL) +#define THR_ADAPTIVE_MUTEX_INITIALIZER ((struct pthread_mutex *)1) +#define THR_MUTEX_DESTROYED ((struct pthread_mutex *)2) +#define THR_COND_INITIALIZER ((struct pthread_cond *)NULL) +#define THR_COND_DESTROYED ((struct pthread_cond *)1) +#define THR_RWLOCK_INITIALIZER ((struct pthread_rwlock *)NULL) +#define THR_RWLOCK_DESTROYED ((struct pthread_rwlock *)1) + struct pthread_mutex { /* * Lock for accesses to this structure. @@ -571,6 +580,7 @@ extern struct pthread_attr _pthread_attr /* Default mutex attributes: */ extern struct pthread_mutex_attr _pthread_mutexattr_default __hidden; +extern struct pthread_mutex_attr _pthread_mutexattr_adaptive_default __hidden; /* Default condition variable attributes: */ extern struct pthread_cond_attr _pthread_condattr_default __hidden; Modified: stable/8/lib/libthr/thread/thr_rwlock.c ============================================================================== --- stable/8/lib/libthr/thread/thr_rwlock.c Tue Oct 26 08:50:09 2010 (r214370) +++ stable/8/lib/libthr/thread/thr_rwlock.c Tue Oct 26 09:25:29 2010 (r214371) @@ -45,6 +45,19 @@ __weak_reference(_pthread_rwlock_unlock, __weak_reference(_pthread_rwlock_wrlock, pthread_rwlock_wrlock); __weak_reference(_pthread_rwlock_timedwrlock, pthread_rwlock_timedwrlock); +#define CHECK_AND_INIT_RWLOCK \ + if (__predict_false((prwlock = (*rwlock)) <= THR_RWLOCK_DESTROYED)) { \ + if (prwlock == THR_RWLOCK_INITIALIZER) { \ + int ret; \ + ret = init_static(_get_curthread(), rwlock); \ + if (ret) \ + return (ret); \ + } else if (prwlock == THR_RWLOCK_DESTROYED) { \ + return (EINVAL); \ + } \ + prwlock = *rwlock; \ + } + /* * Prototypes */ @@ -64,15 +77,16 @@ rwlock_init(pthread_rwlock_t *rwlock, co int _pthread_rwlock_destroy (pthread_rwlock_t *rwlock) { + pthread_rwlock_t prwlock; int ret; - if (rwlock == NULL) + prwlock = *rwlock; + if (prwlock == THR_RWLOCK_INITIALIZER) + ret = 0; + else if (prwlock == THR_RWLOCK_DESTROYED) ret = EINVAL; else { - pthread_rwlock_t prwlock; - - prwlock = *rwlock; - *rwlock = NULL; + *rwlock = THR_RWLOCK_DESTROYED; free(prwlock); ret = 0; @@ -87,7 +101,7 @@ init_static(struct pthread *thread, pthr THR_LOCK_ACQUIRE(thread, &_rwlock_static_lock); - if (*rwlock == NULL) + if (*rwlock == THR_RWLOCK_INITIALIZER) ret = rwlock_init(rwlock, NULL); else ret = 0; @@ -113,18 +127,7 @@ rwlock_rdlock_common(pthread_rwlock_t *r int flags; int ret; - if (__predict_false(rwlock == NULL)) - return (EINVAL); - - prwlock = *rwlock; - - /* check for static initialization */ - if (__predict_false(prwlock == NULL)) { - if ((ret = init_static(curthread, rwlock)) != 0) - return (ret); - - prwlock = *rwlock; - } + CHECK_AND_INIT_RWLOCK if (curthread->rdlock_count) { /* @@ -206,18 +209,7 @@ _pthread_rwlock_tryrdlock (pthread_rwloc int flags; int ret; - if (__predict_false(rwlock == NULL)) - return (EINVAL); - - prwlock = *rwlock; - - /* check for static initialization */ - if (__predict_false(prwlock == NULL)) { - if ((ret = init_static(curthread, rwlock)) != 0) - return (ret); - - prwlock = *rwlock; - } + CHECK_AND_INIT_RWLOCK if (curthread->rdlock_count) { /* @@ -250,18 +242,7 @@ _pthread_rwlock_trywrlock (pthread_rwloc pthread_rwlock_t prwlock; int ret; - if (__predict_false(rwlock == NULL)) - return (EINVAL); - - prwlock = *rwlock; - - /* check for static initialization */ - if (__predict_false(prwlock == NULL)) { - if ((ret = init_static(curthread, rwlock)) != 0) - return (ret); - - prwlock = *rwlock; - } + CHECK_AND_INIT_RWLOCK ret = _thr_rwlock_trywrlock(&prwlock->lock); if (ret == 0) @@ -277,18 +258,7 @@ rwlock_wrlock_common (pthread_rwlock_t * struct timespec ts, ts2, *tsp; int ret; - if (__predict_false(rwlock == NULL)) - return (EINVAL); - - prwlock = *rwlock; - - /* check for static initialization */ - if (__predict_false(prwlock == NULL)) { - if ((ret = init_static(curthread, rwlock)) != 0) - return (ret); - - prwlock = *rwlock; - } + CHECK_AND_INIT_RWLOCK /* * POSIX said the validity of the abstimeout parameter need @@ -356,12 +326,9 @@ _pthread_rwlock_unlock (pthread_rwlock_t int ret; int32_t state; - if (__predict_false(rwlock == NULL)) - return (EINVAL); - prwlock = *rwlock; - if (__predict_false(prwlock == NULL)) + if (__predict_false(prwlock <= THR_RWLOCK_DESTROYED)) return (EINVAL); state = prwlock->lock.rw_state; From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 10:57: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 0C8D31065670; Tue, 26 Oct 2010 10:57:12 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5B2E88FC1F; Tue, 26 Oct 2010 10:57:11 +0000 (UTC) Received: by gwaa18 with SMTP id a18so2399607gwa.13 for ; Tue, 26 Oct 2010 03:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :user-agent:date:message-id:mime-version:content-type; bh=yhlC4oTr8VrcGkxOTCyG5vHzWeUeHWJV4vezI9qLQkQ=; b=iB/GEaN3yqZRQIVj/SazYjNy9udk4kVbNz/bZBjEJW5tvtJwy0fFvma2YLv9Bmx1Tb a8+A3tMnvQkoSYHWPMlDeGLtkHxwXrCeKvZGZYTExZq2u7AMn2YRFkAWipwI2jpd/BgP TrTfjrBhYTuKY2nyL2Iel5RhFPprGMpWcAF88= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:user-agent:date:message-id :mime-version:content-type; b=ioMKRtF1GdU1iymu+0GX/dqCVnusvC+xf5DXlKmtBCh8cnpdwf3wtvg47IHTkudVPD c+bDx5gVaTDs1+dM+LMnFKBkncQbFeMFm61hhCCFV0Feztwt9zTBYMlD/TLgvn44GF8/ ylrE0SrXPCK30OzC3sK6CruMat/mwHvX47H9M= Received: by 10.151.10.1 with SMTP id n1mr15107766ybi.380.1288090630557; Tue, 26 Oct 2010 03:57:10 -0700 (PDT) Received: from localhost (tor-exit-proxy3-readme.formlessnetworking.net [208.53.142.39]) by mx.google.com with ESMTPS id z4sm4797577yhz.1.2010.10.26.03.57.07 (version=SSLv3 cipher=RC4-MD5); Tue, 26 Oct 2010 03:57:09 -0700 (PDT) From: Anonymous To: David Xu References: <201010250916.o9P9G4YO058177__37512.3073034503$1287998186$gmane$org@svn.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) Date: Tue, 26 Oct 2010 14:56:50 +0400 Message-ID: <86lj5lusr1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214334 - head/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: Tue, 26 Oct 2010 10:57:12 -0000 David Xu writes: > Author: davidxu > Date: Mon Oct 25 09:16:04 2010 > New Revision: 214334 > URL: http://svn.freebsd.org/changeset/base/214334 > > Log: > Get cpuset in pthread_attr_get_np() and free it in pthread_attr_destroy(). > > MFC after: 7 days After this change firefox 4.0b8pre built from mozilla trunk crashes with SIGBUS while starting, on /head@r214363M amd64. It may be related to $ js Assertion failure: stackBase, at jsnativestack.cpp:217 and the calls preceding it pthread_attr_get_np(thread, &sattr); pthread_attr_getstack(&sattr, &stackBase, &stackSize); java/openjdk6 doesn't start, too $ java # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (os_bsd_x86.cpp:876), pid=10495, tid=34389128704 # Error: pthread_attr_get_np failed with err = 34 From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 11:52: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 7EDA6106564A; Tue, 26 Oct 2010 11:52:28 +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 57F628FC0C; Tue, 26 Oct 2010 11:52:28 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id F092A46B8C; Tue, 26 Oct 2010 07:52:27 -0400 (EDT) Date: Tue, 26 Oct 2010 12:52:27 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Attilio Rao In-Reply-To: <201010251316.o9PDGB4L066137@svn.freebsd.org> Message-ID: References: <201010251316.o9PDGB4L066137@svn.freebsd.org> 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-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r214338 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 11:52:28 -0000 On Mon, 25 Oct 2010, Attilio Rao wrote: > IP_BINDANY is not correctly handled in getsockopt() case. > Fix it by specifying the correct bits. It would be nice if we had regression tests to validate this sort of thing; I think we already have something in the area of socket options, but it doesn't test for this sort of stuff... Robert > > Modified: > stable/8/sys/netinet/ip_output.c > stable/8/sys/netinet6/ip6_output.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) > > Modified: stable/8/sys/netinet/ip_output.c > ============================================================================== > --- stable/8/sys/netinet/ip_output.c Mon Oct 25 13:13:16 2010 (r214337) > +++ stable/8/sys/netinet/ip_output.c Mon Oct 25 13:16:11 2010 (r214338) > @@ -1127,6 +1127,7 @@ ip_ctloutput(struct socket *so, struct s > case IP_FAITH: > case IP_ONESBCAST: > case IP_DONTFRAG: > + case IP_BINDANY: > switch (sopt->sopt_name) { > > case IP_TOS: > @@ -1182,6 +1183,9 @@ ip_ctloutput(struct socket *so, struct s > case IP_DONTFRAG: > optval = OPTBIT(INP_DONTFRAG); > break; > + case IP_BINDANY: > + optval = OPTBIT(INP_BINDANY); > + break; > } > error = sooptcopyout(sopt, &optval, sizeof optval); > break; > > Modified: stable/8/sys/netinet6/ip6_output.c > ============================================================================== > --- stable/8/sys/netinet6/ip6_output.c Mon Oct 25 13:13:16 2010 (r214337) > +++ stable/8/sys/netinet6/ip6_output.c Mon Oct 25 13:16:11 2010 (r214338) > @@ -1798,6 +1798,7 @@ do { \ > case IPV6_PORTRANGE: > case IPV6_RECVTCLASS: > case IPV6_AUTOFLOWLABEL: > + case IPV6_BINDANY: > switch (optname) { > > case IPV6_RECVHOPOPTS: > From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 12:46: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 59F0E1065697; Tue, 26 Oct 2010 12:46:27 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46F848FC21; Tue, 26 Oct 2010 12:46: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 o9QCkRiB025361; Tue, 26 Oct 2010 12:46:27 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QCkRSg025356; Tue, 26 Oct 2010 12:46:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010261246.o9QCkRSg025356@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 12:46: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: r214373 - 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, 26 Oct 2010 12:46:27 -0000 Author: attilio Date: Tue Oct 26 12:46:26 2010 New Revision: 214373 URL: http://svn.freebsd.org/changeset/base/214373 Log: Merge dump_machdep.c i386/amd64 under the x86 subtree. Sponsored by: Sandvine Incorporated Tested by: gianni Added: head/sys/x86/x86/dump_machdep.c - copied, changed from r214370, head/sys/amd64/amd64/dump_machdep.c Deleted: head/sys/amd64/amd64/dump_machdep.c head/sys/i386/i386/dump_machdep.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 Oct 26 10:23:49 2010 (r214372) +++ head/sys/conf/files.amd64 Tue Oct 26 12:46:26 2010 (r214373) @@ -104,7 +104,6 @@ amd64/amd64/cpu_switch.S standard amd64/amd64/db_disasm.c optional ddb amd64/amd64/db_interface.c optional ddb amd64/amd64/db_trace.c optional ddb -amd64/amd64/dump_machdep.c standard amd64/amd64/elf_machdep.c standard amd64/amd64/exception.S standard amd64/amd64/fpu.c standard @@ -321,6 +320,7 @@ x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/qpi.c standard +x86/x86/dump_machdep.c standard 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 Oct 26 10:23:49 2010 (r214372) +++ head/sys/conf/files.i386 Tue Oct 26 12:46:26 2010 (r214373) @@ -263,7 +263,6 @@ i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb -i386/i386/dump_machdep.c standard i386/i386/elan-mmcr.c optional cpu_elan | cpu_soekris i386/i386/elf_machdep.c standard i386/i386/exception.s optional native @@ -395,6 +394,7 @@ x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/qpi.c standard +x86/x86/dump_machdep.c standard 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 Oct 26 10:23:49 2010 (r214372) +++ head/sys/conf/files.pc98 Tue Oct 26 12:46:26 2010 (r214373) @@ -138,7 +138,6 @@ i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb -i386/i386/dump_machdep.c standard i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb @@ -255,6 +254,7 @@ pc98/pc98/pc98_machdep.c standard x86/isa/atpic.c optional atpic x86/isa/clock.c standard x86/isa/isa.c optional isa +x86/x86/dump_machdep.c standard 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/dump_machdep.c (from r214370, head/sys/amd64/amd64/dump_machdep.c) ============================================================================== --- head/sys/amd64/amd64/dump_machdep.c Tue Oct 26 08:50:09 2010 (r214370, copy source) +++ head/sys/x86/x86/dump_machdep.c Tue Oct 26 12:46:26 2010 (r214373) @@ -36,9 +36,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#ifdef __amd64__ +#define KERNELDUMP_VERSION KERNELDUMP_AMD64_VERSION +#define EM_VALUE EM_X86_64 +#else +#define KERNELDUMP_VERSION KERNELDUMP_I386_VERSION +#define EM_VALUE EM_386 +#endif + CTASSERT(sizeof(struct kerneldumpheader) == 512); int do_minidump = 1; @@ -168,7 +177,8 @@ cb_dumpdata(struct md_pa *mdp, int seqnr if (maxdumppgs == 0) /* seatbelt */ maxdumppgs = 1; - printf(" chunk %d: %ldMB (%ld pages)", seqnr, PG2MB(pgs), pgs); + printf(" chunk %d: %"PRIu64"MB (%"PRIu64" pages)", seqnr, PG2MB(pgs), + pgs); while (pgs) { chunk = pgs; @@ -177,7 +187,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr sz = chunk << PAGE_SHIFT; counter += sz; if (counter >> 24) { - printf(" %ld", PG2MB(pgs)); + printf(" %"PRIu64, PG2MB(pgs)); counter &= (1<<24) - 1; } for (i = 0; i < chunk; i++) { @@ -279,7 +289,7 @@ dumpsys(struct dumperinfo *di) ehdr.e_ident[EI_VERSION] = EV_CURRENT; ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ ehdr.e_type = ET_CORE; - ehdr.e_machine = EM_X86_64; + ehdr.e_machine = EM_VALUE; ehdr.e_phoff = sizeof(ehdr); ehdr.e_flags = 0; ehdr.e_ehsize = sizeof(ehdr); @@ -304,7 +314,8 @@ dumpsys(struct dumperinfo *di) dumplo = di->mediaoffset + di->mediasize - dumpsize; dumplo -= sizeof(kdh) * 2; - mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize, di->blocksize); + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_VERSION, dumpsize, + di->blocksize); printf("Dumping %llu MB (%d chunks)\n", (long long)dumpsize >> 20, ehdr.e_phnum); From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 13:07: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 9848F106566B; Tue, 26 Oct 2010 13:07:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86DBB8FC08; Tue, 26 Oct 2010 13:07: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 o9QD7104026667; Tue, 26 Oct 2010 13:07:01 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QD71A9026665; Tue, 26 Oct 2010 13:07:01 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201010261307.o9QD71A9026665@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Oct 2010 13:07:01 +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: r214374 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 13:07:01 -0000 Author: gjb (doc committer) Date: Tue Oct 26 13:07:01 2010 New Revision: 214374 URL: http://svn.freebsd.org/changeset/base/214374 Log: Minor grammar fix. Submitted by: arundel (via email) Approved by: jkois (mentor) Patch by: arundel MFC after: 5 days Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Tue Oct 26 12:46:26 2010 (r214373) +++ head/share/man/man7/build.7 Tue Oct 26 13:07:01 2010 (r214374) @@ -419,7 +419,7 @@ Typically, one only needs to set .Pp Builds under directory .Pa /usr/src -are also influenced by defining one or more the following symbols, +are also influenced by defining one or more of the following symbols, using the .Fl D option of From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 14:56: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 53745106566B; Tue, 26 Oct 2010 14:56:47 +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 409F68FC14; Tue, 26 Oct 2010 14:56: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 o9QEulqh041420; Tue, 26 Oct 2010 14:56:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QEulei041414; Tue, 26 Oct 2010 14:56:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010261456.o9QEulei041414@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 26 Oct 2010 14:56:47 +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: r214376 - in stable/8/sys/powerpc: aim 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: Tue, 26 Oct 2010 14:56:47 -0000 Author: nwhitehorn Date: Tue Oct 26 14:56:46 2010 New Revision: 214376 URL: http://svn.freebsd.org/changeset/base/214376 Log: MFC r213456: Handle vector assist traps without a kernel panic, by setting denormalized values to zero. A correct solution would involve emulating vector operations on denormalized values, but this has little effect on accuracy and is much less complicated for now. Modified: stable/8/sys/powerpc/aim/machdep.c stable/8/sys/powerpc/aim/trap.c stable/8/sys/powerpc/include/altivec.h stable/8/sys/powerpc/include/pcb.h stable/8/sys/powerpc/include/trap_aim.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) Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Tue Oct 26 14:06:59 2010 (r214375) +++ stable/8/sys/powerpc/aim/machdep.c Tue Oct 26 14:56:46 2010 (r214376) @@ -474,8 +474,8 @@ powerpc_init(u_int startkernel, u_int en bcopy(generictrap, (void *)EXC_SC, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_FPA, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_VEC, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_VECAST, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_THRM, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_VECAST_G4, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_VECAST_G5, (size_t)&trapsize); __syncicache(EXC_RSVD, EXC_LAST - EXC_RSVD); /* Modified: stable/8/sys/powerpc/aim/trap.c ============================================================================== --- stable/8/sys/powerpc/aim/trap.c Tue Oct 26 14:06:59 2010 (r214375) +++ stable/8/sys/powerpc/aim/trap.c Tue Oct 26 14:56:46 2010 (r214376) @@ -196,9 +196,19 @@ trap(struct trapframe *frame) enable_vec(td); break; - case EXC_VECAST: - printf("Vector assist exception!\n"); - sig = SIGILL; + case EXC_VECAST_G4: + case EXC_VECAST_G5: + /* + * We get a VPU assist exception for IEEE mode + * vector operations on denormalized floats. + * Emulating this is a giant pain, so for now, + * just switch off IEEE mode and treat them as + * zero. + */ + + save_vec(td); + td->td_pcb->pcb_vec.vscr |= ALTIVEC_VSCR_NJ; + enable_vec(td); break; case EXC_ALI: Modified: stable/8/sys/powerpc/include/altivec.h ============================================================================== --- stable/8/sys/powerpc/include/altivec.h Tue Oct 26 14:06:59 2010 (r214375) +++ stable/8/sys/powerpc/include/altivec.h Tue Oct 26 14:56:46 2010 (r214376) @@ -29,6 +29,9 @@ #ifndef _MACHINE_ALTIVEC_H_ #define _MACHINE_ALTIVEC_H_ +#define ALTIVEC_VSCR_NJ 0x00010000 /* Enable non-Java mode */ +#define ALTIVEC_VSCR_SAT 0x00000001 /* Saturation status bit */ + void enable_vec(struct thread *); void save_vec(struct thread *); Modified: stable/8/sys/powerpc/include/pcb.h ============================================================================== --- stable/8/sys/powerpc/include/pcb.h Tue Oct 26 14:06:59 2010 (r214375) +++ stable/8/sys/powerpc/include/pcb.h Tue Oct 26 14:56:46 2010 (r214376) @@ -58,7 +58,7 @@ struct pcb { uint32_t vr[32][4]; register_t vrsave; register_t spare[2]; - register_t vscr; + register_t vscr; /* aligned at vector element 3 */ } pcb_vec __attribute__((aligned(16))); /* Vector processor */ unsigned int pcb_veccpu; /* which CPU had our vector stuff. */ Modified: stable/8/sys/powerpc/include/trap_aim.h ============================================================================== --- stable/8/sys/powerpc/include/trap_aim.h Tue Oct 26 14:06:59 2010 (r214375) +++ stable/8/sys/powerpc/include/trap_aim.h Tue Oct 26 14:56:46 2010 (r214376) @@ -52,9 +52,12 @@ /* The following is only available on the 601: */ #define EXC_RUNMODETRC 0x2000 /* Run Mode/Trace Exception */ +/* The following are only available on 970(G5): */ +#define EXC_VECAST_G5 0x1700 /* AltiVec Assist */ + /* The following are only available on 7400(G4): */ #define EXC_VEC 0x0f20 /* AltiVec Unavailable */ -#define EXC_VECAST 0x1600 /* AltiVec Assist */ +#define EXC_VECAST_G4 0x1600 /* AltiVec Assist */ /* The following are only available on 604/750/7400: */ #define EXC_PERF 0x0f00 /* Performance Monitoring */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 14:59: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 8BD791065673; Tue, 26 Oct 2010 14:59:35 +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 79AE48FC08; Tue, 26 Oct 2010 14:59: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 o9QExZ9a041868; Tue, 26 Oct 2010 14:59:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QExZoZ041866; Tue, 26 Oct 2010 14:59:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010261459.o9QExZoZ041866@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 26 Oct 2010 14:59: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: r214377 - stable/8/sys/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: Tue, 26 Oct 2010 14:59:35 -0000 Author: nwhitehorn Date: Tue Oct 26 14:59:35 2010 New Revision: 214377 URL: http://svn.freebsd.org/changeset/base/214377 Log: MFC r212360: On architectures with non-tree-based page tables like PowerPC, every page in a range must be checked when calling pmap_remove(). Calling pmap_remove() from vm_pageout_map_deactivate_pages() with the entire range of the map could result in attempting to demap an extraordinary number of pages (> 10^15), so iterate through each map entry and unmap each of them individually. Modified: stable/8/sys/vm/vm_pageout.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) Modified: stable/8/sys/vm/vm_pageout.c ============================================================================== --- stable/8/sys/vm/vm_pageout.c Tue Oct 26 14:56:46 2010 (r214376) +++ stable/8/sys/vm/vm_pageout.c Tue Oct 26 14:59:35 2010 (r214377) @@ -661,8 +661,11 @@ vm_pageout_map_deactivate_pages(map, des * table pages. */ if (desired == 0 && nothingwired) { - pmap_remove(vm_map_pmap(map), vm_map_min(map), - vm_map_max(map)); + tmpe = map->header.next; + while (tmpe != &map->header) { + pmap_remove(vm_map_pmap(map), tmpe->start, tmpe->end); + tmpe = tmpe->next; + } } vm_map_unlock(map); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 15:48: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 A03D11065670; Tue, 26 Oct 2010 15:48:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6968FC13; Tue, 26 Oct 2010 15:48: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 o9QFm3Ok050364; Tue, 26 Oct 2010 15:48:03 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QFm3bW050360; Tue, 26 Oct 2010 15:48:03 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201010261548.o9QFm3bW050360@svn.freebsd.org> From: Martin Matuska Date: Tue, 26 Oct 2010 15:48: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: r214378 - 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: Tue, 26 Oct 2010 15:48:03 -0000 Author: mm Date: Tue Oct 26 15:48:03 2010 New Revision: 214378 URL: http://svn.freebsd.org/changeset/base/214378 Log: Bugfix merge from OpenSolaris: OpenSolaris onnv-revision: 10209:91f47f0e7728 6830541 zfs_get_data_trips on a verify 6696242 multiple zfs_fillpage() zfs: accessing past end of object panics 6785914 zfs fails to drop dn_struct_rwlock in recovery code path Approved by: delphij (mentor) Obtained from: OpenSolaris (Bug ID 6830541, 6696242, 6785914) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Oct 26 14:59:35 2010 (r214377) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Oct 26 15:48:03 2010 (r214378) @@ -192,7 +192,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, ASSERT(length <= DMU_MAX_ACCESS); - dbuf_flags = DB_RF_CANFAIL | DB_RF_NEVERWAIT; + dbuf_flags = DB_RF_CANFAIL | DB_RF_NEVERWAIT | DB_RF_HAVESTRUCT; if (flags & DMU_READ_NO_PREFETCH || length > zfetch_array_rd_sz) dbuf_flags |= DB_RF_NOPREFETCH; @@ -209,6 +209,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, os_dsl_dataset->ds_object, (longlong_t)dn->dn_object, dn->dn_datablksz, (longlong_t)offset, (longlong_t)length); + rw_exit(&dn->dn_struct_rwlock); return (EIO); } nblks = 1; @@ -231,9 +232,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, } /* initiate async i/o */ if (read) { - rw_exit(&dn->dn_struct_rwlock); (void) dbuf_read(db, zio, dbuf_flags); - rw_enter(&dn->dn_struct_rwlock, RW_READER); } dbp[i] = &db->db; } @@ -540,7 +539,7 @@ dmu_read(objset_t *os, uint64_t object, { dnode_t *dn; dmu_buf_t **dbp; - int numbufs, i, err; + int numbufs, err; err = dnode_hold(os->os, object, FTAG, &dn); if (err) @@ -551,7 +550,7 @@ dmu_read(objset_t *os, uint64_t object, * block. If we ever do the tail block optimization, we will need to * handle that here as well. */ - if (dn->dn_datablkshift == 0) { + if (dn->dn_maxblkid == 0) { int newsz = offset > dn->dn_datablksz ? 0 : MIN(size, dn->dn_datablksz - offset); bzero((char *)buf + newsz, size - newsz); @@ -560,6 +559,7 @@ dmu_read(objset_t *os, uint64_t object, while (size > 0) { uint64_t mylen = MIN(size, DMU_MAX_ACCESS / 2); + int i; /* * NB: we could do this block-at-a-time, but it's nice 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 Tue Oct 26 14:59:35 2010 (r214377) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Oct 26 15:48:03 2010 (r214378) @@ -1031,6 +1031,10 @@ zfs_get_done(dmu_buf_t *db, void *vzgd) VFS_UNLOCK_GIANT(vfslocked); } +#ifdef DEBUG +static int zil_fault_io = 0; +#endif + /* * Get data to generate a TX_WRITE intent log record. */ @@ -1112,7 +1116,21 @@ zfs_get_data(void *arg, lr_write_t *lr, zgd->zgd_rl = rl; zgd->zgd_zilog = zfsvfs->z_log; zgd->zgd_bp = &lr->lr_blkptr; - VERIFY(0 == dmu_buf_hold(os, lr->lr_foid, boff, zgd, &db)); +#ifdef DEBUG + if (zil_fault_io) { + error = EIO; + zil_fault_io = 0; + } else { + error = dmu_buf_hold(os, lr->lr_foid, boff, zgd, &db); + } +#else + error = dmu_buf_hold(os, lr->lr_foid, boff, zgd, &db); +#endif + if (error != 0) { + kmem_free(zgd, sizeof (zgd_t)); + goto out; + } + ASSERT(boff == db->db_offset); lr->lr_blkoff = off - boff; error = dmu_sync(zio, db, &lr->lr_blkptr, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Oct 26 14:59:35 2010 (r214377) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Oct 26 15:48:03 2010 (r214378) @@ -933,6 +933,10 @@ zil_lwb_commit(zilog_t *zilog, itx_t *it } error = zilog->zl_get_data( itx->itx_private, lr, dbuf, lwb->lwb_zio); + if (error == EIO) { + txg_wait_synced(zilog->zl_dmu_pool, txg); + return (lwb); + } if (error) { ASSERT(error == ENOENT || error == EEXIST || error == EALREADY); From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 16:04: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 4E5BD106566B; Tue, 26 Oct 2010 16:04:24 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CB5D8FC29; Tue, 26 Oct 2010 16:04: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 o9QG4OiR052243; Tue, 26 Oct 2010 16:04:24 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QG4ORP052241; Tue, 26 Oct 2010 16:04:24 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201010261604.o9QG4ORP052241@svn.freebsd.org> From: Benedict Reuschling Date: Tue, 26 Oct 2010 16:04: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: r214379 - stable/8/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 16:04:24 -0000 Author: bcr (doc committer) Date: Tue Oct 26 16:04:23 2010 New Revision: 214379 URL: http://svn.freebsd.org/changeset/base/214379 Log: MFC r214147: Sync with OpenBSD rev. 1.13: strtonum does not require limits.h Obtained from: OpenBSD Discussed with: ru@ Modified: stable/8/lib/libc/stdlib/strtonum.3 Modified: stable/8/lib/libc/stdlib/strtonum.3 ============================================================================== --- stable/8/lib/libc/stdlib/strtonum.3 Tue Oct 26 15:48:03 2010 (r214378) +++ stable/8/lib/libc/stdlib/strtonum.3 Tue Oct 26 16:04:23 2010 (r214379) @@ -12,7 +12,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.\" $OpenBSD: strtonum.3,v 1.12 2005/10/26 11:37:58 jmc Exp $ +.\" $OpenBSD: strtonum.3,v 1.13 2006/04/25 05:15:42 tedu Exp $ .\" $FreeBSD$ .\" .Dd April 29, 2004 @@ -23,7 +23,6 @@ .Nd "reliably convert string value to an integer" .Sh SYNOPSIS .In stdlib.h -.In limits.h .Ft long long .Fo strtonum .Fa "const char *nptr" From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 16:16: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 2BCF91065670; Tue, 26 Oct 2010 16:16:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0D38FC0A; Tue, 26 Oct 2010 16:16: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 o9QGGGrw053091; Tue, 26 Oct 2010 16:16:16 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QGGFgX053089; Tue, 26 Oct 2010 16:16:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010261616.o9QGGFgX053089@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 16:16:15 +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: r214380 - 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: Tue, 26 Oct 2010 16:16:16 -0000 Author: attilio Date: Tue Oct 26 16:16:15 2010 New Revision: 214380 URL: http://svn.freebsd.org/changeset/base/214380 Log: Remove usage of PRI* macro for style compliancy. Requested by: bde, jhb Sponsored by: Sandvine Incorporated Modified: head/sys/x86/x86/dump_machdep.c Modified: head/sys/x86/x86/dump_machdep.c ============================================================================== --- head/sys/x86/x86/dump_machdep.c Tue Oct 26 16:04:23 2010 (r214379) +++ head/sys/x86/x86/dump_machdep.c Tue Oct 26 16:16:15 2010 (r214380) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -177,8 +176,8 @@ cb_dumpdata(struct md_pa *mdp, int seqnr if (maxdumppgs == 0) /* seatbelt */ maxdumppgs = 1; - printf(" chunk %d: %"PRIu64"MB (%"PRIu64" pages)", seqnr, PG2MB(pgs), - pgs); + printf(" chunk %d: %jdMB (%jd pages)", seqnr, (uintmax_t)PG2MB(pgs), + (uintmax_t)pgs); while (pgs) { chunk = pgs; @@ -187,7 +186,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr sz = chunk << PAGE_SHIFT; counter += sz; if (counter >> 24) { - printf(" %"PRIu64, PG2MB(pgs)); + printf(" %jd", (uintmax_t)PG2MB(pgs)); counter &= (1<<24) - 1; } for (i = 0; i < chunk; i++) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 16:49: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 A23C11065672; Tue, 26 Oct 2010 16:49:18 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 916C38FC19; Tue, 26 Oct 2010 16:49: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 o9QGnI55055174; Tue, 26 Oct 2010 16:49:18 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QGnInL055172; Tue, 26 Oct 2010 16:49:18 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201010261649.o9QGnInL055172@svn.freebsd.org> From: Bruce Cran Date: Tue, 26 Oct 2010 16:49: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: r214381 - head/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: Tue, 26 Oct 2010 16:49:18 -0000 Author: brucec Date: Tue Oct 26 16:49:18 2010 New Revision: 214381 URL: http://svn.freebsd.org/changeset/base/214381 Log: Add information about the values and default setting of the kern.cam.ada.spindown_shutdown sysctl. MFC after: 3 weeks Modified: head/share/man/man4/ada.4 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Tue Oct 26 16:16:15 2010 (r214380) +++ head/share/man/man4/ada.4 Tue Oct 26 16:49:18 2010 (r214381) @@ -121,6 +121,7 @@ seconds. .It kern.cam.ada.spindown_shutdown .Pp This variable determines whether to spin-down disks when shutting down. +Set to 1 to enable spin-down, 0 to disable. The default is currently enabled. .El .Sh FILES .Bl -tag -width ".Pa /dev/ada*" -compact From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 17:12: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 072E71065672; Tue, 26 Oct 2010 17:12:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id BBDDA8FC13; Tue, 26 Oct 2010 17:12:14 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:1866:d44a:eec6:23e0] (unknown [IPv6:2001:7b8:3a7:0:1866:d44a:eec6:23e0]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D7BAC5C5A; Tue, 26 Oct 2010 19:12:13 +0200 (CEST) Message-ID: <4CC70BF9.30004@FreeBSD.org> Date: Tue, 26 Oct 2010 19:12:25 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.12pre) Gecko/20101016 Lanikai/3.1.6pre MIME-Version: 1.0 To: Attilio Rao References: <201010261616.o9QGGFgX053089@svn.freebsd.org> In-Reply-To: <201010261616.o9QGGFgX053089@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214380 - 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: Tue, 26 Oct 2010 17:12:15 -0000 On 2010-10-26 18:16, Attilio Rao wrote: > Remove usage of PRI* macro for style compliancy. ... > - printf(" chunk %d: %"PRIu64"MB (%"PRIu64" pages)", seqnr, PG2MB(pgs), > - pgs); > + printf(" chunk %d: %jdMB (%jd pages)", seqnr, (uintmax_t)PG2MB(pgs), > + (uintmax_t)pgs); If you cast to uintmax_t, you should use %ju instead. :) Otherwise, cast to intmax_t, e.g. if the PG2MB macro results in a signed value. From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 17:30: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 E850F1065672; Tue, 26 Oct 2010 17:30:34 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D65138FC14; Tue, 26 Oct 2010 17:30: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 o9QHUYf1057524; Tue, 26 Oct 2010 17:30:34 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QHUYYI057521; Tue, 26 Oct 2010 17:30:34 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201010261730.o9QHUYYI057521@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 26 Oct 2010 17:30: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: r214382 - stable/8/sys/dev/iwi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 17:30:35 -0000 Author: bschmidt Date: Tue Oct 26 17:30:34 2010 New Revision: 214382 URL: http://svn.freebsd.org/changeset/base/214382 Log: MFC r213729: Fix monitor mode which is implemented by doing a firmware scan. This is a port from stable/6, seems like the code got lost during the background scan changes in r170530. Modified: stable/8/sys/dev/iwi/if_iwi.c stable/8/sys/dev/iwi/if_iwivar.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) Modified: stable/8/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/8/sys/dev/iwi/if_iwi.c Tue Oct 26 16:49:18 2010 (r214381) +++ stable/8/sys/dev/iwi/if_iwi.c Tue Oct 26 17:30:34 2010 (r214382) @@ -180,6 +180,7 @@ static void iwi_release_fw_dma(struct iw static int iwi_config(struct iwi_softc *); static int iwi_get_firmware(struct iwi_softc *, enum ieee80211_opmode); static void iwi_put_firmware(struct iwi_softc *); +static void iwi_monitor_scan(void *, int); static int iwi_scanchan(struct iwi_softc *, unsigned long, int); static void iwi_scan_start(struct ieee80211com *); static void iwi_scan_end(struct ieee80211com *); @@ -292,6 +293,7 @@ iwi_attach(device_t dev) TASK_INIT(&sc->sc_restarttask, 0, iwi_restart, sc); TASK_INIT(&sc->sc_disassoctask, 0, iwi_disassoc, sc); TASK_INIT(&sc->sc_wmetask, 0, iwi_update_wme, sc); + TASK_INIT(&sc->sc_monitortask, 0, iwi_monitor_scan, sc); callout_init_mtx(&sc->sc_wdtimer, &sc->sc_mtx, 0); callout_init_mtx(&sc->sc_rftimer, &sc->sc_mtx, 0); @@ -460,6 +462,7 @@ iwi_detach(device_t dev) ieee80211_draintask(ic, &sc->sc_radiofftask); ieee80211_draintask(ic, &sc->sc_restarttask); ieee80211_draintask(ic, &sc->sc_disassoctask); + ieee80211_draintask(ic, &sc->sc_monitortask); iwi_stop(sc); @@ -988,7 +991,8 @@ iwi_newstate(struct ieee80211vap *vap, e * This is all totally bogus and needs to be redone. */ iwi_auth_and_assoc(sc, vap); - } + } else if (vap->iv_opmode == IEEE80211_M_MONITOR) + ieee80211_runtask(ic, &sc->sc_monitortask); break; case IEEE80211_S_ASSOC: /* @@ -1407,6 +1411,18 @@ iwi_notification_intr(struct iwi_softc * IWI_STATE_END(sc, IWI_FW_SCANNING); + /* + * Monitor mode works by doing a passive scan to set + * the channel and enable rx. Because we don't want + * to abort a scan lest the firmware crash we scan + * for a short period of time and automatically restart + * the scan when notified the sweep has completed. + */ + if (vap->iv_opmode == IEEE80211_M_MONITOR) { + ieee80211_runtask(ic, &sc->sc_monitortask); + break; + } + if (scan->status == IWI_SCAN_COMPLETED) { /* NB: don't need to defer, net80211 does it for us */ ieee80211_scan_next(vap); @@ -2557,6 +2573,11 @@ iwi_config(struct iwi_softc *sc) config.answer_pbreq = (ic->ic_opmode == IEEE80211_M_IBSS) ? 1 : 0; config.disable_unicast_decryption = 1; config.disable_multicast_decryption = 1; + if (ic->ic_opmode == IEEE80211_M_MONITOR) { + config.allow_invalid_frames = 1; + config.allow_beacon_and_probe_resp = 1; + config.allow_mgt = 1; + } DPRINTF(("Configuring adapter\n")); error = iwi_cmd(sc, IWI_CMD_SET_CONFIG, &config, sizeof config); if (error != 0) @@ -2642,6 +2663,17 @@ scan_band(const struct ieee80211_channel return IEEE80211_IS_CHAN_5GHZ(c) ? IWI_CHAN_5GHZ : IWI_CHAN_2GHZ; } +static void +iwi_monitor_scan(void *arg, int npending) +{ + struct iwi_softc *sc = arg; + IWI_LOCK_DECL; + + IWI_LOCK(sc); + (void) iwi_scanchan(sc, 2000, 0); + IWI_UNLOCK(sc); +} + /* * Start a scan on the current channel or all channels. */ Modified: stable/8/sys/dev/iwi/if_iwivar.h ============================================================================== --- stable/8/sys/dev/iwi/if_iwivar.h Tue Oct 26 16:49:18 2010 (r214381) +++ stable/8/sys/dev/iwi/if_iwivar.h Tue Oct 26 17:30:34 2010 (r214382) @@ -193,6 +193,7 @@ struct iwi_softc { struct task sc_restarttask; /* restart adapter processing */ struct task sc_disassoctask; struct task sc_wmetask; /* set wme parameters */ + struct task sc_monitortask; unsigned int sc_softled : 1, /* enable LED gpio status */ sc_ledstate: 1, /* LED on/off state */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 17:31: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 BBE1B106566B; Tue, 26 Oct 2010 17:31:46 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9F848FC0A; Tue, 26 Oct 2010 17:31: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 o9QHVkbJ057632; Tue, 26 Oct 2010 17:31:46 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QHVk5W057629; Tue, 26 Oct 2010 17:31:46 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201010261731.o9QHVk5W057629@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 26 Oct 2010 17:31:46 +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: r214383 - stable/7/sys/dev/iwi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 17:31:46 -0000 Author: bschmidt Date: Tue Oct 26 17:31:46 2010 New Revision: 214383 URL: http://svn.freebsd.org/changeset/base/214383 Log: MFC r213729: Fix monitor mode which is implemented by doing a firmware scan. This is a port from stable/6, seems like the code got lost during the background scan changes in r170530. Modified: stable/7/sys/dev/iwi/if_iwi.c stable/7/sys/dev/iwi/if_iwivar.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/iwi/if_iwi.c ============================================================================== --- stable/7/sys/dev/iwi/if_iwi.c Tue Oct 26 17:30:34 2010 (r214382) +++ stable/7/sys/dev/iwi/if_iwi.c Tue Oct 26 17:31:46 2010 (r214383) @@ -163,6 +163,7 @@ static void iwi_release_fw_dma(struct iw static int iwi_config(struct iwi_softc *); static int iwi_get_firmware(struct iwi_softc *); static void iwi_put_firmware(struct iwi_softc *); +static void iwi_monitor_scan(void *, int); static int iwi_scanchan(struct iwi_softc *, unsigned long, int); static void iwi_scan_start(struct ieee80211com *); static void iwi_scan_end(struct ieee80211com *); @@ -291,6 +292,7 @@ iwi_attach(device_t dev) TASK_INIT(&sc->sc_restarttask, 0, iwi_restart, sc); TASK_INIT(&sc->sc_opstask, 0, iwi_ops, sc); TASK_INIT(&sc->sc_scanaborttask, 0, iwi_scanabort, sc); + TASK_INIT(&sc->sc_monitortask, 0, iwi_monitor_scan, sc); callout_init_mtx(&sc->sc_wdtimer, &sc->sc_mtx, 0); if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { @@ -978,7 +980,8 @@ iwi_newstate(struct ieee80211com *ic, en */ if (ic->ic_state == IEEE80211_S_SCAN) iwi_assoc(ic); - } + } else if (ic->ic_opmode == IEEE80211_M_MONITOR) + taskqueue_enqueue(sc->sc_tq, &sc->sc_monitortask); break; case IEEE80211_S_INIT: /* @@ -1411,6 +1414,18 @@ iwi_notification_intr(struct iwi_softc * IWI_STATE_END(sc, IWI_FW_SCANNING); + /* + * Monitor mode works by doing a passive scan to set + * the channel and enable rx. Because we don't want + * to abort a scan lest the firmware crash we scan + * for a short period of time and automatically restart + * the scan when notified the sweep has completed. + */ + if (ic->ic_opmode == IEEE80211_M_MONITOR) { + taskqueue_enqueue(sc->sc_tq, &sc->sc_monitortask); + break; + } + if (scan->status == IWI_SCAN_COMPLETED) ieee80211_scan_next(ic); @@ -2595,6 +2610,11 @@ iwi_config(struct iwi_softc *sc) config.answer_pbreq = (ic->ic_opmode == IEEE80211_M_IBSS) ? 1 : 0; config.disable_unicast_decryption = 1; config.disable_multicast_decryption = 1; + if (ic->ic_opmode == IEEE80211_M_MONITOR) { + config.allow_invalid_frames = 1; + config.allow_beacon_and_probe_resp = 1; + config.allow_mgt = 1; + } DPRINTF(("Configuring adapter\n")); error = iwi_cmd(sc, IWI_CMD_SET_CONFIG, &config, sizeof config); if (error != 0) @@ -2717,6 +2737,17 @@ scan_band(const struct ieee80211_channel return IEEE80211_IS_CHAN_5GHZ(c) ? IWI_CHAN_5GHZ : IWI_CHAN_2GHZ; } +static void +iwi_monitor_scan(void *arg, int npending) +{ + struct iwi_softc *sc = arg; + IWI_LOCK_DECL; + + IWI_LOCK(sc); + (void) iwi_scanchan(sc, 2000, 0); + IWI_UNLOCK(sc); +} + /* * Start a scan on the current channel or all channels. */ Modified: stable/7/sys/dev/iwi/if_iwivar.h ============================================================================== --- stable/7/sys/dev/iwi/if_iwivar.h Tue Oct 26 17:30:34 2010 (r214382) +++ stable/7/sys/dev/iwi/if_iwivar.h Tue Oct 26 17:31:46 2010 (r214383) @@ -193,6 +193,7 @@ struct iwi_softc { struct task sc_scanaborttask; /* cancel active scan */ struct task sc_restarttask; /* restart adapter processing */ struct task sc_opstask; /* scan / auth processing */ + struct task sc_monitortask; unsigned int sc_softled : 1, /* enable LED gpio status */ sc_ledstate: 1, /* LED on/off state */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 17:38: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 376C71065673; Tue, 26 Oct 2010 17:38:46 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25C218FC1A; Tue, 26 Oct 2010 17:38: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 o9QHckd7058042; Tue, 26 Oct 2010 17:38:46 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QHckhX058040; Tue, 26 Oct 2010 17:38:46 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201010261738.o9QHckhX058040@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 26 Oct 2010 17:38: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: r214384 - stable/8/sys/dev/if_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: Tue, 26 Oct 2010 17:38:46 -0000 Author: bschmidt Date: Tue Oct 26 17:38:45 2010 New Revision: 214384 URL: http://svn.freebsd.org/changeset/base/214384 Log: MFC r214070: There is no reason to call rt_ifmsg(), remove it. Submitted by: Paul B Mahol Modified: stable/8/sys/dev/if_ndis/if_ndis.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) Modified: stable/8/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis.c Tue Oct 26 17:31:46 2010 (r214383) +++ stable/8/sys/dev/if_ndis/if_ndis.c Tue Oct 26 17:38:45 2010 (r214384) @@ -1671,10 +1671,6 @@ ndis_linksts_done(adapter) break; } - /* Notify possible listners of interface change. */ - - rt_ifmsg(ifp); - return; } From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 17:58: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 2212D106564A; Tue, 26 Oct 2010 17:58:07 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9011B8FC0A; Tue, 26 Oct 2010 17:58:06 +0000 (UTC) Received: by qyk33 with SMTP id 33so2797165qyk.13 for ; Tue, 26 Oct 2010 10:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=YcnGvv6YRJgAl+dODvviAsrPSLFXLJaW8Lpry+awcDA=; b=re51LzvTuUMFt4vRMd0inieDIc5fFuf6cMyxDh51KwA4ZmLwAR8x6UQJ7x2PgMXOzF 2YWaT7rmLks5vLK2KoO/r78YozrqthoqP9WsG4tNj7n3S3p25EHYOkbJe3mFiY5w/MEM n+hExtfvErnlMGmhsOlUIGur8BCyyHUcwpbFs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=L6FGQ9EZNWyD+jfJIdI5AcP83qq6HtIgctCcgmpEOtn+X310eL/Xn5P9Bcuw8hNFct fmfIccxAYICkW5XPWBtBh2d30ubI8awxlBb200t423XZdkGCctPW22f+uDFKw5Eh7wI8 maIqtlRc2MDQOHNg/NWSaIh25SsBv0u/+BiHE= MIME-Version: 1.0 Received: by 10.224.120.141 with SMTP id d13mr1665622qar.375.1288115885776; Tue, 26 Oct 2010 10:58:05 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.237.9 with HTTP; Tue, 26 Oct 2010 10:58:05 -0700 (PDT) In-Reply-To: <4CC70BF9.30004@FreeBSD.org> References: <201010261616.o9QGGFgX053089@svn.freebsd.org> <4CC70BF9.30004@FreeBSD.org> Date: Tue, 26 Oct 2010 19:58:05 +0200 X-Google-Sender-Auth: -HAdEaOHB50iOr2VJ2xQeGzXopc Message-ID: From: Attilio Rao To: Dimitry Andric Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214380 - 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: Tue, 26 Oct 2010 17:58:07 -0000 2010/10/26 Dimitry Andric : > On 2010-10-26 18:16, Attilio Rao wrote: >> >> =C2=A0 Remove usage of PRI* macro for style compliancy. > > ... >> >> - =C2=A0 =C2=A0 =C2=A0 printf(" =C2=A0chunk %d: %"PRIu64"MB (%"PRIu64" p= ages)", seqnr, >> PG2MB(pgs), >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pgs); >> + =C2=A0 =C2=A0 =C2=A0 printf(" =C2=A0chunk %d: %jdMB (%jd pages)", seqn= r, >> (uintmax_t)PG2MB(pgs), >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (uintmax_t)pgs); > > If you cast to uintmax_t, you should use %ju instead. :) =C2=A0Otherwise, > cast to intmax_t, e.g. if the PG2MB macro results in a signed value. This bug was already existing with the old version, but yes, you and Bruce are obviously right. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 18:01: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 63B241065673; Tue, 26 Oct 2010 18:01:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52E288FC16; Tue, 26 Oct 2010 18:01: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 o9QI1S11059296; Tue, 26 Oct 2010 18:01:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QI1SXZ059294; Tue, 26 Oct 2010 18:01:28 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010261801.o9QI1SXZ059294@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 18:01: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: r214386 - 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: Tue, 26 Oct 2010 18:01:28 -0000 Author: attilio Date: Tue Oct 26 18:01:28 2010 New Revision: 214386 URL: http://svn.freebsd.org/changeset/base/214386 Log: Style fix. Reported by: bde, dim Modified: head/sys/x86/x86/dump_machdep.c Modified: head/sys/x86/x86/dump_machdep.c ============================================================================== --- head/sys/x86/x86/dump_machdep.c Tue Oct 26 17:49:17 2010 (r214385) +++ head/sys/x86/x86/dump_machdep.c Tue Oct 26 18:01:28 2010 (r214386) @@ -176,7 +176,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr if (maxdumppgs == 0) /* seatbelt */ maxdumppgs = 1; - printf(" chunk %d: %jdMB (%jd pages)", seqnr, (uintmax_t)PG2MB(pgs), + printf(" chunk %d: %juMB (%ju pages)", seqnr, (uintmax_t)PG2MB(pgs), (uintmax_t)pgs); while (pgs) { @@ -186,7 +186,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr sz = chunk << PAGE_SHIFT; counter += sz; if (counter >> 24) { - printf(" %jd", (uintmax_t)PG2MB(pgs)); + printf(" %ju", (uintmax_t)PG2MB(pgs)); counter &= (1<<24) - 1; } for (i = 0; i < chunk; i++) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 18:32: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 C4006106566B; Tue, 26 Oct 2010 18:32:51 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 986118FC17; Tue, 26 Oct 2010 18:32: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 o9QIWpNp060925; Tue, 26 Oct 2010 18:32:51 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QIWpqX060923; Tue, 26 Oct 2010 18:32:51 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201010261832.o9QIWpqX060923@svn.freebsd.org> From: Benedict Reuschling Date: Tue, 26 Oct 2010 18:32: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: r214387 - 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: Tue, 26 Oct 2010 18:32:51 -0000 Author: bcr (doc committer) Date: Tue Oct 26 18:32:51 2010 New Revision: 214387 URL: http://svn.freebsd.org/changeset/base/214387 Log: Add some missing documentation to the man page: - FILES section ref: ~/nsmb.conf - use of password in examples section - use of simple encryption for password in examples section PR: docs/132311 Submitted by: David Horn (dhorn2000 at gmail dot com) Patch corrected by: trhodes Approved by: trhodes MFC after: 5 days Modified: head/share/man/man5/nsmb.conf.5 Modified: head/share/man/man5/nsmb.conf.5 ============================================================================== --- head/share/man/man5/nsmb.conf.5 Tue Oct 26 18:01:28 2010 (r214386) +++ head/share/man/man5/nsmb.conf.5 Tue Oct 26 18:32:51 2010 (r214387) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2003 +.Dd October 19, 2010 .Dt NSMB.CONF 5 .Os .Sh NAME @@ -87,7 +87,7 @@ Possible keywords may include: .It Va nbns Ta "+ + - -" Ta "address of NetBIOS name server (WINS)" .It Va nbscope Ta "+ + - -" Ta "NetBIOS scope" .It Va nbtimeout Ta "+ + - -" Ta "timeout for NetBIOS name servers" -.It Va password Ta "- - + +" Ta "plain text password used to access the given share" +.It Va password Ta "- - + +" Ta "plain text or simple encrypted password used to access the given share" .It Va retry_count Ta "+ + - -" Ta "number of retries before connection is marked as broken" .It Va timeout Ta "+ + - -" Ta "SMB request timeout" .It Va workgroup Ta "+ + + +" Ta "workgroup name" @@ -96,6 +96,9 @@ Possible keywords may include: .Bl -tag -width ".Pa /etc/nsmb.conf" .It Pa /etc/nsmb.conf The default remote mount-point configuration file. +.Pa "~/nsmb.conf" +.It Pa ~/nsmb.conf +The user specific remote mount-point configuration file. .El .Sh EXAMPLES What follows is a sample configuration file which may, @@ -108,6 +111,9 @@ workgroup=SALES [FSERVER] charsets=koi8-r:cp866 addr=fserv.example.com +# User specific data for FSERVER +[FSERVER:MYUSER] +password=$$16144562c293a0314e6e1 .Ed .Pp All lines which begin with the @@ -124,6 +130,18 @@ required when Cyrillic characters are no The hostname value, .Dq Li fserv.example.com , is also assigned in this section. +.Dq Li FSERVER:USER , +defines the user settings and is useful for saving the password used +during a specific connection. +The password may be plaintext or obfuscated using simple encryption. +The simple encrypted password starts with the `$$1' symbols. +Warning: the encryption function is very weak and intended only to hide +clear text passwords. +If the use of simple encryption is desired, the following command may be +used on a password: +.Bd -literal -offset indent +smbutil crypt +.Ed .Sh COMPATIBILITY At the time of this writing, the .Tn IPX From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 18:56: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 38113106564A; Tue, 26 Oct 2010 18:56:56 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 264F58FC0A; Tue, 26 Oct 2010 18:56: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 o9QIuu9s062273; Tue, 26 Oct 2010 18:56:56 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QIuul3062271; Tue, 26 Oct 2010 18:56:56 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201010261856.o9QIuul3062271@svn.freebsd.org> From: Randall Stewart Date: Tue, 26 Oct 2010 18:56:56 +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: r214388 - 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: Tue, 26 Oct 2010 18:56:56 -0000 Author: rrs Date: Tue Oct 26 18:56:55 2010 New Revision: 214388 URL: http://svn.freebsd.org/changeset/base/214388 Log: MFC of 209644 Log is: Fix a bug that will cause a panic. Basically a read-lock is being called to check the vtag-timewait cache. Then in two cases (where a vtag is bad i.e. in the time-wait state) the write-unlokc is called NOT the read-unlock. Under conditions where lots of associations are coming and going this willc ause the system to panic with invariants on. Modified: stable/8/sys/netinet/sctp_pcb.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) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Tue Oct 26 18:32:51 2010 (r214387) +++ stable/8/sys/netinet/sctp_pcb.c Tue Oct 26 18:56:55 2010 (r214388) @@ -6499,7 +6499,7 @@ sctp_is_vtag_good(struct sctp_inpcb *inp continue; } /* Its a used tag set */ - SCTP_INP_INFO_WUNLOCK(); + SCTP_INP_INFO_RUNLOCK(); return (0); } } @@ -6528,7 +6528,7 @@ skip_vtag_check: (twait_block->vtag_block[i].lport == lport) && (twait_block->vtag_block[i].rport == rport)) { /* Bad tag, sorry :< */ - SCTP_INP_INFO_WUNLOCK(); + SCTP_INP_INFO_RUNLOCK(); return (0); } } From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 18:59: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 D3E9E1065693; Tue, 26 Oct 2010 18:59:36 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A81398FC0A; Tue, 26 Oct 2010 18:59: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 o9QIxaRo062504; Tue, 26 Oct 2010 18:59:36 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QIxaJZ062502; Tue, 26 Oct 2010 18:59:36 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201010261859.o9QIxaJZ062502@svn.freebsd.org> From: Randall Stewart Date: Tue, 26 Oct 2010 18:59: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: r214389 - 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: Tue, 26 Oct 2010 18:59:36 -0000 Author: rrs Date: Tue Oct 26 18:59:36 2010 New Revision: 214389 URL: http://svn.freebsd.org/changeset/base/214389 Log: MFC of 209663 This fixes a crash in SCTP. It was possible to have a large number of packets queued to a crashing process. In a specific case you may get 2 ABORT's back (from say two packets in flight). If the aborts happened to be processed at the same time its possible to have one free the association while the other is trying to report all the outbound packets. When this occured it could lead to a crash. Modified: 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) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Tue Oct 26 18:56:55 2010 (r214388) +++ stable/8/sys/netinet/sctputil.c Tue Oct 26 18:59:36 2010 (r214389) @@ -3691,6 +3691,10 @@ sctp_report_all_outbound(struct sctp_tcb if (stcb == NULL) { return; } + if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + /* already being freed */ + return; + } if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { @@ -3750,11 +3754,13 @@ sctp_report_all_outbound(struct sctp_tcb stcb->asoc.stream_queue_cnt--; TAILQ_REMOVE(&outs->outqueue, sp, next); sctp_free_spbufspace(stcb, asoc, sp); - sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, (void *)sp, so_locked); if (sp->data) { - sctp_m_freem(sp->data); - sp->data = NULL; + sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_UNSENT, (void *)sp, so_locked); + if (sp->data) { + sctp_m_freem(sp->data); + sp->data = NULL; + } } if (sp->net) sctp_free_remote_addr(sp->net); From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 18:59: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 D2C2E1065674; Tue, 26 Oct 2010 18:59:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C16BF8FC17; Tue, 26 Oct 2010 18:59: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 o9QIxoZW062549; Tue, 26 Oct 2010 18:59:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QIxoIS062547; Tue, 26 Oct 2010 18:59:50 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010261859.o9QIxoIS062547@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 26 Oct 2010 18:59: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: r214390 - 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, 26 Oct 2010 18:59:51 -0000 Author: jkim Date: Tue Oct 26 18:59:50 2010 New Revision: 214390 URL: http://svn.freebsd.org/changeset/base/214390 Log: Add two new loader tunables 'hw.acpi.install_interface' and 'hw.acpi.remove_interface'. hw.acpi.install_interface lets you install new interfaces. Conversely, hw.acpi.remove_interface lets you remove OS interfaces from the pre-defined list in ACPICA. For example, hw.acpi.install_interface="FreeBSD" lets _OSI("FreeBSD") method to return 0xffffffff (or success) and hw.acpi.remove_interface="Windows 2009" lets _OSI("Windows 2009") method to return zero (or failure). Both are comma-separated lists and leading white spaces are ignored. For example, the following examples are valid: hw.acpi.install_interface="Linux, FreeBSD" hw.acpi.remove_interface="Windows 2006, Windows 2006.1" Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Oct 26 18:59:36 2010 (r214389) +++ head/sys/dev/acpica/acpi.c Tue Oct 26 18:59:50 2010 (r214390) @@ -86,6 +86,11 @@ static struct cdevsw acpi_cdevsw = { .d_name = "acpi", }; +struct acpi_interface { + ACPI_STRING *data; + int num; +}; + /* Global mutex for locking access to the ACPI subsystem. */ struct mtx acpi_mutex; @@ -163,6 +168,7 @@ static void acpi_enable_pcie(void); #endif static void acpi_hint_device_unit(device_t acdev, device_t child, const char *name, int *unitp); +static void acpi_reset_interfaces(device_t dev); static device_method_t acpi_methods[] = { /* Device interface */ @@ -232,6 +238,16 @@ SYSCTL_STRING(_debug_acpi, OID_AUTO, acp acpi_ca_version, 0, "Version of Intel ACPI-CA"); /* + * Allow overriding _OSI methods. + */ +static char acpi_install_interface[256]; +TUNABLE_STR("hw.acpi.install_interface", acpi_install_interface, + sizeof(acpi_install_interface)); +static char acpi_remove_interface[256]; +TUNABLE_STR("hw.acpi.remove_interface", acpi_remove_interface, + sizeof(acpi_remove_interface)); + +/* * Allow override of whether methods execute in parallel or not. * Enable this for serial behavior, which fixes "AE_ALREADY_EXISTS" * errors for AML that really can't handle parallel method execution. @@ -467,6 +483,9 @@ acpi_attach(device_t dev) goto out; } + /* Override OS interfaces if the user requested. */ + acpi_reset_interfaces(dev); + /* Load ACPI name space. */ status = AcpiLoadTables(); if (ACPI_FAILURE(status)) { @@ -3473,6 +3492,93 @@ acpi_debug_objects_sysctl(SYSCTL_HANDLER } static int +acpi_parse_interfaces(char *str, struct acpi_interface *iface) +{ + char *p; + size_t len; + int i, j; + + p = str; + while (isspace(*p) || *p == ',') + p++; + len = strlen(p); + if (len == 0) + return (0); + p = strdup(p, M_TEMP); + for (i = 0; i < len; i++) + if (p[i] == ',') + p[i] = '\0'; + i = j = 0; + while (i < len) + if (isspace(p[i]) || p[i] == '\0') + i++; + else { + i += strlen(p + i) + 1; + j++; + } + if (j == 0) { + free(p, M_TEMP); + return (0); + } + iface->data = malloc(sizeof(*iface->data) * j, M_TEMP, M_WAITOK); + iface->num = j; + i = j = 0; + while (i < len) + if (isspace(p[i]) || p[i] == '\0') + i++; + else { + iface->data[j] = p + i; + i += strlen(p + i) + 1; + j++; + } + + return (j); +} + +static void +acpi_free_interfaces(struct acpi_interface *iface) +{ + + free(iface->data[0], M_TEMP); + free(iface->data, M_TEMP); +} + +static void +acpi_reset_interfaces(device_t dev) +{ + struct acpi_interface list; + ACPI_STATUS status; + int i; + + if (acpi_parse_interfaces(acpi_install_interface, &list) > 0) { + for (i = 0; i < list.num; i++) { + status = AcpiInstallInterface(list.data[i]); + if (ACPI_FAILURE(status)) + device_printf(dev, + "failed to install _OSI(\"%s\"): %s\n", + list.data[i], AcpiFormatException(status)); + else if (bootverbose) + device_printf(dev, "installed _OSI(\"%s\")\n", + list.data[i]); + } + acpi_free_interfaces(&list); + } + if (acpi_parse_interfaces(acpi_remove_interface, &list) > 0) { + for (i = 0; i < list.num; i++) { + status = AcpiRemoveInterface(list.data[i]); + if (ACPI_FAILURE(status)) + device_printf(dev, + "failed to remove _OSI(\"%s\"): %s\n", + list.data[i], AcpiFormatException(status)); + else if (bootverbose) + device_printf(dev, "removed _OSI(\"%s\")\n", + list.data[i]); + } + acpi_free_interfaces(&list); + } +} + +static int acpi_pm_func(u_long cmd, void *arg, ...) { int state, acpi_state; From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 19:01: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 A110A1065673; Tue, 26 Oct 2010 19:01:56 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F8728FC15; Tue, 26 Oct 2010 19:01: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 o9QJ1uYe062752; Tue, 26 Oct 2010 19:01:56 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QJ1uh2062750; Tue, 26 Oct 2010 19:01:56 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201010261901.o9QJ1uh2062750@svn.freebsd.org> From: Randall Stewart Date: Tue, 26 Oct 2010 19:01:56 +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: r214391 - stable/8/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: Tue, 26 Oct 2010 19:01:56 -0000 Author: rrs Date: Tue Oct 26 19:01:56 2010 New Revision: 214391 URL: http://svn.freebsd.org/changeset/base/214391 Log: MFC: 209760 If a user calls sctp_sendx() with a NULL sinfo we will crash. Instead we should provide our own temp structure to use internally. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Tue Oct 26 18:59:50 2010 (r214390) +++ stable/8/lib/libc/net/sctp_sys_calls.c Tue Oct 26 19:01:56 2010 (r214391) @@ -724,6 +724,7 @@ sctp_sendx(int sd, const void *msg, size struct sctp_sndrcvinfo *sinfo, int flags) { + struct sctp_sndrcvinfo __sinfo; ssize_t ret; int i, cnt, *aa, saved_errno; char *buf; @@ -790,6 +791,10 @@ sctp_sendx(int sd, const void *msg, size return (ret); } continue_send: + if (sinfo == NULL) { + sinfo = &__sinfo; + memset(&__sinfo, 0, sizeof(__sinfo)); + } sinfo->sinfo_assoc_id = sctp_getassocid(sd, addrs); if (sinfo->sinfo_assoc_id == 0) { printf("Huh, can't get associd? TSNH!\n"); From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 19:04: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 22CD4106566B; Tue, 26 Oct 2010 19:04:06 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAE328FC0C; Tue, 26 Oct 2010 19:04: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 o9QJ45uL062951; Tue, 26 Oct 2010 19:04:05 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QJ45DI062949; Tue, 26 Oct 2010 19:04:05 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201010261904.o9QJ45DI062949@svn.freebsd.org> From: Randall Stewart Date: Tue, 26 Oct 2010 19:04: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: r214392 - 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: Tue, 26 Oct 2010 19:04:06 -0000 Author: rrs Date: Tue Oct 26 19:04:05 2010 New Revision: 214392 URL: http://svn.freebsd.org/changeset/base/214392 Log: MFC:210493 When counting the number of chunks in the retransmission queue to validate the retran count, we need to include the chunks in the control send queue too. Otherwise the count will not match and you will get the invarient warning if invarients are on. Modified: stable/8/sys/netinet/sctp_timer.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) Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Tue Oct 26 19:01:56 2010 (r214391) +++ stable/8/sys/netinet/sctp_timer.c Tue Oct 26 19:04:05 2010 (r214392) @@ -870,6 +870,26 @@ start_again: } #endif *num_marked = num_mk; + /* + * Now check for a ECN Echo that may be stranded And include the + * cnt_mk'd to have all resends in the control queue. + */ + TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { + if (chk->sent == SCTP_DATAGRAM_RESEND) { + cnt_mk++; + } + if ((chk->whoTo == net) && + (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { + sctp_free_remote_addr(chk->whoTo); + chk->whoTo = alt; + if (chk->sent != SCTP_DATAGRAM_RESEND) { + chk->sent = SCTP_DATAGRAM_RESEND; + sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); + cnt_mk++; + } + atomic_add_int(&alt->ref_count, 1); + } + } if ((stcb->asoc.sent_queue_retran_cnt == 0) && (could_be_sent)) { /* fix it so we retransmit the highest acked anyway */ sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); @@ -885,19 +905,6 @@ start_again: stcb->asoc.sent_queue_retran_cnt = cnt_mk; #endif } - /* Now check for a ECN Echo that may be stranded */ - TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { - if ((chk->whoTo == net) && - (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { - sctp_free_remote_addr(chk->whoTo); - chk->whoTo = alt; - if (chk->sent != SCTP_DATAGRAM_RESEND) { - chk->sent = SCTP_DATAGRAM_RESEND; - sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); - } - atomic_add_int(&alt->ref_count, 1); - } - } if (audit_tf) { SCTPDBG(SCTP_DEBUG_TIMER4, "Audit total flight due to negative value net:%p\n", From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 19:06: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 05EED1065675; Tue, 26 Oct 2010 19:06:32 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE40B8FC08; Tue, 26 Oct 2010 19:06: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 o9QJ6Vs5063132; Tue, 26 Oct 2010 19:06:31 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QJ6V5D063130; Tue, 26 Oct 2010 19:06:31 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201010261906.o9QJ6V5D063130@svn.freebsd.org> From: Randall Stewart Date: Tue, 26 Oct 2010 19:06: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: r214393 - 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: Tue, 26 Oct 2010 19:06:32 -0000 Author: rrs Date: Tue Oct 26 19:06:31 2010 New Revision: 214393 URL: http://svn.freebsd.org/changeset/base/214393 Log: MFC:210494 Make sure that we report chunks if a socket still exists that were not sent. In either case carefully remove the data if it does not get taken by the reporting routines. Modified: stable/8/sys/netinet/sctp_pcb.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) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Tue Oct 26 19:04:05 2010 (r214392) +++ stable/8/sys/netinet/sctp_pcb.c Tue Oct 26 19:06:31 2010 (r214393) @@ -4830,9 +4830,17 @@ sctp_free_assoc(struct sctp_inpcb *inp, while (sp) { TAILQ_REMOVE(&outs->outqueue, sp, next); if (sp->data) { - sctp_m_freem(sp->data); - sp->data = NULL; - sp->tail_mbuf = NULL; + if (so) { + /* Still an open socket - report */ + sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_UNSENT, + (void *)sp, 0); + } + if (sp->data) { + sctp_m_freem(sp->data); + sp->data = NULL; + sp->tail_mbuf = NULL; + } } sctp_free_remote_addr(sp->net); sctp_free_spbufspace(stcb, asoc, sp); @@ -4892,8 +4900,15 @@ sctp_free_assoc(struct sctp_inpcb *inp, while (chk) { TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; + if (so) { + /* Still a socket? */ + sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_UNSENT, chk, 0); + } + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } } if (chk->holds_key_ref) sctp_auth_key_release(stcb, chk->auth_keyid); @@ -4917,8 +4932,15 @@ sctp_free_assoc(struct sctp_inpcb *inp, while (chk) { TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; + if (so) { + /* Still a socket? */ + sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_SENT, chk, 0); + } + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } } if (chk->holds_key_ref) sctp_auth_key_release(stcb, chk->auth_keyid); From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 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 741141065694; Tue, 26 Oct 2010 19:08:26 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61C2D8FC1E; Tue, 26 Oct 2010 19:08: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 o9QJ8Qch063346; Tue, 26 Oct 2010 19:08:26 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QJ8QOL063341; Tue, 26 Oct 2010 19:08:26 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201010261908.o9QJ8QOL063341@svn.freebsd.org> From: Randall Stewart Date: Tue, 26 Oct 2010 19:08:26 +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: r214394 - 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: Tue, 26 Oct 2010 19:08:26 -0000 Author: rrs Date: Tue Oct 26 19:08:26 2010 New Revision: 214394 URL: http://svn.freebsd.org/changeset/base/214394 Log: MFC:210599 PR SCTP Bugs. Basically a full sized frame of PR SCTP FWD-TSN's would not be sent and thus cause a stalled connection. Also the rwnd Calculation was also off on the receiver side for PR-SCTP. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_timer.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) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Tue Oct 26 19:06:31 2010 (r214393) +++ stable/8/sys/netinet/sctp_indata.c Tue Oct 26 19:08:26 2010 (r214394) @@ -91,8 +91,10 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st * take out what has NOT been put on socket queue and we yet hold * for putting up. */ - calc = sctp_sbspace_sub(calc, (uint32_t) asoc->size_on_reasm_queue); - calc = sctp_sbspace_sub(calc, (uint32_t) asoc->size_on_all_streams); + calc = sctp_sbspace_sub(calc, (uint32_t) (asoc->size_on_reasm_queue + + asoc->cnt_on_reasm_queue * MSIZE)); + calc = sctp_sbspace_sub(calc, (uint32_t) (asoc->size_on_all_streams + + asoc->cnt_on_all_streams * MSIZE)); if (calc == 0) { /* out of space */ @@ -3322,6 +3324,10 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->sent >= SCTP_DATAGRAM_RESEND) { /* either a RESEND, ACKED, or MARKED */ /* skip */ + if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { + /* Continue strikin FWD-TSN chunks */ + tp1->rec.data.fwd_tsn_cnt++; + } tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } @@ -3707,7 +3713,6 @@ sctp_try_advance_peer_ack_point(struct s tp1 = TAILQ_FIRST(&asoc->sent_queue); while (tp1) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && - tp1->sent != SCTP_DATAGRAM_ACKED && tp1->sent != SCTP_DATAGRAM_RESEND) { /* no chance to advance, out of here */ break; @@ -3763,8 +3768,7 @@ sctp_try_advance_peer_ack_point(struct s * the chunk, advance our peer ack point and we can check * the next chunk. */ - if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || - (tp1->sent == SCTP_DATAGRAM_ACKED)) { + if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { /* advance PeerAckPoint goes forward */ if (compare_with_wrap(tp1->rec.data.TSN_seq, asoc->advanced_peer_ack_point, @@ -3905,7 +3909,7 @@ sctp_express_handle_sack(struct sctp_tcb } else if (asoc->last_acked_seq == cumack) { /* Window update sack */ asoc->peers_rwnd = sctp_sbspace_sub(rwnd, - (uint32_t) (asoc->total_flight + (asoc->sent_queue_cnt * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))); + (uint32_t) (asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))); if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { /* SWS sender side engages */ asoc->peers_rwnd = 0; @@ -4189,7 +4193,7 @@ sctp_express_handle_sack(struct sctp_tcb } /* RWND update */ asoc->peers_rwnd = sctp_sbspace_sub(rwnd, - (uint32_t) (asoc->total_flight + (asoc->sent_queue_cnt * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))); + (uint32_t) (asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))); if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { /* SWS sender side engages */ asoc->peers_rwnd = 0; @@ -4404,10 +4408,8 @@ again: asoc->nonce_resync_tsn = asoc->advanced_peer_ack_point; } else if (lchk) { /* try to FR fwd-tsn's that get lost too */ - lchk->rec.data.fwd_tsn_cnt++; - if (lchk->rec.data.fwd_tsn_cnt > 3) { + if (lchk->rec.data.fwd_tsn_cnt >= 3) { send_forward_tsn(stcb, asoc); - lchk->rec.data.fwd_tsn_cnt = 0; } } } @@ -5188,10 +5190,10 @@ done_with_it: /* Adjust and set the new rwnd value */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) { sctp_log_rwnd_set(SCTP_SET_PEER_RWND_VIA_SACK, - asoc->peers_rwnd, asoc->total_flight, (asoc->sent_queue_cnt * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)), a_rwnd); + asoc->peers_rwnd, asoc->total_flight, (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)), a_rwnd); } asoc->peers_rwnd = sctp_sbspace_sub(a_rwnd, - (uint32_t) (asoc->total_flight + (asoc->sent_queue_cnt * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))); + (uint32_t) (asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))); if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { /* SWS sender side engages */ asoc->peers_rwnd = 0; @@ -5314,6 +5316,7 @@ again: } if (compare_with_wrap(asoc->advanced_peer_ack_point, old_adv_peer_ack_point, MAX_TSN)) { + send_forward_tsn(stcb, asoc); /* * ECN Nonce: Disable Nonce Sum check when @@ -5323,10 +5326,8 @@ again: asoc->nonce_resync_tsn = asoc->advanced_peer_ack_point; } else if (lchk) { /* try to FR fwd-tsn's that get lost too */ - lchk->rec.data.fwd_tsn_cnt++; - if (lchk->rec.data.fwd_tsn_cnt > 3) { + if (lchk->rec.data.fwd_tsn_cnt >= 3) { send_forward_tsn(stcb, asoc); - lchk->rec.data.fwd_tsn_cnt = 0; } } } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Tue Oct 26 19:06:31 2010 (r214393) +++ stable/8/sys/netinet/sctp_output.c Tue Oct 26 19:08:26 2010 (r214394) @@ -6580,6 +6580,8 @@ sctp_clean_up_ctl(struct sctp_tcb *stcb, chk->data = NULL; } asoc->ctrl_queue_cnt--; + if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) + asoc->fwd_tsn_cnt--; sctp_free_a_chunk(stcb, chk); } else if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { /* special handling, we must look into the param */ @@ -7800,7 +7802,7 @@ again_one_more_time: } else omtu = 0; /* Here we do NOT factor the r_mtu */ - if ((chk->send_size < (int)(mtu - omtu)) || + if ((chk->send_size <= (int)(mtu - omtu)) || (chk->flags & CHUNK_FLAGS_FRAGMENT_OK)) { /* * We probably should glom the mbuf chain @@ -9705,6 +9707,7 @@ send_forward_tsn(struct sctp_tcb *stcb, if (chk == NULL) { return; } + asoc->fwd_tsn_cnt++; chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_FORWARD_CUM_TSN; chk->rec.chunk_id.can_take_data = 0; @@ -9736,8 +9739,8 @@ sctp_fill_in_rest: unsigned int cnt_of_skipped = 0; TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { - if ((at->sent != SCTP_FORWARD_TSN_SKIP) && - (at->sent != SCTP_DATAGRAM_ACKED)) { + if ((at->sent != SCTP_FORWARD_TSN_SKIP) /* && (at->sent != + SCTP_DATAGRAM_ACKED) */ ) { /* no more to look at */ break; } Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Tue Oct 26 19:06:31 2010 (r214393) +++ stable/8/sys/netinet/sctp_structs.h Tue Oct 26 19:08:26 2010 (r214394) @@ -869,6 +869,7 @@ struct sctp_association { unsigned int size_on_reasm_queue; unsigned int cnt_on_reasm_queue; + unsigned int fwd_tsn_cnt; /* amount of data (bytes) currently in flight (on all destinations) */ unsigned int total_flight; /* Total book size in flight */ Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Tue Oct 26 19:06:31 2010 (r214393) +++ stable/8/sys/netinet/sctp_timer.c Tue Oct 26 19:08:26 2010 (r214394) @@ -545,7 +545,7 @@ static void sctp_backoff_on_timeout(struct sctp_tcb *stcb, struct sctp_nets *net, int win_probe, - int num_marked) + int num_marked, int num_abandoned) { if (net->RTO == 0) { net->RTO = stcb->asoc.minrto; @@ -554,7 +554,7 @@ sctp_backoff_on_timeout(struct sctp_tcb if (net->RTO > stcb->asoc.maxrto) { net->RTO = stcb->asoc.maxrto; } - if ((win_probe == 0) && num_marked) { + if ((win_probe == 0) && (num_marked || num_abandoned)) { /* We don't apply penalty to window probe scenarios */ /* JRS - Use the congestion control given in the CC module */ stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout(stcb, net); @@ -612,7 +612,8 @@ sctp_mark_all_for_resend(struct sctp_tcb struct sctp_nets *net, struct sctp_nets *alt, int window_probe, - int *num_marked) + int *num_marked, + int *num_abandoned) { /* @@ -621,10 +622,11 @@ sctp_mark_all_for_resend(struct sctp_tcb * We only mark chunks that have been outstanding long enough to * have received feed-back. */ - struct sctp_tmit_chunk *chk, *tp2, *could_be_sent = NULL; + struct sctp_tmit_chunk *chk, *tp2; struct sctp_nets *lnets; struct timeval now, min_wait, tv; int cur_rtt; + int cnt_abandoned; int audit_tf, num_mk, fir; unsigned int cnt_mk; uint32_t orig_flight, orig_tf; @@ -680,6 +682,7 @@ sctp_mark_all_for_resend(struct sctp_tcb net->fast_retran_ip = 0; /* Now on to each chunk */ + cnt_abandoned = 0; num_mk = cnt_mk = 0; tsnfirst = tsnlast = 0; #ifndef INVARIANTS @@ -768,6 +771,7 @@ start_again: chk, (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), SCTP_SO_NOT_LOCKED); + cnt_abandoned++; } continue; } @@ -780,6 +784,7 @@ start_again: chk, (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), SCTP_SO_NOT_LOCKED); + cnt_abandoned++; } continue; } @@ -841,9 +846,11 @@ start_again: if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 1) { chk->no_fr_allowed = 1; } +#ifdef THIS_SHOULD_NOT_BE_DONE } else if (chk->sent == SCTP_DATAGRAM_ACKED) { /* remember highest acked one */ could_be_sent = chk; +#endif } if (chk->sent == SCTP_DATAGRAM_RESEND) { cnt_mk++; @@ -870,6 +877,7 @@ start_again: } #endif *num_marked = num_mk; + *num_abandoned = cnt_abandoned; /* * Now check for a ECN Echo that may be stranded And include the * cnt_mk'd to have all resends in the control queue. @@ -890,12 +898,14 @@ start_again: atomic_add_int(&alt->ref_count, 1); } } +#ifdef THIS_SHOULD_NOT_BE_DONE if ((stcb->asoc.sent_queue_retran_cnt == 0) && (could_be_sent)) { /* fix it so we retransmit the highest acked anyway */ sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); cnt_mk++; could_be_sent->sent = SCTP_DATAGRAM_RESEND; } +#endif if (stcb->asoc.sent_queue_retran_cnt != cnt_mk) { #ifdef INVARIANTS SCTP_PRINTF("Local Audit says there are %d for retran asoc cnt:%d we marked:%d this time\n", @@ -996,7 +1006,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, struct sctp_nets *net) { struct sctp_nets *alt; - int win_probe, num_mk; + int win_probe, num_mk, num_abandoned; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(0, 0, 0, SCTP_FR_T3_TIMEOUT); @@ -1055,8 +1065,10 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, } else { /* CMT is OFF */ alt = sctp_find_alternate_net(stcb, net, 0); } - - (void)sctp_mark_all_for_resend(stcb, net, alt, win_probe, &num_mk); + num_mk = 0; + num_abandoned = 0; + (void)sctp_mark_all_for_resend(stcb, net, alt, win_probe, + &num_mk, &num_abandoned); /* FR Loss recovery just ended with the T3. */ stcb->asoc.fast_retran_loss_recovery = 0; @@ -1070,7 +1082,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, stcb->asoc.sat_t3_recovery_tsn = stcb->asoc.sending_seq; /* Backoff the timer and cwnd */ - sctp_backoff_on_timeout(stcb, net, win_probe, num_mk); + sctp_backoff_on_timeout(stcb, net, win_probe, num_mk, num_abandoned); if (win_probe == 0) { /* We don't do normal threshold management on window probes */ if (sctp_threshold_management(inp, stcb, net, @@ -1221,7 +1233,7 @@ sctp_t1init_timer(struct sctp_inpcb *inp return (1); } stcb->asoc.dropped_special_cnt = 0; - sctp_backoff_on_timeout(stcb, stcb->asoc.primary_destination, 1, 0); + sctp_backoff_on_timeout(stcb, stcb->asoc.primary_destination, 1, 0, 0); if (stcb->asoc.initial_init_rto_max < net->RTO) { net->RTO = stcb->asoc.initial_init_rto_max; } @@ -1302,7 +1314,7 @@ sctp_cookie_timer(struct sctp_inpcb *inp * an alternate */ stcb->asoc.dropped_special_cnt = 0; - sctp_backoff_on_timeout(stcb, cookie->whoTo, 1, 0); + sctp_backoff_on_timeout(stcb, cookie->whoTo, 1, 0, 0); alt = sctp_find_alternate_net(stcb, cookie->whoTo, 0); if (alt != cookie->whoTo) { sctp_free_remote_addr(cookie->whoTo); @@ -1347,7 +1359,7 @@ sctp_strreset_timer(struct sctp_inpcb *i * cleared theshold management now lets backoff the address & select * an alternate */ - sctp_backoff_on_timeout(stcb, strrst->whoTo, 1, 0); + sctp_backoff_on_timeout(stcb, strrst->whoTo, 1, 0, 0); alt = sctp_find_alternate_net(stcb, strrst->whoTo, 0); sctp_free_remote_addr(strrst->whoTo); strrst->whoTo = alt; @@ -1426,7 +1438,7 @@ sctp_asconf_timer(struct sctp_inpcb *inp * cleared threshold management, so now backoff the net and * select an alternate */ - sctp_backoff_on_timeout(stcb, asconf->whoTo, 1, 0); + sctp_backoff_on_timeout(stcb, asconf->whoTo, 1, 0, 0); alt = sctp_find_alternate_net(stcb, asconf->whoTo, 0); if (asconf->whoTo != alt) { sctp_free_remote_addr(asconf->whoTo); @@ -1643,7 +1655,7 @@ sctp_heartbeat_timer(struct sctp_inpcb * net->ro._s_addr = NULL; net->src_addr_selected = 0; } - sctp_backoff_on_timeout(stcb, net, 1, 0); + sctp_backoff_on_timeout(stcb, net, 1, 0, 0); } /* Zero PBA, if it needs it */ if (net->partial_bytes_acked) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 19:11: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 158A2106566B; Tue, 26 Oct 2010 19:11:00 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04A7E8FC08; Tue, 26 Oct 2010 19:11: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 o9QJAx2o063538; Tue, 26 Oct 2010 19:10:59 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QJAxnd063536; Tue, 26 Oct 2010 19:10:59 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201010261910.o9QJAxnd063536@svn.freebsd.org> From: Bruce Cran Date: Tue, 26 Oct 2010 19:10: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: r214395 - head/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: Tue, 26 Oct 2010 19:11:00 -0000 Author: brucec Date: Tue Oct 26 19:10:59 2010 New Revision: 214395 URL: http://svn.freebsd.org/changeset/base/214395 Log: Fix formatting. Reported by: yongari Modified: head/share/man/man4/ada.4 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Tue Oct 26 19:08:26 2010 (r214394) +++ head/share/man/man4/ada.4 Tue Oct 26 19:10:59 2010 (r214395) @@ -121,7 +121,8 @@ seconds. .It kern.cam.ada.spindown_shutdown .Pp This variable determines whether to spin-down disks when shutting down. -Set to 1 to enable spin-down, 0 to disable. The default is currently enabled. +Set to 1 to enable spin-down, 0 to disable. +The default is currently enabled. .El .Sh FILES .Bl -tag -width ".Pa /dev/ada*" -compact From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 19:11: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 EF00810656DC; Tue, 26 Oct 2010 19:11:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC8EC8FC08; Tue, 26 Oct 2010 19:11: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 o9QJB9MC063609; Tue, 26 Oct 2010 19:11:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QJB9f0063601; Tue, 26 Oct 2010 19:11:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010261911.o9QJB9f0063601@svn.freebsd.org> From: John Baldwin Date: Tue, 26 Oct 2010 19:11: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: r214396 - head/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 19:11:10 -0000 Author: jhb Date: Tue Oct 26 19:11:09 2010 New Revision: 214396 URL: http://svn.freebsd.org/changeset/base/214396 Log: - Save errno values before calling warn(3) so that errors are correctly reported. - Use powerof2() from rather than a copy and paste version. Submitted by: gcooper MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_config.c head/usr.sbin/mfiutil/mfi_drive.c head/usr.sbin/mfiutil/mfi_evt.c head/usr.sbin/mfiutil/mfi_flash.c head/usr.sbin/mfiutil/mfi_patrol.c head/usr.sbin/mfiutil/mfi_show.c head/usr.sbin/mfiutil/mfi_volume.c Modified: head/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_config.c Tue Oct 26 19:10:59 2010 (r214395) +++ head/usr.sbin/mfiutil/mfi_config.c Tue Oct 26 19:11:09 2010 (r214396) @@ -29,12 +29,12 @@ * $FreeBSD$ */ -#include +#include #ifdef DEBUG #include #endif -#include #include +#include #include #ifdef DEBUG #include @@ -52,8 +52,6 @@ static void dump_config(int fd, struct m static int add_spare(int ac, char **av); static int remove_spare(int ac, char **av); -#define powerof2(x) ((((x)-1)&(x))==0) - static long dehumanize(const char *value) { @@ -151,13 +149,14 @@ static int clear_config(int ac, char **av) { struct mfi_ld_list list; - int ch, fd; + int ch, error, fd; u_int i; fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } if (!mfi_reconfig_supported()) { @@ -167,8 +166,9 @@ clear_config(int ac, char **av) } if (mfi_ld_get_list(fd, &list, NULL) < 0) { + error = errno; warn("Failed to get volume list"); - return (errno); + return (error); } for (i = 0; i < list.ld_count; i++) { @@ -189,8 +189,9 @@ clear_config(int ac, char **av) } if (mfi_dcmd_command(fd, MFI_DCMD_CFG_CLEAR, NULL, 0, NULL, 0, NULL) < 0) { + error = errno; warn("Failed to clear configuration"); - return (errno); + return (error); } printf("mfi%d: Configuration cleared\n", mfi_unit); @@ -335,8 +336,9 @@ parse_array(int fd, int raid_type, char return (error); if (mfi_pd_get_info(fd, device_id, pinfo, NULL) < 0) { + error = errno; warn("Failed to fetch drive info for drive %s", cp); - return (errno); + return (error); } if (pinfo->fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) { @@ -548,8 +550,9 @@ create_volume(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } if (!mfi_reconfig_supported()) { @@ -660,8 +663,9 @@ create_volume(int ac, char **av) * array and volume identifiers. */ if (mfi_config_read(fd, &config) < 0) { + error = errno; warn("Failed to read configuration"); - return (errno); + return (error); } p = (char *)config->array; state.array_ref = 0xffff; @@ -745,14 +749,14 @@ create_volume(int ac, char **av) #ifdef DEBUG if (dump) dump_config(fd, config); - else #endif /* Send the new config to the controller. */ if (mfi_dcmd_command(fd, MFI_DCMD_CFG_ADD, config, config_size, NULL, 0, NULL) < 0) { + error = errno; warn("Failed to add volume"); - return (errno); + return (error); } /* Clean up. */ @@ -774,7 +778,7 @@ static int delete_volume(int ac, char **av) { struct mfi_ld_info info; - int fd; + int error, fd; uint8_t target_id, mbox[4]; /* @@ -799,8 +803,9 @@ delete_volume(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } if (!mfi_reconfig_supported()) { @@ -810,13 +815,15 @@ delete_volume(int ac, char **av) } if (mfi_lookup_volume(fd, av[1], &target_id) < 0) { + error = errno; warn("Invalid volume %s", av[1]); - return (errno); + return (error); } if (mfi_ld_get_info(fd, target_id, &info, NULL) < 0) { + error = errno; warn("Failed to get info for volume %d", target_id); - return (errno); + return (error); } if (mfi_volume_busy(fd, target_id)) { @@ -828,8 +835,9 @@ delete_volume(int ac, char **av) mbox_store_ldref(mbox, &info.ld_config.properties.ld); if (mfi_dcmd_command(fd, MFI_DCMD_LD_DELETE, NULL, 0, mbox, sizeof(mbox), NULL) < 0) { + error = errno; warn("Failed to delete volume"); - return (errno); + return (error); } close(fd); @@ -858,8 +866,9 @@ add_spare(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } error = mfi_lookup_drive(fd, av[1], &device_id); @@ -867,8 +876,9 @@ add_spare(int ac, char **av) return (error); if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { + error = errno; warn("Failed to fetch drive info"); - return (errno); + return (error); } if (info.fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) { @@ -878,14 +888,16 @@ add_spare(int ac, char **av) if (ac > 2) { if (mfi_lookup_volume(fd, av[2], &target_id) < 0) { + error = errno; warn("Invalid volume %s", av[2]); - return (errno); + return (error); } } if (mfi_config_read(fd, &config) < 0) { + error = errno; warn("Failed to read configuration"); - return (errno); + return (error); } spare = malloc(sizeof(struct mfi_spare) + sizeof(uint16_t) * @@ -939,8 +951,9 @@ add_spare(int ac, char **av) if (mfi_dcmd_command(fd, MFI_DCMD_CFG_MAKE_SPARE, spare, sizeof(struct mfi_spare) + sizeof(uint16_t) * spare->array_count, NULL, 0, NULL) < 0) { + error = errno; warn("Failed to assign spare"); - return (errno); + return (error); } close(fd); @@ -964,8 +977,9 @@ remove_spare(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } error = mfi_lookup_drive(fd, av[1], &device_id); @@ -974,8 +988,9 @@ remove_spare(int ac, char **av) /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { + error = errno; warn("Failed to fetch info for drive %u", device_id); - return (errno); + return (error); } if (info.fw_state != MFI_PD_STATE_HOT_SPARE) { @@ -986,8 +1001,9 @@ remove_spare(int ac, char **av) mbox_store_pdref(mbox, &info.ref); if (mfi_dcmd_command(fd, MFI_DCMD_CFG_REMOVE_SPARE, NULL, 0, mbox, sizeof(mbox), NULL) < 0) { + error = errno; warn("Failed to delete spare"); - return (errno); + return (error); } close(fd); @@ -1093,7 +1109,7 @@ static int debug_config(int ac, char **av) { struct mfi_config_data *config; - int fd; + int error, fd; if (ac != 1) { warnx("debug: extra arguments"); @@ -1102,14 +1118,16 @@ debug_config(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } /* Get the config from the controller. */ if (mfi_config_read(fd, &config) < 0) { + error = errno; warn("Failed to get config"); - return (errno); + return (error); } /* Dump out the configuration. */ @@ -1127,7 +1145,7 @@ dump(int ac, char **av) struct mfi_config_data *config; char buf[64]; size_t len; - int fd; + int error, fd; if (ac != 1) { warnx("dump: extra arguments"); @@ -1136,23 +1154,26 @@ dump(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } /* Get the stashed copy of the last dcmd from the driver. */ snprintf(buf, sizeof(buf), "dev.mfi.%d.debug_command", mfi_unit); if (sysctlbyname(buf, NULL, &len, NULL, 0) < 0) { + error = errno; warn("Failed to read debug command"); - if (errno == ENOENT) - errno = EOPNOTSUPP; - return (errno); + if (error == ENOENT) + error = EOPNOTSUPP; + return (error); } config = malloc(len); if (sysctlbyname(buf, config, &len, NULL, 0) < 0) { + error = errno; warn("Failed to read debug command"); - return (errno); + return (error); } dump_config(fd, config); free(config); Modified: head/usr.sbin/mfiutil/mfi_drive.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_drive.c Tue Oct 26 19:10:59 2010 (r214395) +++ head/usr.sbin/mfiutil/mfi_drive.c Tue Oct 26 19:11:09 2010 (r214396) @@ -79,10 +79,11 @@ int mfi_lookup_drive(int fd, char *drive, uint16_t *device_id) { struct mfi_pd_list *list; - uint8_t encl, slot; long val; + int error; u_int i; char *cp; + uint8_t encl, slot; /* Look for a raw device id first. */ val = strtol(drive, &cp, 0); @@ -118,8 +119,9 @@ mfi_lookup_drive(int fd, char *drive, ui slot = val; if (mfi_pd_get_list(fd, &list, NULL) < 0) { + error = errno; warn("Failed to fetch drive list"); - return (errno); + return (error); } for (i = 0; i < list->count; i++) { @@ -302,8 +304,9 @@ drive_set_state(char *drive, uint16_t ne fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } error = mfi_lookup_drive(fd, drive, &device_id); @@ -312,8 +315,9 @@ drive_set_state(char *drive, uint16_t ne /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { + error = errno; warn("Failed to fetch info for drive %u", device_id); - return (errno); + return (error); } /* Try to change the state. */ @@ -327,9 +331,10 @@ drive_set_state(char *drive, uint16_t ne mbox[5] = new_state >> 8; if (mfi_dcmd_command(fd, MFI_DCMD_PD_STATE_SET, NULL, 0, mbox, 6, NULL) < 0) { + error = errno; warn("Failed to set drive %u to %s", device_id, mfi_pdstate(new_state)); - return (errno); + return (error); } close(fd); @@ -395,8 +400,9 @@ start_rebuild(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } error = mfi_lookup_drive(fd, av[1], &device_id); @@ -405,13 +411,14 @@ start_rebuild(int ac, char **av) /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { + error = errno; warn("Failed to fetch info for drive %u", device_id); - return (errno); + return (error); } /* Check the state, must be REBUILD. */ if (info.fw_state != MFI_PD_STATE_REBUILD) { - warn("Drive %d is not in the REBUILD state", device_id); + warnx("Drive %d is not in the REBUILD state", device_id); return (EINVAL); } @@ -419,8 +426,9 @@ start_rebuild(int ac, char **av) mbox_store_pdref(&mbox[0], &info.ref); if (mfi_dcmd_command(fd, MFI_DCMD_PD_REBUILD_START, NULL, 0, mbox, 4, NULL) < 0) { + error = errno; warn("Failed to start rebuild on drive %u", device_id); - return (errno); + return (error); } close(fd); @@ -444,8 +452,9 @@ abort_rebuild(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } error = mfi_lookup_drive(fd, av[1], &device_id); @@ -454,8 +463,9 @@ abort_rebuild(int ac, char **av) /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { + error = errno; warn("Failed to fetch info for drive %u", device_id); - return (errno); + return (error); } /* Check the state, must be REBUILD. */ @@ -468,8 +478,9 @@ abort_rebuild(int ac, char **av) mbox_store_pdref(&mbox[0], &info.ref); if (mfi_dcmd_command(fd, MFI_DCMD_PD_REBUILD_ABORT, NULL, 0, mbox, 4, NULL) < 0) { + error = errno; warn("Failed to abort rebuild on drive %u", device_id); - return (errno); + return (error); } close(fd); @@ -492,8 +503,9 @@ drive_progress(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } error = mfi_lookup_drive(fd, av[1], &device_id); @@ -502,8 +514,9 @@ drive_progress(int ac, char **av) /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { + error = errno; warn("Failed to fetch info for drive %u", device_id); - return (errno); + return (error); } close(fd); @@ -551,8 +564,9 @@ drive_clear(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } error = mfi_lookup_drive(fd, av[1], &device_id); @@ -561,16 +575,18 @@ drive_clear(int ac, char **av) /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { + error = errno; warn("Failed to fetch info for drive %u", device_id); - return (errno); + return (error); } mbox_store_pdref(&mbox[0], &info.ref); if (mfi_dcmd_command(fd, opcode, NULL, 0, mbox, 4, NULL) < 0) { + error = errno; warn("Failed to %s clear on drive %u", opcode == MFI_DCMD_PD_CLEAR_START ? "start" : "stop", device_id); - return (errno); + return (error); } close(fd); @@ -604,8 +620,9 @@ drive_locate(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } error = mfi_lookup_drive(fd, av[1], &device_id); @@ -617,10 +634,11 @@ drive_locate(int ac, char **av) mbox[2] = 0; mbox[3] = 0; if (mfi_dcmd_command(fd, opcode, NULL, 0, mbox, 4, NULL) < 0) { + error = errno; warn("Failed to %s locate on drive %u", opcode == MFI_DCMD_PD_LOCATE_START ? "start" : "stop", device_id); - return (errno); + return (error); } close(fd); Modified: head/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_evt.c Tue Oct 26 19:10:59 2010 (r214395) +++ head/usr.sbin/mfiutil/mfi_evt.c Tue Oct 26 19:11:09 2010 (r214396) @@ -32,7 +32,6 @@ #include #include #include -//#include #include #include #include @@ -67,7 +66,7 @@ static int show_logstate(int ac, char **av) { struct mfi_evt_log_state info; - int fd; + int error, fd; if (ac != 1) { warnx("show logstate: extra arguments"); @@ -76,13 +75,15 @@ show_logstate(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } if (mfi_event_get_info(fd, &info, NULL) < 0) { + error = errno; warn("Failed to get event log info"); - return (errno); + return (error); } printf("mfi%d Event Log Sequence Numbers:\n", mfi_unit); @@ -536,18 +537,20 @@ show_events(int ac, char **av) ssize_t size; uint32_t seq, start, stop; uint8_t status; - int ch, fd, num_events, verbose; + int ch, error, fd, num_events, verbose; u_int i; fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } if (mfi_event_get_info(fd, &info, NULL) < 0) { + error = errno; warn("Failed to get event log info"); - return (errno); + return (error); } /* Default settings. */ @@ -565,14 +568,16 @@ show_events(int ac, char **av) switch (ch) { case 'c': if (parse_class(optarg, &filter.members.class) < 0) { + error = errno; warn("Error parsing event class"); - return (errno); + return (error); } break; case 'l': if (parse_locale(optarg, &filter.members.locale) < 0) { + error = errno; warn("Error parsing event locale"); - return (errno); + return (error); } break; case 'n': @@ -608,20 +613,23 @@ show_events(int ac, char **av) return (EINVAL); } if (ac > 0 && parse_seq(&info, av[0], &start) < 0) { + error = errno; warn("Error parsing starting sequence number"); - return (errno); + return (error); } if (ac > 1 && parse_seq(&info, av[1], &stop) < 0) { + error = errno; warn("Error parsing ending sequence number"); - return (errno); + return (error); } list = malloc(size); for (seq = start;;) { if (mfi_get_events(fd, list, num_events, filter, seq, &status) < 0) { + error = errno; warn("Failed to fetch events"); - return (errno); + return (error); } if (status == MFI_STAT_NOT_FOUND) { if (seq == start) Modified: head/usr.sbin/mfiutil/mfi_flash.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_flash.c Tue Oct 26 19:10:59 2010 (r214395) +++ head/usr.sbin/mfiutil/mfi_flash.c Tue Oct 26 19:11:09 2010 (r214396) @@ -72,16 +72,18 @@ display_firmware(struct mfi_info_compone fw_time_width, comp->build_time); } -static void +static int display_pending_firmware(int fd) { struct mfi_ctrl_info info; struct mfi_info_component header; + int error; u_int i; if (mfi_ctrl_get_info(fd, &info, NULL) < 0) { + error = errno; warn("Failed to get controller info"); - return; + return (error); } printf("mfi%d Pending Firmware Images:\n", mfi_unit); @@ -97,6 +99,8 @@ display_pending_firmware(int fd) display_firmware(&header); for (i = 0; i < info.pending_image_component_count; i++) display_firmware(&info.pending_image_component[i]); + + return (0); } static void @@ -117,7 +121,7 @@ flash_adapter(int ac, char **av) size_t nread; char *buf; struct stat sb; - int fd, flash; + int error, fd, flash; uint8_t mbox[4], status; if (ac != 2) { @@ -127,13 +131,15 @@ flash_adapter(int ac, char **av) flash = open(av[1], O_RDONLY); if (flash < 0) { + error = errno; warn("flash: Failed to open %s", av[1]); - return (errno); + return (error); } if (fstat(flash, &sb) < 0) { + error = errno; warn("fstat(%s)", av[1]); - return (errno); + return (error); } if (sb.st_size % 1024 != 0 || sb.st_size > 0x7fffffff) { warnx("Invalid flash file size"); @@ -142,8 +148,9 @@ flash_adapter(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } /* First, ask the firmware to allocate space for the flash file. */ @@ -190,10 +197,10 @@ flash_adapter(int ac, char **av) return (ENXIO); } printf("finished\n"); - display_pending_firmware(fd); + error = display_pending_firmware(fd); close(fd); - return (0); + return (error); } MFI_COMMAND(top, flash, flash_adapter); Modified: head/usr.sbin/mfiutil/mfi_patrol.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_patrol.c Tue Oct 26 19:10:59 2010 (r214395) +++ head/usr.sbin/mfiutil/mfi_patrol.c Tue Oct 26 19:11:09 2010 (r214396) @@ -62,11 +62,13 @@ mfi_get_time(int fd, uint32_t *at) static int patrol_get_props(int fd, struct mfi_pr_properties *prop) { + int error; if (mfi_dcmd_command(fd, MFI_DCMD_PR_GET_PROPERTIES, prop, sizeof(*prop), NULL, 0, NULL) < 0) { + error = errno; warn("Failed to get patrol read properties"); - return (-1); + return (error); } return (0); } @@ -81,19 +83,21 @@ show_patrol(int ac, char **av) char label[16]; time_t now; uint32_t at; - int fd; + int error, fd; u_int i; fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } time(&now); mfi_get_time(fd, &at); - if (patrol_get_props(fd, &prop) < 0) - return (errno); + error = patrol_get_props(fd, &prop); + if (error) + return (error); printf("Operation Mode: "); switch (prop.op_mode) { case MFI_PR_OPMODE_AUTO: @@ -122,8 +126,9 @@ show_patrol(int ac, char **av) if (mfi_dcmd_command(fd, MFI_DCMD_PR_GET_STATUS, &status, sizeof(status), NULL, 0, NULL) < 0) { + error = errno; warn("Failed to get patrol read properties"); - return (errno); + return (error); } printf("Runs Completed: %u\n", status.num_iteration); printf("Current State: "); @@ -146,8 +151,9 @@ show_patrol(int ac, char **av) } if (status.state == MFI_PR_STATE_ACTIVE) { if (mfi_pd_get_list(fd, &list, NULL) < 0) { + error = errno; warn("Failed to get drive list"); - return (errno); + return (error); } for (i = 0; i < list->count; i++) { @@ -156,9 +162,10 @@ show_patrol(int ac, char **av) if (mfi_pd_get_info(fd, list->addr[i].device_id, &info, NULL) < 0) { + error = errno; warn("Failed to fetch info for drive %u", list->addr[i].device_id); - return (errno); + return (error); } if (info.prog_info.active & MFI_PD_PROGRESS_PATROL) { snprintf(label, sizeof(label), " Drive %u", @@ -178,18 +185,20 @@ MFI_COMMAND(show, patrol, show_patrol); static int start_patrol(int ac, char **av) { - int fd; + int error, fd; fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } if (mfi_dcmd_command(fd, MFI_DCMD_PR_START, NULL, 0, NULL, 0, NULL) < 0) { + error = errno; warn("Failed to start patrol read"); - return (errno); + return (error); } close(fd); @@ -201,18 +210,20 @@ MFI_COMMAND(start, patrol, start_patrol) static int stop_patrol(int ac, char **av) { - int fd; + int error, fd; fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } if (mfi_dcmd_command(fd, MFI_DCMD_PR_STOP, NULL, 0, NULL, 0, NULL) < 0) { + error = errno; warn("Failed to stop patrol read"); - return (errno); + return (error); } close(fd); @@ -227,10 +238,10 @@ patrol_config(int ac, char **av) struct mfi_pr_properties prop; long val; time_t now; + int error, fd; uint32_t at, next_exec, exec_freq; char *cp; uint8_t op_mode; - int fd; exec_freq = 0; /* GCC too stupid */ next_exec = 0; @@ -272,12 +283,14 @@ patrol_config(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } - if (patrol_get_props(fd, &prop) < 0) - return (errno); + error = patrol_get_props(fd, &prop); + if (error) + return (error); prop.op_mode = op_mode; if (op_mode == MFI_PR_OPMODE_AUTO) { if (ac > 2) @@ -294,8 +307,9 @@ patrol_config(int ac, char **av) } if (mfi_dcmd_command(fd, MFI_DCMD_PR_SET_PROPERTIES, &prop, sizeof(prop), NULL, 0, NULL) < 0) { + error = errno; warn("Failed to set patrol read properties"); - return (errno); + return (error); } close(fd); Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Tue Oct 26 19:10:59 2010 (r214395) +++ head/usr.sbin/mfiutil/mfi_show.c Tue Oct 26 19:11:09 2010 (r214396) @@ -54,7 +54,7 @@ show_adapter(int ac, char **av) { struct mfi_ctrl_info info; char stripe[5]; - int fd, comma; + int error, fd, comma; if (ac != 1) { warnx("show adapter: extra arguments"); @@ -63,13 +63,15 @@ show_adapter(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } if (mfi_ctrl_get_info(fd, &info, NULL) < 0) { + error = errno; warn("Failed to get controller info"); - return (errno); + return (error); } printf("mfi%d Adapter:\n", mfi_unit); printf(" Product Name: %.80s\n", info.product_name); @@ -137,7 +139,7 @@ show_battery(int ac, char **av) struct mfi_bbu_capacity_info cap; struct mfi_bbu_design_info design; uint8_t status; - int fd; + int error, fd; if (ac != 1) { warnx("show battery: extra arguments"); @@ -146,8 +148,9 @@ show_battery(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_CAPACITY_INFO, &cap, @@ -156,14 +159,16 @@ show_battery(int ac, char **av) printf("mfi%d: No battery present\n", mfi_unit); return (0); } + error = errno; warn("Failed to get capacity info"); - return (errno); + return (error); } if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_DESIGN_INFO, &design, sizeof(design), NULL, 0, NULL) < 0) { + error = errno; warn("Failed to get design info"); - return (errno); + return (error); } printf("mfi%d: Battery State:\n", mfi_unit); @@ -242,7 +247,7 @@ show_config(int ac, char **av) struct mfi_pd_info pinfo; uint16_t device_id; char *p; - int fd, i, j; + int error, fd, i, j; if (ac != 1) { warnx("show config: extra arguments"); @@ -251,14 +256,16 @@ show_config(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } /* Get the config from the controller. */ if (mfi_config_read(fd, &config) < 0) { + error = errno; warn("Failed to get config"); - return (errno); + return (error); } /* Dump out the configuration. */ @@ -337,8 +344,8 @@ show_volumes(int ac, char **av) { struct mfi_ld_list list; struct mfi_ld_info info; + int error, fd; u_int i, len, state_len; - int fd; if (ac != 1) { warnx("show volumes: extra arguments"); @@ -347,14 +354,16 @@ show_volumes(int ac, char **av) fd = mfi_open(mfi_unit); if (fd < 0) { + error = errno; warn("mfi_open"); - return (errno); + return (error); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 19:12: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 7A435106566B; Tue, 26 Oct 2010 19:12:37 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E48F8FC16; Tue, 26 Oct 2010 19:12: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 o9QJCbbJ063725; Tue, 26 Oct 2010 19:12:37 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QJCbdq063723; Tue, 26 Oct 2010 19:12:37 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201010261912.o9QJCbdq063723@svn.freebsd.org> From: Randall Stewart Date: Tue, 26 Oct 2010 19:12: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: r214397 - 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: Tue, 26 Oct 2010 19:12:37 -0000 Author: rrs Date: Tue Oct 26 19:12:37 2010 New Revision: 214397 URL: http://svn.freebsd.org/changeset/base/214397 Log: MFC:210600 Fix the comment block that has the nice table to really have the nice table :-) Modified: stable/8/sys/netinet/sctp_output.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) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Tue Oct 26 19:11:09 2010 (r214396) +++ stable/8/sys/netinet/sctp_output.c Tue Oct 26 19:12:37 2010 (r214397) @@ -2186,21 +2186,31 @@ sctp_is_ifa_addr_preferred(struct sctp_i /* dest_is_priv is true if destination is a private address */ /* dest_is_loop is true if destination is a loopback addresses */ - /* + /** * Here we determine if its a preferred address. A preferred address * means it is the same scope or higher scope then the destination. * L = loopback, P = private, G = global - * ----------------------------------------- src | dest | result - * ---------------------------------------- L | L | yes - * ----------------------------------------- P | L | - * yes-v4 no-v6 ----------------------------------------- G | - * L | yes-v4 no-v6 ----------------------------------------- L - * | P | no ----------------------------------------- P | - * P | yes ----------------------------------------- G | - * P | no ----------------------------------------- L | G - * | no ----------------------------------------- P | G | - * no ----------------------------------------- G | G | - * yes ----------------------------------------- + * ----------------------------------------- + * src | dest | result + * ---------------------------------------- + * L | L | yes + * ----------------------------------------- + * P | L | yes-v4 no-v6 + * ----------------------------------------- + * G | L | yes-v4 no-v6 + * ----------------------------------------- + * L | P | no + * ----------------------------------------- + * P | P | yes + * ----------------------------------------- + * G | P | no + * ----------------------------------------- + * L | G | no + * ----------------------------------------- + * P | G | no + * ----------------------------------------- + * G | G | yes + * ----------------------------------------- */ if (ifa->address.sa.sa_family != fam) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 19:56: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 29C3E1065673; Tue, 26 Oct 2010 19:56:54 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17C038FC1B; Tue, 26 Oct 2010 19:56: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 o9QJur0e066235; Tue, 26 Oct 2010 19:56:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QJurxq066233; Tue, 26 Oct 2010 19:56:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010261956.o9QJurxq066233@svn.freebsd.org> From: Rui Paulo Date: Tue, 26 Oct 2010 19:56: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: r214398 - stable/8/sys/modules/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 19:56:54 -0000 Author: rpaulo Date: Tue Oct 26 19:56:53 2010 New Revision: 214398 URL: http://svn.freebsd.org/changeset/base/214398 Log: MFC r214056: Revert r206418 Modified: stable/8/sys/modules/wlan/Makefile 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) Modified: stable/8/sys/modules/wlan/Makefile ============================================================================== --- stable/8/sys/modules/wlan/Makefile Tue Oct 26 19:12:37 2010 (r214397) +++ stable/8/sys/modules/wlan/Makefile Tue Oct 26 19:56:53 2010 (r214398) @@ -3,13 +3,13 @@ .PATH: ${.CURDIR}/../../net80211 KMOD= wlan -SRCS= ieee80211.c ieee80211_action.c ieee80211_ageq.c ieee80211_amrr.c \ +SRCS= ieee80211.c ieee80211_action.c ieee80211_ageq.c \ ieee80211_crypto.c ieee80211_crypto_none.c ieee80211_dfs.c \ ieee80211_freebsd.c ieee80211_input.c ieee80211_ioctl.c \ ieee80211_mesh.c ieee80211_node.c ieee80211_output.c ieee80211_phy.c \ ieee80211_power.c ieee80211_proto.c ieee80211_scan.c \ ieee80211_scan_sta.c ieee80211_radiotap.c ieee80211_ratectl.c \ - ieee80211_regdomain.c ieee80211_rssadapt.c \ + ieee80211_regdomain.c \ ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \ ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h opt_ipx.h opt_wlan.h \ From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 20:23: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 768801065670; Tue, 26 Oct 2010 20:23:29 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 630528FC08; Tue, 26 Oct 2010 20:23: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 o9QKNT7i067764; Tue, 26 Oct 2010 20:23:29 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QKNTlN067758; Tue, 26 Oct 2010 20:23:29 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201010262023.o9QKNTlN067758@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 26 Oct 2010 20:23: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: r214399 - in stable/8/sys: conf modules/wlan 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: Tue, 26 Oct 2010 20:23:29 -0000 Author: bschmidt Date: Tue Oct 26 20:23:29 2010 New Revision: 214399 URL: http://svn.freebsd.org/changeset/base/214399 Log: MFC r214069: Fix an undefined behaviour if the desired ratectl algo is not available. This can happen if the algos are built as modules but are not loaded. If the selected ratectl algo is not available, try to load it (The load module functions does nothing currently). Add a dummy ratectl algo which always selects the first available rate. Use that one if the desired algo is not available. Added: stable/8/sys/net80211/ieee80211_ratectl_none.c - copied unchanged from r214069, head/sys/net80211/ieee80211_ratectl_none.c Modified: stable/8/sys/conf/files stable/8/sys/modules/wlan/Makefile stable/8/sys/net80211/ieee80211_ratectl.c stable/8/sys/net80211/ieee80211_ratectl.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) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Tue Oct 26 19:56:53 2010 (r214398) +++ stable/8/sys/conf/files Tue Oct 26 20:23:29 2010 (r214399) @@ -2395,6 +2395,7 @@ net80211/ieee80211_power.c optional wlan net80211/ieee80211_proto.c optional wlan net80211/ieee80211_radiotap.c optional wlan net80211/ieee80211_ratectl.c optional wlan +net80211/ieee80211_ratectl_none.c optional wlan net80211/ieee80211_regdomain.c optional wlan net80211/ieee80211_rssadapt.c optional wlan wlan_rssadapt net80211/ieee80211_scan.c optional wlan Modified: stable/8/sys/modules/wlan/Makefile ============================================================================== --- stable/8/sys/modules/wlan/Makefile Tue Oct 26 19:56:53 2010 (r214398) +++ stable/8/sys/modules/wlan/Makefile Tue Oct 26 20:23:29 2010 (r214399) @@ -9,7 +9,7 @@ SRCS= ieee80211.c ieee80211_action.c iee ieee80211_mesh.c ieee80211_node.c ieee80211_output.c ieee80211_phy.c \ ieee80211_power.c ieee80211_proto.c ieee80211_scan.c \ ieee80211_scan_sta.c ieee80211_radiotap.c ieee80211_ratectl.c \ - ieee80211_regdomain.c \ + ieee80211_ratectl_none.c ieee80211_regdomain.c \ ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \ ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h opt_ipx.h opt_wlan.h \ Modified: stable/8/sys/net80211/ieee80211_ratectl.c ============================================================================== --- stable/8/sys/net80211/ieee80211_ratectl.c Tue Oct 26 19:56:53 2010 (r214398) +++ stable/8/sys/net80211/ieee80211_ratectl.c Tue Oct 26 20:23:29 2010 (r214399) @@ -39,6 +39,14 @@ __FBSDID("$FreeBSD$"); static const struct ieee80211_ratectl *ratectls[IEEE80211_RATECTL_MAX]; +static const char *ratectl_modnames[IEEE80211_RATECTL_MAX] = { + [IEEE80211_RATECTL_AMRR] = "wlan_amrr", + [IEEE80211_RATECTL_RSSADAPT] = "wlan_rssadapt", + [IEEE80211_RATECTL_ONOE] = "wlan_onoe", + [IEEE80211_RATECTL_SAMPLE] = "wlan_sample", + [IEEE80211_RATECTL_NONE] = "wlan_none", +}; + MALLOC_DEFINE(M_80211_RATECTL, "80211ratectl", "802.11 rate control"); void @@ -62,5 +70,15 @@ ieee80211_ratectl_set(struct ieee80211va { if (type >= IEEE80211_RATECTL_MAX) return; + if (ratectls[type] == NULL) { + ieee80211_load_module(ratectl_modnames[type]); + if (ratectls[type] == NULL) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_RATECTL, + "%s: unable to load algo %u, module %s\n", + __func__, type, ratectl_modnames[type]); + vap->iv_rate = ratectls[IEEE80211_RATECTL_NONE]; + return; + } + } vap->iv_rate = ratectls[type]; } Modified: stable/8/sys/net80211/ieee80211_ratectl.h ============================================================================== --- stable/8/sys/net80211/ieee80211_ratectl.h Tue Oct 26 19:56:53 2010 (r214398) +++ stable/8/sys/net80211/ieee80211_ratectl.h Tue Oct 26 20:23:29 2010 (r214399) @@ -26,10 +26,11 @@ */ enum ieee80211_ratealgs { - IEEE80211_RATECTL_AMRR = 0, + IEEE80211_RATECTL_AMRR = 0, IEEE80211_RATECTL_RSSADAPT = 1, IEEE80211_RATECTL_ONOE = 2, IEEE80211_RATECTL_SAMPLE = 3, + IEEE80211_RATECTL_NONE = 4, IEEE80211_RATECTL_MAX }; Copied: stable/8/sys/net80211/ieee80211_ratectl_none.c (from r214069, head/sys/net80211/ieee80211_ratectl_none.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/net80211/ieee80211_ratectl_none.c Tue Oct 26 20:23:29 2010 (r214399, copy of r214069, head/sys/net80211/ieee80211_ratectl_none.c) @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 2010 Bernhard Schmidt + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include + +#include +#include + +#ifdef INET +#include +#include +#endif + +#include +#include + +static void +none_init(struct ieee80211vap *vap) +{ +} + +static void +none_deinit(struct ieee80211vap *vap) +{ + free(vap->iv_rs, M_80211_RATECTL); +} + +static void +none_node_init(struct ieee80211_node *ni) +{ +} + +static void +none_node_deinit(struct ieee80211_node *ni) +{ +} + +static int +none_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg __unused) +{ + int rix = 0; + + ni->ni_txrate = ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL; + return rix; +} + +static void +none_tx_complete(const struct ieee80211vap *vap, + const struct ieee80211_node *ni, int ok, + void *arg1, void *arg2 __unused) +{ +} + +static void +none_tx_update(const struct ieee80211vap *vap, const struct ieee80211_node *ni, + void *arg1, void *arg2, void *arg3) +{ +} + +static void +none_setinterval(const struct ieee80211vap *vap, int msecs) +{ +} + +/* number of references from net80211 layer */ +static int nrefs = 0; + +static const struct ieee80211_ratectl none = { + .ir_name = "none", + .ir_attach = NULL, + .ir_detach = NULL, + .ir_init = none_init, + .ir_deinit = none_deinit, + .ir_node_init = none_node_init, + .ir_node_deinit = none_node_deinit, + .ir_rate = none_rate, + .ir_tx_complete = none_tx_complete, + .ir_tx_update = none_tx_update, + .ir_setinterval = none_setinterval, +}; +IEEE80211_RATECTL_MODULE(ratectl_none, 1); +IEEE80211_RATECTL_ALG(none, IEEE80211_RATECTL_NONE, none); From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 21:19: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 323D6106566B; Tue, 26 Oct 2010 21:19:37 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 201838FC13; Tue, 26 Oct 2010 21:19: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 o9QLJbBk070879; Tue, 26 Oct 2010 21:19:37 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QLJaup070874; Tue, 26 Oct 2010 21:19:36 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010262119.o9QLJaup070874@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 26 Oct 2010 21:19:36 +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: r214400 - in vendor/tzcode/dist: libc/stdtime unused zic X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Oct 2010 21:19:37 -0000 Author: edwin Date: Tue Oct 26 21:19:36 2010 New Revision: 214400 URL: http://svn.freebsd.org/changeset/base/214400 Log: Vendor import of tzcode2010n: * Makefile Change LOCALTIME default from "Factory" to "GMT"; do not compile "factory" file (but keep it in the distribution). * Theory Remove reference to "Factory" zone. * localtime.c Initialize ttinfo structures filled by tzparse (thanks to Ravindra for reporting a valgrind warning). * zic.c Fix generation of POSIX strings for zones with rules using "weekday<=n" forms of dates (thanks to Lei Liu for finding the problem). Also, limit output for non-POSIX-specificable zones defined to follow the same rules every year. (Note that no zones of either of the above types appear in the distribution; these changes cater to add-on zones). Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzcode/dist/libc/stdtime/localtime.c vendor/tzcode/dist/unused/Makefile vendor/tzcode/dist/zic/Theory vendor/tzcode/dist/zic/zic.c Modified: vendor/tzcode/dist/libc/stdtime/localtime.c ============================================================================== --- vendor/tzcode/dist/libc/stdtime/localtime.c Tue Oct 26 20:23:29 2010 (r214399) +++ vendor/tzcode/dist/libc/stdtime/localtime.c Tue Oct 26 21:19:36 2010 (r214400) @@ -5,7 +5,7 @@ #ifndef lint #ifndef NOID -static char elsieid[] = "@(#)localtime.c 8.14"; +static char elsieid[] = "@(#)localtime.c 8.15"; #endif /* !defined NOID */ #endif /* !defined lint */ @@ -914,6 +914,7 @@ const int lastditch; register unsigned char * typep; register char * cp; register int load_result; + static struct ttinfo zttinfo; INITIALIZE(dstname); stdname = name; @@ -986,6 +987,7 @@ const int lastditch; /* ** Two transitions per year, from EPOCH_YEAR forward. */ + sp->ttis[0] = sp->ttis[1] = zttinfo; sp->ttis[0].tt_gmtoff = -dstoffset; sp->ttis[0].tt_isdst = 1; sp->ttis[0].tt_abbrind = stdlen + 1; @@ -1099,8 +1101,8 @@ const int lastditch; } /* ** Finally, fill in ttis. - ** ttisstd and ttisgmt need not be handled. */ + sp->ttis[0] = sp->ttis[1] = zttinfo; sp->ttis[0].tt_gmtoff = -stdoffset; sp->ttis[0].tt_isdst = FALSE; sp->ttis[0].tt_abbrind = 0; @@ -1113,6 +1115,7 @@ const int lastditch; dstlen = 0; sp->typecnt = 1; /* only standard time */ sp->timecnt = 0; + sp->ttis[0] = zttinfo; sp->ttis[0].tt_gmtoff = -stdoffset; sp->ttis[0].tt_isdst = 0; sp->ttis[0].tt_abbrind = 0; Modified: vendor/tzcode/dist/unused/Makefile ============================================================================== --- vendor/tzcode/dist/unused/Makefile Tue Oct 26 20:23:29 2010 (r214399) +++ vendor/tzcode/dist/unused/Makefile Tue Oct 26 21:19:36 2010 (r214400) @@ -1,5 +1,5 @@ #
-# @(#)Makefile	8.8
+# @(#)Makefile	8.9
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -12,7 +12,7 @@
 #	make zonenames
 # to get a list of the values you can use for LOCALTIME.
 
-LOCALTIME=	Factory
+LOCALTIME=	GMT
 
 # If you want something other than Eastern United States time as a template
 # for handling POSIX-style time zone environment variables,
@@ -262,8 +262,8 @@ MANS=		newctime.3 newstrftime.3 newtzset
 DOCS=		README Theory $(MANS) date.1 Makefile
 PRIMARY_YDATA=	africa antarctica asia australasia \
 		europe northamerica southamerica
-YDATA=		$(PRIMARY_YDATA) pacificnew etcetera factory backward
-NDATA=		systemv
+YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
+NDATA=		systemv factory
 SDATA=		solar87 solar88 solar89
 TDATA=		$(YDATA) $(NDATA) $(SDATA)
 TABDATA=	iso3166.tab zone.tab

Modified: vendor/tzcode/dist/zic/Theory
==============================================================================
--- vendor/tzcode/dist/zic/Theory	Tue Oct 26 20:23:29 2010	(r214399)
+++ vendor/tzcode/dist/zic/Theory	Tue Oct 26 21:19:36 2010	(r214400)
@@ -1,4 +1,4 @@
-@(#)Theory	8.4
+@(#)Theory	8.5
 This file is in the public domain, so clarified as of
 2009-05-17 by Arthur David Olson.
 
@@ -287,8 +287,7 @@ and these older names are still supporte
 See the file `backward' for most of these older names
 (e.g. `US/Eastern' instead of `America/New_York').
 The other old-fashioned names still supported are
-`WET', `CET', `MET', `EET' (see the file `europe'),
-and `Factory' (see the file `factory').
+`WET', `CET', `MET', and `EET' (see the file `europe').
 
 
 ----- Time zone abbreviations -----

Modified: vendor/tzcode/dist/zic/zic.c
==============================================================================
--- vendor/tzcode/dist/zic/zic.c	Tue Oct 26 20:23:29 2010	(r214399)
+++ vendor/tzcode/dist/zic/zic.c	Tue Oct 26 21:19:36 2010	(r214400)
@@ -3,7 +3,7 @@
 ** 2006-07-17 by Arthur David Olson.
 */
 
-static char	elsieid[] = "@(#)zic.c	8.22";
+static char	elsieid[] = "@(#)zic.c	8.24";
 
 #include "private.h"
 #include "locale.h"
@@ -1881,16 +1881,16 @@ const long			gmtoff;
 		register int	week;
 
 		if (rp->r_dycode == DC_DOWGEQ) {
-			week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
-			if ((week - 1) * DAYSPERWEEK + 1 != rp->r_dayofmonth)
+			if ((rp->r_dayofmonth % DAYSPERWEEK) != 1)
 				return -1;
+			week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
 		} else if (rp->r_dycode == DC_DOWLEQ) {
 			if (rp->r_dayofmonth == len_months[1][rp->r_month])
 				week = 5;
 			else {
-				week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
-				if (week * DAYSPERWEEK - 1 != rp->r_dayofmonth)
+				if ((rp->r_dayofmonth % DAYSPERWEEK) != 0)
 					return -1;
+				week = rp->r_dayofmonth / DAYSPERWEEK;
 			}
 		} else	return -1;	/* "cannot happen" */
 		(void) sprintf(result, "M%d.%d.%d",
@@ -2018,6 +2018,7 @@ const int			zonecount;
 	register char *			envvar;
 	register int			max_abbr_len;
 	register int			max_envvar_len;
+	register int			prodstic; /* all rules are min to max */
 
 	max_abbr_len = 2 + max_format_len + max_abbrvar_len;
 	max_envvar_len = 2 * max_abbr_len + 5 * 9;
@@ -2032,6 +2033,7 @@ const int			zonecount;
 	timecnt = 0;
 	typecnt = 0;
 	charcnt = 0;
+	prodstic = zonecount == 1;
 	/*
 	** Thanks to Earl Chew
 	** for noting the need to unconditionally initialize startttisstd.
@@ -2053,6 +2055,8 @@ const int			zonecount;
 				updateminmax(rp->r_loyear);
 			if (rp->r_hiwasnum)
 				updateminmax(rp->r_hiyear);
+			if (rp->r_lowasnum || rp->r_hiwasnum)
+				prodstic = FALSE;
 		}
 	}
 	/*
@@ -2075,6 +2079,16 @@ wp = ecpyalloc(_("no POSIX environment v
 		if (max_year <= INT_MAX - YEARSPERREPEAT)
 			max_year += YEARSPERREPEAT;
 		else	max_year = INT_MAX;
+		/*
+		** Regardless of any of the above,
+		** for a "proDSTic" zone which specifies that its rules
+		** always have and always will be in effect,
+		** we only need one cycle to define the zone.
+		*/
+		if (prodstic) {
+			min_year = 1900;
+			max_year = min_year + YEARSPERREPEAT;
+		}
 	}
 	/*
 	** For the benefit of older systems,

From owner-svn-src-all@FreeBSD.ORG  Tue Oct 26 21:22: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 2BF0C1065674;
	Tue, 26 Oct 2010 21:22:56 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1AEDA8FC13;
	Tue, 26 Oct 2010 21:22: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 o9QLMu6v071189;
	Tue, 26 Oct 2010 21:22:56 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QLMt33071187;
	Tue, 26 Oct 2010 21:22:55 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201010262122.o9QLMt33071187@svn.freebsd.org>
From: Jung-uk Kim 
Date: Tue, 26 Oct 2010 21:22:55 +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: r214401 - head/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: Tue, 26 Oct 2010 21:22:56 -0000

Author: jkim
Date: Tue Oct 26 21:22:55 2010
New Revision: 214401
URL: http://svn.freebsd.org/changeset/base/214401

Log:
  Document newly added loader tunables "hw.acpi.install_interface" and
  "hw.acpi.remove_interface".

Modified:
  head/share/man/man4/acpi.4

Modified: head/share/man/man4/acpi.4
==============================================================================
--- head/share/man/man4/acpi.4	Tue Oct 26 21:19:36 2010	(r214400)
+++ head/share/man/man4/acpi.4	Tue Oct 26 21:22:55 2010	(r214401)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 12, 2010
+.Dd October 26, 2010
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -224,6 +224,26 @@ Try increasing this number if you get th
 .Qq Li AE_NO_HARDWARE_RESPONSE .
 .It Va hw.acpi.host_mem_start
 Override the assumed memory starting address for PCI host bridges.
+.It Va hw.acpi.install_interface , hw.acpi.remove_interface
+Install or remove OS interface(s) to control return value of
+.Ql _OSI
+query method.  When an OS interface is specified in
+.Va hw.acpi.install_interface ,
+.Li _OSI
+query for the interface returns it is
+.Em supported .
+Conversely, when an OS interface is specified in
+.Va hw.acpi.remove_interface ,
+.Li _OSI
+query returns it is
+.Em not supported .
+Multiple interfaces can be specified in a comma-separated list and
+any leading white spaces will be ignored.  For example,
+.Qq Li FreeBSD, Linux
+is a valid list of two interfaces
+.Qq Li FreeBSD
+and
+.Qq Li Linux .
 .It Va hw.acpi.reset_video
 Enables calling the VESA reset BIOS vector on the resume path.
 This can fix some graphics cards that have problems such as LCD white-out

From owner-svn-src-all@FreeBSD.ORG  Tue Oct 26 21:23: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 51B7A1065672;
	Tue, 26 Oct 2010 21:23:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C9E68FC23;
	Tue, 26 Oct 2010 21:23: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 o9QLNuAg071319;
	Tue, 26 Oct 2010 21:23:56 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QLNutG071309;
	Tue, 26 Oct 2010 21:23:56 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201010262123.o9QLNutG071309@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 26 Oct 2010 21:23:56 +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: r214402 - in stable/8/sbin/geom: class/cache class/eli
	class/journal class/mirror class/nop class/sched class/stripe
	class/virstor core
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 26 Oct 2010 21:23:56 -0000

Author: pjd
Date: Tue Oct 26 21:23:55 2010
New Revision: 214402
URL: http://svn.freebsd.org/changeset/base/214402

Log:
  - Make it possible for default value to be const.
  - Default number is now also a string.

Modified:
  stable/8/sbin/geom/class/cache/geom_cache.c
  stable/8/sbin/geom/class/eli/geom_eli.c
  stable/8/sbin/geom/class/journal/geom_journal.c
  stable/8/sbin/geom/class/mirror/geom_mirror.c
  stable/8/sbin/geom/class/nop/geom_nop.c
  stable/8/sbin/geom/class/sched/geom_sched.c
  stable/8/sbin/geom/class/stripe/geom_stripe.c
  stable/8/sbin/geom/class/virstor/geom_virstor.c
  stable/8/sbin/geom/core/geom.c

Modified: stable/8/sbin/geom/class/cache/geom_cache.c
==============================================================================
--- stable/8/sbin/geom/class/cache/geom_cache.c	Tue Oct 26 21:22:55 2010	(r214401)
+++ stable/8/sbin/geom/class/cache/geom_cache.c	Tue Oct 26 21:23:55 2010	(r214402)
@@ -42,10 +42,8 @@ __FBSDID("$FreeBSD$");
 uint32_t lib_version = G_LIB_VERSION;
 uint32_t version = G_CACHE_VERSION;
 
-static intmax_t blocksize_label = 65536;
-static intmax_t size_label = 100;
-static intmax_t blocksize_configure = 0;
-static intmax_t size_configure = 0;
+#define	GCACHE_BLOCKSIZE	"65536"
+#define	GCACHE_SIZE		"100"
 
 static void cache_main(struct gctl_req *req, unsigned flags);
 static void cache_clear(struct gctl_req *req);
@@ -58,16 +56,16 @@ struct g_command class_commands[] = {
 	},
 	{ "configure", G_FLAG_VERBOSE, NULL,
 	    {
-		{ 'b', "blocksize", &blocksize_configure, G_TYPE_NUMBER },
-		{ 's', "size", &size_configure, G_TYPE_NUMBER },
+		{ 'b', "blocksize", "0", G_TYPE_NUMBER },
+		{ 's', "size", "0", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-v] [-b blocksize] [-s size] name"
 	},
 	{ "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL,
 	    {
-		{ 'b', "blocksize", &blocksize_label, G_TYPE_NUMBER },
-		{ 's', "size", &size_label, G_TYPE_NUMBER },
+		{ 'b', "blocksize", GCACHE_BLOCKSIZE, G_TYPE_NUMBER },
+		{ 's', "size", GCACHE_SIZE, G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-v] [-b blocksize] [-s size] name prov"
@@ -84,8 +82,8 @@ struct g_command class_commands[] = {
 	},
 	{ "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, cache_main,
 	    {
-		{ 'b', "blocksize", &blocksize_label, G_TYPE_NUMBER },
-		{ 's', "size", &size_label, G_TYPE_NUMBER },
+		{ 'b', "blocksize", GCACHE_BLOCKSIZE, G_TYPE_NUMBER },
+		{ 's', "size", GCACHE_SIZE, G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-v] [-b blocksize] [-s size] name prov"

Modified: stable/8/sbin/geom/class/eli/geom_eli.c
==============================================================================
--- stable/8/sbin/geom/class/eli/geom_eli.c	Tue Oct 26 21:22:55 2010	(r214401)
+++ stable/8/sbin/geom/class/eli/geom_eli.c	Tue Oct 26 21:23:55 2010	(r214402)
@@ -55,15 +55,7 @@ uint32_t lib_version = G_LIB_VERSION;
 uint32_t version = G_ELI_VERSION;
 
 #define	GELI_BACKUP_DIR	"/var/backups/"
-
-static char aalgo[] = "none";
-static char ealgo[] = "aes";
-static intmax_t keylen = 0;
-static intmax_t keyno = -1;
-static intmax_t iterations = -1;
-static intmax_t sectorsize = 0;
-static char keyfile[] = "", newkeyfile[] = "";
-static char backupfile[] = "";
+#define	GELI_ENC_ALGO	"aes"
 
 static void eli_main(struct gctl_req *req, unsigned flags);
 static void eli_init(struct gctl_req *req);
@@ -101,30 +93,30 @@ static int eli_backup_create(struct gctl
 struct g_command class_commands[] = {
 	{ "init", G_FLAG_VERBOSE, eli_main,
 	    {
-		{ 'a', "aalgo", aalgo, G_TYPE_STRING },
+		{ 'a', "aalgo", "none", G_TYPE_STRING },
 		{ 'b', "boot", NULL, G_TYPE_BOOL },
-		{ 'B', "backupfile", backupfile, G_TYPE_STRING },
-		{ 'e', "ealgo", ealgo, G_TYPE_STRING },
-		{ 'i', "iterations", &iterations, G_TYPE_NUMBER },
-		{ 'K', "newkeyfile", newkeyfile, G_TYPE_STRING },
-		{ 'l', "keylen", &keylen, G_TYPE_NUMBER },
+		{ 'B', "backupfile", "", G_TYPE_STRING },
+		{ 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING },
+		{ 'i', "iterations", "-1", G_TYPE_NUMBER },
+		{ 'K', "newkeyfile", "", G_TYPE_STRING },
+		{ 'l', "keylen", "0", G_TYPE_NUMBER },
 		{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL },
-		{ 's', "sectorsize", §orsize, G_TYPE_NUMBER },
+		{ 's', "sectorsize", "0", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-K newkeyfile] [-s sectorsize] prov"
 	},
 	{ "label", G_FLAG_VERBOSE, eli_main,
 	    {
-		{ 'a', "aalgo", aalgo, G_TYPE_STRING },
+		{ 'a', "aalgo", "none", G_TYPE_STRING },
 		{ 'b', "boot", NULL, G_TYPE_BOOL },
-		{ 'B', "backupfile", backupfile, G_TYPE_STRING },
-		{ 'e', "ealgo", ealgo, G_TYPE_STRING },
-		{ 'i', "iterations", &iterations, G_TYPE_NUMBER },
-		{ 'K', "newkeyfile", newkeyfile, G_TYPE_STRING },
-		{ 'l', "keylen", &keylen, G_TYPE_NUMBER },
+		{ 'B', "backupfile", "", G_TYPE_STRING },
+		{ 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING },
+		{ 'i', "iterations", "-1", G_TYPE_NUMBER },
+		{ 'K', "newkeyfile", "", G_TYPE_STRING },
+		{ 'l', "keylen", "0", G_TYPE_NUMBER },
 		{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL },
-		{ 's', "sectorsize", §orsize, G_TYPE_NUMBER },
+		{ 's', "sectorsize", "0", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "- an alias for 'init'"
@@ -132,7 +124,7 @@ struct g_command class_commands[] = {
 	{ "attach", G_FLAG_VERBOSE | G_FLAG_LOADKLD, eli_main,
 	    {
 		{ 'd', "detach", NULL, G_TYPE_BOOL },
-		{ 'k', "keyfile", keyfile, G_TYPE_STRING },
+		{ 'k', "keyfile", "", G_TYPE_STRING },
 		{ 'p', "nopassphrase", NULL, G_TYPE_BOOL },
 		{ 'r', "readonly", NULL, G_TYPE_BOOL },
 		G_OPT_SENTINEL
@@ -157,11 +149,11 @@ struct g_command class_commands[] = {
 	},
 	{ "onetime", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL,
 	    {
-		{ 'a', "aalgo", aalgo, G_TYPE_STRING },
+		{ 'a', "aalgo", "none", G_TYPE_STRING },
 		{ 'd', "detach", NULL, G_TYPE_BOOL },
-		{ 'e', "ealgo", ealgo, G_TYPE_STRING },
-		{ 'l', "keylen", &keylen, G_TYPE_NUMBER },
-		{ 's', "sectorsize", §orsize, G_TYPE_NUMBER },
+		{ 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING },
+		{ 'l', "keylen", "0", G_TYPE_NUMBER },
+		{ 's', "sectorsize", "0", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-d] [-a aalgo] [-e ealgo] [-l keylen] [-s sectorsize] prov"
@@ -176,10 +168,10 @@ struct g_command class_commands[] = {
 	},
 	{ "setkey", G_FLAG_VERBOSE, eli_main,
 	    {
-		{ 'i', "iterations", &iterations, G_TYPE_NUMBER },
-		{ 'k', "keyfile", keyfile, G_TYPE_STRING },
-		{ 'K', "newkeyfile", newkeyfile, G_TYPE_STRING },
-		{ 'n', "keyno", &keyno, G_TYPE_NUMBER },
+		{ 'i', "iterations", "-1", G_TYPE_NUMBER },
+		{ 'k', "keyfile", "", G_TYPE_STRING },
+		{ 'K', "newkeyfile", "", G_TYPE_STRING },
+		{ 'n', "keyno", "-1", G_TYPE_NUMBER },
 		{ 'p', "nopassphrase", NULL, G_TYPE_BOOL },
 		{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL },
 		G_OPT_SENTINEL
@@ -190,7 +182,7 @@ struct g_command class_commands[] = {
 	    {
 		{ 'a', "all", NULL, G_TYPE_BOOL },
 		{ 'f', "force", NULL, G_TYPE_BOOL },
-		{ 'n', "keyno", &keyno, G_TYPE_NUMBER },
+		{ 'n', "keyno", "-1", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-afv] [-n keyno] prov"

Modified: stable/8/sbin/geom/class/journal/geom_journal.c
==============================================================================
--- stable/8/sbin/geom/class/journal/geom_journal.c	Tue Oct 26 21:22:55 2010	(r214401)
+++ stable/8/sbin/geom/class/journal/geom_journal.c	Tue Oct 26 21:23:55 2010	(r214402)
@@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$");
 uint32_t lib_version = G_LIB_VERSION;
 uint32_t version = G_JOURNAL_VERSION;
 
-static intmax_t default_jsize = -1;
-
 static void journal_main(struct gctl_req *req, unsigned flags);
 static void journal_clear(struct gctl_req *req);
 static void journal_dump(struct gctl_req *req);
@@ -66,7 +64,7 @@ struct g_command class_commands[] = {
 		{ 'c', "checksum", NULL, G_TYPE_BOOL },
 		{ 'f', "force", NULL, G_TYPE_BOOL },
 		{ 'h', "hardcode", NULL, G_TYPE_BOOL },
-		{ 's', "jsize", &default_jsize, G_TYPE_NUMBER },
+		{ 's', "jsize", "-1", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-cfhv] [-s jsize] dataprov [jprov]"

Modified: stable/8/sbin/geom/class/mirror/geom_mirror.c
==============================================================================
--- stable/8/sbin/geom/class/mirror/geom_mirror.c	Tue Oct 26 21:22:55 2010	(r214401)
+++ stable/8/sbin/geom/class/mirror/geom_mirror.c	Tue Oct 26 21:23:55 2010	(r214402)
@@ -44,9 +44,9 @@ __FBSDID("$FreeBSD$");
 uint32_t lib_version = G_LIB_VERSION;
 uint32_t version = G_MIRROR_VERSION;
 
-static char label_balance[] = "load", configure_balance[] = "none";
-static intmax_t label_slice = 4096, configure_slice = -1;
-static intmax_t insert_priority = 0, configure_priority = -1;
+#define	GMIRROR_BALANCE		"load"
+#define	GMIRROR_SLICE		"4096"
+#define	GMIRROR_PRIORITY	"0"
 
 static void mirror_main(struct gctl_req *req, unsigned flags);
 static void mirror_activate(struct gctl_req *req);
@@ -64,14 +64,14 @@ struct g_command class_commands[] = {
 	{ "configure", G_FLAG_VERBOSE, NULL,
 	    {
 		{ 'a', "autosync", NULL, G_TYPE_BOOL },
-		{ 'b', "balance", configure_balance, G_TYPE_STRING },
+		{ 'b', "balance", "none", G_TYPE_STRING },
 		{ 'd', "dynamic", NULL, G_TYPE_BOOL },
 		{ 'f', "failsync", NULL, G_TYPE_BOOL },
 		{ 'F', "nofailsync", NULL, G_TYPE_BOOL },
 		{ 'h', "hardcode", NULL, G_TYPE_BOOL },
 		{ 'n', "noautosync", NULL, G_TYPE_BOOL },
-		{ 'p', "priority", &configure_priority, G_TYPE_NUMBER },
-		{ 's', "slice", &configure_slice, G_TYPE_NUMBER },
+		{ 'p', "priority", "-1", G_TYPE_NUMBER },
+		{ 's', "slice", "-1", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-adfFhnv] [-b balance] [-s slice] name\n"
@@ -88,11 +88,11 @@ struct g_command class_commands[] = {
 	},
 	{ "label", G_FLAG_VERBOSE, mirror_main,
 	    {
-		{ 'b', "balance", label_balance, G_TYPE_STRING },
+		{ 'b', "balance", GMIRROR_BALANCE, G_TYPE_STRING },
 		{ 'F', "nofailsync", NULL, G_TYPE_BOOL },
 		{ 'h', "hardcode", NULL, G_TYPE_BOOL },
 		{ 'n', "noautosync", NULL, G_TYPE_BOOL },
-		{ 's', "slice", &label_slice, G_TYPE_NUMBER },
+		{ 's', "slice", GMIRROR_SLICE, G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-Fhnv] [-b balance] [-s slice] name prov ..."
@@ -101,7 +101,7 @@ struct g_command class_commands[] = {
 	    {
 		{ 'h', "hardcode", NULL, G_TYPE_BOOL },
 		{ 'i', "inactive", NULL, G_TYPE_BOOL },
-		{ 'p', "priority", &insert_priority, G_TYPE_NUMBER },
+		{ 'p', "priority", GMIRROR_PRIORITY, G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-hiv] [-p priority] name prov ..."

Modified: stable/8/sbin/geom/class/nop/geom_nop.c
==============================================================================
--- stable/8/sbin/geom/class/nop/geom_nop.c	Tue Oct 26 21:22:55 2010	(r214401)
+++ stable/8/sbin/geom/class/nop/geom_nop.c	Tue Oct 26 21:23:55 2010	(r214402)
@@ -38,22 +38,15 @@ __FBSDID("$FreeBSD$");
 uint32_t lib_version = G_LIB_VERSION;
 uint32_t version = G_NOP_VERSION;
 
-static intmax_t error = -1;
-static intmax_t rfailprob = -1;
-static intmax_t wfailprob = -1;
-static intmax_t offset = 0;
-static intmax_t secsize = 0;
-static intmax_t size = 0;
-
 struct g_command class_commands[] = {
 	{ "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL,
 	    {
-		{ 'e', "error", &error, G_TYPE_NUMBER },
-		{ 'o', "offset", &offset, G_TYPE_NUMBER },
-		{ 'r', "rfailprob", &rfailprob, G_TYPE_NUMBER },
-		{ 's', "size", &size, G_TYPE_NUMBER },
-		{ 'S', "secsize", &secsize, G_TYPE_NUMBER },
-		{ 'w', "wfailprob", &wfailprob, G_TYPE_NUMBER },
+		{ 'e', "error", "-1", G_TYPE_NUMBER },
+		{ 'o', "offset", "0", G_TYPE_NUMBER },
+		{ 'r', "rfailprob", "-1", G_TYPE_NUMBER },
+		{ 's', "size", "0", G_TYPE_NUMBER },
+		{ 'S', "secsize", "0", G_TYPE_NUMBER },
+		{ 'w', "wfailprob", "-1", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-v] [-e error] [-o offset] [-r rfailprob] [-s size] "
@@ -61,9 +54,9 @@ struct g_command class_commands[] = {
 	},
 	{ "configure", G_FLAG_VERBOSE, NULL,
 	    {
-		{ 'e', "error", &error, G_TYPE_NUMBER },
-		{ 'r', "rfailprob", &rfailprob, G_TYPE_NUMBER },
-		{ 'w', "wfailprob", &wfailprob, G_TYPE_NUMBER },
+		{ 'e', "error", "-1", G_TYPE_NUMBER },
+		{ 'r', "rfailprob", "-1", G_TYPE_NUMBER },
+		{ 'w', "wfailprob", "-1", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-v] [-e error] [-r rfailprob] [-w wfailprob] prov ..."

Modified: stable/8/sbin/geom/class/sched/geom_sched.c
==============================================================================
--- stable/8/sbin/geom/class/sched/geom_sched.c	Tue Oct 26 21:22:55 2010	(r214401)
+++ stable/8/sbin/geom/class/sched/geom_sched.c	Tue Oct 26 21:23:55 2010	(r214402)
@@ -54,7 +54,7 @@ uint32_t version = G_SCHED_VERSION;
  * storage for parameters used by this geom class.
  * Right now only the scheduler name is used.
  */
-static char algo[] = "rr";	/* default scheduler */
+#define	GSCHED_ALGO	"rr"	/* default scheduler */
 
 /*
  * Adapt to differences in geom library.
@@ -76,7 +76,7 @@ gcmd_createinsert(struct gctl_req *req, 
 	if (gctl_has_param(req, "algo"))
 		reqalgo = gctl_get_ascii(req, "algo");
 	else
-		reqalgo = algo;
+		reqalgo = GSCHED_ALGO;
 
 	snprintf(name, sizeof(name), "gsched_%s", reqalgo);
 	/*
@@ -91,21 +91,21 @@ gcmd_createinsert(struct gctl_req *req, 
 struct g_command class_commands[] = {
 	{ "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, gcmd_createinsert,
 	    {
-		{ 'a', "algo", algo, G_TYPE_STRING },
+		{ 'a', "algo", GSCHED_ALGO, G_TYPE_STRING },
 		G_OPT_SENTINEL
 	    },
 	    G_ARGNAME "[-v] [-a algorithm_name] dev ..."
 	},
 	{ "insert", G_FLAG_VERBOSE | G_FLAG_LOADKLD, gcmd_createinsert,
 	    {
-		{ 'a', "algo", algo, G_TYPE_STRING },
+		{ 'a', "algo", GSCHED_ALGO, G_TYPE_STRING },
 		G_OPT_SENTINEL
 	    },
 	    G_ARGNAME "[-v] [-a algorithm_name] dev ..."
 	},
 	{ "configure", G_FLAG_VERBOSE, NULL,
 	    {
-		{ 'a', "algo", algo, G_TYPE_STRING },
+		{ 'a', "algo", GSCHED_ALGO, G_TYPE_STRING },
 		G_OPT_SENTINEL
 	    },
 	    G_ARGNAME "[-v] [-a algorithm_name] prov ..."

Modified: stable/8/sbin/geom/class/stripe/geom_stripe.c
==============================================================================
--- stable/8/sbin/geom/class/stripe/geom_stripe.c	Tue Oct 26 21:22:55 2010	(r214401)
+++ stable/8/sbin/geom/class/stripe/geom_stripe.c	Tue Oct 26 21:23:55 2010	(r214402)
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
 uint32_t lib_version = G_LIB_VERSION;
 uint32_t version = G_STRIPE_VERSION;
 
-static intmax_t default_stripesize = 65536;
+#define	GSTRIPE_STRIPESIZE	"65536"
 
 static void stripe_main(struct gctl_req *req, unsigned flags);
 static void stripe_clear(struct gctl_req *req);
@@ -59,7 +59,7 @@ struct g_command class_commands[] = {
 	},
 	{ "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL,
 	    {
-		{ 's', "stripesize", &default_stripesize, G_TYPE_NUMBER },
+		{ 's', "stripesize", GSTRIPE_STRIPESIZE, G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-hv] [-s stripesize] name prov prov ..."
@@ -77,7 +77,7 @@ struct g_command class_commands[] = {
 	{ "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, stripe_main,
 	    {
 		{ 'h', "hardcode", NULL, G_TYPE_BOOL },
-		{ 's', "stripesize", &default_stripesize, G_TYPE_NUMBER },
+		{ 's', "stripesize", GSTRIPE_STRIPESIZE, G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
 	    NULL, "[-hv] [-s stripesize] name prov prov ..."

Modified: stable/8/sbin/geom/class/virstor/geom_virstor.c
==============================================================================
--- stable/8/sbin/geom/class/virstor/geom_virstor.c	Tue Oct 26 21:22:55 2010	(r214401)
+++ stable/8/sbin/geom/class/virstor/geom_virstor.c	Tue Oct 26 21:23:55 2010	(r214402)
@@ -48,8 +48,9 @@ __FBSDID("$FreeBSD$");
 
 uint32_t lib_version = G_LIB_VERSION;
 uint32_t version = G_VIRSTOR_VERSION;
-static intmax_t chunk_size = 4 * 1024 * 1024; /* in kB (default: 4 MB) */
-static intmax_t vir_size = 2ULL << 40; /* in MB (default: 2 TB) */
+
+#define	GVIRSTOR_CHUNK_SIZE	"4M"
+#define	GVIRSTOR_VIR_SIZE	"2T"
 
 #if G_LIB_VERSION == 1
 /* Support RELENG_6 */
@@ -71,8 +72,8 @@ struct g_command class_commands[] = {
 	{"label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, virstor_main,
 		{
 			{'h', "hardcode", NULL, G_TYPE_BOOL},
-			{'m', "chunk_size", &chunk_size, G_TYPE_NUMBER},
-			{'s', "vir_size", &vir_size, G_TYPE_NUMBER},
+			{'m', "chunk_size", GVIRSTOR_CHUNK_SIZE, G_TYPE_NUMBER},
+			{'s', "vir_size", GVIRSTOR_VIR_SIZE, G_TYPE_NUMBER},
 			G_OPT_SENTINEL
 		},
 		NULL, "[-h] [-v] [-m chunk_size] [-s vir_size] name provider0 [provider1 ...]"

Modified: stable/8/sbin/geom/core/geom.c
==============================================================================
--- stable/8/sbin/geom/core/geom.c	Tue Oct 26 21:22:55 2010	(r214401)
+++ stable/8/sbin/geom/core/geom.c	Tue Oct 26 21:23:55 2010	(r214402)
@@ -374,14 +374,8 @@ parse_arguments(struct g_command *cmd, s
 				usage();
 			} else if (opt->go_val == G_VAL_OPTIONAL) {
 				/* add nothing. */
-			} else if (G_OPT_TYPE(opt) == G_TYPE_STRING) {
+			} else {
 				set_option(cmd, req, opt, opt->go_val);
-			} else if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) {
-				char val[64];
-
-				snprintf(val, sizeof(val), "%jd",
-				    *(const intmax_t *)opt->go_val);
-				set_option(cmd, req, opt, val);
 			}
 		}
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue Oct 26 21:24: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 8A00E1065693;
	Tue, 26 Oct 2010 21:24:15 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5EF418FC27;
	Tue, 26 Oct 2010 21:24: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 o9QLOFdi071367;
	Tue, 26 Oct 2010 21:24:15 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QLOFLY071366;
	Tue, 26 Oct 2010 21:24:15 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201010262124.o9QLOFLY071366@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 26 Oct 2010 21:24:15 +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: r214403 - vendor/tzcode/tzcode2010n
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 26 Oct 2010 21:24:15 -0000

Author: edwin
Date: Tue Oct 26 21:24:14 2010
New Revision: 214403
URL: http://svn.freebsd.org/changeset/base/214403

Log:
  Tag of tzcode2010n.

Added:
  vendor/tzcode/tzcode2010n/
     - copied from r214401, vendor/tzcode/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Oct 26 21:56: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 92B10106564A;
	Tue, 26 Oct 2010 21:56:47 +0000 (UTC)
	(envelope-from mdounin@mdounin.ru)
Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81])
	by mx1.freebsd.org (Postfix) with ESMTP id 49A908FC08;
	Tue, 26 Oct 2010 21:56:47 +0000 (UTC)
Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81])
	by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 6111D1702F;
	Wed, 27 Oct 2010 01:38:21 +0400 (MSD)
Date: Wed, 27 Oct 2010 01:38:21 +0400
From: Maxim Dounin 
To: Randall Stewart 
Message-ID: <20101026213820.GK44164@mdounin.ru>
References: <201010261912.o9QJCbdq063723@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201010261912.o9QJCbdq063723@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
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: r214397 - 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: Tue, 26 Oct 2010 21:56:47 -0000

Hello!

On Tue, Oct 26, 2010 at 07:12:37PM +0000, Randall Stewart wrote:

> Author: rrs
> Date: Tue Oct 26 19:12:37 2010
> New Revision: 214397
> URL: http://svn.freebsd.org/changeset/base/214397
> 
> Log:
>   MFC:210600
>   
>   Fix the comment block that has the nice
>   table to really have the nice table :-)
> 
> ==============================================================================
> --- stable/8/sys/netinet/sctp_output.c	Tue Oct 26 19:11:09 2010	(r214396)
> +++ stable/8/sys/netinet/sctp_output.c	Tue Oct 26 19:12:37 2010	(r214397)
> @@ -2186,21 +2186,31 @@ sctp_is_ifa_addr_preferred(struct sctp_i
>  	/* dest_is_priv is true if destination is a private address */
>  	/* dest_is_loop is true if destination is a loopback addresses */
>  
> -	/*
> +	/**
>  	 * Here we determine if its a preferred address. A preferred address
>  	 * means it is the same scope or higher scope then the destination.
>  	 * L = loopback, P = private, G = global
> -	 * ----------------------------------------- src    |  dest | result
> -	 * ---------------------------------------- L     |    L  |    yes
> -	 * ----------------------------------------- P     |    L  |
> -	 * yes-v4 no-v6 ----------------------------------------- G     |
> -	 * L  |    yes-v4 no-v6 ----------------------------------------- L
> -	 * |    P  |    no ----------------------------------------- P     |
> -	 * P  |    yes ----------------------------------------- G     |
> -	 * P  |    no ----------------------------------------- L     |    G
> -	 * |    no ----------------------------------------- P     |    G  |
> -	 * no ----------------------------------------- G     |    G  |
> -	 * yes -----------------------------------------
> +	 * -----------------------------------------
> +         *    src    |  dest | result
> +         *  ----------------------------------------

Looks like it now has whitespace damage though (uses spaces as 
indentation).

Maxim Dounin

From owner-svn-src-all@FreeBSD.ORG  Tue Oct 26 22:08: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 24471106566C;
	Tue, 26 Oct 2010 22:08:24 +0000 (UTC)
	(envelope-from pjd@garage.freebsd.pl)
Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60])
	by mx1.freebsd.org (Postfix) with ESMTP id 35C4E8FC12;
	Tue, 26 Oct 2010 22:08:23 +0000 (UTC)
Received: by mail.garage.freebsd.pl (Postfix, from userid 65534)
	id 3E3BE45D8D; Wed, 27 Oct 2010 00:08:22 +0200 (CEST)
Received: from localhost (chello089073192049.chello.pl [89.73.192.49])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.garage.freebsd.pl (Postfix) with ESMTP id A494E45C9B;
	Wed, 27 Oct 2010 00:08:16 +0200 (CEST)
Date: Wed, 27 Oct 2010 00:07:42 +0200
From: Pawel Jakub Dawidek 
To: Colin Percival 
Message-ID: <20101026220742.GB1848@garage.freebsd.pl>
References: <201010242309.o9ON90uV043782@svn.freebsd.org>
	<4CC4BFC8.4010500@freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="kORqDWCi7qDJ0mEj"
Content-Disposition: inline
In-Reply-To: <4CC4BFC8.4010500@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-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org,
	"David E. O'Brien" 
Subject: Re: svn commit: r214307 - in stable/7: . bin/sh
	contrib/wpa_supplicant gnu/usr.bin/groff/tmac share/misc
	tools/regression/bin/sh/expansion tools/tools/nanobsd
	usr.sbin usr.sbin/makefs usr.sbin/makefs/f...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 26 Oct 2010 22:08:24 -0000


--kORqDWCi7qDJ0mEj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Oct 24, 2010 at 04:22:48PM -0700, Colin Percival wrote:
> On 10/24/10 16:09, David E. O'Brien wrote:
> >   MFC r213814: Do not assume in growstackstr() that a "precious" charac=
ter
> >   will be immediately written into the stack after the call.  Instead l=
et
> >   the caller manage the "space left".
> >=20
> > Added:
> >   stable/7/tools/regression/bin/sh/expansion/trim4.0
> >      - copied unchanged from r213814, head/tools/regression/bin/sh/expa=
nsion/trim4.0
> > Modified:
> >   stable/7/bin/sh/histedit.c
> >   stable/7/bin/sh/memalloc.c
> >   stable/7/bin/sh/memalloc.h
> > Directory Properties:
> >   stable/7/   (props changed)
> >   [snip 362 lines of (props changed)]
> >   stable/7/usr.sbin/zic/   (props changed)
>=20
> Did you read the 'Merging with Subversion' instructions
>   http://wiki.freebsd.org/SubversionPrimer/Merging
> where it says "Because of mergeinfo propagation, it is important to choose
> the source and target for the merge carefully to minimize property changes
> on unrelated directories." ?

The same for r213738 and for r213817.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--kORqDWCi7qDJ0mEj
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAkzHUS4ACgkQForvXbEpPzRLUgCZAWGbFi2pp5Ry0tnQJ6319G8v
uCMAoLYZAGSBpXEk6+YzQIpDyNYCg+4G
=8pqZ
-----END PGP SIGNATURE-----

--kORqDWCi7qDJ0mEj--

From owner-svn-src-all@FreeBSD.ORG  Tue Oct 26 22:46: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 4BD69106564A;
	Tue, 26 Oct 2010 22:46:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3AE048FC18;
	Tue, 26 Oct 2010 22:46: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 o9QMkGb0075751;
	Tue, 26 Oct 2010 22:46:16 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QMkG4I075749;
	Tue, 26 Oct 2010 22:46:16 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201010262246.o9QMkG4I075749@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 26 Oct 2010 22:46: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: r214404 - head/sbin/geom/class/eli
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 26 Oct 2010 22:46:16 -0000

Author: pjd
Date: Tue Oct 26 22:46:15 2010
New Revision: 214404
URL: http://svn.freebsd.org/changeset/base/214404

Log:
  Use fprintf(stderr) instead of gctl_error() to print a warning about too
  big sector size. When gctl error is set gctl_has_param() always returns
  'false', which prevents geli(8) from finding some arguments and also masks
  an error, which is generates in such case.
  
  MFC after:	3 days

Modified:
  head/sbin/geom/class/eli/geom_eli.c

Modified: head/sbin/geom/class/eli/geom_eli.c
==============================================================================
--- head/sbin/geom/class/eli/geom_eli.c	Tue Oct 26 21:24:14 2010	(r214403)
+++ head/sbin/geom/class/eli/geom_eli.c	Tue Oct 26 22:46:15 2010	(r214404)
@@ -749,8 +749,8 @@ eli_init(struct gctl_req *req)
 			return;
 		}
 		if (val > sysconf(_SC_PAGE_SIZE)) {
-			gctl_error(req, "warning: Using sectorsize bigger than "
-			    "the page size!");
+			fprintf(stderr,
+			    "warning: Using sectorsize bigger than the page size!\n");
 		}
 		md.md_sectorsize = val;
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue Oct 26 23:06: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 2ECC0106564A;
	Tue, 26 Oct 2010 23:06:54 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A6448FC12;
	Tue, 26 Oct 2010 23:06: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 o9QN6sAk076796;
	Tue, 26 Oct 2010 23:06:54 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QN6sWp076792;
	Tue, 26 Oct 2010 23:06:54 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201010262306.o9QN6sWp076792@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 26 Oct 2010 23:06: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: r214405 - in stable/8: sbin/geom/class/eli
	sbin/geom/class/sched sbin/geom/core sys/geom/eli
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 26 Oct 2010 23:06:54 -0000

Author: pjd
Date: Tue Oct 26 23:06:53 2010
New Revision: 214405
URL: http://svn.freebsd.org/changeset/base/214405

Log:
  MFC r202976,r211927,r212845,r212846,r212934,r213055,r213056,r213057,r213058,
      r213059,r213060,r213062,r213063,r213067,r213070,r213071,r213072,r213073,
      r213164,r213165,r213172,r214116,r214118,r214133,r214163,r214225,r214226,
      r214227,r214228,r214229,r214404:
  
  r202976 (by trasz):
  
  Remove pointless assignment.
  
  Found with:	clang
  
  r211927:
  
  Correct offset conversion to little endian. It was implemented in version 2,
  but because of a bug it was a no-op, so we were still using offsets in native
  byte order for the host. Do it properly this time, bump version to 4 and set
  the G_ELI_FLAG_NATIVE_BYTE_ORDER flag when version is under 4.
  
  Reported by:	ivoras
  
  r212845 (by brian):
  
  Support attaching version 4 metadata
  
  Reviewed by:	pjd
  
  r212846:
  
  Fix indent.
  
  r212934 (by brian):
  
  Add a geli resize subcommand to resize encrypted filesystems prior
  to growing the filesystem.
  
  Refuse to attach providers where the metadata provider size is
  wrong.  This makes post-boot attaches behave consistently with
  pre-boot attaches.  Also refuse to restore metadata to a provider
  of the wrong size without the new -f switch.  The new -f switch
  forces the metadata restoration despite the provider size, and
  updates the provider size in the restored metadata to the correct
  value.
  
  Helped by:	pjd
  Reviewed by:	pjd
  
  r213055:
  
  When trashing metadata, flush after each write.
  
  r213056:
  
  Simplify code a bit by using g_*() API from libgeom.
  
  r213057:
  
  - Make use of g_*() API.
  - Flush cache after writing metadata.
  
  r213058:
  
  Because we first write metadata into new place and then trash old place we
  don't want situation where old size is equal to new size, as we will trash
  newly written metadata.
  
  r213059:
  
  - Use g_*() API when doing backups.
  - fsync() created files.
  
  r213060:
  
  - When trashing metadata, repeat overwrite kern.geom.eli.overwrites times.
  - Flush write cache after each write.
  
  r213062:
  
  Define default overwrite count, so that userland can use it.
  
  r213063:
  
  Make the code similar to the code in g_eli_integrity.c.
  
  r213067:
  
  Implement switching of data encryption key every 2^20 blocks.
  This ensures the same encryption key won't be used for more than
  2^20 blocks (sectors). This will be the default now.
  
  r213070:
  
  Add support for AES-XTS. This will be the default now.
  
  r213071:
  
  Document AES-XTS.
  
  r213072:
  
  Update copyright years.
  
  r213073:
  
  Update copyright years.
  
  r213164:
  
  Ignore errors from BIO_FLUSH. It might confuse users that provider wasn't
  really killed. What we really care about are write errors only.
  
  r213165:
  
  Change g_eli_debug to int, so one can turn off any GELI output by setting
  kern.geom.eli.debug sysctl to -1.
  
  r213172:
  
  - Add support for loading passphrase from a file (-J and -j options).
    This is especially useful for things like installers, where regular
    geli prompt can't be used.
  - Add support for specifing multiple -K or -k options, so there is no
    need to cat all keyfiles and read them from standard input.
  
  Requested by:	Kris Moore , thompsa
  
  r214116:
  
  - Add missing comments.
  - Make a comment consistent with others.
  
  r214118:
  
  Bring in geli suspend/resume functionality (finally).
  
  Before this change if you wanted to suspend your laptop and be sure that your
  encryption keys are safe, you had to stop all processes that use file system
  stored on encrypted device, unmount the file system and detach geli provider.
  
  This isn't very handy. If you are a lucky user of a laptop where suspend/resume
  actually works with FreeBSD (I'm not!) you most likely want to suspend your
  laptop, because you don't want to start everything over again when you turn
  your laptop back on.
  
  And this is where geli suspend/resume steps in. When you execute:
  
  	# geli suspend -a
  
  geli will wait for all in-flight I/O requests, suspend new I/O requests, remove
  all geli sensitive data from the kernel memory (like encryption keys) and will
  wait for either 'geli resume' or 'geli detach'.
  
  Now with no keys in memory you can suspend your laptop without stopping any
  processes or unmounting any file systems.
  
  When you resume your laptop you have to resume geli devices using 'geli resume'
  command. You need to provide your passphrase, etc. again so the keys can be
  restored and suspended I/O requests released.
  
  Of course you need to remember that 'geli suspend' won't clear file system
  cache and other places where data from your geli-encrypted file system might be
  present. But to get rid of those stopping processes and unmounting file system
  won't help either - you have to turn your laptop off. Be warned.
  
  Also note, that suspending geli device which contains file system with geli
  utility (or anything used by 'geli resume') is not very good idea, as you won't
  be able to resume it - when you execute geli(8), the kernel will try to read it
  and this read I/O request will be suspended.
  
  r214133:
  
  Fix a bug introduced in r213067 where we use authentication key before
  initializing it.
  
  r214163:
  
  Free opencrypto sessions on suspend, as they also might keep encryption keys.
  
  r214225:
  
  Move sc_akeyctx and sc_ivctx initialization to the g_eli_mkey_propagate()
  function which eliminates code duplication and will ensure proper order
  of operation.
  
  r214226:
  
  Encryption keys array might be NULL if device is suspended. Check for this, so
  we don't panic when we detach suspended device.
  
  r214227:
  
  Add State tag, so 'geli status' will report active/suspended status, eg:
  
  	# geli status
  	   Name     Status  Components
  	da0.eli  SUSPENDED  da0
  	da1.eli     ACTIVE  da1
  
  r214228:
  
  Close a race between checking if device is already suspended and suspending it.
  
  r214229:
  
  - Improve error messages, so instead of 'Not fully done', the user will get
    information that device is already suspended or that device is using
    one-time key and suspend is not supported.
  - 'geli suspend -a' silently skips devices that use one-time key, this is fine,
    but because we log which device were suspended on the console, log also which
    devices were skipped.
  
  r214404:
  
  Use fprintf(stderr) instead of gctl_error() to print a warning about too
  big sector size. When gctl error is set gctl_has_param() always returns
  'false', which prevents geli(8) from finding some arguments and also masks
  an error, which is generates in such case.

Modified:
  stable/8/sbin/geom/class/eli/geli.8
  stable/8/sbin/geom/class/eli/geom_eli.c
  stable/8/sbin/geom/core/geom.c
  stable/8/sys/geom/eli/g_eli.c
  stable/8/sys/geom/eli/g_eli.h
  stable/8/sys/geom/eli/g_eli_crypto.c
  stable/8/sys/geom/eli/g_eli_ctl.c
  stable/8/sys/geom/eli/g_eli_integrity.c
  stable/8/sys/geom/eli/g_eli_key.c
  stable/8/sys/geom/eli/g_eli_privacy.c
Directory Properties:
  stable/8/sbin/geom/   (props changed)
  stable/8/sbin/geom/class/part/   (props changed)
  stable/8/sbin/geom/class/sched/gsched.8   (props changed)
  stable/8/sbin/geom/class/stripe/   (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)

Modified: stable/8/sbin/geom/class/eli/geli.8
==============================================================================
--- stable/8/sbin/geom/class/eli/geli.8	Tue Oct 26 22:46:15 2010	(r214404)
+++ stable/8/sbin/geom/class/eli/geli.8	Tue Oct 26 23:06:53 2010	(r214405)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2005-2008 Pawel Jakub Dawidek 
+.\" Copyright (c) 2005-2010 Pawel Jakub Dawidek 
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 29, 2008
+.Dd October 20, 2010
 .Dt GELI 8
 .Os
 .Sh NAME
@@ -56,6 +56,7 @@ utility:
 .Op Fl B Ar backupfile
 .Op Fl e Ar ealgo
 .Op Fl i Ar iterations
+.Op Fl J Ar newpassfile
 .Op Fl K Ar newkeyfile
 .Op Fl l Ar keylen
 .Op Fl s Ar sectorsize
@@ -66,6 +67,7 @@ utility:
 .Nm
 .Cm attach
 .Op Fl dprv
+.Op Fl j Ar passfile
 .Op Fl k Ar keyfile
 .Ar prov
 .Nm
@@ -91,6 +93,8 @@ utility:
 .Cm setkey
 .Op Fl pPv
 .Op Fl i Ar iterations
+.Op Fl j Ar passfile
+.Op Fl J Ar newpassfile
 .Op Fl k Ar keyfile
 .Op Fl K Ar newkeyfile
 .Op Fl n Ar keyno
@@ -111,10 +115,25 @@ utility:
 .Ar file
 .Nm
 .Cm restore
-.Op Fl v
+.Op Fl fv
 .Ar file
 .Ar prov
 .Nm
+.Cm suspend
+.Op Fl v
+.Fl a | Ar prov ...
+.Nm
+.Cm resume
+.Op Fl pv
+.Op Fl j Ar passfile
+.Op Fl k Ar keyfile
+.Ar prov
+.Nm
+.Cm resize
+.Op Fl v
+.Fl s Ar oldsize
+.Ar prov
+.Nm
 .Cm clear
 .Op Fl v
 .Ar prov ...
@@ -146,11 +165,12 @@ framework, so when there is crypto hardw
 will make use of it automatically.
 .It
 Supports many cryptographic algorithms (currently
-.Nm AES ,
-.Nm Blowfish ,
-.Nm Camellia
+.Nm AES-XTS ,
+.Nm AES-CBC ,
+.Nm Blowfish-CBC ,
+.Nm Camellia-CBC
 and
-.Nm 3DES ) .
+.Nm 3DES-CBC ) .
 .It
 Can optionally perform data authentication (integrity verification) utilizing
 one of the following algorithms:
@@ -197,6 +217,8 @@ Allows to attach a provider with a rando
 partitions and temporary file systems.
 .It
 Allows to verify data integrity (data authentication).
+.It
+Allows to suspend and resume encrypted devices.
 .El
 .Pp
 The first argument to
@@ -217,7 +239,7 @@ The metadata can be recovered with the
 subcommand described below.
 .Pp
 Additional options include:
-.Bl -tag -width ".Fl a Ar aalgo"
+.Bl -tag -width ".Fl J Ar newpassfile"
 .It Fl a Ar aalgo
 Enable data integrity verification (authentication) using the given algorithm.
 This will reduce size of available storage and also reduce speed.
@@ -252,39 +274,44 @@ as the
 .It Fl e Ar ealgo
 Encryption algorithm to use.
 Currently supported algorithms are:
-.Nm AES ,
-.Nm Blowfish ,
-.Nm Camellia
+.Nm AES-XTS ,
+.Nm AES-CBC ,
+.Nm Blowfish-CBC ,
+.Nm Camellia-CBC
 and
-.Nm 3DES .
+.Nm 3DES-CBC .
 The default and recommended algorithm is
-.Nm AES .
+.Nm AES-XTS .
 .It Fl i Ar iterations
 Number of iterations to use with PKCS#5v2.
 If this option is not specified,
 .Nm
 will find the number of iterations which is equal to 2 seconds of crypto work.
 If 0 is given, PKCS#5v2 will not be used.
+.It Fl J Ar newpassfile
+Specifies a file which contains the passphrase or its part.
+If
+.Ar newpassfile
+is given as -, standard input will be used.
+Only the first line (excluding new-line character) is taken from the given file.
+This argument can be specified multiple times.
 .It Fl K Ar newkeyfile
 Specifies a file which contains part of the key.
 If
 .Ar newkeyfile
 is given as -, standard input will be used.
-Here is how more than one file with a key component can be used:
-.Bd -literal -offset indent
-# cat key1 key2 key3 | geli init -K - /dev/da0
-.Ed
+This argument can be specified multiple times.
 .It Fl l Ar keylen
 Key length to use with the given cryptographic algorithm.
 If not given, the default key length for the given algorithm is used, which is:
 128 for
-.Nm AES ,
-128 for
-.Nm Blowfish ,
-128 for
-.Nm Camellia
+.Nm AES-XTS ,
+.Nm AES-CBC ,
+.Nm Blowfish-CBC
+and
+.Nm Camellia-CBC
 and 192 for
-.Nm 3DES .
+.Nm 3DES-CBC .
 .It Fl P
 Do not use passphrase as the key component.
 .It Fl s Ar sectorsize
@@ -302,7 +329,7 @@ provider's name with an
 suffix.
 .Pp
 Additional options include:
-.Bl -tag -width ".Fl a Ar algo"
+.Bl -tag -width ".Fl j Ar passfile"
 .It Fl d
 If specified, a decrypted provider will be detached automatically on last close.
 This can help with short memory - user does not have to remember to detach the
@@ -314,6 +341,13 @@ Probably a better choice is the
 option for the
 .Cm detach
 subcommand.
+.It Fl j Ar passfile
+Specifies a file which contains the passphrase or its part.
+For more information see the description of the
+.Fl J
+option for the
+.Cm init
+subcommand.
 .It Fl k Ar keyfile
 Specifies a file which contains part of the key.
 For more information see the description of the
@@ -332,7 +366,7 @@ Detach the given providers, which means 
 and clear the keys from memory.
 .Pp
 Additional options include:
-.Bl -tag -width ".Fl a Ar algo"
+.Bl -tag -width ".Fl f"
 .It Fl f
 Force detach - detach even if the provider is open.
 .It Fl l
@@ -347,7 +381,7 @@ Attach the given providers with random, 
 The command can be used to encrypt swap partitions or temporary file systems.
 .Pp
 Additional options include:
-.Bl -tag -width ".Fl a Ar aalgo"
+.Bl -tag -width ".Fl a Ar sectorsize"
 .It Fl a Ar aalgo
 Enable data integrity verification (authentication).
 For more information, see the description of the
@@ -402,13 +436,17 @@ When a provider is attached, the user do
 an old passphrase/keyfile.
 .Pp
 Additional options include:
-.Bl -tag -width ".Fl a Ar algo"
+.Bl -tag -width ".Fl J Ar newpassfile"
 .It Fl i Ar iterations
 Number of iterations to use with PKCS#5v2.
 If 0 is given, PKCS#5v2 will not be used.
 To be able to use this option with
 .Cm setkey
 subcommand, only one key have to be defined and this key has to be changed.
+.It Fl j Ar passfile
+Specifies a file which contains the old passphrase or its part.
+.It Fl J Ar newpassfile
+Specifies a file which contains the new passphrase or its part.
 .It Fl k Ar keyfile
 Specifies a file which contains part of the old key.
 .It Fl K Ar newkeyfile
@@ -432,7 +470,9 @@ will not be detached even if all keys wi
 It can be even rescued with the
 .Cm setkey
 subcommand.
-.Bl -tag -width ".Fl a Ar algo"
+.Pp
+Additional options include:
+.Bl -tag -width ".Fl a Ar keyno"
 .It Fl a
 Destroy all keys (does not need
 .Fl f
@@ -456,7 +496,9 @@ backup, your data is gone for good.
 In case the provider was attached with the
 .Fl r
 flag, the keys will not be destroyed, only the provider will be detached.
-.Bl -tag -width ".Fl a Ar algo"
+.Pp
+Additional options include:
+.Bl -tag -width ".Fl a"
 .It Fl a
 If specified, all currently attached providers will be killed.
 .El
@@ -464,6 +506,97 @@ If specified, all currently attached pro
 Backup metadata from the given provider to the given file.
 .It Cm restore
 Restore metadata from the given file to the given provider.
+.Pp
+Additional options include:
+.Bl -tag -width ".Fl f"
+.It Fl f
+Metadata contains the size of the provider to ensure that the correct
+partition or slice is attached.
+If an attempt is made to restore metadata to a provider that has a different
+size,
+.Nm
+will refuse to restore the data unless the
+.Fl f
+switch is used.
+If the partition or slice has been grown, the
+.Cm resize
+subcommand should be used rather than attempting to relocate the metadata
+through
+.Cm backup
+and
+.Cm restore .
+.El
+.It Cm suspend
+Suspend device by waiting for all inflight request to finish, clearing all
+sensitive informations (like keys) from the kernel memory and blocking all
+further I/O requests until the
+.Cm resume
+subcommand is executed.
+This functionality is useful for eg. laptops - when one wants to suspend a
+laptop, one does not want to leave encrypted device attached.
+Instead of closing all files and directories opened from a file system placed
+on an encrypted device, unmounting the file system and detaching the device,
+the
+.Cm suspend
+subcommand can be used.
+Any access to the encrypted device will be blocked until the keys are
+recovered through
+.Cm resume
+subcommand, thus there is no need to close nor unmount anything.
+The
+.Cm suspend
+subcommand does not work with devices created with the
+.Cm onetime
+subcommand.
+Please note that sensitive data might still be present in memory after
+suspending encrypted device, because of file system cache, etc.
+.Pp
+Additional options include:
+.Bl -tag -width ".Fl a"
+.It Fl a
+Suspend all
+.Nm
+devices.
+.El
+.It Cm resume
+Resume previously suspended device.
+The caller must ensure that executing this subcommand won't try to access
+suspended device, which will lead to a deadlock.
+For example suspending device, which contains file system where the
+.Nm
+utility is stored is bad idea.
+.Pp
+Additional options include:
+.Bl -tag -width ".Fl j Ar passfile"
+.It Fl j Ar passfile
+Specifies a file which contains the passphrase or its part.
+For more information see the description of the
+.Fl J
+option for the
+.Cm init
+subcommand.
+.It Fl k Ar keyfile
+Specifies a file which contains part of the key.
+For more information see the description of the
+.Fl K
+option for the
+.Cm init
+subcommand.
+.It Fl p
+Do not use passphrase as the key component.
+.El
+.It Cm resize
+Inform
+.Nm
+that the provider has been resized.
+The old metadata block is relocated to the correct position at the end of the
+provider and the provider size is updated.
+.Pp
+Additional options include:
+.Bl -tag -width ".Fl s Ar oldsize"
+.It Fl s Ar oldsize
+The size of the provider before it was resized.
+.El
 .It Cm clear
 Clear metadata from the given providers.
 .It Cm dump
@@ -603,7 +736,7 @@ keyfile:
 # dd if=/dev/random of=/boot/keys/da0.key0 bs=32k count=1
 # dd if=/dev/random of=/boot/keys/da0.key1 bs=32k count=1
 # dd if=/dev/random of=/boot/keys/da0.key2 bs=32k count=1
-# cat /boot/keys/da0.key0 /boot/keys/da0.key1 /boot/keys/da0.key2 | geli init -b -K - da0
+# geli init -b -K /boot/keys/da0.key0 -K /boot/keys/da0.key1 -K /boot/keys/da0.key2 da0
 Enter new passphrase:
 Reenter new passphrase:
 # dd if=/dev/random of=/dev/da1s3a bs=1m
@@ -665,6 +798,61 @@ geli: Cannot read metadata from /dev/da0
 # geli attach /dev/da0
 Enter passphrase:
 .Ed
+.Pp
+If an encrypted filesystem is extended, it is necessary to relocate and
+update the metadata:
+.Bd -literal -offset indent
+# gpart create -s GPT ada0
+# gpart add -s 1g -t freebsd-ufs -i 1 ada0
+# geli init -K keyfile -P ada0p1
+# gpart resize -s 2g -i 1 ada0
+# geli resize -s 1g ada0p1
+# geli attach -k keyfile -p ada0p1
+.Ed
+.Pp
+Initialize provider with passphrase split into two files.
+The provider can be attached by giving those two files or by giving
+.Dq foobar
+passphrase on
+.Nm
+prompt:
+.Bd -literal -offset indent
+# echo foo > da0.pass0
+# echo bar > da0.pass1
+# geli init -J da0.pass0 -J da0.pass1 da0
+# geli attach -j da0.pass0 -j da0.pass1 da0
+# geli detach da0
+# geli attach da0
+Enter passphrase: foobar
+.Ed
+.Pp
+Suspend all
+.Nm
+devices, suspend a laptop, then resume devices one by one after resuming a
+laptop:
+.Bd -literal -offset indent
+# geli suspend -a
+# zzz
+
+# geli resume -p -k keyfile gpt/secret
+# geli resume gpt/private
+Enter passphrase:
+.Ed
+.Sh ENCRYPTION MODES
+.Nm
+supports two encryption modes:
+.Nm XTS ,
+which was standarized as
+.Nm IEE P1619
+and
+.Nm CBC
+with unpredictable IV.
+The
+.Nm CBC
+mode used by
+.Nm
+is very similar to the mode
+.Nm ESSIV .
 .Sh DATA AUTHENTICATION
 .Nm
 can verify data integrity when an authentication algorithm is specified.

Modified: stable/8/sbin/geom/class/eli/geom_eli.c
==============================================================================
--- stable/8/sbin/geom/class/eli/geom_eli.c	Tue Oct 26 22:46:15 2010	(r214404)
+++ stable/8/sbin/geom/class/eli/geom_eli.c	Tue Oct 26 23:06:53 2010	(r214405)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2004-2008 Pawel Jakub Dawidek 
+ * Copyright (c) 2004-2010 Pawel Jakub Dawidek 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,6 +27,10 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+#include 
+
+#include 
 #include 
 #include 
 #include 
@@ -63,9 +67,11 @@ static void eli_attach(struct gctl_req *
 static void eli_configure(struct gctl_req *req);
 static void eli_setkey(struct gctl_req *req);
 static void eli_delkey(struct gctl_req *req);
+static void eli_resume(struct gctl_req *req);
 static void eli_kill(struct gctl_req *req);
 static void eli_backup(struct gctl_req *req);
 static void eli_restore(struct gctl_req *req);
+static void eli_resize(struct gctl_req *req);
 static void eli_clear(struct gctl_req *req);
 static void eli_dump(struct gctl_req *req);
 
@@ -75,18 +81,21 @@ static int eli_backup_create(struct gctl
 /*
  * Available commands:
  *
- * init [-bhPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-K newkeyfile] prov
+ * init [-bhPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] prov
  * label - alias for 'init'
- * attach [-dprv] [-k keyfile] prov
+ * attach [-dprv] [-j passfile] [-k keyfile] prov
  * detach [-fl] prov ...
  * stop - alias for 'detach'
  * onetime [-d] [-a aalgo] [-e ealgo] [-l keylen] prov
  * configure [-bB] prov ...
- * setkey [-pPv] [-n keyno] [-k keyfile] [-K newkeyfile] prov
+ * setkey [-pPv] [-n keyno] [-j passfile] [-J newpassfile] [-k keyfile] [-K newkeyfile] prov
  * delkey [-afv] [-n keyno] prov
+ * suspend [-v] -a | prov ...
+ * resume [-pv] [-j passfile] [-k keyfile] prov
  * kill [-av] [prov ...]
  * backup [-v] prov file
- * restore [-v] file prov
+ * restore [-fv] file prov
+ * resize [-v] -s oldsize prov
  * clear [-v] prov ...
  * dump [-v] prov ...
  */
@@ -98,13 +107,15 @@ struct g_command class_commands[] = {
 		{ 'B', "backupfile", "", G_TYPE_STRING },
 		{ 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING },
 		{ 'i', "iterations", "-1", G_TYPE_NUMBER },
-		{ 'K', "newkeyfile", "", G_TYPE_STRING },
+		{ 'J', "newpassfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
+		{ 'K', "newkeyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
 		{ 'l', "keylen", "0", G_TYPE_NUMBER },
 		{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL },
 		{ 's', "sectorsize", "0", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-K newkeyfile] [-s sectorsize] prov"
+	    NULL,
+	    "[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] prov"
 	},
 	{ "label", G_FLAG_VERBOSE, eli_main,
 	    {
@@ -113,23 +124,27 @@ struct g_command class_commands[] = {
 		{ 'B', "backupfile", "", G_TYPE_STRING },
 		{ 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING },
 		{ 'i', "iterations", "-1", G_TYPE_NUMBER },
-		{ 'K', "newkeyfile", "", G_TYPE_STRING },
+		{ 'J', "newpassfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
+		{ 'K', "newkeyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
 		{ 'l', "keylen", "0", G_TYPE_NUMBER },
 		{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL },
 		{ 's', "sectorsize", "0", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "- an alias for 'init'"
+	    NULL,
+	    "- an alias for 'init'"
 	},
 	{ "attach", G_FLAG_VERBOSE | G_FLAG_LOADKLD, eli_main,
 	    {
 		{ 'd', "detach", NULL, G_TYPE_BOOL },
-		{ 'k', "keyfile", "", G_TYPE_STRING },
+		{ 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
+		{ 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
 		{ 'p', "nopassphrase", NULL, G_TYPE_BOOL },
 		{ 'r', "readonly", NULL, G_TYPE_BOOL },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "[-dprv] [-k keyfile] prov"
+	    NULL,
+	    "[-dprv] [-j passfile] [-k keyfile] prov"
 	},
 	{ "detach", 0, NULL,
 	    {
@@ -137,7 +152,8 @@ struct g_command class_commands[] = {
 		{ 'l', "last", NULL, G_TYPE_BOOL },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "[-fl] prov ..."
+	    NULL,
+	    "[-fl] prov ..."
 	},
 	{ "stop", 0, NULL,
 	    {
@@ -145,7 +161,8 @@ struct g_command class_commands[] = {
 		{ 'l', "last", NULL, G_TYPE_BOOL },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "- an alias for 'detach'"
+	    NULL,
+	    "- an alias for 'detach'"
 	},
 	{ "onetime", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL,
 	    {
@@ -156,7 +173,8 @@ struct g_command class_commands[] = {
 		{ 's', "sectorsize", "0", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "[-d] [-a aalgo] [-e ealgo] [-l keylen] [-s sectorsize] prov"
+	    NULL,
+	    "[-d] [-a aalgo] [-e ealgo] [-l keylen] [-s sectorsize] prov"
 	},
 	{ "configure", G_FLAG_VERBOSE, eli_main,
 	    {
@@ -164,19 +182,23 @@ struct g_command class_commands[] = {
 		{ 'B', "noboot", NULL, G_TYPE_BOOL },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "[-bB] prov ..."
+	    NULL,
+	    "[-bB] prov ..."
 	},
 	{ "setkey", G_FLAG_VERBOSE, eli_main,
 	    {
 		{ 'i', "iterations", "-1", G_TYPE_NUMBER },
-		{ 'k', "keyfile", "", G_TYPE_STRING },
-		{ 'K', "newkeyfile", "", G_TYPE_STRING },
+		{ 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
+		{ 'J', "newpassfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
+		{ 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
+		{ 'K', "newkeyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
 		{ 'n', "keyno", "-1", G_TYPE_NUMBER },
 		{ 'p', "nopassphrase", NULL, G_TYPE_BOOL },
 		{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "[-pPv] [-n keyno] [-i iterations] [-k keyfile] [-K newkeyfile] prov"
+	    NULL,
+	    "[-pPv] [-n keyno] [-i iterations] [-j passfile] [-J newpassfile] [-k keyfile] [-K newkeyfile] prov"
 	},
 	{ "delkey", G_FLAG_VERBOSE, eli_main,
 	    {
@@ -185,20 +207,53 @@ struct g_command class_commands[] = {
 		{ 'n', "keyno", "-1", G_TYPE_NUMBER },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "[-afv] [-n keyno] prov"
+	    NULL,
+	    "[-afv] [-n keyno] prov"
+	},
+	{ "suspend", G_FLAG_VERBOSE, NULL,
+	    {
+		{ 'a', "all", NULL, G_TYPE_BOOL },
+		G_OPT_SENTINEL
+	    },
+	    NULL,
+	    "[-v] -a | prov ..."
+	},
+	{ "resume", G_FLAG_VERBOSE, eli_main,
+	    {
+		{ 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
+		{ 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI },
+		{ 'p', "nopassphrase", NULL, G_TYPE_BOOL },
+		G_OPT_SENTINEL
+	    },
+	    NULL,
+	    "[-pv] [-j passfile] [-k keyfile] prov"
 	},
 	{ "kill", G_FLAG_VERBOSE, eli_main,
 	    {
 		{ 'a', "all", NULL, G_TYPE_BOOL },
 		G_OPT_SENTINEL
 	    },
-	    NULL, "[-av] [prov ...]"
+	    NULL,
+	    "[-av] [prov ...]"
 	},
 	{ "backup", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, NULL,
 	    "[-v] prov file"
 	},
-	{ "restore", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, NULL,
-	    "[-v] file prov"
+	{ "restore", G_FLAG_VERBOSE, eli_main,
+	    {
+		{ 'f', "force", NULL, G_TYPE_BOOL },
+		G_OPT_SENTINEL
+	    },
+	    NULL,
+	    "[-fv] file prov"
+	},
+	{ "resize", G_FLAG_VERBOSE, eli_main,
+	    {
+		{ 's', "oldsize", NULL, G_TYPE_NUMBER },
+		G_OPT_SENTINEL
+	    },
+	    NULL,
+	    "[-v] -s oldsize prov"
 	},
 	{ "clear", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, NULL,
 	    "[-v] prov ..."
@@ -233,7 +288,7 @@ eli_protect(struct gctl_req *req)
 }
 
 static void
-eli_main(struct gctl_req *req, unsigned flags)
+eli_main(struct gctl_req *req, unsigned int flags)
 {
 	const char *name;
 
@@ -258,12 +313,16 @@ eli_main(struct gctl_req *req, unsigned 
 		eli_setkey(req);
 	else if (strcmp(name, "delkey") == 0)
 		eli_delkey(req);
+	else if (strcmp(name, "resume") == 0)
+		eli_resume(req);
 	else if (strcmp(name, "kill") == 0)
 		eli_kill(req);
 	else if (strcmp(name, "backup") == 0)
 		eli_backup(req);
 	else if (strcmp(name, "restore") == 0)
 		eli_restore(req);
+	else if (strcmp(name, "resize") == 0)
+		eli_resize(req);
 	else if (strcmp(name, "dump") == 0)
 		eli_dump(req);
 	else if (strcmp(name, "clear") == 0)
@@ -277,7 +336,7 @@ arc4rand(unsigned char *buf, size_t size
 {
 	uint32_t *buf4;
 	size_t size4;
-	unsigned i;
+	unsigned int i;
 
 	buf4 = (uint32_t *)buf;
 	size4 = size / 4;
@@ -306,123 +365,216 @@ eli_is_attached(const char *prov)
 	return (0);
 }
 
-static unsigned char *
-eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key,
-    int new)
+static int
+eli_genkey_files(struct gctl_req *req, bool new, const char *type,
+    struct hmac_ctx *ctxp, char *passbuf, size_t passbufsize)
 {
-	struct hmac_ctx ctx;
-	const char *str;
-	int error, nopassphrase;
+	char *p, buf[MAXPHYS], argname[16];
+	const char *file;
+	int error, fd, i;
+	ssize_t done;
+
+	assert((strcmp(type, "keyfile") == 0 && ctxp != NULL &&
+	    passbuf == NULL && passbufsize == 0) ||
+	    (strcmp(type, "passfile") == 0 && ctxp == NULL &&
+	    passbuf != NULL && passbufsize > 0));
+	assert(strcmp(type, "keyfile") == 0 || passbuf[0] == '\0');
+
+	for (i = 0; ; i++) {
+		snprintf(argname, sizeof(argname), "%s%s%d",
+		    new ? "new" : "", type, i);
+
+		/* No more {key,pass}files? */
+		if (!gctl_has_param(req, argname))
+			return (i);
 
-	nopassphrase =
-	    gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase");
-
-	g_eli_crypto_hmac_init(&ctx, NULL, 0);
-
-	str = gctl_get_ascii(req, new ? "newkeyfile" : "keyfile");
-	if (str[0] == '\0' && nopassphrase) {
-		gctl_error(req, "No key components given.");
-		return (NULL);
-	} else if (str[0] != '\0') {
-		char buf[MAXPHYS];
-		ssize_t done;
-		int fd;
+		file = gctl_get_ascii(req, argname);
+		assert(file != NULL);
 
-		if (strcmp(str, "-") == 0)
+		if (strcmp(file, "-") == 0)
 			fd = STDIN_FILENO;
 		else {
-			fd = open(str, O_RDONLY);
+			fd = open(file, O_RDONLY);
 			if (fd == -1) {
-				gctl_error(req, "Cannot open keyfile %s: %s.",
-				    str, strerror(errno));
-				return (NULL);
+				gctl_error(req, "Cannot open %s %s: %s.",
+				    type, file, strerror(errno));
+				return (-1);
+			}
+		}
+		if (strcmp(type, "keyfile") == 0) {
+			while ((done = read(fd, buf, sizeof(buf))) > 0)
+				g_eli_crypto_hmac_update(ctxp, buf, done);
+		} else /* if (strcmp(type, "passfile") == 0) */ {
+			while ((done = read(fd, buf, sizeof(buf) - 1)) > 0) {
+				buf[done] = '\0';
+				p = strchr(buf, '\n');
+				if (p != NULL) {
+					*p = '\0';
+					done = p - buf;
+				}
+				if (strlcat(passbuf, buf, passbufsize) >=
+				    passbufsize) {
+					gctl_error(req,
+					    "Passphrase in %s too long.", file);
+					bzero(buf, sizeof(buf));
+					return (-1);
+				}
+				if (p != NULL)
+					break;
 			}
 		}
-		while ((done = read(fd, buf, sizeof(buf))) > 0)
-			g_eli_crypto_hmac_update(&ctx, buf, done);
 		error = errno;
-		if (strcmp(str, "-") != 0)
+		if (strcmp(file, "-") != 0)
 			close(fd);
 		bzero(buf, sizeof(buf));
 		if (done == -1) {
-			gctl_error(req, "Cannot read keyfile %s: %s.", str,
-			    strerror(error));
-			return (NULL);
+			gctl_error(req, "Cannot read %s %s: %s.",
+			    type, file, strerror(error));
+			return (-1);
 		}
 	}
+	/* NOTREACHED */
+}
 
-	if (!nopassphrase) {
-		char buf1[BUFSIZ], buf2[BUFSIZ], *p;
+static int
+eli_genkey_passphrase_prompt(struct gctl_req *req, bool new, char *passbuf,
+    size_t passbufsize)
+{
+	char *p;
 
-		if (!new && md->md_iterations == -1) {
-			gctl_error(req, "Missing -p flag.");
-			return (NULL);
+	for (;;) {
+		p = readpassphrase(
+		    new ? "Enter new passphrase:" : "Enter passphrase:",
+		    passbuf, passbufsize, RPP_ECHO_OFF | RPP_REQUIRE_TTY);
+		if (p == NULL) {
+			bzero(passbuf, passbufsize);
+			gctl_error(req, "Cannot read passphrase: %s.",
+			    strerror(errno));
+			return (-1);
 		}
-		for (;;) {
-			p = readpassphrase(
-			    new ? "Enter new passphrase:" : "Enter passphrase:",
-			    buf1, sizeof(buf1), RPP_ECHO_OFF | RPP_REQUIRE_TTY);
+
+		if (new) {
+			char tmpbuf[BUFSIZ];
+
+			p = readpassphrase("Reenter new passphrase: ",
+			    tmpbuf, sizeof(tmpbuf),
+			    RPP_ECHO_OFF | RPP_REQUIRE_TTY);
 			if (p == NULL) {
-				bzero(buf1, sizeof(buf1));
-				gctl_error(req, "Cannot read passphrase: %s.",
+				bzero(passbuf, passbufsize);
+				gctl_error(req,
+				    "Cannot read passphrase: %s.",
 				    strerror(errno));
-				return (NULL);
+				return (-1);
 			}
-	
-			if (new) {
-				p = readpassphrase("Reenter new passphrase: ",
-				    buf2, sizeof(buf2),
-				    RPP_ECHO_OFF | RPP_REQUIRE_TTY);
-				if (p == NULL) {
-					bzero(buf1, sizeof(buf1));
-					gctl_error(req,
-					    "Cannot read passphrase: %s.",
-					    strerror(errno));
-					return (NULL);
-				}
-	
-				if (strcmp(buf1, buf2) != 0) {
-					bzero(buf2, sizeof(buf2));
-					fprintf(stderr, "They didn't match.\n");
-					continue;
-				}
-				bzero(buf2, sizeof(buf2));
+
+			if (strcmp(passbuf, tmpbuf) != 0) {
+				bzero(passbuf, passbufsize);
+				fprintf(stderr, "They didn't match.\n");
+				continue;
 			}
-			break;
+			bzero(tmpbuf, sizeof(tmpbuf));
 		}
-		/*
-		 * Field md_iterations equal to -1 means "choose some sane
-		 * value for me".
-		 */
-		if (md->md_iterations == -1) {
-			assert(new);
-			if (verbose)
-				printf("Calculating number of iterations...\n");
-			md->md_iterations = pkcs5v2_calculate(2000000);
-			assert(md->md_iterations > 0);
-			if (verbose) {
-				printf("Done, using %d iterations.\n",
-				    md->md_iterations);
-			}
+		return (0);
+	}
+	/* NOTREACHED */
+}
+
+static int
+eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new,
+    struct hmac_ctx *ctxp)
+{
+	char passbuf[MAXPHYS];
+	bool nopassphrase;
+	int nfiles;
+
+	nopassphrase =
+	    gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase");
+	if (nopassphrase) {
+		if (gctl_has_param(req, new ? "newpassfile0" : "passfile0")) {
+			gctl_error(req,
+			    "Options -%c and -%c are mutually exclusive.",
+			    new ? 'J' : 'j', new ? 'P' : 'p');
+			return (-1);
 		}
-		/*
-		 * If md_iterations is equal to 0, user don't want PKCS#5v2.
-		 */
-		if (md->md_iterations == 0) {
-			g_eli_crypto_hmac_update(&ctx, md->md_salt,
-			    sizeof(md->md_salt));
-			g_eli_crypto_hmac_update(&ctx, buf1, strlen(buf1));
-		} else /* if (md->md_iterations > 0) */ {
-			unsigned char dkey[G_ELI_USERKEYLEN];
-
-			pkcs5v2_genkey(dkey, sizeof(dkey), md->md_salt,
-			    sizeof(md->md_salt), buf1, md->md_iterations);
-			g_eli_crypto_hmac_update(&ctx, dkey, sizeof(dkey));
-			bzero(dkey, sizeof(dkey));
+		return (0);
+	}
+
+	if (!new && md->md_iterations == -1) {
+		gctl_error(req, "Missing -p flag.");
+		return (-1);
+	}
+	passbuf[0] = '\0';
+	nfiles = eli_genkey_files(req, new, "passfile", NULL, passbuf,
+	    sizeof(passbuf));
+	if (nfiles == -1)
+		return (-1);
+	else if (nfiles == 0) {
+		if (eli_genkey_passphrase_prompt(req, new, passbuf,
+		    sizeof(passbuf)) == -1) {
+			return (-1);
+		}
+	}
+	/*
+	 * Field md_iterations equal to -1 means "choose some sane
+	 * value for me".
+	 */
+	if (md->md_iterations == -1) {
+		assert(new);
+		if (verbose)
+			printf("Calculating number of iterations...\n");
+		md->md_iterations = pkcs5v2_calculate(2000000);
+		assert(md->md_iterations > 0);
+		if (verbose) {
+			printf("Done, using %d iterations.\n",
+			    md->md_iterations);
 		}
-		bzero(buf1, sizeof(buf1));
 	}
+	/*
+	 * If md_iterations is equal to 0, user doesn't want PKCS#5v2.
+	 */
+	if (md->md_iterations == 0) {
+		g_eli_crypto_hmac_update(ctxp, md->md_salt,
+		    sizeof(md->md_salt));
+		g_eli_crypto_hmac_update(ctxp, passbuf, strlen(passbuf));
+	} else /* if (md->md_iterations > 0) */ {
+		unsigned char dkey[G_ELI_USERKEYLEN];
+
+		pkcs5v2_genkey(dkey, sizeof(dkey), md->md_salt,
+		    sizeof(md->md_salt), passbuf, md->md_iterations);
+		g_eli_crypto_hmac_update(ctxp, dkey, sizeof(dkey));
+		bzero(dkey, sizeof(dkey));
+	}
+	bzero(passbuf, sizeof(passbuf));
+
+	return (0);
+}
+
+static unsigned char *
+eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key,
+    bool new)
+{
+	struct hmac_ctx ctx;
+	bool nopassphrase;
+	int nfiles;
+
+	nopassphrase =
+	    gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase");
+
+	g_eli_crypto_hmac_init(&ctx, NULL, 0);
+
+	nfiles = eli_genkey_files(req, new, "keyfile", &ctx, NULL, 0);
+	if (nfiles == -1)
+		return (NULL);
+	else if (nfiles == 0 && nopassphrase) {
+		gctl_error(req, "No key components given.");
+		return (NULL);
+	}
+
+	if (eli_genkey_passphrase(req, md, new, &ctx) == -1)
+		return (NULL);
+
 	g_eli_crypto_hmac_final(&ctx, key, 0);
+
 	return (key);
 }
 
@@ -611,8 +763,8 @@ eli_init(struct gctl_req *req)
 			return;
 		}
 		if (val > sysconf(_SC_PAGE_SIZE)) {
-			gctl_error(req, "warning: Using sectorsize bigger than "
-			    "the page size!");
+			fprintf(stderr,
+			    "warning: Using sectorsize bigger than the page size!\n");
 		}
 		md.md_sectorsize = val;
 	}
@@ -622,7 +774,7 @@ eli_init(struct gctl_req *req)
 	arc4rand(md.md_mkeys, sizeof(md.md_mkeys));
 
 	/* Generate user key. */
-	if (eli_genkey(req, &md, key, 1) == NULL) {
+	if (eli_genkey(req, &md, key, true) == NULL) {
 		bzero(key, sizeof(key));

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Tue Oct 26 23:18: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 877E0106564A;
	Tue, 26 Oct 2010 23:18:37 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 75E9A8FC16;
	Tue, 26 Oct 2010 23:18: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 o9QNIbE4077306;
	Tue, 26 Oct 2010 23:18:37 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QNIbMe077303;
	Tue, 26 Oct 2010 23:18:37 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201010262318.o9QNIbMe077303@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 26 Oct 2010 23:18: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: r214406 - in head/sys/fs: nfs 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: Tue, 26 Oct 2010 23:18:37 -0000

Author: rmacklem
Date: Tue Oct 26 23:18:37 2010
New Revision: 214406
URL: http://svn.freebsd.org/changeset/base/214406

Log:
  Add a flag to the experimental NFSv4 client to indicate when
  delegations are being returned for reasons other than a Recall.
  Also, re-organize nfscl_recalldeleg() slightly, so that it leaves
  clearing NMODIFIED to the ncl_flush() call and invalidates the
  attribute cache after flushing. It is hoped that these changes
  might fix the problem others have seen when using the NFSv4
  client with delegations enabled, since I can't reliably reproduce
  the problem. These changes only affect the client when doing NFSv4
  mounts with delegations enabled.
  
  MFC after:	10 days

Modified:
  head/sys/fs/nfs/nfsclstate.h
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfs/nfsclstate.h
==============================================================================
--- head/sys/fs/nfs/nfsclstate.h	Tue Oct 26 23:06:53 2010	(r214405)
+++ head/sys/fs/nfs/nfsclstate.h	Tue Oct 26 23:18:37 2010	(r214406)
@@ -118,6 +118,7 @@ struct nfscldeleg {
 #define	NFSCLDL_NEEDRECLAIM	0x08
 #define	NFSCLDL_ZAPPED		0x10
 #define	NFSCLDL_MODTIMESET	0x20
+#define	NFSCLDL_DELEGRET	0x40
 
 /*
  * MALLOC'd to the correct length to accommodate the file handle.

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Tue Oct 26 23:06:53 2010	(r214405)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Tue Oct 26 23:18:37 2010	(r214406)
@@ -929,8 +929,10 @@ nfscl_getbytelock(vnode_t vp, u_int64_t 
 		ldp = dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh,
 		    np->n_fhp->nfh_len);
 		/* Just sanity check for correct type of delegation */
-		if (dp != NULL && ((dp->nfsdl_flags & NFSCLDL_RECALL) ||
-		    (type == F_WRLCK && !(dp->nfsdl_flags & NFSCLDL_WRITE))))
+		if (dp != NULL && ((dp->nfsdl_flags &
+		    (NFSCLDL_RECALL | NFSCLDL_DELEGRET)) != 0 ||
+		     (type == F_WRLCK &&
+		      (dp->nfsdl_flags & NFSCLDL_WRITE) == 0)))
 			dp = NULL;
 	}
 	if (dp != NULL) {
@@ -2495,8 +2497,8 @@ tryagain:
 		    if (dp->nfsdl_rwlock.nfslock_usecnt == 0 &&
 			dp->nfsdl_rwlock.nfslock_lock == 0 &&
 			dp->nfsdl_timestamp < NFSD_MONOSEC &&
-			!(dp->nfsdl_flags & (NFSCLDL_RECALL | NFSCLDL_ZAPPED |
-			  NFSCLDL_NEEDRECLAIM))) {
+			(dp->nfsdl_flags & (NFSCLDL_RECALL | NFSCLDL_ZAPPED |
+			  NFSCLDL_NEEDRECLAIM | NFSCLDL_DELEGRET)) == 0) {
 			clearok = 1;
 			LIST_FOREACH(owp, &dp->nfsdl_owner, nfsow_list) {
 			    op = LIST_FIRST(&owp->nfsow_open);
@@ -3086,7 +3088,8 @@ nfscl_docb(struct nfsrv_descript *nd, NF
 				if (clp != NULL) {
 					dp = nfscl_finddeleg(clp, nfhp->nfh_fh,
 					    nfhp->nfh_len);
-					if (dp != NULL) {
+					if (dp != NULL && (dp->nfsdl_flags &
+					    NFSCLDL_DELEGRET) == 0) {
 						dp->nfsdl_flags |=
 						    NFSCLDL_RECALL;
 						wakeup((caddr_t)clp);
@@ -3338,7 +3341,6 @@ nfscl_recalldeleg(struct nfsclclient *cl
 		np = VTONFS(vp);
 	}
 	dp->nfsdl_flags &= ~NFSCLDL_MODTIMESET;
-	NFSINVALATTRCACHE(np);
 
 	/*
 	 * Ok, if it's a write delegation, flush data to the server, so
@@ -3347,21 +3349,14 @@ nfscl_recalldeleg(struct nfsclclient *cl
 	ret = 0;
 	NFSLOCKNODE(np);
 	if ((dp->nfsdl_flags & NFSCLDL_WRITE) && (np->n_flag & NMODIFIED)) {
-#ifdef APPLE
-		OSBitOrAtomic((u_int32_t)NDELEGRECALL, (UInt32 *)&np->n_flag);
-#else
 		np->n_flag |= NDELEGRECALL;
-#endif
 		NFSUNLOCKNODE(np);
 		ret = ncl_flush(vp, MNT_WAIT, cred, p, 1,
 		    called_from_renewthread);
 		NFSLOCKNODE(np);
-#ifdef APPLE
-		OSBitAndAtomic((int32_t)~(NMODIFIED | NDELEGRECALL), (UInt32 *)&np->n_flag);
-#else
-		np->n_flag &= ~(NMODIFIED | NDELEGRECALL);
-#endif
+		np->n_flag &= ~NDELEGRECALL;
 	}
+	NFSINVALATTRCACHE(np);
 	NFSUNLOCKNODE(np);
 	if (ret == EIO && called_from_renewthread != 0) {
 		/*
@@ -3534,8 +3529,10 @@ nfscl_totalrecall(struct nfsclclient *cl
 {
 	struct nfscldeleg *dp;
 
-	TAILQ_FOREACH(dp, &clp->nfsc_deleg, nfsdl_list)
-		dp->nfsdl_flags |= NFSCLDL_RECALL;
+	TAILQ_FOREACH(dp, &clp->nfsc_deleg, nfsdl_list) {
+		if ((dp->nfsdl_flags & NFSCLDL_DELEGRET) == 0)
+			dp->nfsdl_flags |= NFSCLDL_RECALL;
+	}
 }
 
 /*
@@ -3754,8 +3751,9 @@ nfscl_mustflush(vnode_t vp)
 		return (1);
 	}
 	dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len);
-	if (dp != NULL && (dp->nfsdl_flags & (NFSCLDL_WRITE | NFSCLDL_RECALL))
-	     == NFSCLDL_WRITE &&
+	if (dp != NULL && (dp->nfsdl_flags &
+	    (NFSCLDL_WRITE | NFSCLDL_RECALL | NFSCLDL_DELEGRET)) ==
+	     NFSCLDL_WRITE &&
 	    (dp->nfsdl_sizelimit >= np->n_size ||
 	     !NFSHASSTRICT3530(nmp))) {
 		NFSUNLOCKCLSTATE();
@@ -3787,9 +3785,10 @@ nfscl_nodeleg(vnode_t vp, int writedeleg
 		return (1);
 	}
 	dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len);
-	if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_RECALL) == 0 &&
-	    (writedeleg == 0 || (dp->nfsdl_flags & NFSCLDL_WRITE)
-	     == NFSCLDL_WRITE)) {
+	if (dp != NULL &&
+	    (dp->nfsdl_flags & (NFSCLDL_RECALL | NFSCLDL_DELEGRET)) == 0 &&
+	    (writedeleg == 0 || (dp->nfsdl_flags & NFSCLDL_WRITE) ==
+	     NFSCLDL_WRITE)) {
 		NFSUNLOCKCLSTATE();
 		return (0);
 	}
@@ -3860,6 +3859,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T 
 			}
 		    }
 		    if (needsrecall && !triedrecall) {
+			dp->nfsdl_flags |= NFSCLDL_DELEGRET;
 			islept = 0;
 			while (!igotlock) {
 			    igotlock = nfsv4_lock(&clp->nfsc_lock, 1,
@@ -3958,6 +3958,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stat
 			}
 		    }
 		    if (needsrecall && !triedrecall) {
+			dp->nfsdl_flags |= NFSCLDL_DELEGRET;
 			islept = 0;
 			while (!igotlock) {
 			    igotlock = nfsv4_lock(&clp->nfsc_lock, 1,

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 02: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 E01F4106564A;
	Wed, 27 Oct 2010 02:04:24 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CE2058FC12;
	Wed, 27 Oct 2010 02:04: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 o9R24OFa083668;
	Wed, 27 Oct 2010 02:04:24 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9R24OVG083666;
	Wed, 27 Oct 2010 02:04:24 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201010270204.o9R24OVG083666@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 27 Oct 2010 02:04: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: r214407 - stable/8/sys/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 02:04:25 -0000

Author: yongari
Date: Wed Oct 27 02:04:24 2010
New Revision: 214407
URL: http://svn.freebsd.org/changeset/base/214407

Log:
  MFC r213796:
    Rewrite interrupt handler to give fairness for both RX and TX.
    Previously rl(4) continuously checked whether there are RX events
    or TX completions in forever loop. This caused TX starvation under
    high RX load as well as consuming too much CPU cycles in the
    interrupt handler. If interrupt was shared with other devices which
    may be always true due to USB devices in these days, rl(4) also
    tried to process the interrupt. This means polling(4) was the only
    way to mitigate the these issues.
  
    To address these issues, rl(4) now disables interrupts when it
    knows the interrupt is ours and limit the number of iteration of
    the loop to 16. The interrupt would be enabled again before exiting
    interrupt handler if the driver is still running. Because RX buffer
    is 64KB in size, the number of iterations in the loop has nothing
    to do with number of RX packets being processed. This change
    ensures sending TX frames under high RX load.
  
    RX handler drops a driver lock to pass received frames to upper
    stack such that there is a window that user can down the interface.
    So rl(4) now checks whether driver is still running before serving
    RX or TX completion in the loop.
  
    While I'm here, exit interrupt handler when driver initialized
    controller.
  
    With this change, now rl(4) can send frames under high RX load even
    though the TX performance is still not good(rl(4) controllers can't
    queue more than 4 frames at a time so low TX performance was one of
    design issue of rl(4) controllers). It's much better than previous
    TX starvation and you should not notice RX performance drop with
    this change. Controller still shows poor performance under high
    network load but for many cases it's now usable without resorting
    to polling(4).

Modified:
  stable/8/sys/pci/if_rl.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)

Modified: stable/8/sys/pci/if_rl.c
==============================================================================
--- stable/8/sys/pci/if_rl.c	Tue Oct 26 23:18:37 2010	(r214406)
+++ stable/8/sys/pci/if_rl.c	Wed Oct 27 02:04:24 2010	(r214407)
@@ -1620,6 +1620,7 @@ rl_intr(void *arg)
 	struct rl_softc		*sc = arg;
 	struct ifnet		*ifp = sc->rl_ifp;
 	uint16_t		status;
+	int			count;
 
 	RL_LOCK(sc);
 
@@ -1631,30 +1632,41 @@ rl_intr(void *arg)
 		goto done_locked;
 #endif
 
-	for (;;) {
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+		goto done_locked2;
+	status = CSR_READ_2(sc, RL_ISR);
+	if (status == 0xffff || (status & RL_INTRS) == 0)
+		goto done_locked;
+	/*
+	 * Ours, disable further interrupts.
+	 */
+	CSR_WRITE_2(sc, RL_IMR, 0);
+	for (count = 16; count > 0; count--) {
+		CSR_WRITE_2(sc, RL_ISR, status);
+		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+			if (status & (RL_ISR_RX_OK | RL_ISR_RX_ERR))
+				rl_rxeof(sc);
+			if (status & (RL_ISR_TX_OK | RL_ISR_TX_ERR))
+				rl_txeof(sc);
+			if (status & RL_ISR_SYSTEM_ERR) {
+				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+				rl_init_locked(sc);
+				RL_UNLOCK(sc);
+				return;
+			}
+		}
 		status = CSR_READ_2(sc, RL_ISR);
 		/* If the card has gone away, the read returns 0xffff. */
-		if (status == 0xffff)
+		if (status == 0xffff || (status & RL_INTRS) == 0)
 			break;
-		if (status != 0)
-			CSR_WRITE_2(sc, RL_ISR, status);
-		if ((status & RL_INTRS) == 0)
-			break;
-		if (status & RL_ISR_RX_OK)
-			rl_rxeof(sc);
-		if (status & RL_ISR_RX_ERR)
-			rl_rxeof(sc);
-		if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR))
-			rl_txeof(sc);
-		if (status & RL_ISR_SYSTEM_ERR) {
-			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-			rl_init_locked(sc);
-		}
 	}
 
 	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 		rl_start_locked(ifp);
 
+done_locked2:
+	if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+		CSR_WRITE_2(sc, RL_IMR, RL_INTRS);
 done_locked:
 	RL_UNLOCK(sc);
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 02:07: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 47A49106566B;
	Wed, 27 Oct 2010 02:07:26 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 35D918FC1F;
	Wed, 27 Oct 2010 02:07: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 o9R27Q6E083798;
	Wed, 27 Oct 2010 02:07:26 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9R27Qta083796;
	Wed, 27 Oct 2010 02:07:26 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201010270207.o9R27Qta083796@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 27 Oct 2010 02:07:26 +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: r214408 - stable/7/sys/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 02:07:26 -0000

Author: yongari
Date: Wed Oct 27 02:07:25 2010
New Revision: 214408
URL: http://svn.freebsd.org/changeset/base/214408

Log:
  MFC r213796:
    Rewrite interrupt handler to give fairness for both RX and TX.
    Previously rl(4) continuously checked whether there are RX events
    or TX completions in forever loop. This caused TX starvation under
    high RX load as well as consuming too much CPU cycles in the
    interrupt handler. If interrupt was shared with other devices which
    may be always true due to USB devices in these days, rl(4) also
    tried to process the interrupt. This means polling(4) was the only
    way to mitigate the these issues.
  
    To address these issues, rl(4) now disables interrupts when it
    knows the interrupt is ours and limit the number of iteration of
    the loop to 16. The interrupt would be enabled again before exiting
    interrupt handler if the driver is still running. Because RX buffer
    is 64KB in size, the number of iterations in the loop has nothing
    to do with number of RX packets being processed. This change
    ensures sending TX frames under high RX load.
  
    RX handler drops a driver lock to pass received frames to upper
    stack such that there is a window that user can down the interface.
    So rl(4) now checks whether driver is still running before serving
    RX or TX completion in the loop.
  
    While I'm here, exit interrupt handler when driver initialized
    controller.
  
    With this change, now rl(4) can send frames under high RX load even
    though the TX performance is still not good(rl(4) controllers can't
    queue more than 4 frames at a time so low TX performance was one of
    design issue of rl(4) controllers). It's much better than previous
    TX starvation and you should not notice RX performance drop with
    this change. Controller still shows poor performance under high
    network load but for many cases it's now usable without resorting
    to polling(4).

Modified:
  stable/7/sys/pci/if_rl.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/pci/if_rl.c
==============================================================================
--- stable/7/sys/pci/if_rl.c	Wed Oct 27 02:04:24 2010	(r214407)
+++ stable/7/sys/pci/if_rl.c	Wed Oct 27 02:07:25 2010	(r214408)
@@ -1613,6 +1613,7 @@ rl_intr(void *arg)
 	struct rl_softc		*sc = arg;
 	struct ifnet		*ifp = sc->rl_ifp;
 	uint16_t		status;
+	int			count;
 
 	RL_LOCK(sc);
 
@@ -1624,30 +1625,41 @@ rl_intr(void *arg)
 		goto done_locked;
 #endif
 
-	for (;;) {
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+		goto done_locked2;
+	status = CSR_READ_2(sc, RL_ISR);
+	if (status == 0xffff || (status & RL_INTRS) == 0)
+		goto done_locked;
+	/*
+	 * Ours, disable further interrupts.
+	 */
+	CSR_WRITE_2(sc, RL_IMR, 0);
+	for (count = 16; count > 0; count--) {
+		CSR_WRITE_2(sc, RL_ISR, status);
+		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+			if (status & (RL_ISR_RX_OK | RL_ISR_RX_ERR))
+				rl_rxeof(sc);
+			if (status & (RL_ISR_TX_OK | RL_ISR_TX_ERR))
+				rl_txeof(sc);
+			if (status & RL_ISR_SYSTEM_ERR) {
+				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+				rl_init_locked(sc);
+				RL_UNLOCK(sc);
+				return;
+			}
+		}
 		status = CSR_READ_2(sc, RL_ISR);
 		/* If the card has gone away, the read returns 0xffff. */
-		if (status == 0xffff)
+		if (status == 0xffff || (status & RL_INTRS) == 0)
 			break;
-		if (status != 0)
-			CSR_WRITE_2(sc, RL_ISR, status);
-		if ((status & RL_INTRS) == 0)
-			break;
-		if (status & RL_ISR_RX_OK)
-			rl_rxeof(sc);
-		if (status & RL_ISR_RX_ERR)
-			rl_rxeof(sc);
-		if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR))
-			rl_txeof(sc);
-		if (status & RL_ISR_SYSTEM_ERR) {
-			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-			rl_init_locked(sc);
-		}
 	}
 
 	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 		rl_start_locked(ifp);
 
+done_locked2:
+	if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+		CSR_WRITE_2(sc, RL_IMR, RL_INTRS);
 done_locked:
 	RL_UNLOCK(sc);
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 02:32: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 88D29106564A;
	Wed, 27 Oct 2010 02:32:54 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 77FAA8FC1C;
	Wed, 27 Oct 2010 02:32: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 o9R2Wsco084555;
	Wed, 27 Oct 2010 02:32:54 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9R2Wsu3084553;
	Wed, 27 Oct 2010 02:32:54 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
From: David Xu 
Date: Wed, 27 Oct 2010 02:32: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: r214409 - 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: Wed, 27 Oct 2010 02:32:54 -0000

Author: davidxu
Date: Wed Oct 27 02:32:54 2010
New Revision: 214409
URL: http://svn.freebsd.org/changeset/base/214409

Log:
  If input parameter cpusetsize is zero, give userland size of cpuset mask
  kernel is using.

Modified:
  head/sys/kern/kern_cpuset.c

Modified: head/sys/kern/kern_cpuset.c
==============================================================================
--- head/sys/kern/kern_cpuset.c	Wed Oct 27 02:07:25 2010	(r214408)
+++ head/sys/kern/kern_cpuset.c	Wed Oct 27 02:32:54 2010	(r214409)
@@ -889,6 +889,10 @@ cpuset_getaffinity(struct thread *td, st
 	int error;
 	size_t size;
 
+	if (uap->cpusetsize == 0) {
+		td->td_retval[0] = sizeof(cpuset_t);
+		return (0);
+	}
 	if (uap->cpusetsize < sizeof(cpuset_t) ||
 	    uap->cpusetsize > CPU_MAXSIZE / NBBY)
 		return (ERANGE);

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 02:43: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 82810106566B;
	Wed, 27 Oct 2010 02:43:06 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 976718FC1E;
	Wed, 27 Oct 2010 02:43:05 +0000 (UTC)
Received: by wwb24 with SMTP id 24so174413wwb.31
	for ; Tue, 26 Oct 2010 19:43:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=h/uXWnhOC1KT0bGUXhBAl1KfSXkhYrdGapSRAKipdKQ=;
	b=EvvyqaN+N+fEnGiA3jTxLZK3fDASoLYFnxlqZBg6QaanA+4Na9lXPLydJvvV8+Asn4
	c8+vkblGV+LIxDOdSPEc5BikihQeah1H5B52fvBz7q8vNSt7fA+AxH6HiuWoUASnqZ3E
	61oyZKcdIrCwezFMzeK4L/C+eM6a58742BpC4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=VuTITHWOcu+uZVgmReVEs8CKEmEqdRMQxCB9Lha2+zaDXf6vrNoalGF9gaSaCMu42W
	H2y83eS8Th7n+TR8b33Iwi1R6g/+T2pFaJbpwD8Ffn79uPJ8GcIwydM/e+1qkEPV4mJg
	16GFyArFE5Z+nx4xcdvrAWEbHUB2rjV+fpKiw=
MIME-Version: 1.0
Received: by 10.216.173.7 with SMTP id u7mr210310wel.50.1288147383254; Tue, 26
	Oct 2010 19:43:03 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.10.198 with HTTP; Tue, 26 Oct 2010 19:43:03 -0700 (PDT)
In-Reply-To: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
Date: Tue, 26 Oct 2010 19:43:03 -0700
X-Google-Sender-Auth: -glZ_QFwNUvxU71OBOY5nsp1NI8
Message-ID: 
From: Garrett Cooper 
To: David Xu 
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: r214409 - 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: Wed, 27 Oct 2010 02:43:06 -0000

On Tue, Oct 26, 2010 at 7:32 PM, David Xu  wrote:
> Author: davidxu
> Date: Wed Oct 27 02:32:54 2010
> New Revision: 214409
> URL: http://svn.freebsd.org/changeset/base/214409
>
> Log:
> =A0If input parameter cpusetsize is zero, give userland size of cpuset ma=
sk
> =A0kernel is using.
>
> Modified:
> =A0head/sys/kern/kern_cpuset.c
>
> Modified: head/sys/kern/kern_cpuset.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/kern/kern_cpuset.c Wed Oct 27 02:07:25 2010 =A0 =A0 =A0 =A0(=
r214408)
> +++ head/sys/kern/kern_cpuset.c Wed Oct 27 02:32:54 2010 =A0 =A0 =A0 =A0(=
r214409)
> @@ -889,6 +889,10 @@ cpuset_getaffinity(struct thread *td, st
> =A0 =A0 =A0 =A0int error;
> =A0 =A0 =A0 =A0size_t size;
>
> + =A0 =A0 =A0 if (uap->cpusetsize =3D=3D 0) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 td->td_retval[0] =3D sizeof(cpuset_t);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> + =A0 =A0 =A0 }
> =A0 =A0 =A0 =A0if (uap->cpusetsize < sizeof(cpuset_t) ||
> =A0 =A0 =A0 =A0 =A0 =A0uap->cpusetsize > CPU_MAXSIZE / NBBY)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (ERANGE);

    Isn't this requirement partly broken now?

     [ERANGE]           The cpusetsize was either preposterously large or
                        smaller than the kernel set size.

    Why should cpuset(2) be broken in favor of people not passing valid val=
ues?
Thanks,
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 02:49: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 E7DFB106566B;
	Wed, 27 Oct 2010 02:49:12 +0000 (UTC)
	(envelope-from davidxu@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id D54C58FC13;
	Wed, 27 Oct 2010 02:49:12 +0000 (UTC)
Received: from xyf.my.dom (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9R2nAJ5095111;
	Wed, 27 Oct 2010 02:49:11 GMT (envelope-from davidxu@freebsd.org)
Message-ID: <4CC803A8.3040602@freebsd.org>
Date: Wed, 27 Oct 2010 10:49:12 +0000
From: David Xu 
User-Agent: Thunderbird 2.0.0.24 (X11/20100630)
MIME-Version: 1.0
To: Garrett Cooper 
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 02:49:13 -0000

Garrett Cooper wrote:
> On Tue, Oct 26, 2010 at 7:32 PM, David Xu  wrote:
>> Author: davidxu
>> Date: Wed Oct 27 02:32:54 2010
>> New Revision: 214409
>> URL: http://svn.freebsd.org/changeset/base/214409
>>
>> Log:
>>  If input parameter cpusetsize is zero, give userland size of cpuset mask
>>  kernel is using.
>>
>> Modified:
>>  head/sys/kern/kern_cpuset.c
>>
>> Modified: head/sys/kern/kern_cpuset.c
>> ==============================================================================
>> --- head/sys/kern/kern_cpuset.c Wed Oct 27 02:07:25 2010        (r214408)
>> +++ head/sys/kern/kern_cpuset.c Wed Oct 27 02:32:54 2010        (r214409)
>> @@ -889,6 +889,10 @@ cpuset_getaffinity(struct thread *td, st
>>        int error;
>>        size_t size;
>>
>> +       if (uap->cpusetsize == 0) {
>> +               td->td_retval[0] = sizeof(cpuset_t);
>> +               return (0);
>> +       }
>>        if (uap->cpusetsize < sizeof(cpuset_t) ||
>>            uap->cpusetsize > CPU_MAXSIZE / NBBY)
>>                return (ERANGE);
> 
>     Isn't this requirement partly broken now?
> 
>      [ERANGE]           The cpusetsize was either preposterously large or
>                         smaller than the kernel set size.
> 
>     Why should cpuset(2) be broken in favor of people not passing valid values?
> Thanks,
> -Garrett
> 

I really hate to see such a problem that userland can not figure out
what kernel is using, I try hardly to guess, but still can not find
what it is using. yes, I think the doc may need to be fixed or
another syscall is needed.


From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 03:10: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 5AC4D106566C;
	Wed, 27 Oct 2010 03:10:43 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DF178FC18;
	Wed, 27 Oct 2010 03:10:42 +0000 (UTC)
Received: by wyb42 with SMTP id 42so208042wyb.13
	for ; Tue, 26 Oct 2010 20:10:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=HH6PN73P7eMsBlKzcqfrrKpkoJwME17Pa6ugKOAACOc=;
	b=pVNH1fituXFYRorCacq6vh/yWtHUyvMLY6OyJ0cDLPY7WV/xsYPw2ausluiNrmBlCH
	TIHWFro7fyWUN/XYjHajPAVbRqknGhyesNovuLQRAuWzadjiCpJVm2SeRZBfJbXX9uZy
	Ydkz9AMzclrkuDjMSmuHZZ+CudeKduxvWYrQk=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=pa66NpKY1Jyx97E27vrF0P2J2qXJElvuBJ23F8K44MbmBVYUMObUqmu9gvSl1EJEW4
	OUF/hK+wT3rhnzoD9iLHhzJK4soJxcpNf9hm/JcmFipPu6CWvmnYqBFnSulY8fdjVxR0
	2KIY9gxHJXa0XxkqN/3EZuefiMO8d6lMLaf5M=
MIME-Version: 1.0
Received: by 10.216.231.82 with SMTP id k60mr1893751weq.64.1288149041286; Tue,
	26 Oct 2010 20:10:41 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.10.198 with HTTP; Tue, 26 Oct 2010 20:10:41 -0700 (PDT)
In-Reply-To: <4CC803A8.3040602@freebsd.org>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
Date: Tue, 26 Oct 2010 20:10:41 -0700
X-Google-Sender-Auth: VrpRtpbwABd_53udK2ZH0LgXm0M
Message-ID: 
From: Garrett Cooper 
To: David Xu 
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: r214409 - 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: Wed, 27 Oct 2010 03:10:43 -0000

On Wed, Oct 27, 2010 at 3:49 AM, David Xu  wrote:
> Garrett Cooper wrote:
>>
>> On Tue, Oct 26, 2010 at 7:32 PM, David Xu  wrote:
>>>
>>> Author: davidxu
>>> Date: Wed Oct 27 02:32:54 2010
>>> New Revision: 214409
>>> URL: http://svn.freebsd.org/changeset/base/214409
>>>
>>> Log:
>>> =A0If input parameter cpusetsize is zero, give userland size of cpuset =
mask
>>> =A0kernel is using.
>>>
>>> Modified:
>>> =A0head/sys/kern/kern_cpuset.c
>>>
>>> Modified: head/sys/kern/kern_cpuset.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/kern/kern_cpuset.c Wed Oct 27 02:07:25 2010 =A0 =A0 =A0 =
=A0(r214408)
>>> +++ head/sys/kern/kern_cpuset.c Wed Oct 27 02:32:54 2010 =A0 =A0 =A0 =
=A0(r214409)
>>> @@ -889,6 +889,10 @@ cpuset_getaffinity(struct thread *td, st
>>> =A0 =A0 =A0 int error;
>>> =A0 =A0 =A0 size_t size;
>>>
>>> + =A0 =A0 =A0 if (uap->cpusetsize =3D=3D 0) {
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 td->td_retval[0] =3D sizeof(cpuset_t);
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
>>> + =A0 =A0 =A0 }
>>> =A0 =A0 =A0 if (uap->cpusetsize < sizeof(cpuset_t) ||
>>> =A0 =A0 =A0 =A0 =A0 uap->cpusetsize > CPU_MAXSIZE / NBBY)
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (ERANGE);
>>
>> =A0 =A0Isn't this requirement partly broken now?
>>
>> =A0 =A0 [ERANGE] =A0 =A0 =A0 =A0 =A0 The cpusetsize was either preposter=
ously large or
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0smaller than the kernel s=
et size.
>>
>> =A0 =A0Why should cpuset(2) be broken in favor of people not passing val=
id
>> values?
>
> I really hate to see such a problem that userland can not figure out
> what kernel is using, I try hardly to guess, but still can not find
> what it is using. yes, I think the doc may need to be fixed or
> another syscall is needed.

    Well... Jeff's code in cpuset(1) does some trivial sizeof(mask)
's, but it just passes in cpuset_t for mask. I've seen different
calling conventions at the kernel level when I tried to get my brain
in sync with that for a bug I was looking at a few weeks ago (and
sadly, failed to some degree).
    These syscalls are a bit confusing though, and apart from
cpuset(1) there aren't any really good examples in the sourcebase on
how to use them (at least not the last time I checked)...
Thanks,
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 03:19: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 ADA6A106564A;
	Wed, 27 Oct 2010 03:19:22 +0000 (UTC)
	(envelope-from davidxu@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 7F0E58FC15;
	Wed, 27 Oct 2010 03:19:22 +0000 (UTC)
Received: from xyf.my.dom (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9R3JKqE027667;
	Wed, 27 Oct 2010 03:19:21 GMT (envelope-from davidxu@freebsd.org)
Message-ID: <4CC80ABA.3080404@freebsd.org>
Date: Wed, 27 Oct 2010 11:19:22 +0000
From: David Xu 
User-Agent: Thunderbird 2.0.0.24 (X11/20100630)
MIME-Version: 1.0
To: Garrett Cooper 
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>		<4CC803A8.3040602@freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 03:19:22 -0000

Garrett Cooper wrote:
> On Wed, Oct 27, 2010 at 3:49 AM, David Xu  wrote:
>> Garrett Cooper wrote:
>>> On Tue, Oct 26, 2010 at 7:32 PM, David Xu  wrote:
>>>> Author: davidxu
>>>> Date: Wed Oct 27 02:32:54 2010
>>>> New Revision: 214409
>>>> URL: http://svn.freebsd.org/changeset/base/214409
>>>>
>>>> Log:
>>>>  If input parameter cpusetsize is zero, give userland size of cpuset mask
>>>>  kernel is using.
>>>>
>>>> Modified:
>>>>  head/sys/kern/kern_cpuset.c
>>>>
>>>> Modified: head/sys/kern/kern_cpuset.c
>>>>
>>>> ==============================================================================
>>>> --- head/sys/kern/kern_cpuset.c Wed Oct 27 02:07:25 2010        (r214408)
>>>> +++ head/sys/kern/kern_cpuset.c Wed Oct 27 02:32:54 2010        (r214409)
>>>> @@ -889,6 +889,10 @@ cpuset_getaffinity(struct thread *td, st
>>>>       int error;
>>>>       size_t size;
>>>>
>>>> +       if (uap->cpusetsize == 0) {
>>>> +               td->td_retval[0] = sizeof(cpuset_t);
>>>> +               return (0);
>>>> +       }
>>>>       if (uap->cpusetsize < sizeof(cpuset_t) ||
>>>>           uap->cpusetsize > CPU_MAXSIZE / NBBY)
>>>>               return (ERANGE);
>>>    Isn't this requirement partly broken now?
>>>
>>>     [ERANGE]           The cpusetsize was either preposterously large or
>>>                        smaller than the kernel set size.
>>>
>>>    Why should cpuset(2) be broken in favor of people not passing valid
>>> values?
>> I really hate to see such a problem that userland can not figure out
>> what kernel is using, I try hardly to guess, but still can not find
>> what it is using. yes, I think the doc may need to be fixed or
>> another syscall is needed.
> 
>     Well... Jeff's code in cpuset(1) does some trivial sizeof(mask)
> 's, but it just passes in cpuset_t for mask. I've seen different
> calling conventions at the kernel level when I tried to get my brain
> in sync with that for a bug I was looking at a few weeks ago (and
> sadly, failed to some degree).
>     These syscalls are a bit confusing though, and apart from
> cpuset(1) there aren't any really good examples in the sourcebase on
> how to use them (at least not the last time I checked)...
> Thanks,
> -Garrett
> 
The problem is that the size of cpuset is not fixed, it is tunable
by the recompiling kernel with different parameter, so if you have
a program which you want to adapt it to use any size of cpuset,
it should be able to get the size the kernel is using, if you
don't have source code of the program, you can not compile it
with new parameter, then there is trouble.






From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 04: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 3D96D106564A;
	Wed, 27 Oct 2010 04:19:08 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C57F8FC14;
	Wed, 27 Oct 2010 04: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 o9R4J8Tl088083;
	Wed, 27 Oct 2010 04:19:08 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9R4J8Mj088081;
	Wed, 27 Oct 2010 04:19:08 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201010270419.o9R4J8Mj088081@svn.freebsd.org>
From: David Xu 
Date: Wed, 27 Oct 2010 04: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: r214410 - head/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, 27 Oct 2010 04:19:08 -0000

Author: davidxu
Date: Wed Oct 27 04:19:07 2010
New Revision: 214410
URL: http://svn.freebsd.org/changeset/base/214410

Log:
  Remove locking and unlock in pthread_mutex_destroy, because
  it can not fix race condition in application code, as a result,
  the problem described in PR threads/151767 is avoided.

Modified:
  head/lib/libthr/thread/thr_mutex.c

Modified: head/lib/libthr/thread/thr_mutex.c
==============================================================================
--- head/lib/libthr/thread/thr_mutex.c	Wed Oct 27 02:32:54 2010	(r214409)
+++ head/lib/libthr/thread/thr_mutex.c	Wed Oct 27 04:19:07 2010	(r214410)
@@ -257,10 +257,8 @@ _mutex_fork(struct pthread *curthread)
 int
 _pthread_mutex_destroy(pthread_mutex_t *mutex)
 {
-	struct pthread *curthread = _get_curthread();
 	pthread_mutex_t m;
-	uint32_t id;
-	int ret = 0;
+	int ret;
 
 	m = *mutex;
 	if (m < THR_MUTEX_DESTROYED) {
@@ -268,34 +266,13 @@ _pthread_mutex_destroy(pthread_mutex_t *
 	} else if (m == THR_MUTEX_DESTROYED) {
 		ret = EINVAL;
 	} else {
-		id = TID(curthread);
-
-		/*
-		 * Try to lock the mutex structure, we only need to
-		 * try once, if failed, the mutex is in used.
-		 */
-		ret = _thr_umutex_trylock(&m->m_lock, id);
-		if (ret)
-			return (ret);
-		/*
-		 * Check mutex other fields to see if this mutex is
-		 * in use. Mostly for prority mutex types, or there
-		 * are condition variables referencing it.
-		 */
 		if (m->m_owner != NULL || m->m_refcount != 0) {
-			if (m->m_lock.m_flags & UMUTEX_PRIO_PROTECT)
-				set_inherited_priority(curthread, m);
-			_thr_umutex_unlock(&m->m_lock, id);
 			ret = EBUSY;
 		} else {
 			*mutex = THR_MUTEX_DESTROYED;
-
-			if (m->m_lock.m_flags & UMUTEX_PRIO_PROTECT)
-				set_inherited_priority(curthread, m);
-			_thr_umutex_unlock(&m->m_lock, id);
-
 			MUTEX_ASSERT_NOT_OWNED(m);
 			free(m);
+			ret = 0;
 		}
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 07:14: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 F12781065672;
	Wed, 27 Oct 2010 07:14:46 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D7CB18FC17;
	Wed, 27 Oct 2010 07:14: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 o9R7EkQu093417;
	Wed, 27 Oct 2010 07:14:46 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9R7EkHU093412;
	Wed, 27 Oct 2010 07:14:46 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201010270714.o9R7EkHU093412@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 27 Oct 2010 07:14: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: r214411 - in head/contrib/tzcode: stdtime zic
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 07:14:47 -0000

Author: edwin
Date: Wed Oct 27 07:14:46 2010
New Revision: 214411
URL: http://svn.freebsd.org/changeset/base/214411

Log:
  Sync code with tzcode2010m
  
  asctime.c:
  * Set errno to EINVAL and return "??? ??? ?? ??:??:?? ????\n" if
    asctime_r is called with a NULL struct tm pointer.  (Note that
    asctime_r is called by ctime_r and asctime; asctime is called by
    ctime.)
  
  localtime.c:
  * Set errno to EINVAL and return WRONG if time1 is called with a
    NULL struct tm pointer; avoid dereference if a NULL struct tm
    pointer is passed to timelocal, timegm, or timeoff.  (Note that
    time1 is called by mktime, timegm, and timeoff; mktime is called
    by timelocal.)
  * more core-avoidance work
  * Change to set timezone and altzone based on time types with
    greatest transition times (for the benefit of Asia/Seoul).
  
  zic.8:
  * Warning about case-sensitivity of names, but not of abbrevations
  
  zic.c:
  * Conditionally output extra types with most-recently-use offsets
    last (for use by systems with pre-2011 versions of localtime.c,
    helping to ensure that globals "altzone and "timezone" get set
    correctly).
  
  The code has been running for nearly four weeks on my laptop running
  FreeBSD 8.1 without a problem.
  
  MFC after:	1 month

Modified:
  head/contrib/tzcode/stdtime/asctime.c
  head/contrib/tzcode/stdtime/localtime.c
  head/contrib/tzcode/zic/zic.8
  head/contrib/tzcode/zic/zic.c

Modified: head/contrib/tzcode/stdtime/asctime.c
==============================================================================
--- head/contrib/tzcode/stdtime/asctime.c	Wed Oct 27 04:19:07 2010	(r214410)
+++ head/contrib/tzcode/stdtime/asctime.c	Wed Oct 27 07:14:46 2010	(r214411)
@@ -12,7 +12,7 @@
 #include 
 #ifndef lint
 #ifndef NOID
-static char	elsieid[] __unused = "@(#)asctime.c	8.2";
+static char	elsieid[] __unused = "@(#)asctime.c	8.5";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 __FBSDID("$FreeBSD$");
@@ -95,6 +95,10 @@ char *			buf;
 	char			year[INT_STRLEN_MAXIMUM(int) + 2];
 	char			result[MAX_ASCTIME_BUF_SIZE];
 
+	if (timeptr == NULL) {
+		errno = EINVAL;
+		return strcpy(buf, "??? ??? ?? ??:??:?? ????\n");
+	}
 	if (timeptr->tm_wday < 0 || timeptr->tm_wday >= DAYSPERWEEK)
 		wn = "???";
 	else	wn = wday_name[timeptr->tm_wday];
@@ -117,10 +121,9 @@ char *			buf;
 		timeptr->tm_mday, timeptr->tm_hour,
 		timeptr->tm_min, timeptr->tm_sec,
 		year);
-	if (strlen(result) < STD_ASCTIME_BUF_SIZE || buf == buf_asctime) {
-		(void) strcpy(buf, result);
-		return buf;
-	} else {
+	if (strlen(result) < STD_ASCTIME_BUF_SIZE || buf == buf_asctime)
+		return strcpy(buf, result);
+	else {
 #ifdef EOVERFLOW
 		errno = EOVERFLOW;
 #else /* !defined EOVERFLOW */

Modified: head/contrib/tzcode/stdtime/localtime.c
==============================================================================
--- head/contrib/tzcode/stdtime/localtime.c	Wed Oct 27 04:19:07 2010	(r214410)
+++ head/contrib/tzcode/stdtime/localtime.c	Wed Oct 27 07:14:46 2010	(r214411)
@@ -6,7 +6,7 @@
 #include 
 #ifndef lint
 #ifndef NOID
-static char	elsieid[] __unused = "@(#)localtime.c	8.9";
+static char	elsieid[] __unused = "@(#)localtime.c	8.14";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 __FBSDID("$FreeBSD$");
@@ -315,34 +315,26 @@ settzname(void)
 		return;
 	}
 #endif /* defined ALL_STATE */
+	/*
+	** And to get the latest zone names into tzname. . .
+	*/
 	for (i = 0; i < sp->typecnt; ++i) {
-		const struct ttinfo * const	ttisp = &sp->ttis[i];
+		const struct ttinfo * const ttisp = &sp->ttis[sp->types[i]];
 
 		tzname[ttisp->tt_isdst] =
 			&sp->chars[ttisp->tt_abbrind];
 #ifdef USG_COMPAT
 		if (ttisp->tt_isdst)
 			daylight = 1;
-		if (i == 0 || !ttisp->tt_isdst)
+		if (!ttisp->tt_isdst)
 			timezone = -(ttisp->tt_gmtoff);
 #endif /* defined USG_COMPAT */
 #ifdef ALTZONE
-		if (i == 0 || ttisp->tt_isdst)
+		if (ttisp->tt_isdst)
 			altzone = -(ttisp->tt_gmtoff);
 #endif /* defined ALTZONE */
 	}
 	/*
-	** And to get the latest zone names into tzname. . .
-	*/
-	for (i = 0; i < sp->timecnt; ++i) {
-		const struct ttinfo * const	ttisp =
-							&sp->ttis[
-								sp->types[i]];
-
-		tzname[ttisp->tt_isdst] =
-			&sp->chars[ttisp->tt_abbrind];
-	}
-	/*
 	** Finally, scrub the abbreviations.
 	** First, replace bogus characters.
 	*/
@@ -395,6 +387,8 @@ register const int	doextend;
 					4 * TZ_MAX_TIMES];
 	} u;
 
+	sp->goback = sp->goahead = FALSE;
+
 	/* XXX The following is from OpenBSD, and I'm not sure it is correct */
 	if (name != NULL && issetugid() != 0)
 		if ((name[0] == ':' && name[1] == '/') || 
@@ -610,7 +604,6 @@ register const int	doextend;
 					sp->ttis[sp->typecnt++] = ts.ttis[1];
 			}
 	}
-	sp->goback = sp->goahead = FALSE;
 	if (sp->timecnt > 1) {
 		for (i = 1; i < sp->timecnt; ++i)
 			if (typesequiv(sp, sp->types[i], sp->types[0]) &&
@@ -1221,7 +1214,7 @@ tzsetwall_basic(int rdlocked)
 
 #ifdef ALL_STATE
 	if (lclptr == NULL) {
-		lclptr = (struct state *) malloc(sizeof *lclptr);
+		lclptr = (struct state *) calloc(1, sizeof *lclptr);
 		if (lclptr == NULL) {
 			settzname();	/* all we can do */
 			_RWLOCK_UNLOCK(&lcl_rwlock);
@@ -1273,7 +1266,7 @@ tzset_basic(int rdlocked)
 
 #ifdef ALL_STATE
 	if (lclptr == NULL) {
-		lclptr = (struct state *) malloc(sizeof *lclptr);
+		lclptr = (struct state *) calloc(1, sizeof *lclptr);
 		if (lclptr == NULL) {
 			settzname();	/* all we can do */
 			_RWLOCK_UNLOCK(&lcl_rwlock);
@@ -1471,7 +1464,7 @@ gmt_init(void)
 {
 
 #ifdef ALL_STATE
-	gmtptr = (struct state *) malloc(sizeof *gmtptr);
+	gmtptr = (struct state *) calloc(1, sizeof *gmtptr);
 	if (gmtptr != NULL)
 #endif /* defined ALL_STATE */
 		gmtload(gmtptr);
@@ -2054,6 +2047,11 @@ const long		offset;
 	int				types[TZ_MAX_TYPES];
 	int				okay;
 
+	if (tmp == NULL) {
+		errno = EINVAL;
+		return WRONG;
+	}
+
 	if (tmp->tm_isdst > 1)
 		tmp->tm_isdst = 1;
 	t = time2(tmp, funcp, offset, &okay);
@@ -2129,7 +2127,8 @@ time_t
 timelocal(tmp)
 struct tm * const	tmp;
 {
-	tmp->tm_isdst = -1;	/* in case it wasn't initialized */
+	if (tmp != NULL)
+		tmp->tm_isdst = -1;	/* in case it wasn't initialized */
 	return mktime(tmp);
 }
 
@@ -2137,7 +2136,8 @@ time_t
 timegm(tmp)
 struct tm * const	tmp;
 {
-	tmp->tm_isdst = 0;
+	if (tmp != NULL)
+		tmp->tm_isdst = 0;
 	return time1(tmp, gmtsub, 0L);
 }
 
@@ -2146,7 +2146,8 @@ timeoff(tmp, offset)
 struct tm * const	tmp;
 const long		offset;
 {
-	tmp->tm_isdst = 0;
+	if (tmp != NULL)
+		tmp->tm_isdst = 0;
 	return time1(tmp, gmtsub, offset);
 }
 

Modified: head/contrib/tzcode/zic/zic.8
==============================================================================
--- head/contrib/tzcode/zic/zic.8	Wed Oct 27 04:19:07 2010	(r214410)
+++ head/contrib/tzcode/zic/zic.8	Wed Oct 27 07:14:46 2010	(r214411)
@@ -119,6 +119,9 @@ Any line that is blank (after comment st
 Non-blank lines are expected to be of one of three types:
 rule lines, zone lines, and link lines.
 .Pp
+Names (such as month names) must be in English and are case insensitive.
+Abbreviations, if used, must be unambiguous in context.
+.Pp
 A rule line has the form:
 .Dl "Rule	NAME	FROM	TO	TYPE	IN	ON		AT	SAVE	LETTER/S"
 For example:
@@ -460,6 +463,6 @@ standard directory used for created file
 .Xr ctime 3 ,
 .Xr tzfile 5 ,
 .Xr zdump 8
-.\" @(#)zic.8	8.5
+.\" @(#)zic.8	8.6
 .\" This file is in the public domain, so clarified as of
 .\" 2009-05-17 by Arthur David Olson.

Modified: head/contrib/tzcode/zic/zic.c
==============================================================================
--- head/contrib/tzcode/zic/zic.c	Wed Oct 27 04:19:07 2010	(r214410)
+++ head/contrib/tzcode/zic/zic.c	Wed Oct 27 07:14:46 2010	(r214411)
@@ -3,7 +3,7 @@
 ** 2006-07-17 by Arthur David Olson.
 */
 
-static const char	elsieid[] = "@(#)zic.c	8.20";
+static const char	elsieid[] = "@(#)zic.c	8.22";
 
 #ifndef lint
 static const char rcsid[] =
@@ -1588,6 +1588,53 @@ const char * const	string;
 			if (thistimei == 0)
 				writetype[0] = TRUE;
 		}
+#ifndef LEAVE_SOME_PRE_2011_SYSTEMS_IN_THE_LURCH
+		/*
+		** For some pre-2011 systems: if the last-to-be-written
+		** standard (or daylight) type has an offset different from the
+		** most recently used offset,
+		** append an (unused) copy of the most recently used type
+		** (to help get global "altzone" and "timezone" variables
+		** set correctly).
+		*/
+		{
+			register int	mrudst, mrustd, hidst, histd, type;
+
+			hidst = histd = mrudst = mrustd = -1;
+			for (i = thistimei; i < thistimelim; ++i)
+				if (isdsts[types[i]])
+					mrudst = types[i];
+				else	mrustd = types[i];
+			for (i = 0; i < typecnt; ++i)
+				if (writetype[i]) {
+					if (isdsts[i])
+						hidst = i;
+					else	histd = i;
+				}
+			if (hidst >= 0 && mrudst >= 0 && hidst != mrudst &&
+				gmtoffs[hidst] != gmtoffs[mrudst]) {
+					isdsts[mrudst] = -1;
+					type = addtype(gmtoffs[mrudst],
+						&chars[abbrinds[mrudst]],
+						TRUE,
+						ttisstds[mrudst],
+						ttisgmts[mrudst]);
+					isdsts[mrudst] = TRUE;
+					writetype[type] = TRUE;
+			}
+			if (histd >= 0 && mrustd >= 0 && histd != mrustd &&
+				gmtoffs[histd] != gmtoffs[mrustd]) {
+					isdsts[mrustd] = -1;
+					type = addtype(gmtoffs[mrustd],
+						&chars[abbrinds[mrustd]],
+						FALSE,
+						ttisstds[mrustd],
+						ttisgmts[mrustd]);
+					isdsts[mrustd] = FALSE;
+					writetype[type] = TRUE;
+			}
+		}
+#endif /* !defined LEAVE_SOME_PRE_2011_SYSTEMS_IN_THE_LURCH */
 		thistypecnt = 0;
 		for (i = 0; i < typecnt; ++i)
 			typemap[i] = writetype[i] ?  thistypecnt++ : -1;

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 08:22: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 5DD50106566B;
	Wed, 27 Oct 2010 08:22:05 +0000 (UTC)
	(envelope-from pjd@garage.freebsd.pl)
Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60])
	by mx1.freebsd.org (Postfix) with ESMTP id F1D538FC0A;
	Wed, 27 Oct 2010 08:22:04 +0000 (UTC)
Received: by mail.garage.freebsd.pl (Postfix, from userid 65534)
	id A73F745C89; Wed, 27 Oct 2010 10:22:03 +0200 (CEST)
Received: from localhost (chello089073192049.chello.pl [89.73.192.49])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.garage.freebsd.pl (Postfix) with ESMTP id 9A03645CAC;
	Wed, 27 Oct 2010 10:21:57 +0200 (CEST)
Date: Wed, 27 Oct 2010 10:21:22 +0200
From: Pawel Jakub Dawidek 
To: David Xu 
Message-ID: <20101027082122.GD1848@garage.freebsd.pl>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="8w3uRX/HFJGApMzv"
Content-Disposition: inline
In-Reply-To: <4CC803A8.3040602@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, Garrett Cooper 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 08:22:05 -0000


--8w3uRX/HFJGApMzv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Oct 27, 2010 at 10:49:12AM +0000, David Xu wrote:
> I really hate to see such a problem that userland can not figure out
> what kernel is using, I try hardly to guess, but still can not find
> what it is using. yes, I think the doc may need to be fixed or
> another syscall is needed.

Maybe you could just add sysctl and eventually put it into sysconf(3)?

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--8w3uRX/HFJGApMzv
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAkzH4QIACgkQForvXbEpPzQIiQCfdrTmyy9IcqdG34BaTxv51mtG
Af0Anj3Wv1q4GLBXk0IGIHwKBYuUCQzP
=oJAe
-----END PGP SIGNATURE-----

--8w3uRX/HFJGApMzv--

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 08:37: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 6CD1A106566B;
	Wed, 27 Oct 2010 08:37:38 +0000 (UTC)
	(envelope-from davidxu@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 58BAC8FC19;
	Wed, 27 Oct 2010 08:37:38 +0000 (UTC)
Received: from xyf.my.dom (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9R8ba3k092394;
	Wed, 27 Oct 2010 08:37:37 GMT (envelope-from davidxu@freebsd.org)
Message-ID: <4CC85552.2020100@freebsd.org>
Date: Wed, 27 Oct 2010 16:37:38 +0000
From: David Xu 
User-Agent: Thunderbird 2.0.0.24 (X11/20100630)
MIME-Version: 1.0
To: Pawel Jakub Dawidek 
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	<20101027082122.GD1848@garage.freebsd.pl>
In-Reply-To: <20101027082122.GD1848@garage.freebsd.pl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Garrett Cooper 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 08:37:38 -0000

Pawel Jakub Dawidek wrote:
> On Wed, Oct 27, 2010 at 10:49:12AM +0000, David Xu wrote:
>> I really hate to see such a problem that userland can not figure out
>> what kernel is using, I try hardly to guess, but still can not find
>> what it is using. yes, I think the doc may need to be fixed or
>> another syscall is needed.
> 
> Maybe you could just add sysctl and eventually put it into sysconf(3)?
> 

I just found a dirty method, use sizeof(long) and kern.smp.maxcpus
32 to figure out the size the kernel is using, because it is how
cpuset_t is constructed, wish it will never be changed. ;-)



From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 08:39: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 C50441065673;
	Wed, 27 Oct 2010 08:39:53 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by mx1.freebsd.org (Postfix) with ESMTP id A9A3D8FC18;
	Wed, 27 Oct 2010 08:39:52 +0000 (UTC)
Received: by wyb42 with SMTP id 42so424304wyb.13
	for ; Wed, 27 Oct 2010 01:39:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type;
	bh=Qm/7qYv4HOuqs0A4W0DQIxS8BXURo065sMpU07NrGkU=;
	b=hGALf0bk4WP45hgmXTxHNTf4zudAyoE8xQfXbzE6EjPtUbx3Puo8nA9DnJldqfMRu/
	OxRmEeA3UimAXaLPiH+gn2E8YrM8MtnNbFEb7RPPt5pMWqApPIuGSA+bb7OTi0tjD8Wk
	HRs0r+qxRg3/zBaW2K/Sb/06zjfkNc+gFlcRc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	b=jOw2Rgzcf97cdxqNTPFXZq84vS8K12Wcfi0sPr7I8oYRv3e9jvRqq0SFFddNs217gw
	xqz9cVmeYOp7FtPnQ8HEUb78ILqff2f59d37uSTWg5cHZXF8U0UYeVpJb9L67TCyfHl+
	TuJn0q+nJlh9ewwbHvdx+QNzvfAGhN18Z05b0=
MIME-Version: 1.0
Received: by 10.216.63.77 with SMTP id z55mr4204510wec.66.1288168791204; Wed,
	27 Oct 2010 01:39:51 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.10.198 with HTTP; Wed, 27 Oct 2010 01:39:51 -0700 (PDT)
In-Reply-To: <4CC85552.2020100@freebsd.org>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	<20101027082122.GD1848@garage.freebsd.pl>
	<4CC85552.2020100@freebsd.org>
Date: Wed, 27 Oct 2010 01:39:51 -0700
X-Google-Sender-Auth: ugvGh5K3n0vYSeQlfY9269s0NYI
Message-ID: 
From: Garrett Cooper 
To: David Xu 
Content-Type: text/plain; charset=ISO-8859-1
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Pawel Jakub Dawidek 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 08:39:53 -0000

On Wed, Oct 27, 2010 at 9:37 AM, David Xu  wrote:
> Pawel Jakub Dawidek wrote:
>>
>> On Wed, Oct 27, 2010 at 10:49:12AM +0000, David Xu wrote:
>>>
>>> I really hate to see such a problem that userland can not figure out
>>> what kernel is using, I try hardly to guess, but still can not find
>>> what it is using. yes, I think the doc may need to be fixed or
>>> another syscall is needed.
>>
>> Maybe you could just add sysctl and eventually put it into sysconf(3)?
>
> I just found a dirty method, use sizeof(long) and kern.smp.maxcpus
> 32 to figure out the size the kernel is using, because it is how
> cpuset_t is constructed, wish it will never be changed. ;-)

Pawel's suggestion makes more sense to be honest. If this should be
added to sysconf(3) and is worthy of abstracting out into a more
generalized concept, then it might be a good idea to get into POSIX.
However, it would need to be hashed out because the current
implementation is very FreeBSD centric of course :).

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 09:29: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 3BCB6106564A;
	Wed, 27 Oct 2010 09:29:04 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2A0AC8FC08;
	Wed, 27 Oct 2010 09:29: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 o9R9T4NO097926;
	Wed, 27 Oct 2010 09:29:04 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9R9T4oI097923;
	Wed, 27 Oct 2010 09:29:04 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201010270929.o9R9T4oI097923@svn.freebsd.org>
From: David Xu 
Date: Wed, 27 Oct 2010 09:29: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: r214412 - in head: lib/libthr/thread 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: Wed, 27 Oct 2010 09:29:04 -0000

Author: davidxu
Date: Wed Oct 27 09:29:03 2010
New Revision: 214412
URL: http://svn.freebsd.org/changeset/base/214412

Log:
  - Revert r214409.
  - Use long word to figure out sizeof kernel cpuset, hope it works.

Modified:
  head/lib/libthr/thread/thr_attr.c
  head/sys/kern/kern_cpuset.c

Modified: head/lib/libthr/thread/thr_attr.c
==============================================================================
--- head/lib/libthr/thread/thr_attr.c	Wed Oct 27 07:14:46 2010	(r214411)
+++ head/lib/libthr/thread/thr_attr.c	Wed Oct 27 09:29:03 2010	(r214412)
@@ -574,13 +574,14 @@ _get_kern_cpuset_size(void)
 
 	if (kern_cpuset_size == 0) {
 		size_t len;
+		int maxcpus;
 
-		len = sizeof(kern_cpuset_size);
-		if (sysctlbyname("kern.smp.maxcpus", &kern_cpuset_size,
-		    &len, NULL, 0))
+		len = sizeof(maxcpus);
+		if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &len, NULL, 0))
 			PANIC("failed to get sysctl kern.smp.maxcpus");
-
-		kern_cpuset_size = (kern_cpuset_size + 7) / 8;
+		int nbits_long = sizeof(long) * NBBY;
+		int num_long = (maxcpus + nbits_long - 1) / nbits_long;
+		kern_cpuset_size = num_long * sizeof(long);
 	}
 
 	return (kern_cpuset_size);

Modified: head/sys/kern/kern_cpuset.c
==============================================================================
--- head/sys/kern/kern_cpuset.c	Wed Oct 27 07:14:46 2010	(r214411)
+++ head/sys/kern/kern_cpuset.c	Wed Oct 27 09:29:03 2010	(r214412)
@@ -889,10 +889,6 @@ cpuset_getaffinity(struct thread *td, st
 	int error;
 	size_t size;
 
-	if (uap->cpusetsize == 0) {
-		td->td_retval[0] = sizeof(cpuset_t);
-		return (0);
-	}
 	if (uap->cpusetsize < sizeof(cpuset_t) ||
 	    uap->cpusetsize > CPU_MAXSIZE / NBBY)
 		return (ERANGE);

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 09:34: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 EB5541065674;
	Wed, 27 Oct 2010 09:33:59 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 0F8F88FC13;
	Wed, 27 Oct 2010 09:33:58 +0000 (UTC)
Received: by wwb24 with SMTP id 24so440930wwb.31
	for ; Wed, 27 Oct 2010 02:33:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=9XkILs/4XLvbZXQDJc9Ktalfgr3ENzv8gaVYo8KOHNI=;
	b=chRNYyPBE4hrhpS18+Sq9v4C5nX2rS4gp1GzguA3OiCex0iiMcnNz40wt+TvXu7QVE
	CxqqYDfrsAmHutuSJNfGpKd0i0l5coHKd6pVWqSbfKRC2DLyAJvMUf13oWvtm04UvewO
	h+RrZFSudNskMKnCZf3kvWwJWSoT5zdhU99qo=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=PXDUDCN39GVuOrnYtUHuNY1Z6R2i9eeQJzjvVycTqheO4+wF+wR5ZvTT68hN+vVuyP
	Q2kw7OmsV3407c0o5QO6SFt7+ntwDpDy07jHOFqdnsd4FlFby9g3DMVBLBj3DYnHGaDI
	clsoyWea5BFixCkjvKnC7rgl5HC6mHGKRqOYQ=
MIME-Version: 1.0
Received: by 10.216.141.14 with SMTP id f14mr554515wej.22.1288172037937; Wed,
	27 Oct 2010 02:33:57 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.10.198 with HTTP; Wed, 27 Oct 2010 02:33:57 -0700 (PDT)
In-Reply-To: <201010270929.o9R9T4oI097923@svn.freebsd.org>
References: <201010270929.o9R9T4oI097923@svn.freebsd.org>
Date: Wed, 27 Oct 2010 02:33:57 -0700
X-Google-Sender-Auth: olxstP0f6CgCcQgA8nlcet7JgSY
Message-ID: 
From: Garrett Cooper 
To: David Xu 
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: r214412 - in head: lib/libthr/thread 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: Wed, 27 Oct 2010 09:34:00 -0000

On Wed, Oct 27, 2010 at 2:29 AM, David Xu  wrote:
> Author: davidxu
> Date: Wed Oct 27 09:29:03 2010
> New Revision: 214412
> URL: http://svn.freebsd.org/changeset/base/214412
>
> Log:
> =A0- Revert r214409.
> =A0- Use long word to figure out sizeof kernel cpuset, hope it works.
>
> Modified:
> =A0head/lib/libthr/thread/thr_attr.c
> =A0head/sys/kern/kern_cpuset.c
>
> Modified: head/lib/libthr/thread/thr_attr.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/lib/libthr/thread/thr_attr.c =A0 Wed Oct 27 07:14:46 2010 =A0 =
=A0 =A0 =A0(r214411)
> +++ head/lib/libthr/thread/thr_attr.c =A0 Wed Oct 27 09:29:03 2010 =A0 =
=A0 =A0 =A0(r214412)
> @@ -574,13 +574,14 @@ _get_kern_cpuset_size(void)
>
> =A0 =A0 =A0 =A0if (kern_cpuset_size =3D=3D 0) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0size_t len;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 int maxcpus;
>
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 len =3D sizeof(kern_cpuset_size);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sysctlbyname("kern.smp.maxcpus", &kern_=
cpuset_size,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &len, NULL, 0))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 len =3D sizeof(maxcpus);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sysctlbyname("kern.smp.maxcpus", &maxcp=
us, &len, NULL, 0))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PANIC("failed to get sysct=
l kern.smp.maxcpus");
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 kern_cpuset_size =3D (kern_cpuset_size + 7)=
 / 8;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 int nbits_long =3D sizeof(long) * NBBY;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 int num_long =3D (maxcpus + nbits_long - 1)=
 / nbits_long;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 kern_cpuset_size =3D num_long * sizeof(long=
);
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0return (kern_cpuset_size);
>
> Modified: head/sys/kern/kern_cpuset.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/kern/kern_cpuset.c Wed Oct 27 07:14:46 2010 =A0 =A0 =A0 =A0(=
r214411)
> +++ head/sys/kern/kern_cpuset.c Wed Oct 27 09:29:03 2010 =A0 =A0 =A0 =A0(=
r214412)
> @@ -889,10 +889,6 @@ cpuset_getaffinity(struct thread *td, st
> =A0 =A0 =A0 =A0int error;
> =A0 =A0 =A0 =A0size_t size;
>
> - =A0 =A0 =A0 if (uap->cpusetsize =3D=3D 0) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 td->td_retval[0] =3D sizeof(cpuset_t);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> - =A0 =A0 =A0 }
> =A0 =A0 =A0 =A0if (uap->cpusetsize < sizeof(cpuset_t) ||
> =A0 =A0 =A0 =A0 =A0 =A0uap->cpusetsize > CPU_MAXSIZE / NBBY)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (ERANGE);

Are you sure this won't break 32-bit on 64-bit architectures, i.e.
amd64, mips, powerpc64, sparc64?
Thanks,
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 09: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 717081065672;
	Wed, 27 Oct 2010 09:44:05 +0000 (UTC)
	(envelope-from davidxu@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 44B6D8FC08;
	Wed, 27 Oct 2010 09:44:05 +0000 (UTC)
Received: from xyf.my.dom (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9R9i2HL063646;
	Wed, 27 Oct 2010 09:44:03 GMT (envelope-from davidxu@freebsd.org)
Message-ID: <4CC864E4.5050606@freebsd.org>
Date: Wed, 27 Oct 2010 17:44:04 +0000
From: David Xu 
User-Agent: Thunderbird 2.0.0.24 (X11/20100630)
MIME-Version: 1.0
To: Garrett Cooper 
References: <201010270929.o9R9T4oI097923@svn.freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214412 - in head: lib/libthr/thread 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: Wed, 27 Oct 2010 09:44:05 -0000

Garrett Cooper wrote:
> On Wed, Oct 27, 2010 at 2:29 AM, David Xu  wrote:
>> Author: davidxu
>> Date: Wed Oct 27 09:29:03 2010
>> New Revision: 214412
>> URL: http://svn.freebsd.org/changeset/base/214412
>>
>> Log:
>>  - Revert r214409.
>>  - Use long word to figure out sizeof kernel cpuset, hope it works.
>>
>> Modified:
>>  head/lib/libthr/thread/thr_attr.c
>>  head/sys/kern/kern_cpuset.c
>>
>> Modified: head/lib/libthr/thread/thr_attr.c
>> ==============================================================================
>> --- head/lib/libthr/thread/thr_attr.c   Wed Oct 27 07:14:46 2010        (r214411)
>> +++ head/lib/libthr/thread/thr_attr.c   Wed Oct 27 09:29:03 2010        (r214412)
>> @@ -574,13 +574,14 @@ _get_kern_cpuset_size(void)
>>
>>        if (kern_cpuset_size == 0) {
>>                size_t len;
>> +               int maxcpus;
>>
>> -               len = sizeof(kern_cpuset_size);
>> -               if (sysctlbyname("kern.smp.maxcpus", &kern_cpuset_size,
>> -                   &len, NULL, 0))
>> +               len = sizeof(maxcpus);
>> +               if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &len, NULL, 0))
>>                        PANIC("failed to get sysctl kern.smp.maxcpus");
>> -
>> -               kern_cpuset_size = (kern_cpuset_size + 7) / 8;
>> +               int nbits_long = sizeof(long) * NBBY;
>> +               int num_long = (maxcpus + nbits_long - 1) / nbits_long;
>> +               kern_cpuset_size = num_long * sizeof(long);
>>        }
>>
>>        return (kern_cpuset_size);
>>
>> Modified: head/sys/kern/kern_cpuset.c
>> ==============================================================================
>> --- head/sys/kern/kern_cpuset.c Wed Oct 27 07:14:46 2010        (r214411)
>> +++ head/sys/kern/kern_cpuset.c Wed Oct 27 09:29:03 2010        (r214412)
>> @@ -889,10 +889,6 @@ cpuset_getaffinity(struct thread *td, st
>>        int error;
>>        size_t size;
>>
>> -       if (uap->cpusetsize == 0) {
>> -               td->td_retval[0] = sizeof(cpuset_t);
>> -               return (0);
>> -       }
>>        if (uap->cpusetsize < sizeof(cpuset_t) ||
>>            uap->cpusetsize > CPU_MAXSIZE / NBBY)
>>                return (ERANGE);
> 
> Are you sure this won't break 32-bit on 64-bit architectures, i.e.
> amd64, mips, powerpc64, sparc64?
> Thanks,
> -Garrett
> 
Unfortunately, I have not thought 32-bit on 64-bit kernel,
we have a bunch of system calls, but still can not get a
simple size.



From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 09:59: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 64087106564A;
	Wed, 27 Oct 2010 09:59:43 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 52B398FC18;
	Wed, 27 Oct 2010 09:59: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 o9R9xh8t098987;
	Wed, 27 Oct 2010 09:59:43 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9R9xh6g098985;
	Wed, 27 Oct 2010 09:59:43 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201010270959.o9R9xh6g098985@svn.freebsd.org>
From: David Xu 
Date: Wed, 27 Oct 2010 09:59: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: r214413 - head/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, 27 Oct 2010 09:59:43 -0000

Author: davidxu
Date: Wed Oct 27 09:59:43 2010
New Revision: 214413
URL: http://svn.freebsd.org/changeset/base/214413

Log:
  Check small set and reject it, this is how kernel did. Always use the
  size kernel is using.

Modified:
  head/lib/libthr/thread/thr_attr.c

Modified: head/lib/libthr/thread/thr_attr.c
==============================================================================
--- head/lib/libthr/thread/thr_attr.c	Wed Oct 27 09:29:03 2010	(r214412)
+++ head/lib/libthr/thread/thr_attr.c	Wed Oct 27 09:59:43 2010	(r214413)
@@ -141,19 +141,14 @@ _pthread_attr_get_np(pthread_t pthread, 
 	struct pthread *curthread;
 	struct pthread_attr attr, *dst;
 	int	ret;
-	size_t	cpusetsize;
+	size_t	kern_size;
 
 	if (pthread == NULL || dstattr == NULL || (dst = *dstattr) == NULL)
 		return (EINVAL);
-	cpusetsize = _get_kern_cpuset_size();
-	if (dst->cpusetsize < cpusetsize) {
-		char *newset = realloc(dst->cpuset, cpusetsize);
-		if (newset == NULL)
-			return (errno);
-		memset(newset + dst->cpusetsize, 0, cpusetsize -
-			dst->cpusetsize);
-		dst->cpuset = (cpuset_t *)newset;
-		dst->cpusetsize = cpusetsize;
+	kern_size = _get_kern_cpuset_size();
+	if (dst->cpuset == NULL) {
+		dst->cpuset = calloc(1, kern_size);
+		dst->cpusetsize = kern_size;
 	}
 	curthread = _get_curthread();
 	if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)) != 0)
@@ -606,27 +601,25 @@ _pthread_attr_setaffinity_np(pthread_att
 			}
 			return (0);
 		}
-			
-		if (cpusetsize > attr->cpusetsize) {
-			size_t kern_size = _get_kern_cpuset_size();
-			if (cpusetsize > kern_size) {
-				size_t i;
-				for (i = kern_size; i < cpusetsize; ++i) {
-					if (((char *)cpusetp)[i])
-						return (EINVAL);
-				}
+		size_t kern_size = _get_kern_cpuset_size();
+		/* Kernel rejects small set, we check it here too. */ 
+		if (cpusetsize < kern_size)
+			return (ERANGE);
+		if (cpusetsize > kern_size) {
+			/* Kernel checks invalid bits, we check it here too. */
+			size_t i;
+			for (i = kern_size; i < cpusetsize; ++i) {
+				if (((char *)cpusetp)[i])
+					return (EINVAL);
 			}
-			void *newset = realloc(attr->cpuset, cpusetsize);
-       			if (newset == NULL)
-		            return (ENOMEM);
-			attr->cpuset = newset;
-			attr->cpusetsize = cpusetsize;
-		} else {
-			memset(((char *)attr->cpuset) + cpusetsize, 0,
-				attr->cpusetsize - cpusetsize);
-			attr->cpusetsize = cpusetsize;
 		}
-		memcpy(attr->cpuset, cpusetp, cpusetsize);
+		if (attr->cpuset == NULL) {
+			attr->cpuset = calloc(1, kern_size);
+			if (attr->cpuset == NULL)
+				return (errno);
+			attr->cpusetsize = kern_size;
+		}
+		memcpy(attr->cpuset, cpusetp, kern_size);
 		ret = 0;
 	}
 	return (ret);
@@ -642,16 +635,18 @@ _pthread_attr_getaffinity_np(const pthre
 
 	if (pattr == NULL || (attr = (*pattr)) == NULL)
 		ret = EINVAL;
-	else if (attr->cpuset != NULL) {
-		memcpy(cpusetp, attr->cpuset, MIN(cpusetsize, attr->cpusetsize));
-		if (cpusetsize > attr->cpusetsize)
-			memset(((char *)cpusetp) + attr->cpusetsize, 0, 
-				cpusetsize - attr->cpusetsize);
-	} else {
+	else {
+		/* Kernel rejects small set, we check it here too. */ 
 		size_t kern_size = _get_kern_cpuset_size();
-		memset(cpusetp, -1, MIN(cpusetsize, kern_size));
+		if (cpusetsize < kern_size)
+			return (ERANGE);
+		if (attr->cpuset != NULL)
+			memcpy(cpusetp, attr->cpuset, MIN(cpusetsize,
+			   attr->cpusetsize));
+		else
+			memset(cpusetp, -1, kern_size);
 		if (cpusetsize > kern_size)
-			memset(((char *)cpusetp) + kern_size, 0,
+			memset(((char *)cpusetp) + kern_size, 0, 
 				cpusetsize - kern_size);
 	}
 	return (ret);

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 11:18: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 1A0FD106566C;
	Wed, 27 Oct 2010 11:18:39 +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 E67A18FC0C;
	Wed, 27 Oct 2010 11:18:38 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 8CECD46B06;
	Wed, 27 Oct 2010 07:18:38 -0400 (EDT)
Date: Wed, 27 Oct 2010 12:18:38 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: David Xu 
In-Reply-To: <4CC80ABA.3080404@freebsd.org>
Message-ID: 
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	
	<4CC80ABA.3080404@freebsd.org>
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, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Garrett Cooper 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 11:18:39 -0000


On Wed, 27 Oct 2010, David Xu wrote:

>>> I really hate to see such a problem that userland can not figure out what 
>>> kernel is using, I try hardly to guess, but still can not find what it is 
>>> using. yes, I think the doc may need to be fixed or another syscall is 
>>> needed.
>>
>>     Well... Jeff's code in cpuset(1) does some trivial sizeof(mask) 's, but 
>> it just passes in cpuset_t for mask. I've seen different calling 
>> conventions at the kernel level when I tried to get my brain in sync with 
>> that for a bug I was looking at a few weeks ago (and sadly, failed to some 
>> degree).
>>     These syscalls are a bit confusing though, and apart from cpuset(1) 
>> there aren't any really good examples in the sourcebase on how to use them 
>> (at least not the last time I checked)... Thanks, -Garrett
>> 
> The problem is that the size of cpuset is not fixed, it is tunable by the 
> recompiling kernel with different parameter, so if you have a program which 
> you want to adapt it to use any size of cpuset, it should be able to get the 
> size the kernel is using, if you don't have source code of the program, you 
> can not compile it with new parameter, then there is trouble.

Yay, it's fd_set all over again :-).

It sounds like we might just need to add a sysctl and a few wrapper functions 
in userspace along the lines of (hand-wave):

cpuset_t	*cpuset_alloc();
void		 cpuset_free();

And perhaps some sort of API that abstracts manipulation of the set (or
doesn't but allows the user to easily query its bounds).

Robert

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 12:51: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 7F898106566B;
	Wed, 27 Oct 2010 12:51:36 +0000 (UTC)
	(envelope-from bapt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6ED938FC14;
	Wed, 27 Oct 2010 12:51: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 o9RCpaAH006423;
	Wed, 27 Oct 2010 12:51:36 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RCpaIh006421;
	Wed, 27 Oct 2010 12:51:36 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201010271251.o9RCpaIh006421@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Wed, 27 Oct 2010 12:51: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: r214414 - 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: Wed, 27 Oct 2010 12:51:36 -0000

Author: bapt (ports committer)
Date: Wed Oct 27 12:51:36 2010
New Revision: 214414
URL: http://svn.freebsd.org/changeset/base/214414

Log:
  Add attachement to my mentors
  
  Reporter by: wxs (on irc)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==============================================================================
--- head/share/misc/committers-ports.dot	Wed Oct 27 09:59:43 2010	(r214413)
+++ head/share/misc/committers-ports.dot	Wed Oct 27 12:51:36 2010	(r214414)
@@ -261,6 +261,8 @@ itetcu -> araujo
 itetcu -> dryice
 itetcu -> sahil
 
+jadawin -> bapt
+
 joerg -> netchild
 
 knu -> daichi
@@ -365,6 +367,7 @@ steve -> netchild
 tabthorpe -> ashish
 tabthorpe -> avilla
 tabthorpe -> avl
+tabthorpe -> bapt
 tabthorpe -> fluffy
 tabthorpe -> jacula
 tabthorpe -> jadawin

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 12:57:09 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from alona.my.domain (localhost [127.0.0.1])
	by hub.freebsd.org (Postfix) with ESMTP id 5E1731065673;
	Wed, 27 Oct 2010 12:57:08 +0000 (UTC)
	(envelope-from davidxu@freebsd.org)
Message-ID: <4CC82195.5000201@freebsd.org>
Date: Wed, 27 Oct 2010 20:56:53 +0800
From: David Xu 
User-Agent: Thunderbird 2.0.0.21 (X11/20090522)
MIME-Version: 1.0
To: Robert Watson 
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	
	<4CC80ABA.3080404@freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Garrett Cooper 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 12:57:09 -0000

Robert Watson wrote:
>
> On Wed, 27 Oct 2010, David Xu wrote:
>
>>>> I really hate to see such a problem that userland can not figure 
>>>> out what kernel is using, I try hardly to guess, but still can not 
>>>> find what it is using. yes, I think the doc may need to be fixed or 
>>>> another syscall is needed.
>>>
>>>     Well... Jeff's code in cpuset(1) does some trivial sizeof(mask) 
>>> 's, but it just passes in cpuset_t for mask. I've seen different 
>>> calling conventions at the kernel level when I tried to get my brain 
>>> in sync with that for a bug I was looking at a few weeks ago (and 
>>> sadly, failed to some degree).
>>>     These syscalls are a bit confusing though, and apart from 
>>> cpuset(1) there aren't any really good examples in the sourcebase on 
>>> how to use them (at least not the last time I checked)... Thanks, 
>>> -Garrett
>>>
>> The problem is that the size of cpuset is not fixed, it is tunable by 
>> the recompiling kernel with different parameter, so if you have a 
>> program which you want to adapt it to use any size of cpuset, it 
>> should be able to get the size the kernel is using, if you don't have 
>> source code of the program, you can not compile it with new 
>> parameter, then there is trouble.
>
> Yay, it's fd_set all over again :-).
>
> It sounds like we might just need to add a sysctl and a few wrapper 
> functions in userspace along the lines of (hand-wave):
>
> cpuset_t    *cpuset_alloc();
> void         cpuset_free();
>
> And perhaps some sort of API that abstracts manipulation of the set (or
> doesn't but allows the user to easily query its bounds).
>
> Robert
>
Problem is who will use the non-standard interface ? 
The pthread_attr_getaffinity_np pthread_attr_setaffinity_np
and others are from glibc, which let you specify arbitrary
cpuset size but kernel only accept one size.  :-)

Though it is not POSIX, but some software start to use it, AFAIK,
Erlang language's VM start to use it for binding its scheduler
thread to cpu, we have to live with it. We still lack of some functions
to let it compile without modification, one is it wants to know
cpu topology, and other crappy functions it wants to use is:
sched_getaffinity, sched_setaffinity, which one guy thought each
thread is just a process which has a  PID.  :-)
I don't know how it uses Solaris processor binding interface.


From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 13:06: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 7FC101065673;
	Wed, 27 Oct 2010 13:06:08 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 618E28FC23;
	Wed, 27 Oct 2010 13:06:07 +0000 (UTC)
Received: by wyb42 with SMTP id 42so662515wyb.13
	for ; Wed, 27 Oct 2010 06:06:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=GrOIE+apgTk8JYgo7/kc4XZOmtInF1metD36zLLIy9w=;
	b=lXjeFm/TdyINbiWYr9rMKxaWmI2uvtgjM45y06FfMSRPGol8ecSZWz3bfKCmx0OegX
	pTX/X3OUM6I7VS6+LWzqZfEQs7YVkn47DZdHBT617xXv5E7YzuQazVseBbHw6q9X8MP1
	F1NQcMT6uTqY7YwtgRJ1VVl0I97BbkFmMpiqI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=fTlW5CgH07GhU6OLHKr5ljF+SEBNvuTcMtDDJFoj/FSzp7PmpP/GiLI2QBuxP5fe18
	22YZubTbzB2fPNvImwQQsASL4mbuO5bHnRbt9gg1xv7gg9m1yVATVt51x6dploOMV2pi
	JycXcun1Mh9vxv55j3neQYl0BHW9uMRm4s/c4=
MIME-Version: 1.0
Received: by 10.216.1.6 with SMTP id 6mr9025440wec.24.1288184766388; Wed, 27
	Oct 2010 06:06:06 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.10.198 with HTTP; Wed, 27 Oct 2010 06:06:06 -0700 (PDT)
In-Reply-To: <4CC82195.5000201@freebsd.org>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	
	<4CC80ABA.3080404@freebsd.org>
	
	<4CC82195.5000201@freebsd.org>
Date: Wed, 27 Oct 2010 06:06:06 -0700
X-Google-Sender-Auth: shMS-QCBUz651ZiaUXXXhE5PHIE
Message-ID: 
From: Garrett Cooper 
To: David Xu 
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, Robert Watson 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 13:06:08 -0000

On Wed, Oct 27, 2010 at 5:56 AM, David Xu  wrote:
> Robert Watson wrote:
>>
>> On Wed, 27 Oct 2010, David Xu wrote:
>>
>>>>> I really hate to see such a problem that userland can not figure out
>>>>> what kernel is using, I try hardly to guess, but still can not find w=
hat it
>>>>> is using. yes, I think the doc may need to be fixed or another syscal=
l is
>>>>> needed.
>>>>
>>>> =A0 =A0Well... Jeff's code in cpuset(1) does some trivial sizeof(mask)=
 's,
>>>> but it just passes in cpuset_t for mask. I've seen different calling
>>>> conventions at the kernel level when I tried to get my brain in sync w=
ith
>>>> that for a bug I was looking at a few weeks ago (and sadly, failed to =
some
>>>> degree).
>>>> =A0 =A0These syscalls are a bit confusing though, and apart from cpuse=
t(1)
>>>> there aren't any really good examples in the sourcebase on how to use =
them
>>>> (at least not the last time I checked)... Thanks, -Garrett
>>>>
>>> The problem is that the size of cpuset is not fixed, it is tunable by t=
he
>>> recompiling kernel with different parameter, so if you have a program w=
hich
>>> you want to adapt it to use any size of cpuset, it should be able to ge=
t the
>>> size the kernel is using, if you don't have source code of the program,=
 you
>>> can not compile it with new parameter, then there is trouble.
>>
>> Yay, it's fd_set all over again :-).
>>
>> It sounds like we might just need to add a sysctl and a few wrapper
>> functions in userspace along the lines of (hand-wave):
>>
>> cpuset_t =A0 =A0*cpuset_alloc();
>> void =A0 =A0 =A0 =A0 cpuset_free();
>>
>> And perhaps some sort of API that abstracts manipulation of the set (or
>> doesn't but allows the user to easily query its bounds).
>>
>> Robert
>>
> Problem is who will use the non-standard interface ? The
> pthread_attr_getaffinity_np pthread_attr_setaffinity_np
> and others are from glibc, which let you specify arbitrary
> cpuset size but kernel only accept one size. =A0:-)
>
> Though it is not POSIX, but some software start to use it, AFAIK,
> Erlang language's VM start to use it for binding its scheduler
> thread to cpu, we have to live with it. We still lack of some functions
> to let it compile without modification, one is it wants to know
> cpu topology, and other crappy functions it wants to use is:
> sched_getaffinity, sched_setaffinity, which one guy thought each
> thread is just a process which has a =A0PID. =A0:-)
> I don't know how it uses Solaris processor binding interface.

I brought this up a while back over the Austin Group list, but it
looks like I need to file an Aardvark ticket for it and attend the
meetings so the OpenGroup folks actually take the issue to heart.

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 13:10: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 797EC106564A;
	Wed, 27 Oct 2010 13:10:08 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 673AB8FC08;
	Wed, 27 Oct 2010 13:10: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 o9RDA8Ic007032;
	Wed, 27 Oct 2010 13:10:08 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RDA8PH007028;
	Wed, 27 Oct 2010 13:10:08 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201010271310.o9RDA8PH007028@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 27 Oct 2010 13:10:08 +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: r214415 - stable/8/sys/rpc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 13:10:08 -0000

Author: rmacklem
Date: Wed Oct 27 13:10:08 2010
New Revision: 214415
URL: http://svn.freebsd.org/changeset/base/214415

Log:
  MFC: r213756
  Fix the krpc so that it can handle NFSv3,UDP mounts with a read/write
  data size greater than 8192. Since soreserve(so, 256*1024, 256*1024)
  would always fail for the default value of sb_max, modify clnt_dg.c
  so that it uses the calculated values and checks for an error return
  from soreserve(). Also, add a check for error return from soreserve()
  to clnt_vc.c and change __rpc_get_t_size() to use sb_max_adj instead of
  the bogus maxsize == 256*1024.

Modified:
  stable/8/sys/rpc/clnt_dg.c
  stable/8/sys/rpc/clnt_vc.c
  stable/8/sys/rpc/rpc_generic.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)

Modified: stable/8/sys/rpc/clnt_dg.c
==============================================================================
--- stable/8/sys/rpc/clnt_dg.c	Wed Oct 27 12:51:36 2010	(r214414)
+++ stable/8/sys/rpc/clnt_dg.c	Wed Oct 27 13:10:08 2010	(r214415)
@@ -193,6 +193,7 @@ clnt_dg_create(
 	struct rpc_msg call_msg;
 	struct __rpc_sockinfo si;
 	XDR xdrs;
+	int error;
 
 	if (svcaddr == NULL) {
 		rpc_createerr.cf_stat = RPC_UNKNOWNADDR;
@@ -267,7 +268,12 @@ clnt_dg_create(
 	 */
 	cu->cu_closeit = FALSE;
 	cu->cu_socket = so;
-	soreserve(so, 256*1024, 256*1024);
+	error = soreserve(so, (u_long)sendsz, (u_long)recvsz);
+	if (error != 0) {
+		rpc_createerr.cf_stat = RPC_FAILED;
+		rpc_createerr.cf_error.re_errno = error;
+		goto err2;
+	}
 
 	sb = &so->so_rcv;
 	SOCKBUF_LOCK(&so->so_rcv);

Modified: stable/8/sys/rpc/clnt_vc.c
==============================================================================
--- stable/8/sys/rpc/clnt_vc.c	Wed Oct 27 12:51:36 2010	(r214414)
+++ stable/8/sys/rpc/clnt_vc.c	Wed Oct 27 13:10:08 2010	(r214415)
@@ -288,13 +288,19 @@ clnt_vc_create(
 	 * Create a client handle which uses xdrrec for serialization
 	 * and authnone for authentication.
 	 */
+	sendsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsz);
+	recvsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsz);
+	error = soreserve(ct->ct_socket, sendsz, recvsz);
+	if (error != 0) {
+		if (ct->ct_closeit) {
+			soclose(ct->ct_socket);
+		}
+		goto err;
+	}
 	cl->cl_refs = 1;
 	cl->cl_ops = &clnt_vc_ops;
 	cl->cl_private = ct;
 	cl->cl_auth = authnone_create();
-	sendsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsz);
-	recvsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsz);
-	soreserve(ct->ct_socket, sendsz, recvsz);
 
 	SOCKBUF_LOCK(&ct->ct_socket->so_rcv);
 	soupcall_set(ct->ct_socket, SO_RCV, clnt_vc_soupcall, ct);

Modified: stable/8/sys/rpc/rpc_generic.c
==============================================================================
--- stable/8/sys/rpc/rpc_generic.c	Wed Oct 27 12:51:36 2010	(r214414)
+++ stable/8/sys/rpc/rpc_generic.c	Wed Oct 27 13:10:08 2010	(r214415)
@@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+extern	u_long sb_max_adj;	/* not defined in socketvar.h */
+
 #if __FreeBSD_version < 700000
 #define strrchr rindex
 #endif
@@ -113,9 +115,8 @@ u_int
 /*ARGSUSED*/
 __rpc_get_t_size(int af, int proto, int size)
 {
-	int maxsize, defsize;
+	int defsize;
 
-	maxsize = 256 * 1024;	/* XXX */
 	switch (proto) {
 	case IPPROTO_TCP:
 		defsize = 64 * 1024;	/* XXX */
@@ -131,7 +132,7 @@ __rpc_get_t_size(int af, int proto, int 
 		return defsize;
 
 	/* Check whether the value is within the upper max limit */
-	return (size > maxsize ? (u_int)maxsize : (u_int)size);
+	return (size > sb_max_adj ? (u_int)sb_max_adj : (u_int)size);
 }
 
 /*

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 13:12: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 2916C106566B;
	Wed, 27 Oct 2010 13:12:07 +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 F248A8FC15;
	Wed, 27 Oct 2010 13:12:06 +0000 (UTC)
Received: from [192.168.2.105] (host86-177-32-238.range86-177.btcentralplus.com
	[86.177.32.238])
	by cyrus.watson.org (Postfix) with ESMTPSA id BFC2A46B09;
	Wed, 27 Oct 2010 09:12:05 -0400 (EDT)
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: "Robert N. M. Watson" 
In-Reply-To: <4CC82195.5000201@freebsd.org>
Date: Wed, 27 Oct 2010 14:12:03 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <0D9C8E2A-520C-4A45-A93F-C958DDA421C6@FreeBSD.org>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	
	<4CC80ABA.3080404@freebsd.org>
	
	<4CC82195.5000201@freebsd.org>
To: David Xu 
X-Mailer: Apple Mail (2.1081)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Garrett Cooper 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 13:12:07 -0000


On 27 Oct 2010, at 13:56, David Xu wrote:

>> Yay, it's fd_set all over again :-).
>>=20
>> It sounds like we might just need to add a sysctl and a few wrapper =
functions in userspace along the lines of (hand-wave):
>>=20
>> cpuset_t    *cpuset_alloc();
>> void         cpuset_free();
>>=20
>> And perhaps some sort of API that abstracts manipulation of the set =
(or
>> doesn't but allows the user to easily query its bounds).

> Problem is who will use the non-standard interface ? The =
pthread_attr_getaffinity_np pthread_attr_setaffinity_np
> and others are from glibc, which let you specify arbitrary
> cpuset size but kernel only accept one size.  :-)
>=20
> Though it is not POSIX, but some software start to use it, AFAIK,
> Erlang language's VM start to use it for binding its scheduler
> thread to cpu, we have to live with it. We still lack of some =
functions
> to let it compile without modification, one is it wants to know
> cpu topology, and other crappy functions it wants to use is:
> sched_getaffinity, sched_setaffinity, which one guy thought each
> thread is just a process which has a  PID.  :-)
> I don't know how it uses Solaris processor binding interface.

I see two separate problems here:

(1) Providing potentially non-portable APIs that do the right thing, and =
do it well.

(2) Providing definitely portable APIs whose implementation is as robust =
as possible given their flawed semantics. I.e., don't crash on common =
use.

The latter should be implemented in terms of the former.

Robert=

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 13:33: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 647051065672;
	Wed, 27 Oct 2010 13:33:18 +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 ADF048FC0A;
	Wed, 27 Oct 2010 13:33:17 +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 o9RDX9Nj080213
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 27 Oct 2010 16:33: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
	o9RDX9NH054205; Wed, 27 Oct 2010 16:33: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 o9RDX7WA054204; 
	Wed, 27 Oct 2010 16:33:07 +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: Wed, 27 Oct 2010 16:33:07 +0300
From: Kostik Belousov 
To: David Xu 
Message-ID: <20101027133307.GQ2392@deviant.kiev.zoral.com.ua>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	<20101027082122.GD1848@garage.freebsd.pl>
	<4CC85552.2020100@freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="qShzMMhzd2CdnVN0"
Content-Disposition: inline
In-Reply-To: <4CC85552.2020100@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=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	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, Pawel Jakub Dawidek ,
	Garrett Cooper 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 13:33:18 -0000


--qShzMMhzd2CdnVN0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Oct 27, 2010 at 04:37:38PM +0000, David Xu wrote:
> Pawel Jakub Dawidek wrote:
> >On Wed, Oct 27, 2010 at 10:49:12AM +0000, David Xu wrote:
> >>I really hate to see such a problem that userland can not figure out
> >>what kernel is using, I try hardly to guess, but still can not find
> >>what it is using. yes, I think the doc may need to be fixed or
> >>another syscall is needed.
> >
> >Maybe you could just add sysctl and eventually put it into sysconf(3)?
> >
>=20
> I just found a dirty method, use sizeof(long) and kern.smp.maxcpus
> 32 to figure out the size the kernel is using, because it is how
> cpuset_t is constructed, wish it will never be changed. ;-)
>=20
I think that sysctl is the way forward, but you may add non-portable
FreeBSD function to get the value, and use an ELF aux vector interface
to avoid sysctl most of the time.

--qShzMMhzd2CdnVN0
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAkzIKhIACgkQC3+MBN1Mb4g0RACg4rYLGVbX4vXDx5/wOjp30mGc
P48AniTB28JicB/3vkEGN6J0nR86AEJn
=Wl2c
-----END PGP SIGNATURE-----

--qShzMMhzd2CdnVN0--

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 14: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 E4D001065670;
	Wed, 27 Oct 2010 14:08:37 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D3FCE8FC13;
	Wed, 27 Oct 2010 14: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 o9RE8be3009106;
	Wed, 27 Oct 2010 14:08:37 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RE8b1D009104;
	Wed, 27 Oct 2010 14:08:37 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201010271408.o9RE8b1D009104@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 27 Oct 2010 14:08: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: r214418 - head/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: Wed, 27 Oct 2010 14:08:38 -0000

Author: jh
Date: Wed Oct 27 14:08:37 2010
New Revision: 214418
URL: http://svn.freebsd.org/changeset/base/214418

Log:
  Add missing "readahead" to the nfs_opts list.
  
  PR:		151321
  Tested by:	Simon Walton
  MFC after:	2 weeks

Modified:
  head/sys/nfsclient/nfs_vfsops.c

Modified: head/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- head/sys/nfsclient/nfs_vfsops.c	Wed Oct 27 13:38:40 2010	(r214417)
+++ head/sys/nfsclient/nfs_vfsops.c	Wed Oct 27 14:08:37 2010	(r214418)
@@ -779,10 +779,10 @@ static const char *nfs_opts[] = { "from"
     "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union",
     "noclusterr", "noclusterw", "multilabel", "acls", "force", "update",
     "async", "dumbtimer", "noconn", "nolockd", "intr", "rdirplus", "resvport",
-    "readdirsize", "soft", "hard", "mntudp", "tcp", "udp", "wsize", "rsize",
-    "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", 
-    "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3", "sec",
-    "maxgroups", "principal", "negnametimeo",
+    "readahead", "readdirsize", "soft", "hard", "mntudp", "tcp", "udp",
+    "wsize", "rsize", "retrans", "acregmin", "acregmax", "acdirmin",
+    "acdirmax", "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3",
+    "sec", "maxgroups", "principal", "negnametimeo",
     NULL };
 
 /*

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 14:11: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 A06B3106566C;
	Wed, 27 Oct 2010 14:11:11 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FCEA8FC08;
	Wed, 27 Oct 2010 14:11: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 o9REBBt4009246;
	Wed, 27 Oct 2010 14:11:11 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9REBBNI009244;
	Wed, 27 Oct 2010 14:11:11 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201010271411.o9REBBNI009244@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 27 Oct 2010 14:11:11 +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: r214419 - head/sbin/mount_nfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 14:11:11 -0000

Author: jh
Date: Wed Oct 27 14:11:11 2010
New Revision: 214419
URL: http://svn.freebsd.org/changeset/base/214419

Log:
  Correct a typo.
  
  PR:		151321
  Submitted by:	Simon Walton
  MFC after:	3 days

Modified:
  head/sbin/mount_nfs/mount_nfs.c

Modified: head/sbin/mount_nfs/mount_nfs.c
==============================================================================
--- head/sbin/mount_nfs/mount_nfs.c	Wed Oct 27 14:08:37 2010	(r214418)
+++ head/sbin/mount_nfs/mount_nfs.c	Wed Oct 27 14:11:11 2010	(r214419)
@@ -177,7 +177,7 @@ main(int argc, char *argv[])
 			mountmode = V3;
 			break;
 		case 'a':
-			printf("-a deprecated, use -o readhead=\n");
+			printf("-a deprecated, use -o readahead=\n");
 			build_iovec(&iov, &iovlen, "readahead", optarg, (size_t)-1);
 			break;
 		case 'b':

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 15:19:22 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from alona.my.domain (localhost [127.0.0.1])
	by hub.freebsd.org (Postfix) with ESMTP id C3053106566B;
	Wed, 27 Oct 2010 15:19:21 +0000 (UTC)
	(envelope-from davidxu@freebsd.org)
Message-ID: <4CC842EA.7030308@freebsd.org>
Date: Wed, 27 Oct 2010 23:19:06 +0800
From: David Xu 
User-Agent: Thunderbird 2.0.0.21 (X11/20090522)
MIME-Version: 1.0
To: "Robert N. M. Watson" 
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	
	<4CC80ABA.3080404@freebsd.org>
	
	<4CC82195.5000201@freebsd.org>
	<0D9C8E2A-520C-4A45-A93F-C958DDA421C6@FreeBSD.org>
In-Reply-To: <0D9C8E2A-520C-4A45-A93F-C958DDA421C6@FreeBSD.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Garrett Cooper 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 15:19:23 -0000

Robert N. M. Watson wrote:
> On 27 Oct 2010, at 13:56, David Xu wrote:
>
>   
>>> Yay, it's fd_set all over again :-).
>>>
>>> It sounds like we might just need to add a sysctl and a few wrapper functions in userspace along the lines of (hand-wave):
>>>
>>> cpuset_t    *cpuset_alloc();
>>> void         cpuset_free();
>>>
>>> And perhaps some sort of API that abstracts manipulation of the set (or
>>> doesn't but allows the user to easily query its bounds).
>>>       
>
>   
>> Problem is who will use the non-standard interface ? The pthread_attr_getaffinity_np pthread_attr_setaffinity_np
>> and others are from glibc, which let you specify arbitrary
>> cpuset size but kernel only accept one size.  :-)
>>
>> Though it is not POSIX, but some software start to use it, AFAIK,
>> Erlang language's VM start to use it for binding its scheduler
>> thread to cpu, we have to live with it. We still lack of some functions
>> to let it compile without modification, one is it wants to know
>> cpu topology, and other crappy functions it wants to use is:
>> sched_getaffinity, sched_setaffinity, which one guy thought each
>> thread is just a process which has a  PID.  :-)
>> I don't know how it uses Solaris processor binding interface.
>>     
>
> I see two separate problems here:
>
> (1) Providing potentially non-portable APIs that do the right thing, and do it well.
>
> (2) Providing definitely portable APIs whose implementation is as robust as possible given their flawed semantics. I.e., don't crash on common use.
>
> The latter should be implemented in terms of the former.
>
> Robert
>   
You still can make wrapper functions, the glibc pthread API is
unrelated to this. you can write a library to manage the cpuset,
cpuset allocation and freeing are done by the library, but hide
or make the cpuset size read-only, the size can be queried but
can not be changed, the cpuset when allocated always has same
size as kernel's. you even can do more work, explore kernel cpu
topology data  and provide interface, current one can only
access xml data via sysctl kern.sched.topology_spec which
is not easy if a program can not parse xml, even there
is a parser, it is still not easy.



From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 15:44: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 E9CB51065670;
	Wed, 27 Oct 2010 15:44:49 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D56718FC16;
	Wed, 27 Oct 2010 15:44: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 o9RFinKL012607;
	Wed, 27 Oct 2010 15:44:49 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RFin4X012592;
	Wed, 27 Oct 2010 15:44:49 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201010271544.o9RFin4X012592@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 27 Oct 2010 15:44:49 +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: r214420 - in stable/8/sys: fs/cd9660 fs/hpfs fs/msdosfs
	fs/ntfs gnu/fs/reiserfs kern sys ufs/ffs ufs/ufs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 15:44:50 -0000

Author: kib
Date: Wed Oct 27 15:44:49 2010
New Revision: 214420
URL: http://svn.freebsd.org/changeset/base/214420

Log:
  MFC r213664:
  The r184588 changed the layout of struct export_args, causing an ABI
  breakage for old mount(2) syscall, since most struct _args
  embed export_args. The mount(2) is supposed to provide ABI
  compatibility for pre-nmount mount(8) binaries, so restore ABI to
  pre-r184588.

Modified:
  stable/8/sys/fs/cd9660/cd9660_mount.h
  stable/8/sys/fs/cd9660/cd9660_vfsops.c
  stable/8/sys/fs/hpfs/hpfs_vfsops.c
  stable/8/sys/fs/hpfs/hpfsmount.h
  stable/8/sys/fs/msdosfs/msdosfs_vfsops.c
  stable/8/sys/fs/msdosfs/msdosfsmount.h
  stable/8/sys/fs/ntfs/ntfs_vfsops.c
  stable/8/sys/fs/ntfs/ntfsmount.h
  stable/8/sys/gnu/fs/reiserfs/reiserfs_mount.h
  stable/8/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
  stable/8/sys/kern/vfs_mount.c
  stable/8/sys/sys/mount.h
  stable/8/sys/ufs/ffs/ffs_vfsops.c
  stable/8/sys/ufs/ufs/ufsmount.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)

Modified: stable/8/sys/fs/cd9660/cd9660_mount.h
==============================================================================
--- stable/8/sys/fs/cd9660/cd9660_mount.h	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/fs/cd9660/cd9660_mount.h	Wed Oct 27 15:44:49 2010	(r214420)
@@ -40,7 +40,7 @@
  */
 struct iso_args {
 	char	*fspec;			/* block special device to mount */
-	struct	export_args export;	/* network export info */
+	struct	oexport_args export;	/* network export info */
 	int	flags;			/* mounting flags, see below */
 	int	ssector;		/* starting sector, 0 for 1st session */
 	char	*cs_disk;		/* disk charset for Joliet cs conversion */

Modified: stable/8/sys/fs/cd9660/cd9660_vfsops.c
==============================================================================
--- stable/8/sys/fs/cd9660/cd9660_vfsops.c	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/fs/cd9660/cd9660_vfsops.c	Wed Oct 27 15:44:49 2010	(r214420)
@@ -98,14 +98,16 @@ static int
 cd9660_cmount(struct mntarg *ma, void *data, int flags)
 {
 	struct iso_args args;
+	struct export_args exp;
 	int error;
 
 	error = copyin(data, &args, sizeof args);
 	if (error)
 		return (error);
+	vfs_oexport_conv(&args.export, &exp);
 
 	ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN);
-	ma = mount_arg(ma, "export", &args.export, sizeof args.export);
+	ma = mount_arg(ma, "export", &exp, sizeof(exp));
 	ma = mount_argsu(ma, "cs_disk", args.cs_disk, 64);
 	ma = mount_argsu(ma, "cs_local", args.cs_local, 64);
 	ma = mount_argf(ma, "ssector", "%u", args.ssector);

Modified: stable/8/sys/fs/hpfs/hpfs_vfsops.c
==============================================================================
--- stable/8/sys/fs/hpfs/hpfs_vfsops.c	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/fs/hpfs/hpfs_vfsops.c	Wed Oct 27 15:44:49 2010	(r214420)
@@ -76,14 +76,16 @@ hpfs_cmount ( 
 	int flags)
 {
 	struct hpfs_args args;
+	struct export_args exp;
 	int error;
 
 	error = copyin(data, (caddr_t)&args, sizeof (struct hpfs_args));
 	if (error)
 		return (error);
+	vfs_oexport_conv(&args.export, &exp);
 
 	ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN);
-	ma = mount_arg(ma, "export", &args.export, sizeof args.export);
+	ma = mount_arg(ma, "export", &exp, sizeof(exp));
 	ma = mount_argf(ma, "uid", "%d", args.uid);
 	ma = mount_argf(ma, "gid", "%d", args.gid);
 	ma = mount_argf(ma, "mode", "%d", args.mode);

Modified: stable/8/sys/fs/hpfs/hpfsmount.h
==============================================================================
--- stable/8/sys/fs/hpfs/hpfsmount.h	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/fs/hpfs/hpfsmount.h	Wed Oct 27 15:44:49 2010	(r214420)
@@ -29,7 +29,7 @@
 #define HPFSMNT_TABLES		0x0001
 struct hpfs_args {
 	char	*fspec;			/* block special device to mount */
-	struct	export_args export;	/* network export information */
+	struct	oexport_args export;	/* network export information */
 	uid_t	uid;			/* uid that owns hpfs files */
 	gid_t	gid;			/* gid that owns hpfs files */
 	mode_t	mode;			/* mask to be applied for hpfs perms */

Modified: stable/8/sys/fs/msdosfs/msdosfs_vfsops.c
==============================================================================
--- stable/8/sys/fs/msdosfs/msdosfs_vfsops.c	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/fs/msdosfs/msdosfs_vfsops.c	Wed Oct 27 15:44:49 2010	(r214420)
@@ -200,6 +200,7 @@ static int
 msdosfs_cmount(struct mntarg *ma, void *data, int flags)
 {
 	struct msdosfs_args args;
+	struct export_args exp;
 	int error;
 
 	if (data == NULL)
@@ -207,9 +208,10 @@ msdosfs_cmount(struct mntarg *ma, void *
 	error = copyin(data, &args, sizeof args);
 	if (error)
 		return (error);
+	vfs_oexport_conv(&args.export, &exp);
 
 	ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN);
-	ma = mount_arg(ma, "export", &args.export, sizeof args.export);
+	ma = mount_arg(ma, "export", &exp, sizeof(exp));
 	ma = mount_argf(ma, "uid", "%d", args.uid);
 	ma = mount_argf(ma, "gid", "%d", args.gid);
 	ma = mount_argf(ma, "mask", "%d", args.mask);

Modified: stable/8/sys/fs/msdosfs/msdosfsmount.h
==============================================================================
--- stable/8/sys/fs/msdosfs/msdosfsmount.h	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/fs/msdosfs/msdosfsmount.h	Wed Oct 27 15:44:49 2010	(r214420)
@@ -234,7 +234,7 @@ uint32_t msdosfs_fileno_map(struct mount
  */
 struct msdosfs_args {
 	char	*fspec;		/* blocks special holding the fs to mount */
-	struct	export_args export;	/* network export information */
+	struct	oexport_args export;	/* network export information */
 	uid_t	uid;		/* uid that owns msdosfs files */
 	gid_t	gid;		/* gid that owns msdosfs files */
 	mode_t	mask;		/* file mask to be applied for msdosfs perms */

Modified: stable/8/sys/fs/ntfs/ntfs_vfsops.c
==============================================================================
--- stable/8/sys/fs/ntfs/ntfs_vfsops.c	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/fs/ntfs/ntfs_vfsops.c	Wed Oct 27 15:44:49 2010	(r214420)
@@ -119,14 +119,16 @@ ntfs_cmount ( 
 	void *data,
 	int flags)
 {
-	int error;
 	struct ntfs_args args;
+	struct export_args exp;
+	int error;
 
-	error = copyin(data, (caddr_t)&args, sizeof args);
+	error = copyin(data, &args, sizeof(args));
 	if (error)
 		return (error);
+	vfs_oexport_conv(&args.export, &exp);
 	ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN);
-	ma = mount_arg(ma, "export", &args.export, sizeof args.export);
+	ma = mount_arg(ma, "export", &exp, sizeof(exp));
 	ma = mount_argf(ma, "uid", "%d", args.uid);
 	ma = mount_argf(ma, "gid", "%d", args.gid);
 	ma = mount_argf(ma, "mode", "%d", args.mode);

Modified: stable/8/sys/fs/ntfs/ntfsmount.h
==============================================================================
--- stable/8/sys/fs/ntfs/ntfsmount.h	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/fs/ntfs/ntfsmount.h	Wed Oct 27 15:44:49 2010	(r214420)
@@ -34,7 +34,7 @@
 
 struct ntfs_args {
 	char	*fspec;			/* block special device to mount */
-	struct	export_args export;	/* network export information */
+	struct	oexport_args export;	/* network export information */
 	uid_t	uid;			/* uid that owns ntfs files */
 	gid_t	gid;			/* gid that owns ntfs files */
 	mode_t	mode;			/* mask to be applied for ntfs perms */

Modified: stable/8/sys/gnu/fs/reiserfs/reiserfs_mount.h
==============================================================================
--- stable/8/sys/gnu/fs/reiserfs/reiserfs_mount.h	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/gnu/fs/reiserfs/reiserfs_mount.h	Wed Oct 27 15:44:49 2010	(r214420)
@@ -39,7 +39,7 @@ struct reiserfs_mount {
 /* Arguments to mount ReiserFS filesystems. */
 struct reiserfs_args {
 	char	*fspec;		/* blocks special holding the fs to mount */
-	struct export_args export;	/* network export information */
+	struct oexport_args export;	/* network export information */
 };
 
 #endif /* !defined _GNU_REISERFS_REISERFS_MOUNT_H */

Modified: stable/8/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
==============================================================================
--- stable/8/sys/gnu/fs/reiserfs/reiserfs_vfsops.c	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/gnu/fs/reiserfs/reiserfs_vfsops.c	Wed Oct 27 15:44:49 2010	(r214420)
@@ -52,14 +52,16 @@ static int
 reiserfs_cmount(struct mntarg *ma, void *data, int flags)
 {
 	struct reiserfs_args args;
+	struct export_args exp;
 	int error;
 
 	error = copyin(data, &args, sizeof(args));
 	if (error)
 		return (error);
+	vfs_oexport_conv(&args.export, &exp);
 
 	ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN);
-	ma = mount_arg(ma, "export", &args.export, sizeof args.export);
+	ma = mount_arg(ma, "export", &exp, sizeof(exp));
 
 	error = kernel_mount(ma, flags);
 

Modified: stable/8/sys/kern/vfs_mount.c
==============================================================================
--- stable/8/sys/kern/vfs_mount.c	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/kern/vfs_mount.c	Wed Oct 27 15:44:49 2010	(r214420)
@@ -2501,3 +2501,11 @@ kernel_vmount(int flags, ...)
 	error = kernel_mount(ma, flags);
 	return (error);
 }
+
+void
+vfs_oexport_conv(const struct oexport_args *oexp, struct export_args *exp)
+{
+
+	bcopy(oexp, exp, sizeof(*oexp));
+	exp->ex_numsecflavors = 0;
+}

Modified: stable/8/sys/sys/mount.h
==============================================================================
--- stable/8/sys/sys/mount.h	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/sys/mount.h	Wed Oct 27 15:44:49 2010	(r214420)
@@ -738,6 +738,8 @@ int	vfs_modevent(module_t, int, void *);
 void	vfs_mount_error(struct mount *, const char *, ...);
 void	vfs_mountroot(void);			/* mount our root filesystem */
 void	vfs_mountedfrom(struct mount *, const char *from);
+void	vfs_oexport_conv(const struct oexport_args *oexp,
+	    struct export_args *exp);
 void	vfs_ref(struct mount *);
 void	vfs_rel(struct mount *);
 struct mount *vfs_mount_alloc(struct vnode *, struct vfsconf *, const char *,

Modified: stable/8/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- stable/8/sys/ufs/ffs/ffs_vfsops.c	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/ufs/ffs/ffs_vfsops.c	Wed Oct 27 15:44:49 2010	(r214420)
@@ -460,6 +460,7 @@ static int
 ffs_cmount(struct mntarg *ma, void *data, int flags)
 {
 	struct ufs_args args;
+	struct export_args exp;
 	int error;
 
 	if (data == NULL)
@@ -467,9 +468,10 @@ ffs_cmount(struct mntarg *ma, void *data
 	error = copyin(data, &args, sizeof args);
 	if (error)
 		return (error);
+	vfs_oexport_conv(&args.export, &exp);
 
 	ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN);
-	ma = mount_arg(ma, "export", &args.export, sizeof args.export);
+	ma = mount_arg(ma, "export", &exp, sizeof(exp));
 	error = kernel_mount(ma, flags);
 
 	return (error);

Modified: stable/8/sys/ufs/ufs/ufsmount.h
==============================================================================
--- stable/8/sys/ufs/ufs/ufsmount.h	Wed Oct 27 14:11:11 2010	(r214419)
+++ stable/8/sys/ufs/ufs/ufsmount.h	Wed Oct 27 15:44:49 2010	(r214420)
@@ -40,7 +40,7 @@
  */
 struct ufs_args {
 	char	*fspec;			/* block special device to mount */
-	struct	export_args export;	/* network export information */
+	struct	oexport_args export;	/* network export information */
 };
 
 #ifdef _KERNEL

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 15:57: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 9A587106564A;
	Wed, 27 Oct 2010 15:57:17 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 879958FC15;
	Wed, 27 Oct 2010 15:57: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 o9RFvHY8013023;
	Wed, 27 Oct 2010 15:57:17 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RFvHju013016;
	Wed, 27 Oct 2010 15:57:17 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201010271557.o9RFvHju013016@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 27 Oct 2010 15:57:17 +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: r214421 - in stable/8/sys: amd64/linux32 compat/svr4
	i386/ibcs2 i386/linux 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: Wed, 27 Oct 2010 15:57:17 -0000

Author: kib
Date: Wed Oct 27 15:57:17 2010
New Revision: 214421
URL: http://svn.freebsd.org/changeset/base/214421

Log:
  MFC r213716:
  Add macro DECLARE_MODULE_TIED to denote a module as requiring the
  kernel of exactly the same __FreeBSD_version as the headers module was
  compiled against.
  
  Mark our in-tree ABI emulators with DECLARE_MODULE_TIED. The modules
  use kernel interfaces that the Release Engineering Team feel are not
  stable enough to guarantee they will not change during the life cycle
  of a STABLE branch. In particular, the layout of struct sysentvec is
  declared to be not part of the STABLE KBI.

Modified:
  stable/8/sys/amd64/linux32/linux32_sysvec.c
  stable/8/sys/compat/svr4/svr4_sysvec.c
  stable/8/sys/i386/ibcs2/ibcs2_sysvec.c
  stable/8/sys/i386/linux/linux_sysvec.c
  stable/8/sys/sys/exec.h
  stable/8/sys/sys/module.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)

Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Oct 27 15:57:17 2010	(r214421)
@@ -1205,4 +1205,4 @@ static moduledata_t linux_elf_mod = {
 	0
 };
 
-DECLARE_MODULE(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);

Modified: stable/8/sys/compat/svr4/svr4_sysvec.c
==============================================================================
--- stable/8/sys/compat/svr4/svr4_sysvec.c	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/compat/svr4/svr4_sysvec.c	Wed Oct 27 15:57:17 2010	(r214421)
@@ -306,5 +306,5 @@ static moduledata_t svr4_elf_mod = {
 	svr4_elf_modevent,
 	0
 };
-DECLARE_MODULE(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
 MODULE_DEPEND(svr4elf, streams, 1, 1, 1);

Modified: stable/8/sys/i386/ibcs2/ibcs2_sysvec.c
==============================================================================
--- stable/8/sys/i386/ibcs2/ibcs2_sysvec.c	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/i386/ibcs2/ibcs2_sysvec.c	Wed Oct 27 15:57:17 2010	(r214421)
@@ -131,4 +131,4 @@ static moduledata_t ibcs2_mod = {
 	ibcs2_modevent,
 	0
 };
-DECLARE_MODULE(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
+DECLARE_MODULE_TIED(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);

Modified: stable/8/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/8/sys/i386/linux/linux_sysvec.c	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/i386/linux/linux_sysvec.c	Wed Oct 27 15:57:17 2010	(r214421)
@@ -1167,4 +1167,4 @@ static moduledata_t linux_elf_mod = {
 	0
 };
 
-DECLARE_MODULE(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);

Modified: stable/8/sys/sys/exec.h
==============================================================================
--- stable/8/sys/sys/exec.h	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/sys/exec.h	Wed Oct 27 15:57:17 2010	(r214421)
@@ -115,7 +115,8 @@ int exec_unregister(const struct execsw 
 		__CONCAT(name,_modevent), \
 		(void *)& execsw_arg \
 	}; \
-	DECLARE_MODULE(name, __CONCAT(name,_mod), SI_SUB_EXEC, SI_ORDER_ANY)
+	DECLARE_MODULE_TIED(name, __CONCAT(name,_mod), SI_SUB_EXEC, \
+	    SI_ORDER_ANY)
 #endif
 
 #endif

Modified: stable/8/sys/sys/module.h
==============================================================================
--- stable/8/sys/sys/module.h	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/sys/module.h	Wed Oct 27 15:57:17 2010	(r214421)
@@ -125,13 +125,26 @@ struct mod_metadata {
  */
 #define	MODULE_KERNEL_MAXVER	(roundup(__FreeBSD_version, 100000) - 1)
 
-#define	DECLARE_MODULE(name, data, sub, order)				\
+#define	DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, maxver)	\
 	MODULE_DEPEND(name, kernel, __FreeBSD_version,			\
-	    __FreeBSD_version, MODULE_KERNEL_MAXVER);			\
+	    __FreeBSD_version, maxver);			\
 	MODULE_METADATA(_md_##name, MDT_MODULE, &data, #name);		\
 	SYSINIT(name##module, sub, order, module_register_init, &data);	\
 	struct __hack
 
+#define	DECLARE_MODULE(name, data, sub, order)				\
+	DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, MODULE_KERNEL_MAXVER)
+
+/*
+ * The module declared with DECLARE_MODULE_TIED can only be loaded
+ * into the kernel with exactly the same __FreeBSD_version.
+ *
+ * Use it for modules that use kernel interfaces that are not stable
+ * even on STABLE/X branches.
+ */
+#define	DECLARE_MODULE_TIED(name, data, sub, order)				\
+	DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version)
+
 #define	MODULE_VERSION(module, version)					\
 	static struct mod_version _##module##_version = {		\
 		version							\

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 16: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 605151065670;
	Wed, 27 Oct 2010 16:01:58 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4E5DC8FC12;
	Wed, 27 Oct 2010 16: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 o9RG1vJd013246;
	Wed, 27 Oct 2010 16:01:57 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RG1vZv013243;
	Wed, 27 Oct 2010 16:01:57 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201010271601.o9RG1vZv013243@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 27 Oct 2010 16:01:57 +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: r214422 - stable/8/share/man/man9
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 16:01:58 -0000

Author: kib
Date: Wed Oct 27 16:01:57 2010
New Revision: 214422
URL: http://svn.freebsd.org/changeset/base/214422

Log:
  MFC r213983:
  Document vunref(9), add some important notes for vrele(9) and vput(9).
  Merge all three manpages to one, removing separate file for vput(9).
  
  MFC r214061 (by uqs):
  mdoc: fix markup typo.

Deleted:
  stable/8/share/man/man9/vput.9
Modified:
  stable/8/share/man/man9/Makefile
  stable/8/share/man/man9/vrele.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/Makefile
==============================================================================
--- stable/8/share/man/man9/Makefile	Wed Oct 27 15:57:17 2010	(r214421)
+++ stable/8/share/man/man9/Makefile	Wed Oct 27 16:01:57 2010	(r214422)
@@ -364,7 +364,6 @@ MAN=	accept_filter.9 \
 	VOP_STRATEGY.9 \
 	VOP_VPTOCNP.9 \
 	VOP_VPTOFH.9 \
-	vput.9 \
 	vref.9 \
 	vrefcnt.9 \
 	vrele.9 \
@@ -1359,6 +1358,8 @@ MLINKS+=VOP_RDWR.9 VOP_READ.9 \
 	VOP_RDWR.9 VOP_WRITE.9
 MLINKS+=VOP_REMOVE.9 VOP_RMDIR.9
 MLINKS+=vref.9 VREF.9
+MLINKS+=vrele.9 vput.9 \
+	vrele.9 vunref.9
 MLINKS+=vslock.9 vsunlock.9
 MLINKS+=zero_copy.9 zero_copy_sockets.9
 MLINKS+=zone.9 uma.9 \

Modified: stable/8/share/man/man9/vrele.9
==============================================================================
--- stable/8/share/man/man9/vrele.9	Wed Oct 27 15:57:17 2010	(r214421)
+++ stable/8/share/man/man9/vrele.9	Wed Oct 27 16:01:57 2010	(r214422)
@@ -1,6 +1,7 @@
 .\" -*- nroff -*-
 .\"
 .\" Copyright (c) 1996 Doug Rabson
+.\" Copyright (c) 2010 Konstantin Belousov 
 .\"
 .\" All rights reserved.
 .\"
@@ -28,17 +29,23 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 24, 1996
+.Dd October 17, 2010
 .Dt VRELE 9
 .Os
 .Sh NAME
-.Nm vrele
+.Nm vput ,
+.Nm vrele ,
+.Nm vunref
 .Nd decrement the use count for a vnode
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/vnode.h
 .Ft void
+.Fn vput "struct vnode *vp"
+.Ft void
 .Fn vrele "struct vnode *vp"
+.Ft void
+.Fn vunref "struct vnode *vp"
 .Sh DESCRIPTION
 Decrement the
 .Va v_usecount
@@ -48,18 +55,51 @@ field of a vnode.
 the vnode to decrement
 .El
 .Pp
-Any code in the system which is using a vnode should call
+The
 .Fn vrele
-when it is finished with the vnode.
+function takes an unlocked vnode and returns with the vnode unlocked.
+.Pp
+The
+.Fn vput
+function should be given a locked vnode as argument, the vnode is unlocked
+after the function returned.
+The
+.Fn vput
+is operationally equivalent to calling
+.Xr VOP_UNLOCK 9
+followed by
+.Xr vrele 9 ,
+with less overhead.
+.Pp
+The
+.Fn vunref
+function takes a locked vnode as argument, and returns with the vnode locked.
+Nonetheless, the
+.Fn vunref
+might drop the vnode lock during the operation, so caller should not expect
+that non-doomed vnode is still non-doomed after the function returned.
+.Pp
+Any code in the system which signified its use of a vnode by usecount
+should call one of the listed function to decrement use counter.
 If the
 .Va v_usecount
-field of the vnode reaches zero, then it will be placed on the free list.
+field of the non-doomed vnode reaches zero, then it will be inactivated
+and placed on the free list.
+Since the functions might need to call VOPs for the vnode, the
+.Va Giant
+mutex should be conditionally locked around the call.
+.Pp
+The hold count for the vnode is always greater or equal to the usecount.
+Non-forced unmount fails when mount point owns a vnode that has non-zero
+usecount, see
+.Xr vflush 9 .
 .Sh SEE ALSO
 .Xr vget 9 ,
 .Xr vnode 9 ,
-.Xr vput 9 ,
 .Xr vref 9 ,
 .Xr vrefcnt 9
 .Sh AUTHORS
 This manual page was written by
-.An Doug Rabson .
+.An Doug Rabson
+and
+.An Konstantin Belousov .

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 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 E1BD71065672;
	Wed, 27 Oct 2010 16:07:40 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id CBD1B8FC17;
	Wed, 27 Oct 2010 16:07:39 +0000 (UTC)
Received: by wwb24 with SMTP id 24so810113wwb.31
	for ; Wed, 27 Oct 2010 09:07:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type;
	bh=FRJU5r/w71R+p4m6cqsd6pehK7dikrCOFdDZmh1qLoY=;
	b=bRyKNxuk0kUbkV+iTFsBBvk8c7mr0eZt9fEI5KZZ8zutZOwwcEstGJqopyD73nZm/z
	NmjU8uxPmh6qc3kHaBMnPsfCjQWdsjCfF7i9DdsCXy9QOK53AUU3Nf9FPv973nQnTZY2
	glLCCuX3Y3q7MR+G4eQxeSXaVqGqiPSmLxOZQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	b=BLmk5oGlG/pBJ7jpk7nhdGHWlYugHmo8gSVjpjL0V4gNQZGWb6OcTpCRfmzulrgxPf
	9VTgW3bF7BaKxBGHZiRCcwDWFv97fKh3Mv4qemSoIQFOwfB0jQggW8pDlDC/5x8wJ2Jp
	048/9KmmQIGP5snmpXd+vkNhA+mR839edSHGM=
MIME-Version: 1.0
Received: by 10.216.23.147 with SMTP id v19mr1054195wev.58.1288195658264; Wed,
	27 Oct 2010 09:07:38 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.10.198 with HTTP; Wed, 27 Oct 2010 09:07:37 -0700 (PDT)
In-Reply-To: <20101027133307.GQ2392@deviant.kiev.zoral.com.ua>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	<20101027082122.GD1848@garage.freebsd.pl>
	<4CC85552.2020100@freebsd.org>
	<20101027133307.GQ2392@deviant.kiev.zoral.com.ua>
Date: Wed, 27 Oct 2010 09:07:37 -0700
X-Google-Sender-Auth: mHF7z1HoNYBFVdi1KUJBCbEtzZk
Message-ID: 
From: Garrett Cooper 
To: Kostik Belousov 
Content-Type: multipart/mixed; boundary=0016364d1f159cc03b04939b6ccb
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Pawel Jakub Dawidek ,
	David Xu 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 16:07:41 -0000

--0016364d1f159cc03b04939b6ccb
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Oct 27, 2010 at 6:33 AM, Kostik Belousov  wrote:
> On Wed, Oct 27, 2010 at 04:37:38PM +0000, David Xu wrote:
>> Pawel Jakub Dawidek wrote:
>> >On Wed, Oct 27, 2010 at 10:49:12AM +0000, David Xu wrote:
>> >>I really hate to see such a problem that userland can not figure out
>> >>what kernel is using, I try hardly to guess, but still can not find
>> >>what it is using. yes, I think the doc may need to be fixed or
>> >>another syscall is needed.
>> >
>> >Maybe you could just add sysctl and eventually put it into sysconf(3)?
>> >
>>
>> I just found a dirty method, use sizeof(long) and kern.smp.maxcpus
>> 32 to figure out the size the kernel is using, because it is how
>> cpuset_t is constructed, wish it will never be changed. ;-)
>>
> I think that sysctl is the way forward, but you may add non-portable
> FreeBSD function to get the value, and use an ELF aux vector interface
> to avoid sysctl most of the time.

    How about this patch? I implemented this as a readonly tunable and
sysconf tunable, because (AFAIK) the value that is being tested
shouldn't change during runtime after the system has been booted up,
and figuring that the value wasn't going to change it was better to
lose 4/8 bytes on the kernel stack instead of having to recompute the
value every time in a function call, with the associated lost heap /
stack memory in the process, as the assumption is that this libcall
was going to be called frequently by some programs.
Thanks!
-Garrett

--0016364d1f159cc03b04939b6ccb
Content-Type: text/x-patch; charset=US-ASCII; 
	name="cpuset_t-size-sysctl-and-sysconf-value.patch"
Content-Disposition: attachment; 
	filename="cpuset_t-size-sysctl-and-sysconf-value.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gfseer440

SW5kZXg6IGluY2x1ZGUvdW5pc3RkLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gaW5jbHVkZS91bmlzdGQuaAko
cmV2aXNpb24gMjE0NDEzKQorKysgaW5jbHVkZS91bmlzdGQuaAkod29ya2luZyBjb3B5KQpAQCAt
Mjg4LDYgKzI4OCw3IEBACiAjaWYgX19CU0RfVklTSUJMRQogI2RlZmluZQlfU0NfTlBST0NFU1NP
UlNfQ09ORgk1NwogI2RlZmluZQlfU0NfTlBST0NFU1NPUlNfT05MTgk1OAorI2RlZmluZQlfU0Nf
Q1BVU0VUX1NJWkUJCTEyMgogI2VuZGlmCiAKIC8qIEV4dGVuc2lvbnMgZm91bmQgaW4gU29sYXJp
cyBhbmQgTGludXguICovCkluZGV4OiBsaWIvbGliYy9nZW4vc3lzY29uZi5jCj09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0K
LS0tIGxpYi9saWJjL2dlbi9zeXNjb25mLmMJKHJldmlzaW9uIDIxNDQxMykKKysrIGxpYi9saWJj
L2dlbi9zeXNjb25mLmMJKHdvcmtpbmcgY29weSkKQEAgLTU5Nyw2ICs1OTcsMTUgQEAKIAkJcmV0
dXJuIChsdmFsdWUpOwogI2VuZGlmCiAKKyNpZmRlZiBfU0NfQ1BVU0VUX1NJWkUKKwljYXNlIF9T
Q19DUFVTRVRfU0laRToKKwkJbGVuID0gc2l6ZW9mKGx2YWx1ZSk7CisJCWlmIChzeXNjdGxieW5h
bWUoImtlcm4uc2NoZWQuY3B1c2V0c2l6ZSIsICZsdmFsdWUsICZsZW4sIE5VTEwsCisJCSAgICAw
KSA9PSAtMSkKKwkJCXJldHVybiAoLTEpOworCQlyZXR1cm4gKGx2YWx1ZSk7CisjZW5kaWYKKwog
CWRlZmF1bHQ6CiAJCWVycm5vID0gRUlOVkFMOwogCQlyZXR1cm4gKC0xKTsKSW5kZXg6IHN5cy9r
ZXJuL3NjaGVkX3VsZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9rZXJuL3NjaGVkX3VsZS5jCShyZXZp
c2lvbiAyMTQ0MTMpCisrKyBzeXMva2Vybi9zY2hlZF91bGUuYwkod29ya2luZyBjb3B5KQpAQCAt
MjcxMiw2ICsyNzEyLDggQEAKIAlzYnVmX2RlbGV0ZSh0b3BvKTsKIAlyZXR1cm4gKGVycik7CiB9
CisKK3N0YXRpYyBzaXplX3QgX2tlcm5fY3B1c2V0X3NpemUgPSBzaXplb2YoY3B1c2V0X3QpOwog
I2VuZGlmCiAKIFNZU0NUTF9OT0RFKF9rZXJuLCBPSURfQVVUTywgc2NoZWQsIENUTEZMQUdfUlcs
IDAsICJTY2hlZHVsZXIiKTsKQEAgLTI3NDgsNiArMjc1MCwxNSBAQAogU1lTQ1RMX1BST0MoX2tl
cm5fc2NoZWQsIE9JRF9BVVRPLCB0b3BvbG9neV9zcGVjLCBDVExUWVBFX1NUUklORyB8CiAgICAg
Q1RMRkxBR19SRCwgTlVMTCwgMCwgc3lzY3RsX2tlcm5fc2NoZWRfdG9wb2xvZ3lfc3BlYywgIkEi
LCAKICAgICAiWE1MIGR1bXAgb2YgZGV0ZWN0ZWQgQ1BVIHRvcG9sb2d5Iik7CisKKy8qIAorICog
UmV0dXJuIHRoZSBzaXplIG9mIGNwdXNldF90IGF0IHRoZSBrZXJuZWwgbGV2ZWwKKyAqCisgKiBY
WFggKGdjb29wZXIpOiByZXBsYWNlIFVMT05HIHdpdGggU0laRSBvbmNlIENUTFRZUEVfU0laRSBp
cyBpbXBsZW1lbnRlZC4KKyAqLworU1lTQ1RMX1VMT05HKF9rZXJuX3NjaGVkLCBPSURfQVVUTywg
Y3B1c2V0c2l6ZSwgQ1RMRkxBR19SRFRVTiwKKyAgICAmX2tlcm5fY3B1c2V0X3NpemUsIDAsICJL
ZXJuZWwtbGV2ZWwgY3B1c2V0X3Qgc3RydWN0IHNpemUiKTsKKwogI2VuZGlmCiAKIC8qIHBzIGNv
bXBhdC4gIEFsbCBjcHUgcGVyY2VudGFnZXMgZnJvbSBVTEUgYXJlIHdlaWdodGVkLiAqLwo=
--0016364d1f159cc03b04939b6ccb--

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 16:22: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 54DB7106566B;
	Wed, 27 Oct 2010 16:22:41 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
	by mx1.freebsd.org (Postfix) with ESMTP id 5CA7D8FC17;
	Wed, 27 Oct 2010 16:22:39 +0000 (UTC)
Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua
	[212.40.38.101])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA26207;
	Wed, 27 Oct 2010 19:22:37 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Message-ID: <4CC851CC.80509@freebsd.org>
Date: Wed, 27 Oct 2010 19:22:36 +0300
From: Andriy Gapon 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.11) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.5
MIME-Version: 1.0
To: Garrett Cooper 
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>		<4CC803A8.3040602@freebsd.org>	<20101027082122.GD1848@garage.freebsd.pl>	<4CC85552.2020100@freebsd.org>	<20101027133307.GQ2392@deviant.kiev.zoral.com.ua>
	
In-Reply-To: 
X-Enigmail-Version: 1.1.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: src-committers@freebsd.org, Pawel Jakub Dawidek ,
	svn-src-all@freebsd.org, svn-src-head@freebsd.org,
	David Xu , Kostik Belousov 
Subject: Re: svn commit: r214409 - 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: Wed, 27 Oct 2010 16:22:41 -0000


[patch attachment was lost]

on 27/10/2010 19:07 Garrett Cooper said the following:
>     How about this patch? I implemented this as a readonly tunable and

I don't think that it's correct to call it a tunable or use CTLFLAG_RDTUN.
As I understand it is a read-only sysctl.

> sysconf tunable, because (AFAIK) the value that is being tested
> shouldn't change during runtime after the system has been booted up,
> and figuring that the value wasn't going to change it was better to
> lose 4/8 bytes on the kernel stack instead of having to recompute the
> value every time in a function call, with the associated lost heap /
> stack memory in the process, as the assumption is that this libcall
> was going to be called frequently by some programs.
> Thanks!

-- 
Andriy Gapon

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 16:46: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 4918F1065672;
	Wed, 27 Oct 2010 16:46:38 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 37A8B8FC18;
	Wed, 27 Oct 2010 16:46: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 o9RGkbuw014769;
	Wed, 27 Oct 2010 16:46:37 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RGkbvM014765;
	Wed, 27 Oct 2010 16:46:37 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201010271646.o9RGkbvM014765@svn.freebsd.org>
From: Alan Cox 
Date: Wed, 27 Oct 2010 16:46: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: r214425 - in head/sys/amd64: amd64 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: Wed, 27 Oct 2010 16:46:38 -0000

Author: alc
Date: Wed Oct 27 16:46:37 2010
New Revision: 214425
URL: http://svn.freebsd.org/changeset/base/214425

Log:
  [1] According to the x86 architectural specifications, no virtual-to-
  physical page mapping should span two or more MTRRs of different types.
  Add a pmap function, pmap_demote_DMAP(), by which the MTRR module can
  ensure that the direct map region doesn't have such a mapping.
  
  [2] Fix a couple of nearby style errors in amd64_mrset().
  
  [3] Re-enable the use of 1GB page mappings for implementing the direct
  map.  (See also r197580 and r213897.)
  
  Tested by:	kib@ on a Westmere-family processor [3]
  MFC after:	3 weeks

Modified:
  head/sys/amd64/amd64/amd64_mem.c
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/include/pmap.h

Modified: head/sys/amd64/amd64/amd64_mem.c
==============================================================================
--- head/sys/amd64/amd64/amd64_mem.c	Wed Oct 27 16:35:23 2010	(r214424)
+++ head/sys/amd64/amd64/amd64_mem.c	Wed Oct 27 16:46:37 2010	(r214425)
@@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -527,9 +531,9 @@ static int
 amd64_mrset(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg)
 {
 	struct mem_range_desc *targ;
-	int error = 0;
+	int error, i;
 
-	switch(*arg) {
+	switch (*arg) {
 	case MEMRANGE_SET_UPDATE:
 		/*
 		 * Make sure that what's being asked for is even
@@ -568,6 +572,21 @@ amd64_mrset(struct mem_range_softc *sc, 
 		return (EOPNOTSUPP);
 	}
 
+	/*
+	 * Ensure that the direct map region does not contain any mappings
+	 * that span MTRRs of different types.  However, the fixed MTRRs can
+	 * be ignored, because a large page mapping the first 1 MB of physical
+	 * memory is a special case that the processor handles.  The entire
+	 * TLB will be invalidated by amd64_mrstore(), so pmap_demote_DMAP()
+	 * needn't do it.
+	 */
+	i = (sc->mr_cap & MR686_FIXMTRR) ? MTRR_N64K + MTRR_N16K + MTRR_N4K : 0;
+	mrd = sc->mr_desc + i;
+	for (; i < sc->mr_ndesc; i++, mrd++) {
+		if (mrd->mr_flags & MDF_ACTIVE)
+			pmap_demote_DMAP(mrd->mr_base, mrd->mr_len, FALSE);
+	}
+
 	/* Update the hardware. */
 	amd64_mrstore(sc);
 
@@ -657,6 +676,21 @@ amd64_mrinit(struct mem_range_softc *sc)
 		if (mrd->mr_flags & MDF_ACTIVE)
 			mrd->mr_flags |= MDF_FIRMWARE;
 	}
+
+	/*
+	 * Ensure that the direct map region does not contain any mappings
+	 * that span MTRRs of different types.  However, the fixed MTRRs can
+	 * be ignored, because a large page mapping the first 1 MB of physical
+	 * memory is a special case that the processor handles.  Invalidate
+	 * any old TLB entries that might hold inconsistent memory type
+	 * information. 
+	 */
+	i = (sc->mr_cap & MR686_FIXMTRR) ? MTRR_N64K + MTRR_N16K + MTRR_N4K : 0;
+	mrd = sc->mr_desc + i;
+	for (; i < sc->mr_ndesc; i++, mrd++) {
+		if (mrd->mr_flags & MDF_ACTIVE)
+			pmap_demote_DMAP(mrd->mr_base, mrd->mr_len, TRUE);
+	}
 }
 
 /*

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Wed Oct 27 16:35:23 2010	(r214424)
+++ head/sys/amd64/amd64/pmap.c	Wed Oct 27 16:46:37 2010	(r214425)
@@ -462,7 +462,7 @@ create_pagetables(vm_paddr_t *firstaddr)
 	if (ndmpdp < 4)		/* Minimum 4GB of dirmap */
 		ndmpdp = 4;
 	DMPDPphys = allocpages(firstaddr, NDMPML4E);
-	if (TRUE || (amd_feature & AMDID_PAGE1GB) == 0)
+	if ((amd_feature & AMDID_PAGE1GB) == 0)
 		DMPDphys = allocpages(firstaddr, ndmpdp);
 	dmaplimit = (vm_paddr_t)ndmpdp << PDPSHIFT;
 
@@ -494,11 +494,16 @@ create_pagetables(vm_paddr_t *firstaddr)
 		((pdp_entry_t *)KPDPphys)[i + KPDPI] |= PG_RW | PG_V | PG_U;
 	}
 
-	/* Now set up the direct map space using either 2MB or 1GB pages */
-	/* Preset PG_M and PG_A because demotion expects it */
-	if (TRUE || (amd_feature & AMDID_PAGE1GB) == 0) {
+	/*
+	 * Now, set up the direct map region using either 2MB or 1GB pages.
+	 * Later, if pmap_mapdev{_attr}() uses the direct map for non-write-
+	 * back memory, pmap_change_attr() will demote any 2MB or 1GB page
+	 * mappings that are partially used.
+	 */
+	if ((amd_feature & AMDID_PAGE1GB) == 0) {
 		for (i = 0; i < NPDEPG * ndmpdp; i++) {
 			((pd_entry_t *)DMPDphys)[i] = (vm_paddr_t)i << PDRSHIFT;
+			/* Preset PG_M and PG_A because demotion expects it. */
 			((pd_entry_t *)DMPDphys)[i] |= PG_RW | PG_V | PG_PS |
 			    PG_G | PG_M | PG_A;
 		}
@@ -512,6 +517,7 @@ create_pagetables(vm_paddr_t *firstaddr)
 		for (i = 0; i < ndmpdp; i++) {
 			((pdp_entry_t *)DMPDPphys)[i] =
 			    (vm_paddr_t)i << PDPSHIFT;
+			/* Preset PG_M and PG_A because demotion expects it. */
 			((pdp_entry_t *)DMPDPphys)[i] |= PG_RW | PG_V | PG_PS |
 			    PG_G | PG_M | PG_A;
 		}
@@ -4948,6 +4954,49 @@ pmap_change_attr_locked(vm_offset_t va, 
 }
 
 /*
+ * Demotes any mapping within the direct map region that covers more than the
+ * specified range of physical addresses.  This range's size must be a power
+ * of two and its starting address must be a multiple of its size.  Since the
+ * demotion does not change any attributes of the mapping, a TLB invalidation
+ * is not mandatory.  The caller may, however, request a TLB invalidation.
+ */
+void
+pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate)
+{
+	pdp_entry_t *pdpe;
+	pd_entry_t *pde;
+	vm_offset_t va;
+	boolean_t changed;
+
+	if (len < NBPDP) {
+		va = PHYS_TO_DMAP(base);
+		changed = FALSE;
+		PMAP_LOCK(kernel_pmap);
+		pdpe = pmap_pdpe(kernel_pmap, va);
+		if ((*pdpe & PG_V) == 0)
+			panic("pmap_demote_DMAP: invalid PDPE");
+		if ((*pdpe & PG_PS) != 0) {
+			if (!pmap_demote_pdpe(kernel_pmap, pdpe, va))
+				panic("pmap_demote_DMAP: PDPE failed");
+			changed = TRUE;
+		}
+		if (len < NBPDR) {
+			pde = pmap_pdpe_to_pde(pdpe, va);
+			if ((*pde & PG_V) == 0)
+				panic("pmap_demote_DMAP: invalid PDE");
+			if ((*pde & PG_PS) != 0) {
+				if (!pmap_demote_pde(kernel_pmap, pde, va))
+					panic("pmap_demote_DMAP: PDE failed");
+				changed = TRUE;
+			}
+		}
+		if (changed && invalidate)
+			pmap_invalidate_page(kernel_pmap, va);
+		PMAP_UNLOCK(kernel_pmap);
+	}
+}
+
+/*
  * perform the pmap work for mincore
  */
 int

Modified: head/sys/amd64/include/pmap.h
==============================================================================
--- head/sys/amd64/include/pmap.h	Wed Oct 27 16:35:23 2010	(r214424)
+++ head/sys/amd64/include/pmap.h	Wed Oct 27 16:46:37 2010	(r214425)
@@ -307,6 +307,7 @@ extern vm_offset_t virtual_end;
 
 void	pmap_bootstrap(vm_paddr_t *);
 int	pmap_change_attr(vm_offset_t, vm_size_t, int);
+void	pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate);
 void	pmap_init_pat(void);
 void	pmap_kenter(vm_offset_t va, vm_paddr_t pa);
 void	*pmap_kenter_temporary(vm_paddr_t pa, int i);

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 17:13: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 A7A591065695;
	Wed, 27 Oct 2010 17:13:38 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9715A8FC19;
	Wed, 27 Oct 2010 17:13: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 o9RHDc9h015712;
	Wed, 27 Oct 2010 17:13:38 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RHDcWg015710;
	Wed, 27 Oct 2010 17:13:38 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201010271713.o9RHDcWg015710@svn.freebsd.org>
From: Xin LI 
Date: Wed, 27 Oct 2010 17:13: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: r214426 - head/release
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 17:13:38 -0000

Author: delphij
Date: Wed Oct 27 17:13:38 2010
New Revision: 214426
URL: http://svn.freebsd.org/changeset/base/214426

Log:
  Add a short note about kernel modules in FIXIT mode.
  
  MFC after:	1 month

Modified:
  head/release/fixit.profile

Modified: head/release/fixit.profile
==============================================================================
--- head/release/fixit.profile	Wed Oct 27 16:46:37 2010	(r214425)
+++ head/release/fixit.profile	Wed Oct 27 17:13:38 2010	(r214426)
@@ -25,6 +25,10 @@ echo '| You might want to symlink /mnt/e
 echo '| to /etc after mounting a root filesystem from your disk.      |'
 echo '| tar(1) will not restore all permissions correctly otherwise!  |'
 echo '|                                                               |'
+echo '| In order to load kernel modules you might want to add the     |'
+echo '| fixit media to the kern.module_path sysctl variable so that   |'
+echo '| the kernel knows where to find them.                          |'
+echo '|                                                               |'
 echo '| Note: you can use the arrow keys to browse through the        |'
 echo '| command history of this shell.                                |'
 echo '+---------------------------------------------------------------+'

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 17:16: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 E5B9E1065670;
	Wed, 27 Oct 2010 17:16:40 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BA7908FC0A;
	Wed, 27 Oct 2010 17:16: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 o9RHGenv015864;
	Wed, 27 Oct 2010 17:16:40 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RHGeF0015861;
	Wed, 27 Oct 2010 17:16:40 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201010271716.o9RHGeF0015861@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 27 Oct 2010 17:16: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: r214427 - head/sys/dev/mii
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 17:16:41 -0000

Author: yongari
Date: Wed Oct 27 17:16:40 2010
New Revision: 214427
URL: http://svn.freebsd.org/changeset/base/214427

Log:
  Add BCM5717C 10/100/1000TX PHY id.

Modified:
  head/sys/dev/mii/brgphy.c
  head/sys/dev/mii/miidevs

Modified: head/sys/dev/mii/brgphy.c
==============================================================================
--- head/sys/dev/mii/brgphy.c	Wed Oct 27 17:13:38 2010	(r214426)
+++ head/sys/dev/mii/brgphy.c	Wed Oct 27 17:16:40 2010	(r214427)
@@ -141,6 +141,7 @@ static const struct mii_phydesc brgphys[
 	MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C),
 	MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761),
 	MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709S),
+	MII_PHY_DESC(xxBROADCOM_ALT2, BCM5717C),
 	MII_PHY_DESC(BROADCOM2, BCM5906),
 	MII_PHY_END
 };
@@ -253,6 +254,9 @@ brgphy_attach(device_t dev)
 			break;
 		}
 		break;
+	case MII_OUI_xxBROADCOM_ALT2:
+		/* No special handling yet. */
+		break;
 	default:
 		device_printf(dev, "Unrecognized OUI for PHY!\n");
 	}
@@ -1011,6 +1015,7 @@ brgphy_reset(struct mii_softc *sc)
 		}
 		break;
 	case MII_OUI_xxBROADCOM_ALT1:
+	case MII_OUI_xxBROADCOM_ALT2:
 		break;
 	}
 

Modified: head/sys/dev/mii/miidevs
==============================================================================
--- head/sys/dev/mii/miidevs	Wed Oct 27 17:13:38 2010	(r214426)
+++ head/sys/dev/mii/miidevs	Wed Oct 27 17:16:40 2010	(r214427)
@@ -81,6 +81,7 @@ oui xxINTEL			0x00f800	Intel
 oui xxALTIMA			0x000895	Altima Communications
 oui xxBROADCOM			0x000818	Broadcom Corporation
 oui xxBROADCOM_ALT1		0x0050ef	Broadcom Corporation
+oui xxBROADCOM_ALT2		0x00d897	Broadcom Corporation
 oui xxICS			0x00057d	Integrated Circuit Systems
 oui xxSEEQ			0x0005be	Seeq
 oui xxSIS			0x000760	Silicon Integrated Systems
@@ -153,6 +154,7 @@ model xxBROADCOM_ALT1 BCM5784	0x003a BCM
 model xxBROADCOM_ALT1 BCM5709C	0x003c BCM5709C 10/100/1000baseTX PHY
 model xxBROADCOM_ALT1 BCM5761	0x003d BCM5761 10/100/1000baseTX PHY
 model xxBROADCOM_ALT1 BCM5709S	0x003f BCM5709S 1000/2500baseSX PHY
+model xxBROADCOM_ALT2 BCM5717C	0x0020 BCM5717C 10/100/1000baseTX PHY
 model BROADCOM2 BCM5906		0x0004 BCM5906 10/100baseTX PHY
 
 /* Cicada Semiconductor PHYs (now owned by Vitesse?) */

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 17:20: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 732C4106566B;
	Wed, 27 Oct 2010 17:20:19 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 612038FC08;
	Wed, 27 Oct 2010 17:20: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 o9RHKJ8i016016;
	Wed, 27 Oct 2010 17:20:19 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RHKJYK016013;
	Wed, 27 Oct 2010 17:20:19 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201010271720.o9RHKJYK016013@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 27 Oct 2010 17:20: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: r214428 - 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: Wed, 27 Oct 2010 17:20:19 -0000

Author: yongari
Date: Wed Oct 27 17:20:19 2010
New Revision: 214428
URL: http://svn.freebsd.org/changeset/base/214428

Log:
  Add initial BCM5718 family support. The BCM5718 family includes
  the dual port BCM5717 and BCM5718 devices which are intended for
  mainstream workstation and entry-level server designs and
  represents the twelfth generation of NetXtreme Ethernet controllers.
  This family is the successor to the BCM5714/BCM5715 family and
  supports IPv4/IPv6 checksum offloading, TSO, VLAN hardware tagging,
  jumbo frames, MSI/MSIX, IOV, RSS and TSS.
  
  This change set supports all hardware features except IOV and
  RSS/TSS. Unlike its predecessors, only extended RX buffer
  descriptors can be posted to the jumbo producer ring. Single RX
  buffer descriptors for jumbo frame are not supported. RSS requires
  a more substantial set of changes and will apply to a larger set
  of NetXtreme devices so RSS/TSS multi-queue support will be
  implemented in a future releases.
  
  Special thanks to Broadcom who kindly sent a sample board to me
  and to davidch who gave provided the initial support code.
  
  Submitted by:	davidch (initial version)
  HW donated by:	Broadcom

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bge/if_bgereg.h

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Wed Oct 27 17:16:40 2010	(r214427)
+++ head/sys/dev/bge/if_bge.c	Wed Oct 27 17:20:19 2010	(r214428)
@@ -169,6 +169,8 @@ static const struct bge_type {
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5714S },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5715 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5715S },
+	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5717 },
+	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5718 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5720 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5721 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5722 },
@@ -289,6 +291,8 @@ static const struct bge_revision {
 	{ BGE_CHIPID_BCM5715_A0,	"BCM5715 A0" },
 	{ BGE_CHIPID_BCM5715_A1,	"BCM5715 A1" },
 	{ BGE_CHIPID_BCM5715_A3,	"BCM5715 A3" },
+	{ BGE_CHIPID_BCM5717_A0,	"BCM5717 A0" },
+	{ BGE_CHIPID_BCM5717_B0,	"BCM5717 B0" },
 	{ BGE_CHIPID_BCM5755_A0,	"BCM5755 A0" },
 	{ BGE_CHIPID_BCM5755_A1,	"BCM5755 A1" },
 	{ BGE_CHIPID_BCM5755_A2,	"BCM5755 A2" },
@@ -332,6 +336,7 @@ static const struct bge_revision bge_maj
 	{ BGE_ASICREV_BCM5787,		"unknown BCM5754/5787" },
 	{ BGE_ASICREV_BCM5906,		"unknown BCM5906" },
 	{ BGE_ASICREV_BCM57780,		"unknown BCM57780" },
+	{ BGE_ASICREV_BCM5717,		"unknown BCM5717" },
 
 	{ 0, NULL }
 };
@@ -342,6 +347,7 @@ static const struct bge_revision bge_maj
 #define	BGE_IS_5714_FAMILY(sc)		((sc)->bge_flags & BGE_FLAG_5714_FAMILY)
 #define	BGE_IS_575X_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_575X_PLUS)
 #define	BGE_IS_5755_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_5755_PLUS)
+#define	BGE_IS_5717_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_5717_PLUS)
 
 const struct bge_revision * bge_lookup_rev(uint32_t);
 const struct bge_vendor * bge_lookup_vendor(uint16_t);
@@ -367,6 +373,7 @@ static int bge_get_eaddr_eeprom(struct b
 static int bge_get_eaddr(struct bge_softc *, uint8_t[]);
 
 static void bge_txeof(struct bge_softc *, uint16_t);
+static void bge_rxcsum(struct bge_softc *, struct bge_rx_bd *, struct mbuf *);
 static int bge_rxeof(struct bge_softc *, uint16_t, int);
 
 static void bge_asf_driver_up (struct bge_softc *);
@@ -376,7 +383,7 @@ static void bge_stats_update(struct bge_
 static void bge_stats_update_regs(struct bge_softc *);
 static struct mbuf *bge_check_short_dma(struct mbuf *);
 static struct mbuf *bge_setup_tso(struct bge_softc *, struct mbuf *,
-    uint16_t *);
+    uint16_t *, uint16_t *);
 static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *);
 
 static void bge_intr(void *);
@@ -1349,12 +1356,15 @@ bge_stop_fw(struct bge_softc *sc)
 static int
 bge_chipinit(struct bge_softc *sc)
 {
-	uint32_t dma_rw_ctl;
+	uint32_t dma_rw_ctl, misc_ctl;
 	uint16_t val;
 	int i;
 
 	/* Set endianness before we access any non-PCI registers. */
-	pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4);
+	misc_ctl = BGE_INIT;
+	if (sc->bge_flags & BGE_FLAG_TAGGED_STATUS)
+		misc_ctl |= BGE_PCIMISCCTL_TAGGED_STATUS;
+	pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, misc_ctl, 4);
 
 	/* Clear the MAC control register */
 	CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
@@ -1446,6 +1456,8 @@ bge_chipinit(struct bge_softc *sc)
 	if (sc->bge_asicrev == BGE_ASICREV_BCM5703 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5704)
 		dma_rw_ctl &= ~BGE_PCIDMARWCTL_MINDMA;
+	if (BGE_IS_5717_PLUS(sc))
+		dma_rw_ctl &= ~BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT;
 	pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4);
 
 	/*
@@ -1529,7 +1541,16 @@ bge_blockinit(struct bge_softc *sc)
 	}
 
 	/* Configure mbuf pool watermarks */
-	if (!BGE_IS_5705_PLUS(sc)) {
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5717) {
+		CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
+		if (sc->bge_ifp->if_mtu > ETHERMTU) {
+			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x7e);
+			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xea);
+		} else {
+			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x2a);
+			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xa0);
+		}
+	} else if (!BGE_IS_5705_PLUS(sc)) {
 		CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x50);
 		CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x20);
 		CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0x60);
@@ -1621,7 +1642,16 @@ bge_blockinit(struct bge_softc *sc)
 	    BGE_ADDR_HI(sc->bge_ldata.bge_rx_std_ring_paddr);
 	bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag,
 	    sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREREAD);
-	if (BGE_IS_5705_PLUS(sc)) {
+	if (BGE_IS_5717_PLUS(sc)) {
+		/*
+		 * Bits 31-16: Programmable ring size (2048, 1024, 512, .., 32)
+		 * Bits 15-2 : Maximum RX frame size
+		 * Bit 1     : 1 = Ring Disabled, 0 = Ring ENabled
+		 * Bit 0     : Reserved
+		 */
+		rcb->bge_maxlen_flags =
+		    BGE_RCB_MAXLEN_FLAGS(512, BGE_MAX_FRAMELEN << 2);
+	} else if (BGE_IS_5705_PLUS(sc)) {
 		/*
 		 * Bits 31-16: Programmable ring size (512, 256, 128, 64, 32)
 		 * Bits 15-2 : Reserved (should be 0)
@@ -1640,7 +1670,10 @@ bge_blockinit(struct bge_softc *sc)
 		rcb->bge_maxlen_flags =
 		    BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0);
 	}
-	rcb->bge_nicaddr = BGE_STD_RX_RINGS;
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5717)
+		rcb->bge_nicaddr = BGE_STD_RX_RINGS_5717;
+	else
+		rcb->bge_nicaddr = BGE_STD_RX_RINGS;
 	/* Write the standard receive producer ring control block. */
 	CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_HI, rcb->bge_hostaddr.bge_addr_hi);
 	CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_LO, rcb->bge_hostaddr.bge_addr_lo);
@@ -1669,7 +1702,10 @@ bge_blockinit(struct bge_softc *sc)
 		    BUS_DMASYNC_PREREAD);
 		rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0,
 		    BGE_RCB_FLAG_USE_EXT_RX_BD | BGE_RCB_FLAG_RING_DISABLED);
-		rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS;
+		if (sc->bge_asicrev == BGE_ASICREV_BCM5717)
+			rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS_5717;
+		else
+			rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS;
 		CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_HADDR_HI,
 		    rcb->bge_hostaddr.bge_addr_hi);
 		CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_HADDR_LO,
@@ -1726,6 +1762,10 @@ bge_blockinit(struct bge_softc *sc)
 	if (BGE_IS_JUMBO_CAPABLE(sc))
 		CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH,
 		    BGE_JUMBO_RX_RING_CNT/8);
+	if (BGE_IS_5717_PLUS(sc)) {
+		CSR_WRITE_4(sc, BGE_STD_REPLENISH_LWM, 32);
+		CSR_WRITE_4(sc, BGE_JMB_REPLENISH_LWM, 16);
+	}
 
 	/*
 	 * Disable all send rings by setting the 'ring disabled' bit
@@ -1750,8 +1790,11 @@ bge_blockinit(struct bge_softc *sc)
 	BGE_HOSTADDR(taddr, sc->bge_ldata.bge_tx_ring_paddr);
 	RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_hi, taddr.bge_addr_hi);
 	RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo);
-	RCB_WRITE_4(sc, vrcb, bge_nicaddr,
-	    BGE_NIC_TXRING_ADDR(0, BGE_TX_RING_CNT));
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5717)
+		RCB_WRITE_4(sc, vrcb, bge_nicaddr, BGE_SEND_RING_5717);
+	else
+		RCB_WRITE_4(sc, vrcb, bge_nicaddr,
+		    BGE_NIC_TXRING_ADDR(0, BGE_TX_RING_CNT));
 	RCB_WRITE_4(sc, vrcb, bge_maxlen_flags,
 	    BGE_RCB_MAXLEN_FLAGS(BGE_TX_RING_CNT, 0));
 
@@ -1760,7 +1803,10 @@ bge_blockinit(struct bge_softc *sc)
 	 * 'ring diabled' bit in the flags field of all the receive
 	 * return ring control blocks, located in NIC memory.
 	 */
-	if (!BGE_IS_5705_PLUS(sc))
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5717) {
+		/* Should be 17, use 16 until we get an SRAM map. */
+		limit = 16;
+	} else if (!BGE_IS_5705_PLUS(sc))
 		limit = BGE_RX_RINGS_MAX;
 	else if (sc->bge_asicrev == BGE_ASICREV_BCM5755)
 		limit = 4;
@@ -1936,6 +1982,10 @@ bge_blockinit(struct bge_softc *sc)
 
 	/* Turn on read DMA state machine */
 	val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS;
+
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5717)
+		val |= BGE_RDMAMODE_MULT_DMA_RD_DIS;
+
 	if (sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5785 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM57780)
@@ -1944,16 +1994,18 @@ bge_blockinit(struct bge_softc *sc)
 		    BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN;
 	if (sc->bge_flags & BGE_FLAG_PCIE)
 		val |= BGE_RDMAMODE_FIFO_LONG_BURST;
-	if (sc->bge_flags & BGE_FLAG_TSO) {
+	if (sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) {
 		val |= BGE_RDMAMODE_TSO4_ENABLE;
-		if (sc->bge_asicrev == BGE_ASICREV_BCM5785 ||
+		if (sc->bge_flags & BGE_FLAG_TSO3 ||
+		    sc->bge_asicrev == BGE_ASICREV_BCM5785 ||
 		    sc->bge_asicrev == BGE_ASICREV_BCM57780)
 			val |= BGE_RDMAMODE_TSO6_ENABLE;
 	}
 	if (sc->bge_asicrev == BGE_ASICREV_BCM5761 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5785 ||
-	    sc->bge_asicrev == BGE_ASICREV_BCM57780) {
+	    sc->bge_asicrev == BGE_ASICREV_BCM57780 ||
+	    BGE_IS_5717_PLUS(sc)) {
 		/*
 		 * Enable fix for read DMA FIFO overruns.
 		 * The fix is to limit the number of RX BDs
@@ -1989,8 +2041,9 @@ bge_blockinit(struct bge_softc *sc)
 	CSR_WRITE_4(sc, BGE_SDC_MODE, val);
 
 	/* Turn on send data initiator state machine */
-	if (sc->bge_flags & BGE_FLAG_TSO)
-		CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE | 0x08);
+	if (sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3))
+		CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE |
+		    BGE_SDIMODE_HW_LSO_PRE_DMA);
 	else
 		CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE);
 
@@ -2104,9 +2157,22 @@ bge_probe(device_t dev)
 
 			id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >>
 			    BGE_PCIMISCCTL_ASICREV_SHIFT;
-			if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG)
-				id = pci_read_config(dev,
-				    BGE_PCI_PRODID_ASICREV, 4);
+			if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) {
+				/*
+				 * Find the ASCI revision.  Different chips
+				 * use different registers.
+				 */
+				switch (pci_get_device(dev)) {
+				case BCOM_DEVICEID_BCM5717:
+				case BCOM_DEVICEID_BCM5718:
+					id = pci_read_config(dev,
+					    BGE_PCI_GEN2_PRODID_ASICREV, 4);
+					break;
+				default:
+					id = pci_read_config(dev,
+					    BGE_PCI_PRODID_ASICREV, 4);
+				}
+			}
 			br = bge_lookup_rev(id);
 			v = bge_lookup_vendor(vid);
 			{
@@ -2423,7 +2489,7 @@ bge_dma_alloc(struct bge_softc *sc)
 		return (ENOMEM);
 	}
 	/* Create tag for Tx mbufs. */
-	if (sc->bge_flags & BGE_FLAG_TSO) {
+	if (sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) {
 		txsegsz = BGE_TSOSEG_SZ;
 		txmaxsegsz = 65535 + sizeof(struct ether_vlan_header);
 	} else {
@@ -2539,6 +2605,10 @@ bge_can_use_msi(struct bge_softc *sc)
 {
 	int can_use_msi = 0;
 
+	/* Disable MSI for polling(4). */
+#ifdef DEVICE_POLLING
+	return (0);
+#endif
 	switch (sc->bge_asicrev) {
 	case BGE_ASICREV_BCM5714_A0:
 	case BGE_ASICREV_BCM5714:
@@ -2568,7 +2638,7 @@ bge_attach(device_t dev)
 	struct bge_softc *sc;
 	uint32_t hwcfg = 0, misccfg;
 	u_char eaddr[ETHER_ADDR_LEN];
-	int error, msicount, phy_addr, reg, rid, trys;
+	int error, f, msicount, phy_addr, reg, rid, trys;
 
 	sc = device_get_softc(dev);
 	sc->bge_dev = dev;
@@ -2594,14 +2664,55 @@ bge_attach(device_t dev)
 	sc->bge_chipid =
 	    pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >>
 	    BGE_PCIMISCCTL_ASICREV_SHIFT;
-	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG)
-		sc->bge_chipid = pci_read_config(dev, BGE_PCI_PRODID_ASICREV,
-		    4);
+	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) {
+		/*
+		 * Find the ASCI revision.  Different chips use different
+		 * registers.
+		 */
+		switch (pci_get_device(dev)) {
+		case BCOM_DEVICEID_BCM5717:
+		case BCOM_DEVICEID_BCM5718:
+			sc->bge_chipid = pci_read_config(dev,
+			    BGE_PCI_GEN2_PRODID_ASICREV, 4);
+			break;
+		default:
+			sc->bge_chipid = pci_read_config(dev,
+			    BGE_PCI_PRODID_ASICREV, 4);
+		}
+	}
 	sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid);
 	sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid);
 
 	/* Set default PHY address. */
 	phy_addr = 1;
+	 /*
+	  * PHY address mapping for various devices.
+	  *
+	  *          | F0 Cu | F0 Sr | F1 Cu | F1 Sr |
+	  * ---------+-------+-------+-------+-------+
+	  * BCM57XX  |   1   |   X   |   X   |   X   |
+	  * BCM5704  |   1   |   X   |   1   |   X   |
+	  * BCM5717  |   1   |   8   |   2   |   9   |
+	  *
+	  * Other addresses may respond but they are not
+	  * IEEE compliant PHYs and should be ignored.
+	  */
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5717) {
+		f = pci_get_function(dev);
+		if (sc->bge_chipid == BGE_CHIPID_BCM5717_A0) {
+			if (CSR_READ_4(sc, BGE_SGDIG_STS) &
+			    BGE_SGDIGSTS_IS_SERDES)
+				phy_addr = f + 8;
+			else
+				phy_addr = f + 1;
+		} else if (sc->bge_chipid == BGE_CHIPID_BCM5717_B0) {
+			if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) &
+			    BGE_CPMU_PHY_STRAP_IS_SERDES)
+				phy_addr = f + 8;
+			else
+				phy_addr = f + 1;
+		}
+	}
 
 	/*
 	 * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the
@@ -2610,7 +2721,8 @@ bge_attach(device_t dev)
 	if (sc->bge_asicrev != BGE_ASICREV_BCM5700 &&
 	    sc->bge_asicrev != BGE_ASICREV_BCM5906 &&
 	    sc->bge_chipid != BGE_CHIPID_BCM5705_A0 &&
-	    sc->bge_chipid != BGE_CHIPID_BCM5705_A1)
+	    sc->bge_chipid != BGE_CHIPID_BCM5705_A1 &&
+	    !BGE_IS_5717_PLUS(sc))
 		sc->bge_phy_flags |= BGE_PHY_WIRESPEED;
 
 	if (bge_has_eaddr(sc))
@@ -2618,6 +2730,11 @@ bge_attach(device_t dev)
 
 	/* Save chipset family. */
 	switch (sc->bge_asicrev) {
+	case BGE_ASICREV_BCM5717:
+		sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS |
+		    BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO |
+		    BGE_FLAG_SHORT_DMA_BUG | BGE_FLAG_JUMBO_FRAME;
+		break;
 	case BGE_ASICREV_BCM5755:
 	case BGE_ASICREV_BCM5761:
 	case BGE_ASICREV_BCM5784:
@@ -2663,6 +2780,7 @@ bge_attach(device_t dev)
 		sc->bge_phy_flags |= BGE_PHY_NO_3LED;
 	if ((BGE_IS_5705_PLUS(sc)) &&
 	    sc->bge_asicrev != BGE_ASICREV_BCM5906 &&
+	    sc->bge_asicrev != BGE_ASICREV_BCM5717 &&
 	    sc->bge_asicrev != BGE_ASICREV_BCM5785 &&
 	    sc->bge_asicrev != BGE_ASICREV_BCM57780) {
 		if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
@@ -2679,7 +2797,8 @@ bge_attach(device_t dev)
 	}
 
 	/* Identify the chips that use an CPMU. */
-	if (sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
+	if (BGE_IS_5717_PLUS(sc) ||
+	    sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5761 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5785 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM57780)
@@ -2722,7 +2841,10 @@ bge_attach(device_t dev)
 	 * the TSO to the controllers that are not affected TSO issues
 	 * (e.g. 5755 or higher).
 	 */
-	if (BGE_IS_5755_PLUS(sc)) {
+	if (BGE_IS_5717_PLUS(sc)) {
+		/* BCM5717 requires different TSO configuration. */
+		sc->bge_flags |= BGE_FLAG_TSO3;
+	} else if (BGE_IS_5755_PLUS(sc)) {
 		/*
 		 * BCM5754 and BCM5787 shares the same ASIC id so
 		 * explicit device id check is required.
@@ -2785,6 +2907,16 @@ bge_attach(device_t dev)
 		}
 	}
 
+	/*
+	 * All controllers except BCM5700 supports tagged status but
+	 * we use tagged status only for MSI case on BCM5717. Otherwise
+	 * MSI on BCM5717 does not work.
+	 */
+#ifndef DEVICE_POLLING
+	if (sc->bge_flags & BGE_FLAG_MSI && BGE_IS_5717_PLUS(sc))
+		sc->bge_flags |= BGE_FLAG_TAGGED_STATUS;
+#endif
+
 	sc->bge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
 	    RF_SHAREABLE | RF_ACTIVE);
 
@@ -2848,7 +2980,9 @@ bge_attach(device_t dev)
 	}
 
 	/* 5705 limits RX return ring to 512 entries. */
-	if (BGE_IS_5705_PLUS(sc))
+	if (BGE_IS_5717_PLUS(sc))
+		sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT;
+	else if (BGE_IS_5705_PLUS(sc))
 		sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705;
 	else
 		sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT;
@@ -2893,7 +3027,7 @@ bge_attach(device_t dev)
 	ifp->if_hwassist = sc->bge_csum_features;
 	ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING |
 	    IFCAP_VLAN_MTU;
-	if ((sc->bge_flags & BGE_FLAG_TSO) != 0) {
+	if ((sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) != 0) {
 		ifp->if_hwassist |= CSUM_TSO;
 		ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO;
 	}
@@ -3340,6 +3474,7 @@ bge_reset(struct bge_softc *sc)
 
 	/* XXX: Broadcom Linux driver. */
 	if (sc->bge_flags & BGE_FLAG_PCIE &&
+	    sc->bge_asicrev != BGE_ASICREV_BCM5717 &&
 	    sc->bge_chipid != BGE_CHIPID_BCM5750_A0 &&
 	    sc->bge_asicrev != BGE_ASICREV_BCM5785) {
 		/* Enable Data FIFO protection. */
@@ -3480,20 +3615,8 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 		m->m_pkthdr.len = m->m_len = cur_rx->bge_len - ETHER_CRC_LEN;
 		m->m_pkthdr.rcvif = ifp;
 
-		if (ifp->if_capenable & IFCAP_RXCSUM) {
-			if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM) {
-				m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED;
-				if ((cur_rx->bge_ip_csum ^ 0xFFFF) == 0)
-					m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
-			}
-			if (cur_rx->bge_flags & BGE_RXBDFLAG_TCP_UDP_CSUM &&
-			    m->m_pkthdr.len >= ETHER_MIN_NOPAD) {
-				m->m_pkthdr.csum_data =
-				    cur_rx->bge_tcp_udp_csum;
-				m->m_pkthdr.csum_flags |=
-				    CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
-			}
-		}
+		if (ifp->if_capenable & IFCAP_RXCSUM)
+			bge_rxcsum(sc, cur_rx, m);
 
 		/*
 		 * If we received a packet with a vlan tag,
@@ -3552,6 +3675,41 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 }
 
 static void
+bge_rxcsum(struct bge_softc *sc, struct bge_rx_bd *cur_rx, struct mbuf *m)
+{
+
+	if (BGE_IS_5717_PLUS(sc)) {
+		if ((cur_rx->bge_flags & BGE_RXBDFLAG_IPV6) == 0) {
+			if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM) {
+				m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED;
+				if ((cur_rx->bge_error_flag &
+				    BGE_RXERRFLAG_IP_CSUM_NOK) == 0)
+					m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
+			}
+			if (cur_rx->bge_flags & BGE_RXBDFLAG_TCP_UDP_CSUM) {
+				m->m_pkthdr.csum_data =
+				    cur_rx->bge_tcp_udp_csum;
+				m->m_pkthdr.csum_flags |= CSUM_DATA_VALID |
+				    CSUM_PSEUDO_HDR;
+			}
+		}
+	} else {
+		if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM) {
+			m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED;
+			if ((cur_rx->bge_ip_csum ^ 0xFFFF) == 0)
+				m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
+		}
+		if (cur_rx->bge_flags & BGE_RXBDFLAG_TCP_UDP_CSUM &&
+		    m->m_pkthdr.len >= ETHER_MIN_NOPAD) {
+			m->m_pkthdr.csum_data =
+			    cur_rx->bge_tcp_udp_csum;
+			m->m_pkthdr.csum_flags |= CSUM_DATA_VALID |
+			    CSUM_PSEUDO_HDR;
+		}
+	}
+}
+
+static void
 bge_txeof(struct bge_softc *sc, uint16_t tx_cons)
 {
 	struct bge_tx_bd *cur_tx;
@@ -3668,7 +3826,7 @@ bge_intr_task(void *arg, int pending)
 {
 	struct bge_softc *sc;
 	struct ifnet *ifp;
-	uint32_t status;
+	uint32_t status, status_tag;
 	uint16_t rx_prod, tx_cons;
 
 	sc = (struct bge_softc *)arg;
@@ -3689,16 +3847,19 @@ bge_intr_task(void *arg, int pending)
 	rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx;
 	tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx;
 	status = sc->bge_ldata.bge_status_block->bge_status;
+	status_tag = sc->bge_ldata.bge_status_block->bge_status_tag << 24;
 	sc->bge_ldata.bge_status_block->bge_status = 0;
 	bus_dmamap_sync(sc->bge_cdata.bge_status_tag,
 	    sc->bge_cdata.bge_status_map,
 	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+	if ((sc->bge_flags & BGE_FLAG_TAGGED_STATUS) == 0)
+		status_tag = 0;
 
 	if ((status & BGE_STATFLAG_LINKSTATE_CHANGED) != 0)
 		bge_link_upd(sc);
 
 	/* Let controller work. */
-	bge_writembx(sc, BGE_MBX_IRQ0_LO, 0);
+	bge_writembx(sc, BGE_MBX_IRQ0_LO, status_tag);
 
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
 	    sc->bge_rx_saved_considx != rx_prod) {
@@ -4104,7 +4265,8 @@ bge_check_short_dma(struct mbuf *m)
 }
 
 static struct mbuf *
-bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss)
+bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss,
+    uint16_t *flags)
 {
 	struct ip *ip;
 	struct tcphdr *tcp;
@@ -4147,14 +4309,30 @@ bge_setup_tso(struct bge_softc *sc, stru
 	 * Broadcom controllers uses different descriptor format for
 	 * TSO depending on ASIC revision. Due to TSO-capable firmware
 	 * license issue and lower performance of firmware based TSO
-	 * we only support hardware based TSO which is applicable for
-	 * BCM5755 or newer controllers. Hardware based TSO uses 11
-	 * bits to store MSS and upper 5 bits are used to store IP/TCP
-	 * header length(including IP/TCP options). The header length
-	 * is expressed as 32 bits unit.
+	 * we only support hardware based TSO.
 	 */
+	/* Calculate header length, incl. TCP/IP options, in 32 bit units. */
 	hlen = ((ip->ip_hl << 2) + (tcp->th_off << 2)) >> 2;
-	*mss |= (hlen << 11);
+	if (sc->bge_flags & BGE_FLAG_TSO3) {
+		/*
+		 * For BCM5717 and newer controllers, hardware based TSO
+		 * uses the 14 lower bits of the bge_mss field to store the
+		 * MSS and the upper 2 bits to store the lowest 2 bits of
+		 * the IP/TCP header length.  The upper 6 bits of the header
+		 * length are stored in the bge_flags[14:10,4] field.  Jumbo
+		 * frames are supported.
+		 */
+		*mss |= ((hlen & 0x3) << 14);
+		*flags |= ((hlen & 0xF8) << 7) | ((hlen & 0x4) << 2);
+	} else {
+		/*
+		 * For BCM5755 and newer controllers, hardware based TSO uses
+		 * the lower 11	bits to store the MSS and the upper 5 bits to
+		 * store the IP/TCP header length. Jumbo frames are not
+		 * supported.
+		 */
+		*mss |= (hlen << 11);
+	}
 	return (m);
 }
 
@@ -4184,7 +4362,7 @@ bge_encap(struct bge_softc *sc, struct m
 		m = *m_head;
 	}
 	if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
-		*m_head = m = bge_setup_tso(sc, m, &mss);
+		*m_head = m = bge_setup_tso(sc, m, &mss, &csum_flags);
 		if (*m_head == NULL)
 			return (ENOBUFS);
 		csum_flags |= BGE_TXBDFLAG_CPU_PRE_DMA |
@@ -4207,21 +4385,26 @@ bge_encap(struct bge_softc *sc, struct m
 			csum_flags |= BGE_TXBDFLAG_IP_FRAG;
 	}
 
-	if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0 &&
-	    sc->bge_forced_collapse > 0 &&
-	    (sc->bge_flags & BGE_FLAG_PCIE) != 0 && m->m_next != NULL) {
-		/*
-		 * Forcedly collapse mbuf chains to overcome hardware
-		 * limitation which only support a single outstanding
-		 * DMA read operation.
-		 */
-		if (sc->bge_forced_collapse == 1)
-			m = m_defrag(m, M_DONTWAIT);
-		else
-			m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse);
-		if (m == NULL)
-			m = *m_head;
-		*m_head = m;
+	if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0) {
+		if (sc->bge_flags & BGE_FLAG_JUMBO_FRAME &&
+		    m->m_pkthdr.len > ETHER_MAX_LEN)
+			csum_flags |= BGE_TXBDFLAG_JUMBO_FRAME;
+		if (sc->bge_forced_collapse > 0 &&
+		    (sc->bge_flags & BGE_FLAG_PCIE) != 0 && m->m_next != NULL) {
+			/*
+			 * Forcedly collapse mbuf chains to overcome hardware
+			 * limitation which only support a single outstanding
+			 * DMA read operation.
+			 */
+			if (sc->bge_forced_collapse == 1)
+				m = m_defrag(m, M_DONTWAIT);
+			else
+				m = m_collapse(m, M_DONTWAIT,
+				    sc->bge_forced_collapse);
+			if (m == NULL)
+				m = *m_head;
+			*m_head = m;
+		}
 	}
 
 	map = sc->bge_cdata.bge_tx_dmamap[idx];

Modified: head/sys/dev/bge/if_bgereg.h
==============================================================================
--- head/sys/dev/bge/if_bgereg.h	Wed Oct 27 17:16:40 2010	(r214427)
+++ head/sys/dev/bge/if_bgereg.h	Wed Oct 27 17:20:19 2010	(r214428)
@@ -82,6 +82,7 @@
 #define	BGE_UNMAPPED_END		0x00001FFF
 #define	BGE_DMA_DESCRIPTORS		0x00002000
 #define	BGE_DMA_DESCRIPTORS_END		0x00003FFF
+#define	BGE_SEND_RING_5717		0x00004000
 #define	BGE_SEND_RING_1_TO_4		0x00004000
 #define	BGE_SEND_RING_1_TO_4_END	0x00005FFF
 
@@ -100,6 +101,8 @@
 #define	BGE_BUFFPOOL_2_END		0x00017FFF
 #define	BGE_BUFFPOOL_3			0x00018000 /* or expansion ROM */
 #define	BGE_BUFFPOOL_3_END		0x0001FFFF
+#define	BGE_STD_RX_RINGS_5717		0x00040000
+#define	BGE_JUMBO_RX_RINGS_5717		0x00044400
 
 /* Mappings for external SSRAM configurations */
 #define	BGE_SEND_RING_5_TO_6		0x00006000
@@ -219,6 +222,7 @@
 #define	BGE_PCI_ISR_MBX_HI		0xB0
 #define	BGE_PCI_ISR_MBX_LO		0xB4
 #define	BGE_PCI_PRODID_ASICREV		0xBC
+#define	BGE_PCI_GEN2_PRODID_ASICREV	0xF4
 
 /* PCI Misc. Host control register */
 #define	BGE_PCIMISCCTL_CLEAR_INTA	0x00000001
@@ -229,6 +233,7 @@
 #define	BGE_PCIMISCCTL_CLOCKCTL_RW	0x00000020
 #define	BGE_PCIMISCCTL_REG_WORDSWAP	0x00000040
 #define	BGE_PCIMISCCTL_INDIRECT_ACCESS	0x00000080
+#define	BGE_PCIMISCCTL_TAGGED_STATUS	0x00000200
 #define	BGE_PCIMISCCTL_ASICREV		0xFFFF0000
 #define	BGE_PCIMISCCTL_ASICREV_SHIFT	16
 
@@ -311,6 +316,8 @@
 #define	BGE_CHIPID_BCM5906_A2		0xc002
 #define	BGE_CHIPID_BCM57780_A0		0x57780000
 #define	BGE_CHIPID_BCM57780_A1		0x57780001
+#define	BGE_CHIPID_BCM5717_A0		0x05717000
+#define	BGE_CHIPID_BCM5717_B0		0x05717100
 
 /* shorthand one */
 #define	BGE_ASICREV(x)			((x) >> 12)
@@ -331,6 +338,7 @@
 /* Should consult BGE_PCI_PRODID_ASICREV for ChipID */
 #define	BGE_ASICREV_USE_PRODID_REG	0x0f
 /* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */
+#define	BGE_ASICREV_BCM5717		0x5717
 #define	BGE_ASICREV_BCM5761		0x5761
 #define	BGE_ASICREV_BCM5784		0x5784
 #define	BGE_ASICREV_BCM5785		0x5785
@@ -348,11 +356,14 @@
 #define	BGE_CHIPREV_5750_AX		0x40
 #define	BGE_CHIPREV_5750_BX		0x41
 /* BGE_PCI_PRODID_ASICREV chip rev. identifiers. */
+#define	BGE_CHIPREV_5717_AX		0x57170
+#define	BGE_CHIPREV_5717_BX		0x57171
 #define	BGE_CHIPREV_5761_AX		0x57611
 #define	BGE_CHIPREV_5784_AX		0x57841
 
 /* PCI DMA Read/Write Control register */
 #define	BGE_PCIDMARWCTL_MINDMA		0x000000FF
+#define	BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT	0x00000001
 #define	BGE_PCIDMARWCTL_RDADRR_BNDRY	0x00000700
 #define	BGE_PCIDMARWCTL_WRADDR_BNDRY	0x00003800
 #define	BGE_PCIDMARWCTL_ONEDMA_ATONCE	0x0000C000
@@ -566,6 +577,7 @@
 #define	BGE_TX_RINGS_MAX		4
 #define	BGE_TX_RINGS_EXTSSRAM_MAX	16
 #define	BGE_RX_RINGS_MAX		16
+#define	BGE_RX_RINGS_MAX_5717		17
 
 /* Ethernet MAC control registers */
 #define	BGE_MAC_MODE			0x0400
@@ -843,9 +855,10 @@
 #define	BGE_SGDIGCFG_AUTO		0x80000000
 
 /* SGDIG status (not documented) */
+#define	BGE_SGDIGSTS_DONE		0x00000002
+#define	BGE_SGDIGSTS_IS_SERDES		0x00000100
 #define	BGE_SGDIGSTS_PAUSE_CAP		0x00080000
 #define	BGE_SGDIGSTS_ASYM_PAUSE		0x00100000
-#define	BGE_SGDIGSTS_DONE		0x00000002
 
 
 /* MI communication register */
@@ -911,6 +924,7 @@
 #define	BGE_SDIMODE_RESET		0x00000001
 #define	BGE_SDIMODE_ENABLE		0x00000002
 #define	BGE_SDIMODE_STATS_OFLOW_ATTN	0x00000004
+#define	BGE_SDIMODE_HW_LSO_PRE_DMA	0x00000008
 
 /* Send Data Initiator stats register */
 #define	BGE_SDISTAT_STATS_OFLOW_ATTN	0x00000004
@@ -1188,6 +1202,9 @@
 #define	BGE_RBDI_STD_REPL_THRESH	0x2C18
 #define	BGE_RBDI_JUMBO_REPL_THRESH	0x2C1C
 
+#define	BGE_STD_REPLENISH_LWM		0x2D00
+#define	BGE_JMB_REPLENISH_LWM		0x2D04
+
 /* Receive BD Initiator Mode register */
 #define	BGE_RBDIMODE_RESET		0x00000001
 #define	BGE_RBDIMODE_ENABLE		0x00000002
@@ -1501,6 +1518,7 @@
 #define	BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN	0x00002000
 #define	BGE_RDMAMODE_FIFO_SIZE_128	0x00020000
 #define	BGE_RDMAMODE_FIFO_LONG_BURST	0x00030000
+#define	BGE_RDMAMODE_MULT_DMA_RD_DIS	0x01000000
 #define	BGE_RDMAMODE_TSO4_ENABLE	0x08000000
 #define	BGE_RDMAMODE_TSO6_ENABLE	0x10000000
 
@@ -2068,15 +2086,27 @@ struct bge_tx_bd {
 #define	BGE_TXBDFLAG_IP_CSUM		0x0002
 #define	BGE_TXBDFLAG_END		0x0004
 #define	BGE_TXBDFLAG_IP_FRAG		0x0008
+#define	BGE_TXBDFLAG_JUMBO_FRAME	0x0008	/* 5717 */
 #define	BGE_TXBDFLAG_IP_FRAG_END	0x0010
+#define	BGE_TXBDFLAG_HDRLEN_BIT2	0x0010	/* 5717 */
+#define	BGE_TXBDFLAG_SNAP		0x0020	/* 5717 */
 #define	BGE_TXBDFLAG_VLAN_TAG		0x0040
 #define	BGE_TXBDFLAG_COAL_NOW		0x0080
 #define	BGE_TXBDFLAG_CPU_PRE_DMA	0x0100
 #define	BGE_TXBDFLAG_CPU_POST_DMA	0x0200
+#define	BGE_TXBDFLAG_HDRLEN_BIT3	0x0400	/* 5717 */
+#define	BGE_TXBDFLAG_HDRLEN_BIT4	0x0800	/* 5717 */
 #define	BGE_TXBDFLAG_INSERT_SRC_ADDR	0x1000
+#define	BGE_TXBDFLAG_HDRLEN_BIT5	0x1000	/* 5717 */
+#define	BGE_TXBDFLAG_HDRLEN_BIT6	0x2000	/* 5717 */
+#define	BGE_TXBDFLAG_HDRLEN_BIT7	0x4000	/* 5717 */
 #define	BGE_TXBDFLAG_CHOOSE_SRC_ADDR	0x6000
 #define	BGE_TXBDFLAG_NO_CRC		0x8000
 
+#define	BGE_TXBDFLAG_MSS_SIZE_MASK	0x3FFF	/* 5717 */
+/* Bits [1:0] of the MSS header length. */
+#define	BGE_TXBDFLAG_MSS_HDRLEN_MASK	0xC000	/* 5717 */
+
 #define	BGE_NIC_TXRING_ADDR(ringno, size)	\
 	BGE_SEND_RING_1_TO_4 +			\
 	((ringno * sizeof(struct bge_tx_bd) * size) / 4)
@@ -2153,6 +2183,7 @@ struct bge_extrx_bd {
 #define	BGE_RXBDFLAG_IP_CSUM		0x1000
 #define	BGE_RXBDFLAG_TCP_UDP_CSUM	0x2000
 #define	BGE_RXBDFLAG_TCP_UDP_IS_TCP	0x4000
+#define	BGE_RXBDFLAG_IPV6		0x8000
 
 #define	BGE_RXERRFLAG_BAD_CRC		0x0001
 #define	BGE_RXERRFLAG_COLL_DETECT	0x0002
@@ -2162,6 +2193,7 @@ struct bge_extrx_bd {
 #define	BGE_RXERRFLAG_RUNT		0x0020
 #define	BGE_RXERRFLAG_TRUNC_NO_RSRCS	0x0040
 #define	BGE_RXERRFLAG_GIANT		0x0080
+#define	BGE_RXERRFLAG_IP_CSUM_NOK	0x1000	/* 5717 */
 
 struct bge_sts_idx {
 #if BYTE_ORDER == LITTLE_ENDIAN
@@ -2175,7 +2207,7 @@ struct bge_sts_idx {
 
 struct bge_status_block {
 	uint32_t		bge_status;
-	uint32_t		bge_rsvd0;
+	uint32_t		bge_status_tag;
 #if BYTE_ORDER == LITTLE_ENDIAN
 	uint16_t		bge_rx_jumbo_cons_idx;
 	uint16_t		bge_rx_std_cons_idx;
@@ -2221,6 +2253,8 @@ struct bge_status_block {
 #define	BCOM_DEVICEID_BCM5714S		0x1669
 #define	BCOM_DEVICEID_BCM5715		0x1678
 #define	BCOM_DEVICEID_BCM5715S		0x1679
+#define	BCOM_DEVICEID_BCM5717		0x1655
+#define	BCOM_DEVICEID_BCM5718		0x1656
 #define	BCOM_DEVICEID_BCM5720		0x1658
 #define	BCOM_DEVICEID_BCM5721		0x1659
 #define	BCOM_DEVICEID_BCM5722		0x165A
@@ -2717,16 +2751,20 @@ struct bge_softc {
 #define	BGE_FLAG_EADDR		0x00000008
 #define	BGE_FLAG_MII_SERDES	0x00000010
 #define	BGE_FLAG_CPMU_PRESENT	0x00000020
+#define	BGE_FLAG_TAGGED_STATUS	0x00000040
 #define	BGE_FLAG_MSI		0x00000100
 #define	BGE_FLAG_PCIX		0x00000200
 #define	BGE_FLAG_PCIE		0x00000400
 #define	BGE_FLAG_TSO		0x00000800
+#define	BGE_FLAG_TSO3		0x00001000
+#define	BGE_FLAG_JUMBO_FRAME	0x00002000
 #define	BGE_FLAG_5700_FAMILY	0x00010000
 #define	BGE_FLAG_5705_PLUS	0x00020000
 #define	BGE_FLAG_5714_FAMILY	0x00040000
 #define	BGE_FLAG_575X_PLUS	0x00080000
 #define	BGE_FLAG_5755_PLUS	0x00100000
 #define	BGE_FLAG_5788		0x00200000
+#define	BGE_FLAG_5717_PLUS	0x00400000
 #define	BGE_FLAG_40BIT_BUG	0x01000000
 #define	BGE_FLAG_4G_BNDRY_BUG	0x02000000
 #define	BGE_FLAG_RX_ALIGNBUG	0x04000000

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 17:38: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 23D2E106566C;
	Wed, 27 Oct 2010 17:38:06 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 128668FC08;
	Wed, 27 Oct 2010 17:38: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 o9RHc5Ge016660;
	Wed, 27 Oct 2010 17:38:05 GMT
	(envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RHc50q016656;
	Wed, 27 Oct 2010 17:38:05 GMT
	(envelope-from hselasky@svn.freebsd.org)
Message-Id: <201010271738.o9RHc50q016656@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Wed, 27 Oct 2010 17:38: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: r214429 - head/sys/dev/usb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 17:38:06 -0000

Author: hselasky
Date: Wed Oct 27 17:38:05 2010
New Revision: 214429
URL: http://svn.freebsd.org/changeset/base/214429

Log:
  Add support for setting per-interface PnP information.
  
  Submitted by:	Nick Hibma
  Approved by:	thompsa (mentor)

Modified:
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usbdi.h

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Wed Oct 27 17:20:19 2010	(r214428)
+++ head/sys/dev/usb/usb_device.c	Wed Oct 27 17:38:05 2010	(r214429)
@@ -88,7 +88,7 @@ static void	usb_init_endpoint(struct usb
 		    struct usb_endpoint *);
 static void	usb_unconfigure(struct usb_device *, uint8_t);
 static void	usb_detach_device_sub(struct usb_device *, device_t *,
-		    uint8_t);
+		    char **, uint8_t);
 static uint8_t	usb_probe_and_attach_sub(struct usb_device *,
 		    struct usb_attach_arg *);
 static void	usb_init_attach_arg(struct usb_device *,
@@ -1035,9 +1035,10 @@ usb_reset_iface_endpoints(struct usb_dev
  *------------------------------------------------------------------------*/
 static void
 usb_detach_device_sub(struct usb_device *udev, device_t *ppdev,
-    uint8_t flag)
+    char **ppnpinfo, uint8_t flag)
 {
 	device_t dev;
+	char *pnpinfo;
 	int err;
 
 	dev = *ppdev;
@@ -1069,11 +1070,17 @@ usb_detach_device_sub(struct usb_device 
 			goto error;
 		}
 	}
+
+	pnpinfo = *ppnpinfo;
+	if (pnpinfo != NULL) {
+		*ppnpinfo = NULL;
+		free(pnpinfo, M_USBDEV);
+	}
 	return;
 
 error:
 	/* Detach is not allowed to fail in the USB world */
-	panic("A USB driver would not detach\n");
+	panic("usb_detach_device_sub: A USB driver would not detach\n");
 }
 
 /*------------------------------------------------------------------------*
@@ -1122,7 +1129,8 @@ usb_detach_device(struct usb_device *ude
 			/* looks like the end of the USB interfaces */
 			break;
 		}
-		usb_detach_device_sub(udev, &iface->subdev, flag);
+		usb_detach_device_sub(udev, &iface->subdev,
+		    &iface->pnpinfo, flag);
 	}
 }
 
@@ -2714,3 +2722,37 @@ usbd_enum_is_locked(struct usb_device *u
 {
 	return (sx_xlocked(&udev->enum_sx));
 }
+
+/*
+ * The following function is used to set the per-interface specific
+ * plug and play information. The string referred to by the pnpinfo
+ * argument can safely be freed after calling this function. The
+ * pnpinfo of an interface will be reset at device detach or when
+ * passing a NULL argument to this function. This function
+ * returns zero on success, else a USB_ERR_XXX failure code.
+ */
+
+usb_error_t 
+usbd_set_pnpinfo(struct usb_device *udev, uint8_t iface_index, const char *pnpinfo)
+{
+	struct usb_interface *iface;
+
+	iface = usbd_get_iface(udev, iface_index);
+	if (iface == NULL)
+		return (USB_ERR_INVAL);
+
+	if (iface->pnpinfo != NULL) {
+		free(iface->pnpinfo, M_USBDEV);
+		iface->pnpinfo = NULL;
+	}
+
+	if (pnpinfo == NULL || pnpinfo[0] == 0)
+		return (0);		/* success */
+
+	iface->pnpinfo = strdup(pnpinfo, M_USBDEV);
+	if (iface->pnpinfo == NULL)
+		return (USB_ERR_NOMEM);
+
+	return (0);			/* success */
+}
+

Modified: head/sys/dev/usb/usb_hub.c
==============================================================================
--- head/sys/dev/usb/usb_hub.c	Wed Oct 27 17:20:19 2010	(r214428)
+++ head/sys/dev/usb/usb_hub.c	Wed Oct 27 17:38:05 2010	(r214429)
@@ -1330,7 +1330,7 @@ uhub_child_pnpinfo_string(device_t paren
 		    "devclass=0x%02x devsubclass=0x%02x "
 		    "sernum=\"%s\" "
 		    "release=0x%04x "
-		    "intclass=0x%02x intsubclass=0x%02x",
+		    "intclass=0x%02x intsubclass=0x%02x" "%s%s",
 		    UGETW(res.udev->ddesc.idVendor),
 		    UGETW(res.udev->ddesc.idProduct),
 		    res.udev->ddesc.bDeviceClass,
@@ -1338,7 +1338,9 @@ uhub_child_pnpinfo_string(device_t paren
 		    usb_get_serial(res.udev),
 		    UGETW(res.udev->ddesc.bcdDevice),
 		    iface->idesc->bInterfaceClass,
-		    iface->idesc->bInterfaceSubClass);
+		    iface->idesc->bInterfaceSubClass,
+		    iface->pnpinfo ? " " : "",
+		    iface->pnpinfo ? iface->pnpinfo : "");
 	} else {
 		if (buflen) {
 			buf[0] = '\0';

Modified: head/sys/dev/usb/usbdi.h
==============================================================================
--- head/sys/dev/usb/usbdi.h	Wed Oct 27 17:20:19 2010	(r214428)
+++ head/sys/dev/usb/usbdi.h	Wed Oct 27 17:38:05 2010	(r214429)
@@ -171,6 +171,7 @@ struct usb_interface {
 	struct usb_host_interface *cur_altsetting;
 	struct usb_device *linux_udev;
 	void   *bsd_priv_sc;		/* device specific information */
+	char   *pnpinfo;		/* additional PnP-info for this interface */
 	uint8_t	num_altsetting;		/* number of alternate settings */
 	uint8_t	bsd_iface_index;
 };
@@ -444,6 +445,8 @@ enum usb_hc_mode usbd_get_mode(struct us
 enum usb_dev_speed usbd_get_speed(struct usb_device *udev);
 void	device_set_usb_desc(device_t dev);
 void	usb_pause_mtx(struct mtx *mtx, int _ticks);
+usb_error_t	usbd_set_pnpinfo(struct usb_device *udev,
+			uint8_t iface_index, const char *pnpinfo);
 
 const struct usb_device_id *usbd_lookup_id_by_info(
 	    const struct usb_device_id *id, usb_size_t sizeof_id,

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 18:46: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 8F2291065670;
	Wed, 27 Oct 2010 18:46:56 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E6D58FC08;
	Wed, 27 Oct 2010 18:46: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 o9RIku0d019255;
	Wed, 27 Oct 2010 18:46:56 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RIkufm019253;
	Wed, 27 Oct 2010 18:46:56 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010271846.o9RIkufm019253@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 27 Oct 2010 18:46: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: r214430 - head/cddl/lib/drti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 18:46:56 -0000

Author: rpaulo
Date: Wed Oct 27 18:46:56 2010
New Revision: 214430
URL: http://svn.freebsd.org/changeset/base/214430

Log:
  Use ${PICFLAG} instead of -fpic.

Modified:
  head/cddl/lib/drti/Makefile

Modified: head/cddl/lib/drti/Makefile
==============================================================================
--- head/cddl/lib/drti/Makefile	Wed Oct 27 17:38:05 2010	(r214429)
+++ head/cddl/lib/drti/Makefile	Wed Oct 27 18:46:56 2010	(r214430)
@@ -16,6 +16,6 @@ CFLAGS+=	-I${.CURDIR}/../../../sys/cddl/
 		-I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
 		-I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \
 		-I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
-		-DPIC -fpic
+		-DPIC ${PICFLAG}
 
 .include 

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 18:48: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 13623106564A;
	Wed, 27 Oct 2010 18:48:24 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 02C5C8FC17;
	Wed, 27 Oct 2010 18:48: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 o9RImNYK019346;
	Wed, 27 Oct 2010 18:48:23 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RImNSR019344;
	Wed, 27 Oct 2010 18:48:23 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201010271848.o9RImNSR019344@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 27 Oct 2010 18:48: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: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 18:48:24 -0000

Author: des
Date: Wed Oct 27 18:48:23 2010
New Revision: 214431
URL: http://svn.freebsd.org/changeset/base/214431

Log:
  Language cleanup.

Modified:
  head/bin/rm/rm.1

Modified: head/bin/rm/rm.1
==============================================================================
--- head/bin/rm/rm.1	Wed Oct 27 18:46:56 2010	(r214430)
+++ head/bin/rm/rm.1	Wed Oct 27 18:48:23 2010	(r214431)
@@ -231,6 +231,6 @@ The
 .Fl P
 option assumes that the underlying file system updates existing blocks
 in-place and does not store new data in a new location.
-This is true for UFS but not for ZFS, which is using a Copy-On-Write strategy.
-In addition, only regular files are overwritten, other types of files
-are not.
+This is true for UFS, but not for ZFS or other file systems which use
+copy-on-write semantics.
+In addition, only regular files are overwritten.

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 19:01: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 847B2106564A;
	Wed, 27 Oct 2010 19:01:09 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 58EEB8FC18;
	Wed, 27 Oct 2010 19:01: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 o9RJ19dX020283;
	Wed, 27 Oct 2010 19:01:09 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RJ19Et020281;
	Wed, 27 Oct 2010 19:01:09 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201010271901.o9RJ19Et020281@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 27 Oct 2010 19:01: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: r214432 - head/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, 27 Oct 2010 19:01:09 -0000

Author: yongari
Date: Wed Oct 27 19:01:09 2010
New Revision: 214432
URL: http://svn.freebsd.org/changeset/base/214432

Log:
  Use shorten model name and add RTL8168, RTL8111 to the list of
  supported device. re(4) had been supported all variants of RTL8168,
  RTL8111 and RTL810x. I think this change will cover all controllers
  supported by re(4).
  
  MFC after:	1 week

Modified:
  head/share/man/man4/re.4

Modified: head/share/man/man4/re.4
==============================================================================
--- head/share/man/man4/re.4	Wed Oct 27 18:48:23 2010	(r214431)
+++ head/share/man/man4/re.4	Wed Oct 27 19:01:09 2010	(r214432)
@@ -30,12 +30,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 9, 2009
+.Dd October 27, 2010
 .Dt RE 4
 .Os
 .Sh NAME
 .Nm re
-.Nd "RealTek 8139C+/8169/816xS/811xS/8101E PCI/PCIe Ethernet adapter driver"
+.Nd "RealTek 8139C+/8169/816xS/811xS/8168/810xE/8111 PCI/PCIe Ethernet adapter driver"
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following lines in your
@@ -55,13 +55,13 @@ if_re_load="YES"
 The
 .Nm
 driver provides support for various NICs based on the RealTek RTL8139C+,
-RTL8169, RTL8169S, RTL8110S, RTL8168S, RTL8111S and RTL8101E PCI and
+RTL8169, RTL816xS, RTL811xS, RTL8168, RTL810xE and RTL8111 PCI and
 PCIe Ethernet controllers.
 .Pp
-NICs based on the 8139C+ and 8101E are capable of 10 and 100Mbps speeds
+NICs based on the 8139C+ and 810xE are capable of 10 and 100Mbps speeds
 over CAT5 cable.
-NICs based on the 8169, 816xS and 811xS are capable of 10, 100 and
-1000Mbps operation.
+NICs based on the 8169, 816xS, 811xS, 8168 and 8111 are capable of 10, 100
+and 1000Mbps operation.
 .Pp
 All NICs supported by the
 .Nm
@@ -72,8 +72,8 @@ capable of TCP large send (TCP segmentat
 .Pp
 The 8139C+ is a single-chip solution combining both a 10/100 MAC and PHY.
 The 8169 is a 10/100/1000 MAC only, requiring a GMII or TBI external PHY.
-The 8169S and 8110S are single-chip devices containing both a 10/100/1000
-MAC and 10/100/1000 copper PHY.
+The 816xS, 811xS, 8168 and 8111 are single-chip devices containing both a
+10/100/1000 MAC and 10/100/1000 copper PHY.
 Standalone 10/100/1000 cards are available
 in both 32-bit PCI and 64-bit PCI models.
 The 8110S is designed for
@@ -144,8 +144,8 @@ For more information on configuring this
 .Sh HARDWARE
 The
 .Nm
-driver supports RealTek RTL8139C+, RTL8169, RTL816xS, RTL811xS,
-and RTL8101E based Fast Ethernet and Gigabit Ethernet adapters including:
+driver supports RealTek RTL8139C+, RTL8169, RTL816xS, RTL811xS, RTL8168,
+RTL810xE and RTL8111 based Fast Ethernet and Gigabit Ethernet adapters including:
 .Pp
 .Bl -bullet -compact
 .It

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 21:01: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 A7667106564A;
	Wed, 27 Oct 2010 21:01:53 +0000 (UTC)
	(envelope-from jamie@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 966098FC08;
	Wed, 27 Oct 2010 21:01: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 o9RL1rmO031716;
	Wed, 27 Oct 2010 21:01:53 GMT (envelope-from jamie@svn.freebsd.org)
Received: (from jamie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RL1rF4031714;
	Wed, 27 Oct 2010 21:01:53 GMT (envelope-from jamie@svn.freebsd.org)
Message-Id: <201010272101.o9RL1rF4031714@svn.freebsd.org>
From: Jamie Gritton 
Date: Wed, 27 Oct 2010 21:01: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: r214434 - head/lib/libjail
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 21:01:53 -0000

Author: jamie
Date: Wed Oct 27 21:01:53 2010
New Revision: 214434
URL: http://svn.freebsd.org/changeset/base/214434

Log:
  Find a jail's type as part of jailparam_init rather than waiting until
  it's absolutely necessary.
  
  MFC after:	1 week

Modified:
  head/lib/libjail/jail.c

Modified: head/lib/libjail/jail.c
==============================================================================
--- head/lib/libjail/jail.c	Wed Oct 27 20:25:55 2010	(r214433)
+++ head/lib/libjail/jail.c	Wed Oct 27 21:01:53 2010	(r214434)
@@ -250,10 +250,6 @@ jailparam_all(struct jailparam **jpp)
 		}
 		if (jailparam_init(jp + njp, buf + sizeof(SJPARAM)) < 0)
 			goto error;
-		if (jailparam_type(jp + njp) < 0) {
-			njp++;
-			goto error;
-		}
 		mib1[1] = 2;
 	}
 	jp = realloc(jp, njp * sizeof(*jp));
@@ -279,6 +275,10 @@ jailparam_init(struct jailparam *jp, con
 		strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN);
 		return (-1);
 	}
+	if (jailparam_type(jp) < 0) {
+		jailparam_free(jp, 1);
+		return (-1);
+	}
 	return (0);
 }
 
@@ -293,8 +293,6 @@ jailparam_import(struct jailparam *jp, c
 	const char *avalue;
 	int i, nval, fw;
 
-	if (!jp->jp_ctltype && jailparam_type(jp) < 0)
-		return (-1);
 	if (value == NULL)
 		return (0);
 	if ((jp->jp_ctltype & CTLTYPE) == CTLTYPE_STRING) {
@@ -563,8 +561,6 @@ jailparam_get(struct jailparam *jp, unsi
 	jp_lastjid = jp_jid = jp_name = NULL;
 	arrays = 0;
 	for (ai = j = 0; j < njp; j++) {
-		if (!jp[j].jp_ctltype && jailparam_type(jp + j) < 0)
-			return (-1);
 		if (!strcmp(jp[j].jp_name, "lastjid"))
 			jp_lastjid = jp + j;
 		else if (!strcmp(jp[j].jp_name, "jid"))
@@ -725,8 +721,6 @@ jailparam_export(struct jailparam *jp)
 	int i, nval, ival;
 	char valbuf[INET6_ADDRSTRLEN];
 
-	if (!jp->jp_ctltype && jailparam_type(jp) < 0)
-		return (NULL);
 	if ((jp->jp_ctltype & CTLTYPE) == CTLTYPE_STRING) {
 		value = strdup(jp->jp_value);
 		if (value == NULL)

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 21:26:02 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 0C5DD1065743; Wed, 27 Oct 2010 21:26:02 +0000 (UTC)
Date: Wed, 27 Oct 2010 21:26:02 +0000
From: Alexander Best 
To: Dag-Erling Smorgrav 
Message-ID: <20101027212601.GA78062@freebsd.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201010271848.o9RImNSR019344@svn.freebsd.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 21:26:02 -0000

On Wed Oct 27 10, Dag-Erling Smorgrav wrote:
> Author: des
> Date: Wed Oct 27 18:48:23 2010
> New Revision: 214431
> URL: http://svn.freebsd.org/changeset/base/214431
> 
> Log:
>   Language cleanup.
> 
> Modified:
>   head/bin/rm/rm.1
> 
> Modified: head/bin/rm/rm.1
> ==============================================================================
> --- head/bin/rm/rm.1	Wed Oct 27 18:46:56 2010	(r214430)
> +++ head/bin/rm/rm.1	Wed Oct 27 18:48:23 2010	(r214431)
> @@ -231,6 +231,6 @@ The
>  .Fl P
>  option assumes that the underlying file system updates existing blocks
>  in-place and does not store new data in a new location.
> -This is true for UFS but not for ZFS, which is using a Copy-On-Write strategy.
> -In addition, only regular files are overwritten, other types of files
> -are not.
> +This is true for UFS, but not for ZFS or other file systems which use
> +copy-on-write semantics.
> +In addition, only regular files are overwritten.

are in fact COW fs the only exception where the -P flag won't work? before
r213582 LFS was mentioned here and that the block size must be fixed.
also the comment in rm.c says that -P won't work for any logging file systems.
i'm not a fs expert, but i think mentioning that -P won't work for COW fs isn't
enough.

-- 
a13x

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 21:29: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 37C9C106566B
	for ; Wed, 27 Oct 2010 21:29:44 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6])
	by mx1.freebsd.org (Postfix) with ESMTP id B19318FC0A
	for ; Wed, 27 Oct 2010 21:29:43 +0000 (UTC)
Received: (qmail 18643 invoked by uid 399); 27 Oct 2010 21:29:41 -0000
Received: from localhost (HELO doug-optiplex.ka9q.net)
	(dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 27 Oct 2010 21:29:41 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Message-ID: <4CC899C3.7040107@FreeBSD.org>
Date: Wed, 27 Oct 2010 14:29:39 -0700
From: Doug Barton 
Organization: http://SupersetSolutions.com/
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.11) Gecko/20101024 Thunderbird/3.1.5
MIME-Version: 1.0
To: Alexander Best 
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org>
In-Reply-To: <20101027212601.GA78062@freebsd.org>
X-Enigmail-Version: 1.1.2
OpenPGP: id=1A1ABC84
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 21:29:44 -0000

On 10/27/10 14:26, Alexander Best wrote:
> are in fact COW fs the only exception where the -P flag won't work? before
> r213582 LFS was mentioned here and that the block size must be fixed.
> also the comment in rm.c says that -P won't work for any logging file systems.
> i'm not a fs expert, but i think mentioning that -P won't work for COW fs isn't
> enough.

What may be a better approach is to confirm the fs' that DO work, list 
them, and then add something to the effect of, "This feature is unlikely 
to work on other file systems."


hth,

Doug

-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/


From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 21:48:22 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 46CF11065696; Wed, 27 Oct 2010 21:48:22 +0000 (UTC)
Date: Wed, 27 Oct 2010 21:48:22 +0000
From: Alexander Best 
To: Doug Barton 
Message-ID: <20101027214822.GA82697@freebsd.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4CC899C3.7040107@FreeBSD.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 21:48:22 -0000

On Wed Oct 27 10, Doug Barton wrote:
> On 10/27/10 14:26, Alexander Best wrote:
> >are in fact COW fs the only exception where the -P flag won't work? before
> >r213582 LFS was mentioned here and that the block size must be fixed.
> >also the comment in rm.c says that -P won't work for any logging file 
> >systems.
> >i'm not a fs expert, but i think mentioning that -P won't work for COW fs 
> >isn't
> >enough.
> 
> What may be a better approach is to confirm the fs' that DO work, list 
> them, and then add something to the effect of, "This feature is unlikely 
> to work on other file systems."

i don't think that's a good approach, because then the rm(1) has to be changed
everytime freebsd gets a new fs which works with the -P option. i think it's
better to list which fs semantics DON'T work. so if freebsd gets a new fs,
users simply have to know which semantics the new fs is based on and can decide
for themselves whether the -P switch will work or not.

so far the -P option doesn't seem to work for:

- COW fs and/or
- fs with a variable block size and/or
- fs which do journaling

please correct me if i got anything wrong. so i think having such a list in the
rm(1) manual would be very nice (maybe improving the comment in rm.c too).

cheers.
alex

> 
> 
> hth,
> 
> Doug
> 
> -- 
> 
> 	Nothin' ever doesn't change, but nothin' changes much.
> 			-- OK Go
> 
> 	Breadth of IT experience, and depth of knowledge in the DNS.
> 	Yours for the right price.  :)  http://SupersetSolutions.com/
> 

-- 
a13x

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 22:26: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 E0974106566C;
	Wed, 27 Oct 2010 22:26:07 +0000 (UTC)
	(envelope-from juli@clockworksquid.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 43FB28FC17;
	Wed, 27 Oct 2010 22:26:06 +0000 (UTC)
Received: by gya6 with SMTP id 6so914331gya.13
	for ; Wed, 27 Oct 2010 15:26:06 -0700 (PDT)
Received: by 10.151.13.10 with SMTP id q10mr18555026ybi.436.1288216560767;
	Wed, 27 Oct 2010 14:56:00 -0700 (PDT)
MIME-Version: 1.0
Sender: juli@clockworksquid.com
Received: by 10.236.103.139 with HTTP; Wed, 27 Oct 2010 14:55:40 -0700 (PDT)
In-Reply-To: <20101027214822.GA82697@freebsd.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org>
	<4CC899C3.7040107@FreeBSD.org> <20101027214822.GA82697@freebsd.org>
From: Juli Mallett 
Date: Wed, 27 Oct 2010 14:55:40 -0700
X-Google-Sender-Auth: aZUsib2Kz_Gsmk2QwG2AaLB9F6Y
Message-ID: 
To: Alexander Best 
Content-Type: text/plain; charset=ISO-8859-1
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Doug Barton , src-committers@freebsd.org,
	Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 22:26:08 -0000

On Wed, Oct 27, 2010 at 14:48, Alexander Best  wrote:
> On Wed Oct 27 10, Doug Barton wrote:
>> What may be a better approach is to confirm the fs' that DO work, list
>> them, and then add something to the effect of, "This feature is unlikely
>> to work on other file systems."
>
> i don't think that's a good approach, because then the rm(1) has to be changed
> everytime freebsd gets a new fs which works with the -P option. i think it's
> better to list which fs semantics DON'T work. so if freebsd gets a new fs,
> users simply have to know which semantics the new fs is based on and can decide
> for themselves whether the -P switch will work or not.
>
> so far the -P option doesn't seem to work for:
>
> - COW fs and/or
> - fs with a variable block size and/or
> - fs which do journaling

I really don't want to ask the average user to know whether their
filesystem is in-place block-rewriting or not.  That's just silly.  In
this case Doug is right; I don't think FreeBSD gets new file systems
as often as you think that it would be a big burden.  Having a general
description of the types of filesystem it can work on might be useful,
but a list seems more useful still.  Listing the types it can't work
on is backwards because that requires a user to understand the
dichotomy as well as knowing what kind of filesystem they don't have /
do have.  And for them to never get it backwards.  At least mount(8)
will tell you what filesystem you are using; there's no tool to tell
you the properties of your filesystem, and good luck easily-mining an
answer to the question of whether your filesystem fits into that
category from a manpage without introducing substantial confusion.

Maybe there should be substantial confusion around this feature,
though, since that's what it seems to be there for.

Juli.

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 22:33: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 26F95106566C;
	Wed, 27 Oct 2010 22:33:19 +0000 (UTC)
	(envelope-from delphij@delphij.net)
Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1])
	by mx1.freebsd.org (Postfix) with ESMTP id AA9138FC13;
	Wed, 27 Oct 2010 22:33:18 +0000 (UTC)
Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233])
	by tarsier.geekcn.org (Postfix) with ESMTP id 17991A683DE;
	Thu, 28 Oct 2010 06:33:17 +0800 (CST)
X-Virus-Scanned: amavisd-new at geekcn.org
Received: from tarsier.geekcn.org ([211.166.10.233])
	by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new,
	port 10024)
	with LMTP id jli3LUb0jJLt; Thu, 28 Oct 2010 06:33:08 +0800 (CST)
Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by tarsier.geekcn.org (Postfix) with ESMTPSA id B124CA683D2;
	Thu, 28 Oct 2010 06:33:05 +0800 (CST)
DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns;
	h=message-id:date:from:reply-to:organization:user-agent:
	mime-version:to:cc:subject:references:in-reply-to:
	x-enigmail-version:openpgp:content-type:content-transfer-encoding;
	b=Q273MbKmQIOm7fXgqrOfdl240PeYhIpYUzp9ooFekkLZCrKeo3KoRumcf9y3x7JmF
	O+8NrwrDrNlKqoB5McGnA==
Message-ID: <4CC8A89D.5070909@delphij.net>
Date: Wed, 27 Oct 2010 15:33:01 -0700
From: Xin LI 
Organization: The FreeBSD Project
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.1.14) Gecko/20101020 Thunderbird/3.0.9 ThunderBrowse/3.3.2
MIME-Version: 1.0
To: Alexander Best 
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org>
In-Reply-To: <20101027214822.GA82697@freebsd.org>
X-Enigmail-Version: 1.0.1
OpenPGP: id=3FCA37C1;
	url=http://www.delphij.net/delphij.asc
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG,
	Doug Barton , src-committers@FreeBSD.ORG,
	Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: d@delphij.net
List-Id: "SVN commit messages 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, 27 Oct 2010 22:33:19 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 10/27/10 14:48, Alexander Best wrote:
> On Wed Oct 27 10, Doug Barton wrote:
>> On 10/27/10 14:26, Alexander Best wrote:
>>> are in fact COW fs the only exception where the -P flag won't work? before
>>> r213582 LFS was mentioned here and that the block size must be fixed.
>>> also the comment in rm.c says that -P won't work for any logging file 
>>> systems.
>>> i'm not a fs expert, but i think mentioning that -P won't work for COW fs 
>>> isn't
>>> enough.
>>
>> What may be a better approach is to confirm the fs' that DO work, list 
>> them, and then add something to the effect of, "This feature is unlikely 
>> to work on other file systems."
> 
> i don't think that's a good approach, because then the rm(1) has to be changed
> everytime freebsd gets a new fs which works with the -P option. i think it's
> better to list which fs semantics DON'T work. so if freebsd gets a new fs,
> users simply have to know which semantics the new fs is based on and can decide
> for themselves whether the -P switch will work or not.
> 
> so far the -P option doesn't seem to work for:
> 
> - COW fs and/or
> - fs with a variable block size and/or
> - fs which do journaling
> 
> please correct me if i got anything wrong. so i think having such a list in the
> rm(1) manual would be very nice (maybe improving the comment in rm.c too).

I think what really defeats -P is the fact that the file system or
underlying data storage would not overwrite data on a file at sync().
 COW is of course one of the case, journaling MAY defeat -P but is not
guaranteed.  FS with variable block size - I believe this really depends
on the implementation.

If I understood the code correctly, UFS, UFS+SU, UFS+SUJ, msdosfs and
ext2fs supports rm -P as long as they are not being put on gjournal'ed
disk, ZFS zvol, etc., and no snapshot is being used.

It seems to be hard for me to conclude all cases in short, plain English
but I'm all for improvements to the manual page to describe that in an
elegant and precise manner.

Maybe something like:

===============
BUGS

The -P option assumes that the underlying storage overwrites file block
when data is written on existing offset.  Several factors including the
file system and its backing store could defeat the assumption, this
includes, but is not limited to file systems that uses Copy-On-Write
strategy (e.g. ZFS or UFS when snapshot is being used), or backing
datastore that does journaling, etc.  In addition, only regular files
are overwritten, other types of files are not.
===============

Cheers,
- -- 
Xin LI 	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iQEcBAEBCAAGBQJMyKicAAoJEATO+BI/yjfBElYIAMP70g1a+YheuKD14NXugVTU
sG4KEWAjRSZCe808f46AXU+wJePnRFkYVKD+A+6aH63y/r2V0e3CVMUYZZXr4l/d
HJRnZjJK9e/YJv8pcCpq7PgnmPzMa4m4BQNYVJoNGbPd75V27wMi3hgBzzPrJxWL
aBuB31hpU32PcpvzQgBPLiNzjEuLRq5be42HjgTPT1qGwSMEQcLgXOfG9l6TS27s
I5n5KPU7dEFt0Z+3ljQM+F3Fk2wmy/EOAeRcZL89xvFZIAYmtVrL3UcniHALPRSn
CAbGrNpCbvh2RZvJX1Cwu3H+PVIlIcl2uG/aiOEC7m/tA29LfPPXG0IzUN9qVLc=
=LQen
-----END PGP SIGNATURE-----

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 22:38:56 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 10D65106566C; Wed, 27 Oct 2010 22:38:56 +0000 (UTC)
Date: Wed, 27 Oct 2010 22:38:56 +0000
From: Alexander Best 
To: Juli Mallett 
Message-ID: <20101027223856.GA87087@freebsd.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org>
	
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Doug Barton , src-committers@freebsd.org,
	Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 22:38:56 -0000

On Wed Oct 27 10, Juli Mallett wrote:
> On Wed, Oct 27, 2010 at 14:48, Alexander Best  wrote:
> > On Wed Oct 27 10, Doug Barton wrote:
> >> What may be a better approach is to confirm the fs' that DO work, list
> >> them, and then add something to the effect of, "This feature is unlikely
> >> to work on other file systems."
> >
> > i don't think that's a good approach, because then the rm(1) has to be changed
> > everytime freebsd gets a new fs which works with the -P option. i think it's
> > better to list which fs semantics DON'T work. so if freebsd gets a new fs,
> > users simply have to know which semantics the new fs is based on and can decide
> > for themselves whether the -P switch will work or not.
> >
> > so far the -P option doesn't seem to work for:
> >
> > - COW fs and/or
> > - fs with a variable block size and/or
> > - fs which do journaling
> 
> I really don't want to ask the average user to know whether their
> filesystem is in-place block-rewriting or not.  That's just silly.  In
> this case Doug is right; I don't think FreeBSD gets new file systems
> as often as you think that it would be a big burden.  Having a general
> description of the types of filesystem it can work on might be useful,
> but a list seems more useful still.  Listing the types it can't work
> on is backwards because that requires a user to understand the
> dichotomy as well as knowing what kind of filesystem they don't have /
> do have.  And for them to never get it backwards.  At least mount(8)
> will tell you what filesystem you are using; there's no tool to tell
> you the properties of your filesystem, and good luck easily-mining an
> answer to the question of whether your filesystem fits into that
> category from a manpage without introducing substantial confusion.
> 
> Maybe there should be substantial confusion around this feature,
> though, since that's what it seems to be there for.

how about fusefs? i think there's an ongoing disussion about importing it into
HEAD on arch@ or fs@. won't this bring in support for a number of new
filesystems which then all have to be documented in the rm(1) manual?

but if in fact all working fs should get mentioned...what are they?

- UFS1/2
- ext2fs
- FAT12/16/32

...any more? what about memory backed fs like tmpfs?

cheers.
alex

> 
> Juli.

-- 
a13x

From owner-svn-src-all@FreeBSD.ORG  Wed Oct 27 22:42:57 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.ORG
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 665BE106566C; Wed, 27 Oct 2010 22:42:57 +0000 (UTC)
Date: Wed, 27 Oct 2010 22:42:57 +0000
From: Alexander Best 
To: d@delphij.net
Message-ID: <20101027224257.GB87087@freebsd.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4CC8A89D.5070909@delphij.net>
Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG,
	Doug Barton , src-committers@FreeBSD.ORG,
	Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 27 Oct 2010 22:42:57 -0000

On Wed Oct 27 10, Xin LI wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> On 10/27/10 14:48, Alexander Best wrote:
> > On Wed Oct 27 10, Doug Barton wrote:
> >> On 10/27/10 14:26, Alexander Best wrote:
> >>> are in fact COW fs the only exception where the -P flag won't work? before
> >>> r213582 LFS was mentioned here and that the block size must be fixed.
> >>> also the comment in rm.c says that -P won't work for any logging file 
> >>> systems.
> >>> i'm not a fs expert, but i think mentioning that -P won't work for COW fs 
> >>> isn't
> >>> enough.
> >>
> >> What may be a better approach is to confirm the fs' that DO work, list 
> >> them, and then add something to the effect of, "This feature is unlikely 
> >> to work on other file systems."
> > 
> > i don't think that's a good approach, because then the rm(1) has to be changed
> > everytime freebsd gets a new fs which works with the -P option. i think it's
> > better to list which fs semantics DON'T work. so if freebsd gets a new fs,
> > users simply have to know which semantics the new fs is based on and can decide
> > for themselves whether the -P switch will work or not.
> > 
> > so far the -P option doesn't seem to work for:
> > 
> > - COW fs and/or
> > - fs with a variable block size and/or
> > - fs which do journaling
> > 
> > please correct me if i got anything wrong. so i think having such a list in the
> > rm(1) manual would be very nice (maybe improving the comment in rm.c too).
> 
> I think what really defeats -P is the fact that the file system or
> underlying data storage would not overwrite data on a file at sync().
>  COW is of course one of the case, journaling MAY defeat -P but is not
> guaranteed.  FS with variable block size - I believe this really depends
> on the implementation.
> 
> If I understood the code correctly, UFS, UFS+SU, UFS+SUJ, msdosfs and
> ext2fs supports rm -P as long as they are not being put on gjournal'ed
> disk, ZFS zvol, etc., and no snapshot is being used.
> 
> It seems to be hard for me to conclude all cases in short, plain English
> but I'm all for improvements to the manual page to describe that in an
> elegant and precise manner.
> 
> Maybe something like:
> 
> ===============
> BUGS
> 
> The -P option assumes that the underlying storage overwrites file block
> when data is written on existing offset.  Several factors including the
> file system and its backing store could defeat the assumption, this
> includes, but is not limited to file systems that uses Copy-On-Write
> strategy (e.g. ZFS or UFS when snapshot is being used), or backing
> datastore that does journaling, etc.  In addition, only regular files
> are overwritten, other types of files are not.
> ===============

personally i like this approach a lot better than listing all working fs,
because that list would be quite long since e.g. for UFS2 (as you mentioned)
one cannot asume that it will support the -P option at all times.

cheers.
alex

> 
> Cheers,
> - -- 
> Xin LI 	http://www.delphij.net/
> FreeBSD - The Power to Serve!	       Live free or die
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.16 (FreeBSD)
> 
> iQEcBAEBCAAGBQJMyKicAAoJEATO+BI/yjfBElYIAMP70g1a+YheuKD14NXugVTU
> sG4KEWAjRSZCe808f46AXU+wJePnRFkYVKD+A+6aH63y/r2V0e3CVMUYZZXr4l/d
> HJRnZjJK9e/YJv8pcCpq7PgnmPzMa4m4BQNYVJoNGbPd75V27wMi3hgBzzPrJxWL
> aBuB31hpU32PcpvzQgBPLiNzjEuLRq5be42HjgTPT1qGwSMEQcLgXOfG9l6TS27s
> I5n5KPU7dEFt0Z+3ljQM+F3Fk2wmy/EOAeRcZL89xvFZIAYmtVrL3UcniHALPRSn
> CAbGrNpCbvh2RZvJX1Cwu3H+PVIlIcl2uG/aiOEC7m/tA29LfPPXG0IzUN9qVLc=
> =LQen
> -----END PGP SIGNATURE-----

-- 
a13x

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 00:16: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 5211B1065674;
	Thu, 28 Oct 2010 00:16:55 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 273438FC12;
	Thu, 28 Oct 2010 00:16: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 o9S0Gt80048090;
	Thu, 28 Oct 2010 00:16:55 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9S0GtHf048088;
	Thu, 28 Oct 2010 00:16:55 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201010280016.o9S0GtHf048088@svn.freebsd.org>
From: Jack F Vogel 
Date: Thu, 28 Oct 2010 00:16:55 +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: r214441 - 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: Thu, 28 Oct 2010 00:16:55 -0000

Author: jfv
Date: Thu Oct 28 00:16:54 2010
New Revision: 214441
URL: http://svn.freebsd.org/changeset/base/214441

Log:
  In the data setup code for doing offloads the
  ip and tcp pointers were not reset after some
  pullups. In practice this led to an NFS mount
  failure when using UDP reported by Kevin Lo,
  thanks Kevin. Fix from yongari, thank you!

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Wed Oct 27 23:55:15 2010	(r214440)
+++ head/sys/dev/e1000/if_em.c	Thu Oct 28 00:16:54 2010	(r214441)
@@ -93,7 +93,7 @@ int	em_display_debug_stats = 0;
 /*********************************************************************
  *  Driver version:
  *********************************************************************/
-char em_driver_version[] = "7.1.6";
+char em_driver_version[] = "7.1.7";
 
 /*********************************************************************
  *  PCI Device ID Table
@@ -1848,6 +1848,7 @@ em_xmit(struct tx_ring *txr, struct mbuf
 				*m_headp = NULL;
 				return (ENOBUFS);
 			}
+			ip = (struct ip *)(mtod(m_head, char *) + ip_off);
 			ip->ip_len = 0;
 			ip->ip_sum = 0;
 			/*
@@ -1856,6 +1857,7 @@ em_xmit(struct tx_ring *txr, struct mbuf
 			 * what hardware expect to see. This is adherence of
 			 * Microsoft's Large Send specification.
 			 */
+			tp = (struct tcphdr *)(mtod(m_head, char *) + poff);
 			tp->th_sum = in_pseudo(ip->ip_src.s_addr,
 			    ip->ip_dst.s_addr, htons(IPPROTO_TCP));
 		} else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) {
@@ -1865,12 +1867,15 @@ em_xmit(struct tx_ring *txr, struct mbuf
 				*m_headp = NULL;
 				return (ENOBUFS);
 			}
+			ip = (struct ip *)(mtod(m_head, char *) + ip_off);
+			tp = (struct tcphdr *)(mtod(m_head, char *) + poff);
 		} else if (m_head->m_pkthdr.csum_flags & CSUM_UDP) {
 			m_head = m_pullup(m_head, poff + sizeof(struct udphdr));
 			if (m_head == NULL) {
 				*m_headp = NULL;
 				return (ENOBUFS);
 			}
+			ip = (struct ip *)(mtod(m_head, char *) + ip_off);
 		}
 		*m_headp = m_head;
 	}

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 00:52: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 BD07B106564A;
	Thu, 28 Oct 2010 00:52:36 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 75B588FC08;
	Thu, 28 Oct 2010 00:52:35 +0000 (UTC)
Received: by wwi17 with SMTP id 17so111023wwi.31
	for ; Wed, 27 Oct 2010 17:52:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type;
	bh=7HYUvgh5gmoLReYbkeJxykoBuCU9Oac891nYJXN6dXQ=;
	b=b25K0hYbb2L+sb0E5qnMIqs19Q0BgJx7XdoQ6WEg7N530cdiYCgzPUcw8l172cop/4
	Kc2tqdbe5lB8Md3nOsFqSWV/8hRr33PVfWm9l4HCb1eRL5pjoSW7Uzk4SM1HCcfCrng7
	zFeI1aewMxx+t72LaG1g2ZHYDH/fQCUgsu7Nw=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	b=Qu5qMYjHhYnBSJjIOZoyMm8rwFsXGtVcqAPsZ9PgyRrzRxxXE4Btd8NJRMChsv5rQE
	RT1iWW5ynd2ukK3YNEfhdvcSdJrmdlzsAQZZyhcXwOCxDzgYTVDS9blnkv+7lGYnzkux
	1H3YFqDl7Grxj4ZnI+uh9RB3R9yC/Yfy9tMd4=
MIME-Version: 1.0
Received: by 10.216.11.205 with SMTP id 55mr9833917wex.51.1288227154317; Wed,
	27 Oct 2010 17:52:34 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.10.198 with HTTP; Wed, 27 Oct 2010 17:52:34 -0700 (PDT)
In-Reply-To: <4CC851CC.80509@freebsd.org>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	<20101027082122.GD1848@garage.freebsd.pl>
	<4CC85552.2020100@freebsd.org>
	<20101027133307.GQ2392@deviant.kiev.zoral.com.ua>
	
	<4CC851CC.80509@freebsd.org>
Date: Wed, 27 Oct 2010 17:52:34 -0700
X-Google-Sender-Auth: g5uen7lMADsl5cItc3H3YgFSqbQ
Message-ID: 
From: Garrett Cooper 
To: Andriy Gapon 
Content-Type: multipart/mixed; boundary=0016364d2cbdec533f0493a2c1cf
Cc: src-committers@freebsd.org, Pawel Jakub Dawidek ,
	svn-src-all@freebsd.org, svn-src-head@freebsd.org,
	David Xu , Kostik Belousov 
Subject: Re: svn commit: r214409 - 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, 28 Oct 2010 00:52:36 -0000

--0016364d2cbdec533f0493a2c1cf
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Oct 27, 2010 at 9:22 AM, Andriy Gapon  wrote:
>
> [patch attachment was lost]

Ugh... Mailman hates me I guess :(...

> on 27/10/2010 19:07 Garrett Cooper said the following:
>> =A0 =A0 How about this patch? I implemented this as a readonly tunable a=
nd
>
> I don't think that it's correct to call it a tunable or use CTLFLAG_RDTUN=
.
> As I understand it is a read-only sysctl.

Converted to CTLFLAG_RD.

>> sysconf tunable, because (AFAIK) the value that is being tested
>> shouldn't change during runtime after the system has been booted up,
>> and figuring that the value wasn't going to change it was better to
>> lose 4/8 bytes on the kernel stack instead of having to recompute the
>> value every time in a function call, with the associated lost heap /
>> stack memory in the process, as the assumption is that this libcall
>> was going to be called frequently by some programs.

Thanks!
-Garrett

--0016364d2cbdec533f0493a2c1cf
Content-Type: text/x-patch; charset=US-ASCII; 
	name="cpuset_t-size-sysctl-and-sysconf-value.patch"
Content-Disposition: attachment; 
	filename="cpuset_t-size-sysctl-and-sysconf-value.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gfsx6dxs0

SW5kZXg6IGluY2x1ZGUvdW5pc3RkLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gaW5jbHVkZS91bmlzdGQuaAko
cmV2aXNpb24gMjE0NDEzKQorKysgaW5jbHVkZS91bmlzdGQuaAkod29ya2luZyBjb3B5KQpAQCAt
Mjg4LDYgKzI4OCw3IEBACiAjaWYgX19CU0RfVklTSUJMRQogI2RlZmluZQlfU0NfTlBST0NFU1NP
UlNfQ09ORgk1NwogI2RlZmluZQlfU0NfTlBST0NFU1NPUlNfT05MTgk1OAorI2RlZmluZQlfU0Nf
Q1BVU0VUX1NJWkUJCTEyMgogI2VuZGlmCiAKIC8qIEV4dGVuc2lvbnMgZm91bmQgaW4gU29sYXJp
cyBhbmQgTGludXguICovCkluZGV4OiBsaWIvbGliYy9nZW4vc3lzY29uZi5jCj09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0K
LS0tIGxpYi9saWJjL2dlbi9zeXNjb25mLmMJKHJldmlzaW9uIDIxNDQxMykKKysrIGxpYi9saWJj
L2dlbi9zeXNjb25mLmMJKHdvcmtpbmcgY29weSkKQEAgLTU5Nyw2ICs1OTcsMTUgQEAKIAkJcmV0
dXJuIChsdmFsdWUpOwogI2VuZGlmCiAKKyNpZmRlZiBfU0NfQ1BVU0VUX1NJWkUKKwljYXNlIF9T
Q19DUFVTRVRfU0laRToKKwkJbGVuID0gc2l6ZW9mKGx2YWx1ZSk7CisJCWlmIChzeXNjdGxieW5h
bWUoImtlcm4uc2NoZWQuY3B1c2V0c2l6ZSIsICZsdmFsdWUsICZsZW4sIE5VTEwsCisJCSAgICAw
KSA9PSAtMSkKKwkJCXJldHVybiAoLTEpOworCQlyZXR1cm4gKGx2YWx1ZSk7CisjZW5kaWYKKwog
CWRlZmF1bHQ6CiAJCWVycm5vID0gRUlOVkFMOwogCQlyZXR1cm4gKC0xKTsKSW5kZXg6IHN5cy9r
ZXJuL3NjaGVkX3VsZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9rZXJuL3NjaGVkX3VsZS5jCShyZXZp
c2lvbiAyMTQ0MTMpCisrKyBzeXMva2Vybi9zY2hlZF91bGUuYwkod29ya2luZyBjb3B5KQpAQCAt
MjcxMiw2ICsyNzEyLDggQEAKIAlzYnVmX2RlbGV0ZSh0b3BvKTsKIAlyZXR1cm4gKGVycik7CiB9
CisKK3N0YXRpYyBzaXplX3QgX2tlcm5fY3B1c2V0X3NpemUgPSBzaXplb2YoY3B1c2V0X3QpOwog
I2VuZGlmCiAKIFNZU0NUTF9OT0RFKF9rZXJuLCBPSURfQVVUTywgc2NoZWQsIENUTEZMQUdfUlcs
IDAsICJTY2hlZHVsZXIiKTsKQEAgLTI3NDgsNiArMjc1MCwxNSBAQAogU1lTQ1RMX1BST0MoX2tl
cm5fc2NoZWQsIE9JRF9BVVRPLCB0b3BvbG9neV9zcGVjLCBDVExUWVBFX1NUUklORyB8CiAgICAg
Q1RMRkxBR19SRCwgTlVMTCwgMCwgc3lzY3RsX2tlcm5fc2NoZWRfdG9wb2xvZ3lfc3BlYywgIkEi
LCAKICAgICAiWE1MIGR1bXAgb2YgZGV0ZWN0ZWQgQ1BVIHRvcG9sb2d5Iik7CisKKy8qIAorICog
UmV0dXJuIHRoZSBzaXplIG9mIGNwdXNldF90IGF0IHRoZSBrZXJuZWwgbGV2ZWwKKyAqCisgKiBY
WFggKGdjb29wZXIpOiByZXBsYWNlIFVMT05HIHdpdGggU0laRSBvbmNlIENUTFRZUEVfU0laRSBp
cyBpbXBsZW1lbnRlZC4KKyAqLworU1lTQ1RMX1VMT05HKF9rZXJuX3NjaGVkLCBPSURfQVVUTywg
Y3B1c2V0c2l6ZSwgQ1RMRkxBR19SRCwKKyAgICAmX2tlcm5fY3B1c2V0X3NpemUsIDAsICJLZXJu
ZWwtbGV2ZWwgY3B1c2V0X3Qgc3RydWN0IHNpemUiKTsKKwogI2VuZGlmCiAKIC8qIHBzIGNvbXBh
dC4gIEFsbCBjcHUgcGVyY2VudGFnZXMgZnJvbSBVTEUgYXJlIHdlaWdodGVkLiAqLwo=
--0016364d2cbdec533f0493a2c1cf--

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 00:54: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 E87C410656A6;
	Thu, 28 Oct 2010 00:54:18 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BBFA18FC13;
	Thu, 28 Oct 2010 00:54: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 o9S0sIik050351;
	Thu, 28 Oct 2010 00:54:18 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9S0sIIE050349;
	Thu, 28 Oct 2010 00:54:18 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201010280054.o9S0sIIE050349@svn.freebsd.org>
From: Edwin Groothuis 
Date: Thu, 28 Oct 2010 00:54: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: r214442 - stable/8/usr.sbin/lpr/lpr
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 00:54:19 -0000

Author: edwin
Date: Thu Oct 28 00:54:18 2010
New Revision: 214442
URL: http://svn.freebsd.org/changeset/base/214442

Log:
  MFC of 214124
  
  Fix printing of files located on ZFS filesystem with an st_dev or
  st_ino larger than 2**31.
  
  From the PR:
  
     Printing from a ZFS filesystem using 'lp' fails and returns an
     email reporting "Your printer job was not printed because it was
     not linked to the original file".
  
     In order to protect against files being switched when files
     are printed using 'lp' or 'lpr -s', the st_dev and st_ino
     values for the original file are saved by lpr and verified
     by lpd before the file is printed. Unfortunately, lpr prints
     both values using '%d' (although both fields are unsigned)
     and lpd(8) assumes a string of decimal digits.
  
     ZFS (at least) generates st_dev values greater than 2^31-1,
     resulting in negative values being printed - which lpd cannot
     parse, leading it to report that the file has been switched.
  
     A similar problem would occur with large inode numbers.
  
     How-To-Repeat:
  
     Find a file with either st_dev or st_ino greater than 2^31-1
     (stat(1) will report both numbers) and print it with 'lpq -s'.
     This should generate an email reporting that the file could
     not be printed because it was not linked to the original file
  
  PR:           bin/151567
  Submitted by: Peter Jeremy 

Modified:
  stable/8/usr.sbin/lpr/lpr/lpr.c
Directory Properties:
  stable/8/usr.sbin/lpr/   (props changed)

Modified: stable/8/usr.sbin/lpr/lpr/lpr.c
==============================================================================
--- stable/8/usr.sbin/lpr/lpr/lpr.c	Thu Oct 28 00:16:54 2010	(r214441)
+++ stable/8/usr.sbin/lpr/lpr/lpr.c	Thu Oct 28 00:54:18 2010	(r214442)
@@ -386,7 +386,7 @@ main(int argc, char *argv[])
 			continue;	/* file unreasonable */
 
 		if (sflag && (cp = linked(arg)) != NULL) {
-			(void) snprintf(buf, sizeof(buf), "%d %d", statb.st_dev,
+			(void) snprintf(buf, sizeof(buf), "%u %u", statb.st_dev,
 				statb.st_ino);
 			card('S', buf);
 			if (format == 'p')

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 01:38:57 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.ORG
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id D91A51065673; Thu, 28 Oct 2010 01:38:57 +0000 (UTC)
Date: Thu, 28 Oct 2010 01:38:57 +0000
From: Alexey Dokuchaev 
To: d@delphij.net
Message-ID: <20101028013857.GA4476@FreeBSD.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <4CC8A89D.5070909@delphij.net>
User-Agent: Mutt/1.4.2.1i
Cc: Doug Barton , svn-src-all@FreeBSD.ORG,
	src-committers@FreeBSD.ORG, svn-src-head@FreeBSD.ORG,
	Alexander Best , Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 01:38:57 -0000

On Wed, Oct 27, 2010 at 03:33:01PM -0700, Xin LI wrote:
> Maybe something like:
> 
> BUGS
> 
> The -P option assumes that the underlying storage overwrites file block
> when data is written on existing offset.  Several factors including the
> file system and its backing store could defeat the assumption, this
> includes, but is not limited to file systems that uses Copy-On-Write
> strategy (e.g. ZFS or UFS when snapshot is being used), or backing
> datastore that does journaling, etc.  In addition, only regular files
> are overwritten, other types of files are not.

This sounds very nice and FreeBSD-ish.

./danfe

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 01:54: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 2DB7B106566B;
	Thu, 28 Oct 2010 01:54:05 +0000 (UTC)
	(envelope-from davidxu@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 1425A8FC13;
	Thu, 28 Oct 2010 01:54:05 +0000 (UTC)
Received: from xyf.my.dom (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9S1s2tD064930;
	Thu, 28 Oct 2010 01:54:02 GMT (envelope-from davidxu@freebsd.org)
Message-ID: <4CC9483C.7050507@freebsd.org>
Date: Thu, 28 Oct 2010 09:54:04 +0000
From: David Xu 
User-Agent: Thunderbird 2.0.0.24 (X11/20100630)
MIME-Version: 1.0
To: Garrett Cooper 
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>		<4CC803A8.3040602@freebsd.org>	<20101027082122.GD1848@garage.freebsd.pl>	<4CC85552.2020100@freebsd.org>	<20101027133307.GQ2392@deviant.kiev.zoral.com.ua>		<4CC851CC.80509@freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: src-committers@freebsd.org, Pawel Jakub Dawidek ,
	svn-src-all@freebsd.org, Andriy Gapon ,
	svn-src-head@freebsd.org, Kostik Belousov 
Subject: Re: svn commit: r214409 - 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, 28 Oct 2010 01:54:05 -0000

Garrett Cooper wrote:
> On Wed, Oct 27, 2010 at 9:22 AM, Andriy Gapon  wrote:
>> [patch attachment was lost]
> 
> Ugh... Mailman hates me I guess :(...
> 
>> on 27/10/2010 19:07 Garrett Cooper said the following:
>>>     How about this patch? I implemented this as a readonly tunable and
>> I don't think that it's correct to call it a tunable or use CTLFLAG_RDTUN.
>> As I understand it is a read-only sysctl.
> 
> Converted to CTLFLAG_RD.
> 
>>> sysconf tunable, because (AFAIK) the value that is being tested
>>> shouldn't change during runtime after the system has been booted up,
>>> and figuring that the value wasn't going to change it was better to
>>> lose 4/8 bytes on the kernel stack instead of having to recompute the
>>> value every time in a function call, with the associated lost heap /
>>> stack memory in the process, as the assumption is that this libcall
>>> was going to be called frequently by some programs.
> 
> Thanks!
> -Garrett
> 

The patch looks fine to me. ;-)


From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 02:59: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 9456B106564A;
	Thu, 28 Oct 2010 02:59:25 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8300E8FC0A;
	Thu, 28 Oct 2010 02:59: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 o9S2xPpn059382;
	Thu, 28 Oct 2010 02:59:25 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9S2xPnD059380;
	Thu, 28 Oct 2010 02:59:25 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201010280259.o9S2xPnD059380@svn.freebsd.org>
From: David Xu 
Date: Thu, 28 Oct 2010 02:59: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: r214443 - head/share/man/man3
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 02:59:25 -0000

Author: davidxu
Date: Thu Oct 28 02:59:25 2010
New Revision: 214443
URL: http://svn.freebsd.org/changeset/base/214443

Log:
  Follow the change made in libthr, add ERANGE error code and more
  EINVAL error cases.

Modified:
  head/share/man/man3/pthread_attr_affinity_np.3

Modified: head/share/man/man3/pthread_attr_affinity_np.3
==============================================================================
--- head/share/man/man3/pthread_attr_affinity_np.3	Thu Oct 28 00:54:18 2010	(r214442)
+++ head/share/man/man3/pthread_attr_affinity_np.3	Thu Oct 28 02:59:25 2010	(r214443)
@@ -94,8 +94,6 @@ to indicate the error.
 .Sh ERRORS
 The
 .Fn pthread_attr_getaffinity_np
-and
-.Fn pthread_attr_setaffinity_np
 functions will fail if:
 .Bl -tag -width Er
 .It Bq Er EINVAL
@@ -103,6 +101,10 @@ The
 .Fa pattr
 or the attribute specified by it is
 .Dv NULL .
+.It Bq Er ERANGE
+The
+.Fa cpusetsize
+is too small.
 .El
 .Pp
 The
@@ -114,6 +116,14 @@ The
 .Fa pattr
 or the attribute specified by it is
 .Dv NULL .
+.It Bq Er EINVAL
+The
+.Fa cpusetp
+specified a CPU that was outside the set supported by the kernel. 
+.It Bq Er ERANGE
+The
+.Fa cpusetsize
+is too small.
 .It Bq Er ENOMEM
 Insufficient memory exists to store the cpuset mask.
 .El

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 04: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 47FB11065672;
	Thu, 28 Oct 2010 04:14:29 +0000 (UTC)
	(envelope-from gibbs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3698A8FC17;
	Thu, 28 Oct 2010 04:14: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 o9S4ETuJ061203;
	Thu, 28 Oct 2010 04:14:29 GMT (envelope-from gibbs@svn.freebsd.org)
Received: (from gibbs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9S4ETeD061201;
	Thu, 28 Oct 2010 04:14:29 GMT (envelope-from gibbs@svn.freebsd.org)
Message-Id: <201010280414.o9S4ETeD061201@svn.freebsd.org>
From: "Justin T. Gibbs" 
Date: Thu, 28 Oct 2010 04:14: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: r214444 - head/sys/dev/xen/blkback
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 04:14:29 -0000

Author: gibbs
Date: Thu Oct 28 04:14:28 2010
New Revision: 214444
URL: http://svn.freebsd.org/changeset/base/214444

Log:
  sys/dev/xen/blkback/blkback.c:
  	In xbb_detach() only perform cleanup of our taskqueue and
  	device statistics structures if they have been initialized.
  	This avoids a panic when xbb_detach() is called on a partially
  	initialized device instance, due to an early failure in
  	attach.
  
  Sponsored by:	Spectra Logic Corporation

Modified:
  head/sys/dev/xen/blkback/blkback.c

Modified: head/sys/dev/xen/blkback/blkback.c
==============================================================================
--- head/sys/dev/xen/blkback/blkback.c	Thu Oct 28 02:59:25 2010	(r214443)
+++ head/sys/dev/xen/blkback/blkback.c	Thu Oct 28 04:14:28 2010	(r214444)
@@ -2827,8 +2827,11 @@ xbb_detach(device_t dev)
 
 	DPRINTF("\n");
 
-	taskqueue_free(xbb->io_taskqueue);
-	devstat_remove_entry(xbb->xbb_stats);
+	if (xbb->io_taskqueue != NULL)
+		taskqueue_free(xbb->io_taskqueue);
+
+	if (xbb->xbb_stats != NULL)
+		devstat_remove_entry(xbb->xbb_stats);
 
 	xbb_close_backend(xbb);
 	xbb_free_communication_mem(xbb);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 05:22: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 81470106566B;
	Thu, 28 Oct 2010 05:22:28 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au
	[211.29.132.185])
	by mx1.freebsd.org (Postfix) with ESMTP id 143338FC12;
	Thu, 28 Oct 2010 05:22:27 +0000 (UTC)
Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au
	(c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165])
	by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o9S5M5Q0004681
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 28 Oct 2010 16:22:07 +1100
Date: Thu, 28 Oct 2010 16:22:05 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: d@delphij.net
In-Reply-To: <4CC8A89D.5070909@delphij.net>
Message-ID: <20101028152418.A916@besplex.bde.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: Doug Barton , svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, svn-src-head@FreeBSD.org,
	Alexander Best , Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 05:22:28 -0000

On Wed, 27 Oct 2010, Xin LI wrote:

> I think what really defeats -P is the fact that the file system or
> underlying data storage would not overwrite data on a file at sync().
> COW is of course one of the case, journaling MAY defeat -P but is not
> guaranteed.  FS with variable block size - I believe this really depends
> on the implementation.
>
> If I understood the code correctly, UFS, UFS+SU, UFS+SUJ, msdosfs and
> ext2fs supports rm -P as long as they are not being put on gjournal'ed
> disk, ZFS zvol, etc., and no snapshot is being used.

And that the underlying data storage us dumb.  Any flash drive now
tries to minimise writes.  It wouldn't take much buffering to defeat
the 0xff, 0,0xff pattern.  Wear leveling should result in different
physical blocks being written each time if the writes get to the
lowest level of storage.

And that block reallocation (done by ffs1 and ffs2) doesn't choose
different blocks.

> It seems to be hard for me to conclude all cases in short, plain English
> but I'm all for improvements to the manual page to describe that in an
> elegant and precise manner.
>
> Maybe something like:
>
> ===============
> BUGS
>
> The -P option assumes that the underlying storage overwrites file block
> when data is written on existing offset.  Several factors including the
> file system and its backing store could defeat the assumption, this
> includes, but is not limited to file systems that uses Copy-On-Write
> strategy (e.g. ZFS or UFS when snapshot is being used), or backing
> datastore that does journaling, etc.  In addition, only regular files
> are overwritten, other types of files are not.
> ===============

Summary: it is very hard to tell whether -P works, even when you think
you know what all the subsystems are doing.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 06:45: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 3E223106564A;
	Thu, 28 Oct 2010 06:45:21 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C0838FC0A;
	Thu, 28 Oct 2010 06:45: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 o9S6jLcr064373;
	Thu, 28 Oct 2010 06:45:21 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9S6jLIp064371;
	Thu, 28 Oct 2010 06:45:21 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201010280645.o9S6jLIp064371@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 28 Oct 2010 06:45: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: r214445 - head/usr.sbin/pc-sysinstall/backend-query
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 06:45:21 -0000

Author: imp
Date: Thu Oct 28 06:45:20 2010
New Revision: 214445
URL: http://svn.freebsd.org/changeset/base/214445

Log:
  Turns out we need functions.sh in this file for convert_to_megabytes call.

Modified:
  head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh

Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh	Thu Oct 28 04:14:28 2010	(r214444)
+++ head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh	Thu Oct 28 06:45:20 2010	(r214445)
@@ -28,6 +28,7 @@
 # Query a disk for partitions and display them
 #############################################################################
 
+. ${PROGDIR}/backend/functions.sh
 . ${PROGDIR}/backend/functions-disk.sh
 
 DISK="${1}"
@@ -57,4 +58,3 @@ echo "heads=${HEADS}"
 echo "sectors=${SECS}"
 echo "size=${MB}"
 echo "type=${CTYPE}"
-

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 07:55: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 E82781065698;
	Thu, 28 Oct 2010 07:55:45 +0000 (UTC)
	(envelope-from gljennjohn@googlemail.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 C97988FC0A;
	Thu, 28 Oct 2010 07:55:44 +0000 (UTC)
Received: by fxm17 with SMTP id 17so1667266fxm.13
	for ; Thu, 28 Oct 2010 00:55:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:received:received:date:from:to:cc:subject
	:message-id:in-reply-to:references:reply-to:x-mailer:mime-version
	:content-type:content-transfer-encoding;
	bh=JoYKgNc12xXkPiut6QkDPLgzKO3JsCXyfLWvct/OBTo=;
	b=fBMW5bQykTqnDfbPDI729nTuYosvFV16xaYoowYAfsmgpEbsMYWMv47kVBwJD0Eo66
	ItO2gIe5xj18adks1QlFV2+04H++9cDOrCQwdEGL1jKx+jzvX/iFsHlu4slwDXMD5opF
	ag40s3dLvD+g8ad2Ow/uDlCYp0llJAZlzGmVI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to
	:x-mailer:mime-version:content-type:content-transfer-encoding;
	b=R4d/Y9gSlDogBe1BJGMI39O4fwAYchbFNuGS/UBCW6COt5hFju7M/bNZK4ehuQGhjB
	fSa3T/WYVyIExdk+oeIMsFjqVbXf+qNrb7YZB1xk4OGE9GrbBNRmXrmvgIGHkREcQPQs
	3yDrfD9ddw+Jc80APXto6AEXbCmEtKInf33gA=
Received: by 10.223.78.199 with SMTP id m7mr3597858fak.11.1288252543530;
	Thu, 28 Oct 2010 00:55:43 -0700 (PDT)
Received: from ernst.jennejohn.org (p578E3401.dip.t-dialin.net [87.142.52.1])
	by mx.google.com with ESMTPS id p18sm335237faa.16.2010.10.28.00.55.40
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Thu, 28 Oct 2010 00:55:41 -0700 (PDT)
Date: Thu, 28 Oct 2010 09:55:38 +0200
From: Gary Jennejohn 
To: Bruce Evans 
Message-ID: <20101028095538.24147119@ernst.jennejohn.org>
In-Reply-To: <20101028152418.A916@besplex.bde.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.7; amd64-portbld-freebsd9.0)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: Doug Barton , d@delphij.net, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, svn-src-head@FreeBSD.org,
	Alexander Best , Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: gljennjohn@googlemail.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: Thu, 28 Oct 2010 07:55:46 -0000

On Thu, 28 Oct 2010 16:22:05 +1100 (EST)
Bruce Evans  wrote:

> On Wed, 27 Oct 2010, Xin LI wrote:
> 
> > I think what really defeats -P is the fact that the file system or
> > underlying data storage would not overwrite data on a file at sync().
> > COW is of course one of the case, journaling MAY defeat -P but is not
> > guaranteed.  FS with variable block size - I believe this really depends
> > on the implementation.
> >
> > If I understood the code correctly, UFS, UFS+SU, UFS+SUJ, msdosfs and
> > ext2fs supports rm -P as long as they are not being put on gjournal'ed
> > disk, ZFS zvol, etc., and no snapshot is being used.
> 
> And that the underlying data storage us dumb.  Any flash drive now
> tries to minimise writes.  It wouldn't take much buffering to defeat
> the 0xff, 0,0xff pattern.  Wear leveling should result in different
> physical blocks being written each time if the writes get to the
> lowest level of storage.
> 
> And that block reallocation (done by ffs1 and ffs2) doesn't choose
> different blocks.
> 
> > It seems to be hard for me to conclude all cases in short, plain English
> > but I'm all for improvements to the manual page to describe that in an
> > elegant and precise manner.
> >
> > Maybe something like:
> >
> > ===============
> > BUGS
> >
> > The -P option assumes that the underlying storage overwrites file block
> > when data is written on existing offset.  Several factors including the
> > file system and its backing store could defeat the assumption, this
> > includes, but is not limited to file systems that uses Copy-On-Write
> > strategy (e.g. ZFS or UFS when snapshot is being used), or backing
> > datastore that does journaling, etc.  In addition, only regular files
> > are overwritten, other types of files are not.
> > ===============
> 
> Summary: it is very hard to tell whether -P works, even when you think
> you know what all the subsystems are doing.
> 

All this discussion leads me to the conclusion that we should just
remove the -P functionality and add a remark to the man page that that
was done because it isn't guaranteed to work on all file systems.

Why give users a false sense of security?  If they're concerned about
data security then they should use geli or something similar.

--
Gary Jennejohn

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 07:58: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 A0A331065670;
	Thu, 28 Oct 2010 07:58:06 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8BDCE8FC16;
	Thu, 28 Oct 2010 07:58: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 o9S7w6J3069192;
	Thu, 28 Oct 2010 07:58:06 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9S7w6Vj069186;
	Thu, 28 Oct 2010 07:58:06 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201010280758.o9S7w6Vj069186@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 28 Oct 2010 07:58: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: r214446 - 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, 28 Oct 2010 07:58:06 -0000

Author: attilio
Date: Thu Oct 28 07:58:06 2010
New Revision: 214446
URL: http://svn.freebsd.org/changeset/base/214446

Log:
  Merge the mptable support from MD bits to x86 subtree.
  
  Sponsored by:	Sandvine Incorporated
  Discussed with:	jhb

Added:
  head/sys/x86/x86/mptable.c
     - copied, changed from r214370, head/sys/i386/i386/mptable.c
  head/sys/x86/x86/mptable_pci.c
     - copied unchanged from r214370, head/sys/i386/i386/mptable_pci.c
Deleted:
  head/sys/amd64/amd64/mptable.c
  head/sys/amd64/amd64/mptable_pci.c
  head/sys/i386/i386/mptable.c
  head/sys/i386/i386/mptable_pci.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	Thu Oct 28 06:45:20 2010	(r214445)
+++ head/sys/conf/files.amd64	Thu Oct 28 07:58:06 2010	(r214446)
@@ -121,8 +121,6 @@ amd64/amd64/minidump_machdep.c	standard
 amd64/amd64/mp_machdep.c	optional	smp
 amd64/amd64/mp_watchdog.c	optional	mp_watchdog smp
 amd64/amd64/mpboot.S		optional	smp
-amd64/amd64/mptable.c		optional	mptable
-amd64/amd64/mptable_pci.c	optional	mptable pci
 amd64/amd64/nexus.c		standard
 amd64/amd64/pmap.c		standard
 amd64/amd64/prof_machdep.c	optional	profiling-routine
@@ -324,4 +322,6 @@ x86/x86/dump_machdep.c		standard
 x86/x86/io_apic.c		standard
 x86/x86/local_apic.c		standard
 x86/x86/mca.c			standard
+x86/x86/mptable.c		optional	mptable
+x86/x86/mptable_pci.c		optional	mptable pci
 x86/x86/msi.c			optional	pci

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Thu Oct 28 06:45:20 2010	(r214445)
+++ head/sys/conf/files.i386	Thu Oct 28 07:58:06 2010	(r214446)
@@ -289,9 +289,7 @@ i386/i386/mp_machdep.c		optional native 
 i386/xen/mp_machdep.c		optional xen smp
 i386/i386/mp_watchdog.c		optional mp_watchdog smp
 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/nexus.c		standard
 i386/i386/perfmon.c		optional perfmon
 i386/i386/pmap.c		optional native
@@ -398,4 +396,6 @@ x86/x86/dump_machdep.c		standard
 x86/x86/io_apic.c		optional apic
 x86/x86/local_apic.c		optional apic
 x86/x86/mca.c			standard
+x86/x86/mptable.c		optional apic native
+x86/x86/mptable_pci.c		optional apic pci
 x86/x86/msi.c			optional apic pci

Modified: head/sys/conf/files.pc98
==============================================================================
--- head/sys/conf/files.pc98	Thu Oct 28 06:45:20 2010	(r214445)
+++ head/sys/conf/files.pc98	Thu Oct 28 07:58:06 2010	(r214446)
@@ -156,8 +156,6 @@ i386/i386/mp_clock.c		optional smp
 i386/i386/mp_machdep.c		optional smp
 i386/i386/mp_watchdog.c		optional mp_watchdog smp
 i386/i386/mpboot.s		optional smp
-i386/i386/mptable.c		optional apic
-i386/i386/mptable_pci.c		optional apic pci
 i386/i386/nexus.c		standard
 i386/i386/perfmon.c		optional perfmon
 i386/i386/pmap.c		standard
@@ -258,4 +256,6 @@ x86/x86/dump_machdep.c		standard
 x86/x86/io_apic.c		optional apic
 x86/x86/local_apic.c		optional apic
 x86/x86/mca.c			standard
+x86/x86/mptable.c		optional apic
+x86/x86/mptable_pci.c		optional apic pci
 x86/x86/msi.c			optional apic pci

Copied and modified: head/sys/x86/x86/mptable.c (from r214370, head/sys/i386/i386/mptable.c)
==============================================================================
--- head/sys/i386/i386/mptable.c	Tue Oct 26 08:50:09 2010	(r214370, copy source)
+++ head/sys/x86/x86/mptable.c	Thu Oct 28 07:58:06 2010	(r214446)
@@ -51,7 +51,11 @@ __FBSDID("$FreeBSD$");
 /* string defined by the Intel MP Spec as identifying the MP table */
 #define	MP_SIG			0x5f504d5f	/* _MP_ */
 
+#ifdef __amd64__
+#define	MAX_LAPIC_ID		63	/* Max local APIC ID for HTT fixup */
+#else
 #define	MAX_LAPIC_ID		31	/* Max local APIC ID for HTT fixup */
+#endif
 
 #ifdef PC98
 #define BIOS_BASE		(0xe8000)

Copied: head/sys/x86/x86/mptable_pci.c (from r214370, head/sys/i386/i386/mptable_pci.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/x86/x86/mptable_pci.c	Thu Oct 28 07:58:06 2010	(r214446, copy of r214370, head/sys/i386/i386/mptable_pci.c)
@@ -0,0 +1,177 @@
+/*-
+ * 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.
+ */
+
+/*
+ * Host to PCI and PCI to PCI bridge drivers that use the MP Table to route
+ * interrupts from PCI devices to I/O APICs.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "pcib_if.h"
+
+/* Host to PCI bridge driver. */
+
+static int
+mptable_hostb_probe(device_t dev)
+{
+
+	if (pci_cfgregopen() == 0)
+		return (ENXIO);
+	if (mptable_pci_probe_table(pcib_get_bus(dev)) != 0)
+		return (ENXIO);
+	device_set_desc(dev, "MPTable Host-PCI bridge");
+	return (0);
+}
+
+static int
+mptable_hostb_attach(device_t dev)
+{
+
+	device_add_child(dev, "pci", pcib_get_bus(dev));
+	return (bus_generic_attach(dev));
+}
+
+/* Pass MSI requests up to the nexus. */
+static int
+mptable_hostb_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+    int *irqs)
+{
+	device_t bus;
+
+	bus = device_get_parent(pcib);
+	return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+	    irqs));
+}
+
+static int
+mptable_hostb_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+	device_t bus;
+
+	bus = device_get_parent(pcib);
+	return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+mptable_hostb_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+    uint32_t *data)
+{
+	device_t bus;
+
+	bus = device_get_parent(pcib);
+	return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static device_method_t mptable_hostb_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		mptable_hostb_probe),
+	DEVMETHOD(device_attach,	mptable_hostb_attach),
+	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
+	DEVMETHOD(device_suspend,	bus_generic_suspend),
+	DEVMETHOD(device_resume,	bus_generic_resume),
+
+	/* Bus interface */
+	DEVMETHOD(bus_print_child,	bus_generic_print_child),
+	DEVMETHOD(bus_read_ivar,	legacy_pcib_read_ivar),
+	DEVMETHOD(bus_write_ivar,	legacy_pcib_write_ivar),
+	DEVMETHOD(bus_alloc_resource,	legacy_pcib_alloc_resource),
+	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
+	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
+	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
+
+	/* pcib interface */
+	DEVMETHOD(pcib_maxslots,	legacy_pcib_maxslots),
+	DEVMETHOD(pcib_read_config,	legacy_pcib_read_config),
+	DEVMETHOD(pcib_write_config,	legacy_pcib_write_config),
+	DEVMETHOD(pcib_route_interrupt,	mptable_pci_route_interrupt),
+	DEVMETHOD(pcib_alloc_msi,	mptable_hostb_alloc_msi),
+	DEVMETHOD(pcib_release_msi,	pcib_release_msi),
+	DEVMETHOD(pcib_alloc_msix,	mptable_hostb_alloc_msix),
+	DEVMETHOD(pcib_release_msix,	pcib_release_msix),
+	DEVMETHOD(pcib_map_msi,		mptable_hostb_map_msi),
+
+	{ 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, mptable_hostb_driver, mptable_hostb_methods, 1);
+DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, hostb_devclass, 0, 0);
+
+/* PCI to PCI bridge driver. */
+
+static int
+mptable_pcib_probe(device_t dev)
+{
+	int bus;
+
+	if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+	    (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+		return (ENXIO);
+	bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+	if (bus == 0)
+		return (ENXIO);
+	if (mptable_pci_probe_table(bus) != 0)
+		return (ENXIO);
+	device_set_desc(dev, "MPTable PCI-PCI bridge");
+	return (-1000);
+}
+
+static device_method_t mptable_pcib_pci_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		mptable_pcib_probe),
+
+	/* pcib interface */
+	DEVMETHOD(pcib_route_interrupt,	mptable_pci_route_interrupt),
+
+	{0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_1(pcib, mptable_pcib_driver, mptable_pcib_pci_methods,
+    sizeof(struct pcib_softc), pcib_driver);
+DRIVER_MODULE(mptable_pcib, pci, mptable_pcib_driver, pcib_devclass, 0, 0);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 08:00: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 108391065698;
	Thu, 28 Oct 2010 08:00:21 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B30A8FC15;
	Thu, 28 Oct 2010 08:00:20 +0000 (UTC)
Received: by qwe4 with SMTP id 4so1656927qwe.13
	for ; Thu, 28 Oct 2010 01:00:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:content-type:content-transfer-encoding;
	bh=hH7nOhtPLcSVkQff6Sx2FFM8l3ZDzLdt6YEsIHK1ltM=;
	b=EKUZAg29jA1ZFJ10FEpnRWcVoAknLuUXtSa+6kVHhdif5coz5vCdp0WHO0NFYSrLrv
	yyoA9Z1ZEnUDWFRTuGVeufJxeHCw/wwAzTGewrYNgbpdFLFoDI3qBa855BqPwf39o95f
	qvmHEoKpDWRTNoglvwVcn2ZzcQtzeuqQjbK1k=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=Gura6gVt5CMVAT7BM5zdcMA5iQiqYwGQruIR6cgohkN77ARWLH8t8eUtCCjK4YjflM
	tWD2wmPWpP1tASubed0Ub/GFdATUI2oqrzsgMKmCvUD8perU8yZ9sh4mJXm6Ky6a8WKn
	9qmDU86682u1pYbxEsxkCQxaIEj1lyVNwr8eI=
MIME-Version: 1.0
Received: by 10.229.224.82 with SMTP id in18mr5001477qcb.262.1288252819759;
	Thu, 28 Oct 2010 01:00:19 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.237.9 with HTTP; Thu, 28 Oct 2010 01:00:19 -0700 (PDT)
In-Reply-To: <201010280758.o9S7w6Vj069186@svn.freebsd.org>
References: <201010280758.o9S7w6Vj069186@svn.freebsd.org>
Date: Thu, 28 Oct 2010 10:00:19 +0200
X-Google-Sender-Auth: V9mHDxFe_IKfLf4pi3ojiXjzIbI
Message-ID: 
From: Attilio Rao 
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
	svn-src-head@freebsd.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: 
Subject: Re: svn commit: r214446 - 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, 28 Oct 2010 08:00:21 -0000

2010/10/28 Attilio Rao :
> Author: attilio
> Date: Thu Oct 28 07:58:06 2010
> New Revision: 214446
> URL: http://svn.freebsd.org/changeset/base/214446
>
> Log:
> =C2=A0Merge the mptable support from MD bits to x86 subtree.

This commit should also fix a bug as in the amd64 version the presence
of MPTABLE_FORCE_HTT will never be correctly detected because of the
missing opt inclusion.

Thanks,
Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 09:34: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 B8BC4106566B;
	Thu, 28 Oct 2010 09:34:53 +0000 (UTC)
	(envelope-from ceri@submonkey.net)
Received: from scuttle.submonkey.net (scuttle.submonkey.net [208.111.43.184])
	by mx1.freebsd.org (Postfix) with ESMTP id C16B48FC08;
	Thu, 28 Oct 2010 09:34:48 +0000 (UTC)
Received: from cpc6-cdif11-2-0-cust58.5-1.cable.virginmedia.com
	([62.255.146.59] helo=shrike.submonkey.net)
	by scuttle.submonkey.net with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
	(Exim 4.69) (envelope-from )
	id 1PBNsg-0005jx-Hb; Thu, 28 Oct 2010 08:30:42 +0000
Received: from ceri by shrike.submonkey.net with local (Exim 4.69 (FreeBSD))
	(envelope-from )
	id 1PBNse-000KSr-7r; Thu, 28 Oct 2010 09:30:40 +0100
Date: Thu, 28 Oct 2010 09:30:40 +0100
From: Ceri Davies 
To: Gary Jennejohn 
Message-ID: <20101028083040.GA5488@submonkey.net>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="TB36FDmn/VVEgNH/"
Content-Disposition: inline
In-Reply-To: <20101028095538.24147119@ernst.jennejohn.org>
X-PGP: finger ceri@FreeBSD.org
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: Ceri Davies 
Cc: Doug Barton , d@delphij.net, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Bruce Evans ,
	svn-src-head@FreeBSD.org, Alexander Best ,
	Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 09:34:53 -0000


--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Oct 28, 2010 at 09:55:38AM +0200, Gary Jennejohn wrote:
> On Thu, 28 Oct 2010 16:22:05 +1100 (EST)
> Bruce Evans  wrote:
>=20
> > On Wed, 27 Oct 2010, Xin LI wrote:
> >=20
> > > I think what really defeats -P is the fact that the file system or
> > > underlying data storage would not overwrite data on a file at sync().
> > > COW is of course one of the case, journaling MAY defeat -P but is not
> > > guaranteed.  FS with variable block size - I believe this really depe=
nds
> > > on the implementation.
> > >
> > > If I understood the code correctly, UFS, UFS+SU, UFS+SUJ, msdosfs and
> > > ext2fs supports rm -P as long as they are not being put on gjournal'ed
> > > disk, ZFS zvol, etc., and no snapshot is being used.
> >=20
> > And that the underlying data storage us dumb.  Any flash drive now
> > tries to minimise writes.  It wouldn't take much buffering to defeat
> > the 0xff, 0,0xff pattern.  Wear leveling should result in different
> > physical blocks being written each time if the writes get to the
> > lowest level of storage.
> >=20
> > And that block reallocation (done by ffs1 and ffs2) doesn't choose
> > different blocks.
> >=20
> > > It seems to be hard for me to conclude all cases in short, plain Engl=
ish
> > > but I'm all for improvements to the manual page to describe that in an
> > > elegant and precise manner.
> > >
> > > Maybe something like:
> > >
> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > > BUGS
> > >
> > > The -P option assumes that the underlying storage overwrites file blo=
ck
> > > when data is written on existing offset.  Several factors including t=
he
> > > file system and its backing store could defeat the assumption, this
> > > includes, but is not limited to file systems that uses Copy-On-Write
> > > strategy (e.g. ZFS or UFS when snapshot is being used), or backing
> > > datastore that does journaling, etc.  In addition, only regular files
> > > are overwritten, other types of files are not.
> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >=20
> > Summary: it is very hard to tell whether -P works, even when you think
> > you know what all the subsystems are doing.
> >=20
>=20
> All this discussion leads me to the conclusion that we should just
> remove the -P functionality and add a remark to the man page that that
> was done because it isn't guaranteed to work on all file systems.

I was about to suggest the same thing.  Sounds like -P requires far too
many ducks to be lined up in order to work.

Ceri
--=20
Haffely, Gaffely, Gaffely, Gonward.

--TB36FDmn/VVEgNH/
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iD8DBQFMyTSvocfcwTS3JF8RAn69AJ9GRZnT5EdnwaDyu2juqGFRZPH2AACgiinY
H+lZcVTTdV/QDr5e846LoM4=
=gdId
-----END PGP SIGNATURE-----

--TB36FDmn/VVEgNH/--

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 10:25:47 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 5BE551065672; Thu, 28 Oct 2010 10:25:47 +0000 (UTC)
Date: Thu, 28 Oct 2010 10:25:47 +0000
From: Alexander Best 
To: Gary Jennejohn 
Message-ID: <20101028102547.GA56817@freebsd.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20101028095538.24147119@ernst.jennejohn.org>
Cc: Doug Barton , d@delphij.net, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Bruce Evans ,
	svn-src-head@FreeBSD.org, Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 10:25:47 -0000

On Thu Oct 28 10, Gary Jennejohn wrote:
> On Thu, 28 Oct 2010 16:22:05 +1100 (EST)
> Bruce Evans  wrote:
> 
> > On Wed, 27 Oct 2010, Xin LI wrote:
> > 
> > > I think what really defeats -P is the fact that the file system or
> > > underlying data storage would not overwrite data on a file at sync().
> > > COW is of course one of the case, journaling MAY defeat -P but is not
> > > guaranteed.  FS with variable block size - I believe this really depends
> > > on the implementation.
> > >
> > > If I understood the code correctly, UFS, UFS+SU, UFS+SUJ, msdosfs and
> > > ext2fs supports rm -P as long as they are not being put on gjournal'ed
> > > disk, ZFS zvol, etc., and no snapshot is being used.
> > 
> > And that the underlying data storage us dumb.  Any flash drive now
> > tries to minimise writes.  It wouldn't take much buffering to defeat
> > the 0xff, 0,0xff pattern.  Wear leveling should result in different
> > physical blocks being written each time if the writes get to the
> > lowest level of storage.
> > 
> > And that block reallocation (done by ffs1 and ffs2) doesn't choose
> > different blocks.
> > 
> > > It seems to be hard for me to conclude all cases in short, plain English
> > > but I'm all for improvements to the manual page to describe that in an
> > > elegant and precise manner.
> > >
> > > Maybe something like:
> > >
> > > ===============
> > > BUGS
> > >
> > > The -P option assumes that the underlying storage overwrites file block
> > > when data is written on existing offset.  Several factors including the
> > > file system and its backing store could defeat the assumption, this
> > > includes, but is not limited to file systems that uses Copy-On-Write
> > > strategy (e.g. ZFS or UFS when snapshot is being used), or backing
> > > datastore that does journaling, etc.  In addition, only regular files
> > > are overwritten, other types of files are not.
> > > ===============
> > 
> > Summary: it is very hard to tell whether -P works, even when you think
> > you know what all the subsystems are doing.
> > 
> 
> All this discussion leads me to the conclusion that we should just
> remove the -P functionality and add a remark to the man page that that
> was done because it isn't guaranteed to work on all file systems.
> 
> Why give users a false sense of security?  If they're concerned about
> data security then they should use geli or something similar.

that might be the ultimate solution. also one could use security/srm instead.

+1 here. ;)

question is: should -P be removed entirely or be made a no op?

cheers.
alex

> 
> --
> Gary Jennejohn

-- 
a13x

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 10:37: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 54382106566B;
	Thu, 28 Oct 2010 10:37:34 +0000 (UTC)
	(envelope-from ceri@submonkey.net)
Received: from scuttle.submonkey.net (scuttle.submonkey.net [208.111.43.184])
	by mx1.freebsd.org (Postfix) with ESMTP id 2DA6D8FC19;
	Thu, 28 Oct 2010 10:37:33 +0000 (UTC)
Received: from cpc6-cdif11-2-0-cust58.5-1.cable.virginmedia.com
	([62.255.146.59] helo=shrike.submonkey.net)
	by scuttle.submonkey.net with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
	(Exim 4.69) (envelope-from )
	id 1PBPrL-0000n0-SR; Thu, 28 Oct 2010 10:37:28 +0000
Received: from ceri by shrike.submonkey.net with local (Exim 4.69 (FreeBSD))
	(envelope-from )
	id 1PBPrJ-0003M3-CP; Thu, 28 Oct 2010 11:37:25 +0100
Date: Thu, 28 Oct 2010 11:37:25 +0100
From: Ceri Davies 
To: Alexander Best 
Message-ID: <20101028103725.GC5488@submonkey.net>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
	<20101028102547.GA56817@freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="ghzN8eJ9Qlbqn3iT"
Content-Disposition: inline
In-Reply-To: <20101028102547.GA56817@freebsd.org>
X-PGP: finger ceri@FreeBSD.org
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: Ceri Davies 
Cc: Doug Barton , d@delphij.net, svn-src-all@FreeBSD.org,
	Gary Jennejohn ,
	src-committers@FreeBSD.org, Bruce Evans ,
	svn-src-head@FreeBSD.org, Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 10:37:34 -0000


--ghzN8eJ9Qlbqn3iT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Oct 28, 2010 at 10:25:47AM +0000, Alexander Best wrote:
> On Thu Oct 28 10, Gary Jennejohn wrote:
> > On Thu, 28 Oct 2010 16:22:05 +1100 (EST)
> > Bruce Evans  wrote:
> >=20
> > > On Wed, 27 Oct 2010, Xin LI wrote:
> > >=20
> > > > I think what really defeats -P is the fact that the file system or
> > > > underlying data storage would not overwrite data on a file at sync(=
).
> > > > COW is of course one of the case, journaling MAY defeat -P but is n=
ot
> > > > guaranteed.  FS with variable block size - I believe this really de=
pends
> > > > on the implementation.
> > > >
> > > > If I understood the code correctly, UFS, UFS+SU, UFS+SUJ, msdosfs a=
nd
> > > > ext2fs supports rm -P as long as they are not being put on gjournal=
'ed
> > > > disk, ZFS zvol, etc., and no snapshot is being used.
> > >=20
> > > And that the underlying data storage us dumb.  Any flash drive now
> > > tries to minimise writes.  It wouldn't take much buffering to defeat
> > > the 0xff, 0,0xff pattern.  Wear leveling should result in different
> > > physical blocks being written each time if the writes get to the
> > > lowest level of storage.
> > >=20
> > > And that block reallocation (done by ffs1 and ffs2) doesn't choose
> > > different blocks.
> > >=20
> > > > It seems to be hard for me to conclude all cases in short, plain En=
glish
> > > > but I'm all for improvements to the manual page to describe that in=
 an
> > > > elegant and precise manner.
> > > >
> > > > Maybe something like:
> > > >
> > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > > > BUGS
> > > >
> > > > The -P option assumes that the underlying storage overwrites file b=
lock
> > > > when data is written on existing offset.  Several factors including=
 the
> > > > file system and its backing store could defeat the assumption, this
> > > > includes, but is not limited to file systems that uses Copy-On-Write
> > > > strategy (e.g. ZFS or UFS when snapshot is being used), or backing
> > > > datastore that does journaling, etc.  In addition, only regular fil=
es
> > > > are overwritten, other types of files are not.
> > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > >=20
> > > Summary: it is very hard to tell whether -P works, even when you think
> > > you know what all the subsystems are doing.
> > >=20
> >=20
> > All this discussion leads me to the conclusion that we should just
> > remove the -P functionality and add a remark to the man page that that
> > was done because it isn't guaranteed to work on all file systems.
> >=20
> > Why give users a false sense of security?  If they're concerned about
> > data security then they should use geli or something similar.
>=20
> that might be the ultimate solution. also one could use security/srm inst=
ead.
>=20
> +1 here. ;)
>=20
> question is: should -P be removed entirely or be made a no op?

Probably best that it fail.

Ceri
--=20
Haffely, Gaffely, Gaffely, Gonward.

--ghzN8eJ9Qlbqn3iT
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iD8DBQFMyVJlocfcwTS3JF8RAjW4AJ41Ld0fBOrTS2f+FXDgcQKwfEhI3QCgq5a4
3G0STMIOJJwW2RudigPfA3o=
=7vl4
-----END PGP SIGNATURE-----

--ghzN8eJ9Qlbqn3iT--

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 11:09: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 F413E106566B;
	Thu, 28 Oct 2010 11:09:12 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E342F8FC1E;
	Thu, 28 Oct 2010 11: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 o9SB9CJn088435;
	Thu, 28 Oct 2010 11:09:12 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SB9Cmt088433;
	Thu, 28 Oct 2010 11:09:12 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201010281109.o9SB9Cmt088433@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 28 Oct 2010 11: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: r214447 - head/usr.sbin/rtadvd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 11:09:13 -0000

Author: bz
Date: Thu Oct 28 11:09:12 2010
New Revision: 214447
URL: http://svn.freebsd.org/changeset/base/214447

Log:
  Correct a typo.
  
  MFC after:	3 days

Modified:
  head/usr.sbin/rtadvd/rtadvd.conf.5

Modified: head/usr.sbin/rtadvd/rtadvd.conf.5
==============================================================================
--- head/usr.sbin/rtadvd/rtadvd.conf.5	Thu Oct 28 07:58:06 2010	(r214446)
+++ head/usr.sbin/rtadvd/rtadvd.conf.5	Thu Oct 28 11:09:12 2010	(r214447)
@@ -109,7 +109,7 @@ The default value is 64.
 (str or num) A 8-bit flags field in router advertisement message header.
 This field can be specified either as a case-sensitive string or as an
 integer.
-A sting consists of characters each of which corresponds to a
+A string consists of characters each of which corresponds to a
 particular flag bit(s).
 An integer should be the logical OR of all enabled bits.
 Bit 7

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 13:14:14 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id DD8A21065679; Thu, 28 Oct 2010 13:14:14 +0000 (UTC)
Date: Thu, 28 Oct 2010 13:14:14 +0000
From: Alexander Best 
To: Ceri Davies 
Message-ID: <20101028131414.GA79254@freebsd.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
	<20101028102547.GA56817@freebsd.org>
	<20101028103725.GC5488@submonkey.net>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="3MwIy2ne0vdjdPXF"
Content-Disposition: inline
In-Reply-To: <20101028103725.GC5488@submonkey.net>
Cc: Doug Barton , d@delphij.net, svn-src-all@FreeBSD.org,
	Gary Jennejohn ,
	src-committers@FreeBSD.org, Bruce Evans ,
	svn-src-head@FreeBSD.org, Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 13:14:15 -0000


--3MwIy2ne0vdjdPXF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu Oct 28 10, Ceri Davies wrote:
> On Thu, Oct 28, 2010 at 10:25:47AM +0000, Alexander Best wrote:
> > On Thu Oct 28 10, Gary Jennejohn wrote:
> > > On Thu, 28 Oct 2010 16:22:05 +1100 (EST)
> > > Bruce Evans  wrote:
> > > 
> > > > On Wed, 27 Oct 2010, Xin LI wrote:
> > > > 
> > > > > I think what really defeats -P is the fact that the file system or
> > > > > underlying data storage would not overwrite data on a file at sync().
> > > > > COW is of course one of the case, journaling MAY defeat -P but is not
> > > > > guaranteed.  FS with variable block size - I believe this really depends
> > > > > on the implementation.
> > > > >
> > > > > If I understood the code correctly, UFS, UFS+SU, UFS+SUJ, msdosfs and
> > > > > ext2fs supports rm -P as long as they are not being put on gjournal'ed
> > > > > disk, ZFS zvol, etc., and no snapshot is being used.
> > > > 
> > > > And that the underlying data storage us dumb.  Any flash drive now
> > > > tries to minimise writes.  It wouldn't take much buffering to defeat
> > > > the 0xff, 0,0xff pattern.  Wear leveling should result in different
> > > > physical blocks being written each time if the writes get to the
> > > > lowest level of storage.
> > > > 
> > > > And that block reallocation (done by ffs1 and ffs2) doesn't choose
> > > > different blocks.
> > > > 
> > > > > It seems to be hard for me to conclude all cases in short, plain English
> > > > > but I'm all for improvements to the manual page to describe that in an
> > > > > elegant and precise manner.
> > > > >
> > > > > Maybe something like:
> > > > >
> > > > > ===============
> > > > > BUGS
> > > > >
> > > > > The -P option assumes that the underlying storage overwrites file block
> > > > > when data is written on existing offset.  Several factors including the
> > > > > file system and its backing store could defeat the assumption, this
> > > > > includes, but is not limited to file systems that uses Copy-On-Write
> > > > > strategy (e.g. ZFS or UFS when snapshot is being used), or backing
> > > > > datastore that does journaling, etc.  In addition, only regular files
> > > > > are overwritten, other types of files are not.
> > > > > ===============
> > > > 
> > > > Summary: it is very hard to tell whether -P works, even when you think
> > > > you know what all the subsystems are doing.
> > > > 
> > > 
> > > All this discussion leads me to the conclusion that we should just
> > > remove the -P functionality and add a remark to the man page that that
> > > was done because it isn't guaranteed to work on all file systems.
> > > 
> > > Why give users a false sense of security?  If they're concerned about
> > > data security then they should use geli or something similar.
> > 
> > that might be the ultimate solution. also one could use security/srm instead.
> > 
> > +1 here. ;)
> > 
> > question is: should -P be removed entirely or be made a no op?
> 
> Probably best that it fail.

how about the following patch?

cheers.
alex

> 
> Ceri
> -- 
> Haffely, Gaffely, Gaffely, Gonward.



-- 
a13x

--3MwIy2ne0vdjdPXF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="rm.diff"

diff --git a/bin/rm/rm.1 b/bin/rm/rm.1
index 11bc77d..569e7db 100644
--- a/bin/rm/rm.1
+++ b/bin/rm/rm.1
@@ -84,22 +84,6 @@ directory is being recursively removed.
 This is a far less intrusive option than
 .Fl i
 yet provides almost the same level of protection against mistakes.
-.It Fl P
-Overwrite regular files before deleting them.
-Files are overwritten three times, first with the byte pattern 0xff,
-then 0x00, and then 0xff again, before they are deleted.
-Files with multiple links will not be overwritten nor deleted
-and a warning will be issued.
-If the
-.Fl f
-option is specified, files with multiple links will also be overwritten
-and deleted.
-No warning will be issued.
-.Pp
-Specifying this flag for a read only file will cause
-.Nm
-to generate an error message and exit.
-The file will not be removed or overwritten.
 .It Fl R
 Attempt to remove the file hierarchy rooted in each
 .Ar file
@@ -182,12 +166,6 @@ For example:
 .Pp
 .Dl "rm /home/user/-filename"
 .Dl "rm ./-filename"
-.Pp
-When
-.Fl P
-is specified with
-.Fl f
-the file will be overwritten and removed even if it has hard links.
 .Sh COMPATIBILITY
 The
 .Nm
@@ -203,6 +181,23 @@ Also, historical
 .Bx
 implementations prompted on the standard output,
 not the standard error output.
+.Pp
+Previous
+.Bx
+versions of
+.Nm
+featured a
+.Fl P
+option which instructed
+.Nm
+to overwrite regular files three times with the byte pattern
+0xff, then 0x00, and then 0xff again, before they were deleted.
+Support for the
+.Fl P
+flag was removed in
+.Fx 9.0 ,
+because overwriting specific blocks cannot be assured
+on certain filesystems and media.
 .Sh SEE ALSO
 .Xr chflags 1 ,
 .Xr rmdir 1 ,
@@ -226,11 +221,3 @@ A
 .Nm
 command appeared in
 .At v1 .
-.Sh BUGS
-The
-.Fl P
-option assumes that the underlying file system updates existing blocks
-in-place and does not store new data in a new location.
-This is true for UFS but not for ZFS, which is using a Copy-On-Write strategy.
-In addition, only regular files are overwritten, other types of files
-are not.
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 653833a..1aff60f 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok;
+int dflag, eval, fflag, iflag, vflag, Wflag, stdin_ok;
 int rflag, Iflag;
 uid_t uid;
 volatile sig_atomic_t info;
@@ -67,7 +67,6 @@ int	check2(char **);
 void	checkdot(char **);
 void	checkslash(char **);
 void	rm_file(char **);
-int	rm_overwrite(char *, struct stat *);
 void	rm_tree(char **);
 static void siginfo(int __unused);
 void	usage(void);
@@ -105,8 +104,8 @@ main(int argc, char *argv[])
 		exit(eval);
 	}
 
-	Pflag = rflag = 0;
-	while ((ch = getopt(argc, argv, "dfiIPRrvW")) != -1)
+	rflag = 0;
+	while ((ch = getopt(argc, argv, "dfiIRrvW")) != -1)
 		switch(ch) {
 		case 'd':
 			dflag = 1;
@@ -122,9 +121,6 @@ main(int argc, char *argv[])
 		case 'I':
 			Iflag = 1;
 			break;
-		case 'P':
-			Pflag = 1;
-			break;
 		case 'R':
 		case 'r':			/* Compatibility. */
 			rflag = 1;
@@ -302,9 +298,6 @@ rm_tree(char **argv)
 					continue;
 				/* FALLTHROUGH */
 			default:
-				if (Pflag)
-					if (!rm_overwrite(p->fts_accpath, NULL))
-						continue;
 				rval = unlink(p->fts_accpath);
 				if (rval == 0 || (fflag && errno == ENOENT)) {
 					if (rval == 0 && vflag)
@@ -374,12 +367,8 @@ rm_file(char **argv)
 				rval = undelete(f);
 			else if (S_ISDIR(sb.st_mode))
 				rval = rmdir(f);
-			else {
-				if (Pflag)
-					if (!rm_overwrite(f, &sb))
-						continue;
+			else
 				rval = unlink(f);
-			}
 		}
 		if (rval && (!fflag || errno != ENOENT)) {
 			warn("%s", f);
@@ -394,77 +383,6 @@ rm_file(char **argv)
 	}
 }
 
-/*
- * rm_overwrite --
- *	Overwrite the file 3 times with varying bit patterns.
- *
- * XXX
- * This is a cheap way to *really* delete files.  Note that only regular
- * files are deleted, directories (and therefore names) will remain.
- * Also, this assumes a fixed-block file system (like FFS, or a V7 or a
- * System V file system).  In a logging or COW file system, you'll have to
- * have kernel support.
- */
-int
-rm_overwrite(char *file, struct stat *sbp)
-{
-	struct stat sb;
-	struct statfs fsb;
-	off_t len;
-	int bsize, fd, wlen;
-	char *buf = NULL;
-
-	fd = -1;
-	if (sbp == NULL) {
-		if (lstat(file, &sb))
-			goto err;
-		sbp = &sb;
-	}
-	if (!S_ISREG(sbp->st_mode))
-		return (1);
-	if (sbp->st_nlink > 1 && !fflag) {
-		warnx("%s (inode %u): not overwritten due to multiple links",
-		    file, sbp->st_ino);
-		return (0);
-	}
-	if ((fd = open(file, O_WRONLY, 0)) == -1)
-		goto err;
-	if (fstatfs(fd, &fsb) == -1)
-		goto err;
-	bsize = MAX(fsb.f_iosize, 1024);
-	if ((buf = malloc(bsize)) == NULL)
-		err(1, "%s: malloc", file);
-
-#define	PASS(byte) {							\
-	memset(buf, byte, bsize);					\
-	for (len = sbp->st_size; len > 0; len -= wlen) {		\
-		wlen = len < bsize ? len : bsize;			\
-		if (write(fd, buf, wlen) != wlen)			\
-			goto err;					\
-	}								\
-}
-	PASS(0xff);
-	if (fsync(fd) || lseek(fd, (off_t)0, SEEK_SET))
-		goto err;
-	PASS(0x00);
-	if (fsync(fd) || lseek(fd, (off_t)0, SEEK_SET))
-		goto err;
-	PASS(0xff);
-	if (!fsync(fd) && !close(fd)) {
-		free(buf);
-		return (1);
-	}
-
-err:	eval = 1;
-	if (buf)
-		free(buf);
-	if (fd != -1)
-		close(fd);
-	warn("%s", file);
-	return (0);
-}
-
-
 int
 check(char *path, char *name, struct stat *sp)
 {
@@ -489,10 +407,6 @@ check(char *path, char *name, struct stat *sp)
 		strmode(sp->st_mode, modep);
 		if ((flagsp = fflagstostr(sp->st_flags)) == NULL)
 			err(1, "fflagstostr");
-		if (Pflag)
-			errx(1,
-			    "%s: -P was specified, but file is not writable",
-			    path);
 		(void)fprintf(stderr, "override %s%s%s/%s %s%sfor %s? ",
 		    modep + 1, modep[9] == ' ' ? "" : " ",
 		    user_from_uid(sp->st_uid, 0),
@@ -610,7 +524,7 @@ usage(void)
 {
 
 	(void)fprintf(stderr, "%s\n%s\n",
-	    "usage: rm [-f | -i] [-dIPRrvW] file ...",
+	    "usage: rm [-f | -i] [-dIRrvW] file ...",
 	    "       unlink file");
 	exit(EX_USAGE);
 }

--3MwIy2ne0vdjdPXF--

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 13:44: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 C6559106566B;
	Thu, 28 Oct 2010 13:44:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B58CB8FC18;
	Thu, 28 Oct 2010 13:44: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 o9SDiJPG003015;
	Thu, 28 Oct 2010 13:44:19 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SDiJ4c003012;
	Thu, 28 Oct 2010 13:44:19 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201010281344.o9SDiJ4c003012@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 28 Oct 2010 13:44: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: r214448 - 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: Thu, 28 Oct 2010 13:44:19 -0000

Author: jhb
Date: Thu Oct 28 13:44:19 2010
New Revision: 214448
URL: http://svn.freebsd.org/changeset/base/214448

Log:
  Use 'PCPU_GET(apic_id)' to determine the BSP's APIC ID on a UP machine
  when routing interrupts instead of cpu_apic_ids[0] since cpu_apic_ids[]
  is only populated for multiple-CPU machines.  This also matches what the
  code does when SMP is not enabled.
  
  PR:		bin/151616
  Tested by:	"Damian S. Kolodziejczyk"  damkol | gmail
  Submitted by:	avg
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/intr_machdep.c
  head/sys/i386/i386/intr_machdep.c

Modified: head/sys/amd64/amd64/intr_machdep.c
==============================================================================
--- head/sys/amd64/amd64/intr_machdep.c	Thu Oct 28 11:09:12 2010	(r214447)
+++ head/sys/amd64/amd64/intr_machdep.c	Thu Oct 28 13:44:19 2010	(r214448)
@@ -458,7 +458,7 @@ intr_next_cpu(void)
 
 	/* Leave all interrupts on the BSP during boot. */
 	if (!assign_cpu)
-		return (cpu_apic_ids[0]);
+		return (PCPU_GET(apic_id));
 
 	mtx_lock_spin(&icu_lock);
 	apic_id = cpu_apic_ids[current_cpu];

Modified: head/sys/i386/i386/intr_machdep.c
==============================================================================
--- head/sys/i386/i386/intr_machdep.c	Thu Oct 28 11:09:12 2010	(r214447)
+++ head/sys/i386/i386/intr_machdep.c	Thu Oct 28 13:44:19 2010	(r214448)
@@ -424,7 +424,7 @@ intr_next_cpu(void)
 
 	/* Leave all interrupts on the BSP during boot. */
 	if (!assign_cpu)
-		return (cpu_apic_ids[0]);
+		return (PCPU_GET(apic_id));
 
 	mtx_lock_spin(&icu_lock);
 	apic_id = cpu_apic_ids[current_cpu];

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 14:17: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 91FE0106566B;
	Thu, 28 Oct 2010 14:17:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 81BAD8FC0A;
	Thu, 28 Oct 2010 14:17: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 o9SEH6uN005192;
	Thu, 28 Oct 2010 14:17:06 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SEH6Ep005190;
	Thu, 28 Oct 2010 14:17:06 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201010281417.o9SEH6Ep005190@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 28 Oct 2010 14:17: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: r214449 - 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, 28 Oct 2010 14:17:06 -0000

Author: jhb
Date: Thu Oct 28 14:17:06 2010
New Revision: 214449
URL: http://svn.freebsd.org/changeset/base/214449

Log:
  Set bootverbose directly in mi_startup() rather than via a SYSINIT.  This
  ensures 'bootverbose' is in a valid state for all SYSINITs.
  
  Reported by:	avg
  MFC after:	1 week

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==============================================================================
--- head/sys/kern/init_main.c	Thu Oct 28 13:44:19 2010	(r214448)
+++ head/sys/kern/init_main.c	Thu Oct 28 14:17:06 2010	(r214449)
@@ -180,6 +180,9 @@ mi_startup(void)
 	int verbose;
 #endif
 
+	if (boothowto & RB_VERBOSE)
+		bootverbose++;
+
 	if (sysinit == NULL) {
 		sysinit = SET_BEGIN(sysinit_set);
 		sysinit_end = SET_LIMIT(sysinit_set);
@@ -327,15 +330,6 @@ SYSINIT(diagwarn2, SI_SUB_RUN_SCHEDULER,
     print_caddr_t, diag_warn);
 #endif
 
-static void
-set_boot_verbose(void *data __unused)
-{
-
-	if (boothowto & RB_VERBOSE)
-		bootverbose++;
-}
-SYSINIT(boot_verbose, SI_SUB_TUNABLES, SI_ORDER_ANY, set_boot_verbose, NULL);
-
 static int
 null_fetch_syscall_args(struct thread *td __unused,
     struct syscall_args *sa __unused)

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 15:31: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 1D23D106564A;
	Thu, 28 Oct 2010 15:31:19 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0B7AC8FC0C;
	Thu, 28 Oct 2010 15:31: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 o9SFVIYK011303;
	Thu, 28 Oct 2010 15:31:18 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SFVILK011301;
	Thu, 28 Oct 2010 15:31:18 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201010281531.o9SFVILK011301@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Thu, 28 Oct 2010 15:31: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: r214451 - stable/8/sys/dev/mfi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 15:31:19 -0000

Author: pluknet
Date: Thu Oct 28 15:31:18 2010
New Revision: 214451
URL: http://svn.freebsd.org/changeset/base/214451

Log:
  MFC r214130.
  Update PD state firmware definitions: add copyback, system.
  
  Approved by:	kib (mentor)

Modified:
  stable/8/sys/dev/mfi/mfireg.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)

Modified: stable/8/sys/dev/mfi/mfireg.h
==============================================================================
--- stable/8/sys/dev/mfi/mfireg.h	Thu Oct 28 14:21:18 2010	(r214450)
+++ stable/8/sys/dev/mfi/mfireg.h	Thu Oct 28 15:31:18 2010	(r214451)
@@ -975,7 +975,9 @@ enum mfi_pd_state {
 	MFI_PD_STATE_OFFLINE = 0x10,
 	MFI_PD_STATE_FAILED = 0x11,
 	MFI_PD_STATE_REBUILD = 0x14,
-	MFI_PD_STATE_ONLINE = 0x18
+	MFI_PD_STATE_ONLINE = 0x18,
+	MFI_PD_STATE_COPYBACK = 0x20,
+	MFI_PD_STATE_SYSTEM = 0x40
 };
 
 union mfi_ld_ref {

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 15:37: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 093D0106564A;
	Thu, 28 Oct 2010 15:37:59 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EBCAD8FC13;
	Thu, 28 Oct 2010 15:37: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 o9SFbwca011887;
	Thu, 28 Oct 2010 15:37:58 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SFbwQU011885;
	Thu, 28 Oct 2010 15:37:58 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201010281537.o9SFbwQU011885@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Thu, 28 Oct 2010 15:37: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: r214452 - stable/7/sys/dev/mfi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 15:37:59 -0000

Author: pluknet
Date: Thu Oct 28 15:37:58 2010
New Revision: 214452
URL: http://svn.freebsd.org/changeset/base/214452

Log:
  MFC r214130.
  Update PD state firmware definitions: add copyback, system.
  
  Approved by:	kib (mentor)

Modified:
  stable/7/sys/dev/mfi/mfireg.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/mfi/mfireg.h
==============================================================================
--- stable/7/sys/dev/mfi/mfireg.h	Thu Oct 28 15:31:18 2010	(r214451)
+++ stable/7/sys/dev/mfi/mfireg.h	Thu Oct 28 15:37:58 2010	(r214452)
@@ -975,7 +975,9 @@ enum mfi_pd_state {
 	MFI_PD_STATE_OFFLINE = 0x10,
 	MFI_PD_STATE_FAILED = 0x11,
 	MFI_PD_STATE_REBUILD = 0x14,
-	MFI_PD_STATE_ONLINE = 0x18
+	MFI_PD_STATE_ONLINE = 0x18,
+	MFI_PD_STATE_COPYBACK = 0x20,
+	MFI_PD_STATE_SYSTEM = 0x40
 };
 
 union mfi_ld_ref {

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 15:41: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 84334106564A;
	Thu, 28 Oct 2010 15:41:28 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 728B78FC08;
	Thu, 28 Oct 2010 15:41: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 o9SFfSMI012205;
	Thu, 28 Oct 2010 15:41:28 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SFfS3L012203;
	Thu, 28 Oct 2010 15:41:28 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201010281541.o9SFfS3L012203@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Thu, 28 Oct 2010 15:41:28 +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: r214453 - stable/8/usr.sbin/mfiutil
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 15:41:28 -0000

Author: pluknet
Date: Thu Oct 28 15:41:28 2010
New Revision: 214453
URL: http://svn.freebsd.org/changeset/base/214453

Log:
  MFC r214131.
  Enable copyback and system PD states.
  
  Approved by:	kib (mentor)

Modified:
  stable/8/usr.sbin/mfiutil/mfi_drive.c
Directory Properties:
  stable/8/usr.sbin/mfiutil/   (props changed)
  stable/8/usr.sbin/mfiutil/mfiutil.8   (props changed)

Modified: stable/8/usr.sbin/mfiutil/mfi_drive.c
==============================================================================
--- stable/8/usr.sbin/mfiutil/mfi_drive.c	Thu Oct 28 15:37:58 2010	(r214452)
+++ stable/8/usr.sbin/mfiutil/mfi_drive.c	Thu Oct 28 15:41:28 2010	(r214453)
@@ -65,6 +65,10 @@ mfi_pdstate(enum mfi_pd_state state)
 		return ("REBUILD");
 	case MFI_PD_STATE_ONLINE:
 		return ("ONLINE");
+	case MFI_PD_STATE_COPYBACK:
+		return ("COPYBACK");
+	case MFI_PD_STATE_SYSTEM:
+		return ("SYSTEM");
 	default:
 		sprintf(buf, "PSTATE 0x%04x", state);
 		return (buf);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 15:43: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 D141C1065673;
	Thu, 28 Oct 2010 15:43:14 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BFB358FC0A;
	Thu, 28 Oct 2010 15:43: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 o9SFhEi3012392;
	Thu, 28 Oct 2010 15:43:14 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SFhEwf012390;
	Thu, 28 Oct 2010 15:43:14 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201010281543.o9SFhEwf012390@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Thu, 28 Oct 2010 15:43:14 +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: r214454 - stable/7/usr.sbin/mfiutil
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 15:43:14 -0000

Author: pluknet
Date: Thu Oct 28 15:43:14 2010
New Revision: 214454
URL: http://svn.freebsd.org/changeset/base/214454

Log:
  MFC r214131.
  Enable copyback and system PD states.
  
  Approved by:	kib (mentor)

Modified:
  stable/7/usr.sbin/mfiutil/mfi_drive.c
Directory Properties:
  stable/7/usr.sbin/mfiutil/   (props changed)
  stable/7/usr.sbin/mfiutil/mfiutil.8   (props changed)

Modified: stable/7/usr.sbin/mfiutil/mfi_drive.c
==============================================================================
--- stable/7/usr.sbin/mfiutil/mfi_drive.c	Thu Oct 28 15:41:28 2010	(r214453)
+++ stable/7/usr.sbin/mfiutil/mfi_drive.c	Thu Oct 28 15:43:14 2010	(r214454)
@@ -65,6 +65,10 @@ mfi_pdstate(enum mfi_pd_state state)
 		return ("REBUILD");
 	case MFI_PD_STATE_ONLINE:
 		return ("ONLINE");
+	case MFI_PD_STATE_COPYBACK:
+		return ("COPYBACK");
+	case MFI_PD_STATE_SYSTEM:
+		return ("SYSTEM");
 	default:
 		sprintf(buf, "PSTATE 0x%04x", state);
 		return (buf);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 16:22: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 3BB56106564A;
	Thu, 28 Oct 2010 16:22:14 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 25DDD8FC08;
	Thu, 28 Oct 2010 16:22: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 o9SGMEEP014318;
	Thu, 28 Oct 2010 16:22:14 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SGMEI3014306;
	Thu, 28 Oct 2010 16:22:14 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010281622.o9SGMEI3014306@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 28 Oct 2010 16:22:14 +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: r214455 - in vendor/libpcap/dist: . ChmodBPF SUNOS4
	Win32 Win32/Include Win32/Include/arpa Win32/Include/net
	Win32/Prj Win32/Src bpf/net lbl missing msdos net pcap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 16:22:14 -0000

Author: rpaulo
Date: Thu Oct 28 16:22:13 2010
New Revision: 214455
URL: http://svn.freebsd.org/changeset/base/214455

Log:
  Update libpcap to 1.1.1.
  
  Changes:
  
  Thu.    April 1, 2010.  guy@alum.mit.edu.
  Summary for 1.1.1 libpcap release
          Update CHANGES to reflect more of the changes in 1.1.0.
          Fix build on RHEL5.
          Fix shared library build on AIX.
  
  Thu.    March 11, 2010.  ken@netfunctional.ca/guy@alum.mit.edu.
  Summary for 1.1.0 libpcap release
          Add SocketCAN capture support
          Add Myricom SNF API support
          Update Endace DAG and ERF support
          Add support for shared libraries on Solaris, HP-UX, and AIX
          Build, install, and un-install shared libraries by default;
            don't build/install shared libraries on platforms we don't support
          Fix building from a directory other than the source directory
          Fix compiler warnings and builds on some platforms
          Update config.guess and config.sub
          Support monitor mode on mac80211 devices on Linux
          Fix USB memory-mapped capturing on Linux; it requires a new DLT_
            value
          On Linux, scan /sys/class/net for devices if we have it; scan
            it, or /proc/net/dev if we don't have /sys/class/net, even if
            we have getifaddrs(), as it'll find interfaces with no
            addresses
          Add limited support for reading pcap-ng files
          Fix BPF driver-loading error handling on AIX
          Support getting the full-length interface description on FreeBSD
          In the lexical analyzer, free up any addrinfo structure we got back
            from getaddrinfo().
          Add support for BPF and libdlpi in OpenSolaris (and SXCE)
          Hyphenate "link-layer" everywhere
          Add /sys/kernel/debug/usb/usbmon to the list of usbmon locations
          In pcap_read_linux_mmap(), if there are no frames available, call
            poll() even if we're in non-blocking mode, so we pick up
            errors, and check for the errors in question.
          Note that poll() works on BPF devices is Snow Leopard
          If an ENXIO or ENETDOWN is received, it may mean the device has
            gone away.  Deal with it.
          For BPF, raise the default capture buffer size to from 32k to 512k
          Support ps_ifdrop on Linux
          Added a bunch of #ifdef directives to make wpcap.dll (WinPcap) compile
           under cygwin.
          Changes to Linux mmapped captures.
          Fix bug where create_ring would fail for particular snaplen and
            buffer size combinations
          Update pcap-config so that it handles libpcap requiring
            additional libraries
          Add workaround for threadsafeness on Windows
          Add missing mapping for DLT_ENC <-> LINKTYPE_ENC
          DLT: Add DLT_CAN_SOCKETCAN
          DLT: Add Solaris ipnet
          Don't check for DLT_IPNET if it's not defined
          Add link-layer types for Fibre Channel FC-2
          Add link-layer types for Wireless HART
          Add link-layer types for AOS
          Add link-layer types for DECT
          Autoconf fixes (AIX, HP-UX, OSF/1, Tru64 cleanups)
          Install headers unconditionally, and include vlan.h/bluetooth.h if
            enabled
          Autoconf fixes+cleanup
          Support enabling/disabling bluetooth (--{en,dis}able-bluetooth)
          Support disabling SITA support (--without-sita)
          Return -1 on failure to create packet ring (if supported but
            creation failed)
          Fix handling of 'any' device, so that it can be opened, and no longer
            attempt to open it in Monitor mode
          Add support for snapshot length for USB Memory-Mapped Interface
          Fix configure and build on recent Linux kernels
          Fix memory-mapped Linux capture to support pcap_next() and
            pcap_next_ex()
          Fixes for Linux USB capture
          DLT: Add DLT_LINUX_EVDEV
          DLT: Add DLT_GSMTAP_UM
          DLT: Add DLT_GSMTAP_ABIS

Added:
  vendor/libpcap/dist/ChmodBPF/
  vendor/libpcap/dist/ChmodBPF/ChmodBPF   (contents, props changed)
  vendor/libpcap/dist/ChmodBPF/StartupParameters.plist
  vendor/libpcap/dist/README.Win32
  vendor/libpcap/dist/README.aix
  vendor/libpcap/dist/README.dag
  vendor/libpcap/dist/README.hpux
  vendor/libpcap/dist/README.linux
  vendor/libpcap/dist/README.macosx
  vendor/libpcap/dist/README.septel
  vendor/libpcap/dist/README.sita
  vendor/libpcap/dist/README.tru64
  vendor/libpcap/dist/SUNOS4/
  vendor/libpcap/dist/SUNOS4/nit_if.o.sparc   (contents, props changed)
  vendor/libpcap/dist/SUNOS4/nit_if.o.sun3   (contents, props changed)
  vendor/libpcap/dist/SUNOS4/nit_if.o.sun4c.4.0.3c   (contents, props changed)
  vendor/libpcap/dist/Win32/
  vendor/libpcap/dist/Win32/Include/
  vendor/libpcap/dist/Win32/Include/Gnuc.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/addrinfo.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/arpa/
  vendor/libpcap/dist/Win32/Include/arpa/nameser.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/bittypes.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/cdecl_ext.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/inetprivate.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/ip6_misc.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/net/
  vendor/libpcap/dist/Win32/Include/net/if.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/net/netdb.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/net/paths.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Include/sockstorage.h   (contents, props changed)
  vendor/libpcap/dist/Win32/Prj/
  vendor/libpcap/dist/Win32/Prj/libpcap.dsp
  vendor/libpcap/dist/Win32/Prj/libpcap.dsw
  vendor/libpcap/dist/Win32/Src/
  vendor/libpcap/dist/Win32/Src/ffs.c   (contents, props changed)
  vendor/libpcap/dist/Win32/Src/gai_strerror.c   (contents, props changed)
  vendor/libpcap/dist/Win32/Src/getaddrinfo.c   (contents, props changed)
  vendor/libpcap/dist/Win32/Src/getnetbynm.c   (contents, props changed)
  vendor/libpcap/dist/Win32/Src/getnetent.c   (contents, props changed)
  vendor/libpcap/dist/Win32/Src/getopt.c   (contents, props changed)
  vendor/libpcap/dist/Win32/Src/getservent.c   (contents, props changed)
  vendor/libpcap/dist/Win32/Src/inet_aton.c   (contents, props changed)
  vendor/libpcap/dist/Win32/Src/inet_net.c   (contents, props changed)
  vendor/libpcap/dist/Win32/Src/inet_pton.c   (contents, props changed)
  vendor/libpcap/dist/msdos/
  vendor/libpcap/dist/msdos/bin2c.c   (contents, props changed)
  vendor/libpcap/dist/msdos/common.dj
  vendor/libpcap/dist/msdos/makefile   (contents, props changed)
  vendor/libpcap/dist/msdos/makefile.dj   (contents, props changed)
  vendor/libpcap/dist/msdos/makefile.wc   (contents, props changed)
  vendor/libpcap/dist/msdos/ndis2.c   (contents, props changed)
  vendor/libpcap/dist/msdos/ndis2.h   (contents, props changed)
  vendor/libpcap/dist/msdos/ndis_0.asm
  vendor/libpcap/dist/msdos/pkt_rx0.asm
  vendor/libpcap/dist/msdos/pkt_rx1.s   (contents, props changed)
  vendor/libpcap/dist/msdos/pktdrvr.c   (contents, props changed)
  vendor/libpcap/dist/msdos/pktdrvr.h   (contents, props changed)
  vendor/libpcap/dist/msdos/readme.dos
  vendor/libpcap/dist/opentest.c   (contents, props changed)
  vendor/libpcap/dist/org.tcpdump.chmod_bpf.plist
  vendor/libpcap/dist/pcap-can-linux.c   (contents, props changed)
  vendor/libpcap/dist/pcap-can-linux.h   (contents, props changed)
  vendor/libpcap/dist/pcap-common.c   (contents, props changed)
  vendor/libpcap/dist/pcap-common.h   (contents, props changed)
  vendor/libpcap/dist/pcap-snf.c   (contents, props changed)
  vendor/libpcap/dist/pcap-snf.h   (contents, props changed)
  vendor/libpcap/dist/pcap/ipnet.h   (contents, props changed)
  vendor/libpcap/dist/selpolltest.c   (contents, props changed)
  vendor/libpcap/dist/sf-pcap-ng.c   (contents, props changed)
  vendor/libpcap/dist/sf-pcap-ng.h   (contents, props changed)
  vendor/libpcap/dist/sf-pcap.c   (contents, props changed)
  vendor/libpcap/dist/sf-pcap.h   (contents, props changed)
Deleted:
  vendor/libpcap/dist/acconfig.h
  vendor/libpcap/dist/net/bpf_filter.c
Modified:
  vendor/libpcap/dist/CHANGES
  vendor/libpcap/dist/CREDITS
  vendor/libpcap/dist/INSTALL.txt
  vendor/libpcap/dist/Makefile.in
  vendor/libpcap/dist/README
  vendor/libpcap/dist/TODO
  vendor/libpcap/dist/VERSION
  vendor/libpcap/dist/aclocal.m4
  vendor/libpcap/dist/arcnet.h
  vendor/libpcap/dist/atmuni31.h
  vendor/libpcap/dist/bpf/net/bpf_filter.c
  vendor/libpcap/dist/bpf_dump.c
  vendor/libpcap/dist/bpf_image.c
  vendor/libpcap/dist/config.guess
  vendor/libpcap/dist/config.h.in
  vendor/libpcap/dist/config.sub
  vendor/libpcap/dist/configure
  vendor/libpcap/dist/configure.in
  vendor/libpcap/dist/dlpisubs.c
  vendor/libpcap/dist/dlpisubs.h
  vendor/libpcap/dist/etherent.c
  vendor/libpcap/dist/ethertype.h
  vendor/libpcap/dist/fad-getad.c
  vendor/libpcap/dist/fad-gifc.c
  vendor/libpcap/dist/fad-glifc.c
  vendor/libpcap/dist/fad-null.c
  vendor/libpcap/dist/fad-win32.c
  vendor/libpcap/dist/filtertest.c
  vendor/libpcap/dist/gencode.c
  vendor/libpcap/dist/gencode.h
  vendor/libpcap/dist/grammar.y
  vendor/libpcap/dist/inet.c
  vendor/libpcap/dist/lbl/os-aix4.h
  vendor/libpcap/dist/lbl/os-hpux11.h
  vendor/libpcap/dist/lbl/os-osf4.h
  vendor/libpcap/dist/lbl/os-osf5.h
  vendor/libpcap/dist/lbl/os-solaris2.h
  vendor/libpcap/dist/lbl/os-sunos4.h
  vendor/libpcap/dist/lbl/os-ultrix4.h
  vendor/libpcap/dist/llc.h
  vendor/libpcap/dist/missing/snprintf.c
  vendor/libpcap/dist/nametoaddr.c
  vendor/libpcap/dist/nlpid.h
  vendor/libpcap/dist/optimize.c
  vendor/libpcap/dist/pcap-bpf.c
  vendor/libpcap/dist/pcap-bpf.h
  vendor/libpcap/dist/pcap-bt-linux.c
  vendor/libpcap/dist/pcap-bt-linux.h
  vendor/libpcap/dist/pcap-config.1
  vendor/libpcap/dist/pcap-config.in
  vendor/libpcap/dist/pcap-dag.c
  vendor/libpcap/dist/pcap-dag.h
  vendor/libpcap/dist/pcap-dlpi.c
  vendor/libpcap/dist/pcap-dos.c
  vendor/libpcap/dist/pcap-dos.h
  vendor/libpcap/dist/pcap-enet.c
  vendor/libpcap/dist/pcap-filter.manmisc.in
  vendor/libpcap/dist/pcap-int.h
  vendor/libpcap/dist/pcap-libdlpi.c
  vendor/libpcap/dist/pcap-linktype.manmisc.in
  vendor/libpcap/dist/pcap-linux.c
  vendor/libpcap/dist/pcap-namedb.h
  vendor/libpcap/dist/pcap-nit.c
  vendor/libpcap/dist/pcap-null.c
  vendor/libpcap/dist/pcap-pf.c
  vendor/libpcap/dist/pcap-savefile.manfile.in
  vendor/libpcap/dist/pcap-septel.c
  vendor/libpcap/dist/pcap-septel.h
  vendor/libpcap/dist/pcap-sita.html
  vendor/libpcap/dist/pcap-snit.c
  vendor/libpcap/dist/pcap-snoop.c
  vendor/libpcap/dist/pcap-stdinc.h
  vendor/libpcap/dist/pcap-usb-linux.c
  vendor/libpcap/dist/pcap-usb-linux.h
  vendor/libpcap/dist/pcap-win32.c
  vendor/libpcap/dist/pcap.3pcap.in
  vendor/libpcap/dist/pcap.c
  vendor/libpcap/dist/pcap.h
  vendor/libpcap/dist/pcap/bluetooth.h
  vendor/libpcap/dist/pcap/bpf.h
  vendor/libpcap/dist/pcap/namedb.h
  vendor/libpcap/dist/pcap/pcap.h
  vendor/libpcap/dist/pcap/sll.h
  vendor/libpcap/dist/pcap/usb.h
  vendor/libpcap/dist/pcap/vlan.h
  vendor/libpcap/dist/pcap_activate.3pcap
  vendor/libpcap/dist/pcap_breakloop.3pcap
  vendor/libpcap/dist/pcap_can_set_rfmon.3pcap
  vendor/libpcap/dist/pcap_close.3pcap
  vendor/libpcap/dist/pcap_compile.3pcap.in
  vendor/libpcap/dist/pcap_create.3pcap
  vendor/libpcap/dist/pcap_datalink.3pcap.in
  vendor/libpcap/dist/pcap_datalink_name_to_val.3pcap
  vendor/libpcap/dist/pcap_datalink_val_to_name.3pcap
  vendor/libpcap/dist/pcap_dump.3pcap
  vendor/libpcap/dist/pcap_dump_close.3pcap
  vendor/libpcap/dist/pcap_dump_file.3pcap
  vendor/libpcap/dist/pcap_dump_flush.3pcap
  vendor/libpcap/dist/pcap_dump_ftell.3pcap
  vendor/libpcap/dist/pcap_dump_open.3pcap.in
  vendor/libpcap/dist/pcap_file.3pcap
  vendor/libpcap/dist/pcap_fileno.3pcap
  vendor/libpcap/dist/pcap_findalldevs.3pcap
  vendor/libpcap/dist/pcap_free_datalinks.3pcap
  vendor/libpcap/dist/pcap_freealldevs.3pcap
  vendor/libpcap/dist/pcap_freecode.3pcap
  vendor/libpcap/dist/pcap_get_selectable_fd.3pcap
  vendor/libpcap/dist/pcap_geterr.3pcap
  vendor/libpcap/dist/pcap_inject.3pcap
  vendor/libpcap/dist/pcap_is_swapped.3pcap
  vendor/libpcap/dist/pcap_lib_version.3pcap
  vendor/libpcap/dist/pcap_list_datalinks.3pcap.in
  vendor/libpcap/dist/pcap_lookupdev.3pcap
  vendor/libpcap/dist/pcap_lookupnet.3pcap
  vendor/libpcap/dist/pcap_loop.3pcap
  vendor/libpcap/dist/pcap_major_version.3pcap
  vendor/libpcap/dist/pcap_next_ex.3pcap
  vendor/libpcap/dist/pcap_offline_filter.3pcap
  vendor/libpcap/dist/pcap_open_dead.3pcap.in
  vendor/libpcap/dist/pcap_open_live.3pcap
  vendor/libpcap/dist/pcap_open_offline.3pcap.in
  vendor/libpcap/dist/pcap_set_buffer_size.3pcap
  vendor/libpcap/dist/pcap_set_datalink.3pcap
  vendor/libpcap/dist/pcap_set_promisc.3pcap
  vendor/libpcap/dist/pcap_set_rfmon.3pcap
  vendor/libpcap/dist/pcap_set_snaplen.3pcap
  vendor/libpcap/dist/pcap_set_timeout.3pcap
  vendor/libpcap/dist/pcap_setdirection.3pcap
  vendor/libpcap/dist/pcap_setfilter.3pcap
  vendor/libpcap/dist/pcap_setnonblock.3pcap
  vendor/libpcap/dist/pcap_snapshot.3pcap
  vendor/libpcap/dist/pcap_stats.3pcap
  vendor/libpcap/dist/pcap_statustostr.3pcap
  vendor/libpcap/dist/pcap_strerror.3pcap
  vendor/libpcap/dist/ppp.h
  vendor/libpcap/dist/runlex.sh
  vendor/libpcap/dist/savefile.c
  vendor/libpcap/dist/scanner.l
  vendor/libpcap/dist/sunatmpos.h

Modified: vendor/libpcap/dist/CHANGES
==============================================================================
--- vendor/libpcap/dist/CHANGES	Thu Oct 28 15:43:14 2010	(r214454)
+++ vendor/libpcap/dist/CHANGES	Thu Oct 28 16:22:13 2010	(r214455)
@@ -1,4 +1,77 @@
-@(#) $Header: /tcpdump/master/libpcap/CHANGES,v 1.67.2.4 2008-10-28 00:27:42 ken Exp $ (LBL)
+Thu.    April 1, 2010.  guy@alum.mit.edu.
+Summary for 1.1.1 libpcap release
+	Update CHANGES to reflect more of the changes in 1.1.0.
+	Fix build on RHEL5.
+	Fix shared library build on AIX.
+
+Thu.	March 11, 2010.  ken@netfunctional.ca/guy@alum.mit.edu.
+Summary for 1.1.0 libpcap release
+	Add SocketCAN capture support
+	Add Myricom SNF API support
+	Update Endace DAG and ERF support
+	Add support for shared libraries on Solaris, HP-UX, and AIX
+	Build, install, and un-install shared libraries by default;
+	  don't build/install shared libraries on platforms we don't support
+	Fix building from a directory other than the source directory
+	Fix compiler warnings and builds on some platforms
+	Update config.guess and config.sub
+	Support monitor mode on mac80211 devices on Linux
+	Fix USB memory-mapped capturing on Linux; it requires a new DLT_
+	  value
+	On Linux, scan /sys/class/net for devices if we have it; scan
+	  it, or /proc/net/dev if we don't have /sys/class/net, even if
+	  we have getifaddrs(), as it'll find interfaces with no
+	  addresses
+	Add limited support for reading pcap-ng files
+	Fix BPF driver-loading error handling on AIX
+	Support getting the full-length interface description on FreeBSD
+	In the lexical analyzer, free up any addrinfo structure we got back
+	  from getaddrinfo().
+	Add support for BPF and libdlpi in OpenSolaris (and SXCE)
+	Hyphenate "link-layer" everywhere
+	Add /sys/kernel/debug/usb/usbmon to the list of usbmon locations
+	In pcap_read_linux_mmap(), if there are no frames available, call
+	  poll() even if we're in non-blocking mode, so we pick up
+	  errors, and check for the errors in question.
+	Note that poll() works on BPF devices is Snow Leopard
+	If an ENXIO or ENETDOWN is received, it may mean the device has
+	  gone away.  Deal with it.
+	For BPF, raise the default capture buffer size to from 32k to 512k
+	Support ps_ifdrop on Linux
+	Added a bunch of #ifdef directives to make wpcap.dll (WinPcap) compile
+	 under cygwin.
+	Changes to Linux mmapped captures.
+	Fix bug where create_ring would fail for particular snaplen and
+	  buffer size combinations
+	Update pcap-config so that it handles libpcap requiring
+	  additional libraries
+	Add workaround for threadsafeness on Windows
+	Add missing mapping for DLT_ENC <-> LINKTYPE_ENC
+	DLT: Add DLT_CAN_SOCKETCAN
+	DLT: Add Solaris ipnet
+	Don't check for DLT_IPNET if it's not defined
+	Add link-layer types for Fibre Channel FC-2
+	Add link-layer types for Wireless HART
+	Add link-layer types for AOS
+	Add link-layer types for DECT
+	Autoconf fixes (AIX, HP-UX, OSF/1, Tru64 cleanups)
+	Install headers unconditionally, and include vlan.h/bluetooth.h if
+	  enabled
+	Autoconf fixes+cleanup
+	Support enabling/disabling bluetooth (--{en,dis}able-bluetooth)
+	Support disabling SITA support (--without-sita)
+	Return -1 on failure to create packet ring (if supported but
+	  creation failed)
+	Fix handling of 'any' device, so that it can be opened, and no longer
+	  attempt to open it in Monitor mode
+	Add support for snapshot length for USB Memory-Mapped Interface
+	Fix configure and build on recent Linux kernels
+	Fix memory-mapped Linux capture to support pcap_next() and
+	  pcap_next_ex()
+	Fixes for Linux USB capture
+	DLT: Add DLT_LINUX_EVDEV
+	DLT: Add DLT_GSMTAP_UM
+	DLT: Add DLT_GSMTAP_ABIS
 
 Mon.    October 27, 2008.  ken@netfunctional.ca.  Summary for 1.0.0 libpcap release
 	Compile with IPv6 support by default
@@ -12,7 +85,10 @@ Mon.    October 27, 2008.  ken@netfuncti
 	Variable length 802.11 header support
 	X2E data type support 
 	SITA ACN Interface support - see README.sita
+	Support for memory-mapped capture on Linux
 	Support for zerocopy BPF on platforms that support it
+	Support for setting buffer size when opening devices
+	Support for setting monitor mode when opening 802.11 devices
 	Better support for dealing with VLAN tagging/stripping on Linux
 	Fix dynamic library support on OSX
 	Return PCAP_ERROR_IFACE_NOT_UP if the interface isn't 'UP', so applications
@@ -22,7 +98,7 @@ Mon.    October 27, 2008.  ken@netfuncti
 	On Linux, ignore ENETDOWN so we can continue to capture packets if the 
 	 interface goes down and comes back up again.
 	On Linux, support new tpacket frame headers (2.6.27+)
-	On Mac OS X, add scripts for changing permissions on /dev/pbf* and launchd plist
+	On Mac OS X, add scripts for changing permissions on /dev/bpf* and launchd plist
 	On Solaris, support 'passive mode' on systems that support it
 	Fixes to autoconf and general build environment
 	Man page reorganization + cleanup

Modified: vendor/libpcap/dist/CREDITS
==============================================================================
--- vendor/libpcap/dist/CREDITS	Thu Oct 28 15:43:14 2010	(r214454)
+++ vendor/libpcap/dist/CREDITS	Thu Oct 28 16:22:13 2010	(r214455)
@@ -10,9 +10,10 @@ The current maintainers:
 Additional people who have contributed patches:
 
 	Alan Bawden			
+	Albert Chin			
 	Alexander 'Leo' Bergolth	
 	Alexey Kuznetsov		
-	Albert Chin			
+	Alon Bar-Lev			
 	Andrew Brown			
 	Antti Kantee			
 	Arien Vijn			
@@ -23,24 +24,28 @@ Additional people who have contributed p
 	Charles M. Hannum		
 	Chris G. Demetriou		
 	Chris Lightfoot			
+	Chris Maynard			
 	Chris Pepper			
+	Christian Bell			
 	Christian Peron			
 	Daniele Orlandi			
-	Darren Reed			
+	Darren Reed			
 	David Kaelbling			
 	David Young			
 	Dean Gaudet			
 	Don Ebright			 
 	Dug Song			
+	Dustin Spicuzza			
 	Eric Anderson			
 	Erik de Castro Lopo		
+	Felix Obenhuber			
 	Florent Drouin			
 	Franz Schaefer			
 	Fulko Hew			
+	Fumiyuki Shimizu		
 	Gianluca Varenni		
 	Gilbert Hoyek			
 	Gisle Vanem			
-	Gisle Vanem			
 	Graeme Hewson			
 	Greg Stark			
 	Greg Troxel			
@@ -53,11 +58,13 @@ Additional people who have contributed p
 	Jason R. Thorpe			
 	Javier Achirica			
 	Jean Tourrilhes			
+	Jean-Louis Charton		
 	Jefferson Ogata			
 	Jesper Peterson			
 	Joerg Mayer			
 	John Bankier			
 	Jon Lindgren			
+	Jon Smirl			
 	Juergen Schoenwaelder		
 	Jung-uk Kim			
 	Kazushi Sugyo			
@@ -67,19 +74,22 @@ Additional people who have contributed p
 	Krzysztof Halasa		
 	Lorenzo Cavallaro		
 	Loris Degioanni			
-	Love Hörnquist-Åstrand		
+	Love Hörnquist-Åstrand		
 	Luis Martin Garcia		
 	Maciej W. Rozycki		
 	Marcus Felipe Pereira		
 	Mark C. Brown			
 	Mark Pizzolato			
+	Markus Mayer			
 	Martin Husemann			
+	Márton Németh			
 	Matthew Luckie			
 	Max Laier			
 	Mike Frysinger			
 	Mike Kershaw			
 	Mike Wiacek			
 	Monroe Williams			
+	N. Leiten			
 	Nicolas Dade			
 	Octavian Cerna			
 	Olaf Kirch			
@@ -93,15 +103,20 @@ Additional people who have contributed p
 	Pawel Pokrywka			
 	Peter Fales			
 	Peter Jeremy			
+	Peter Volkov			
 	Phil Wood			
 	Rafal Maszkowski		
 					
 	Richard Stearn			
 	Rick Jones			
+	Robert Edmonds			
+	Roberto Mariani			
+	Romain Francoise		
 	Sagun Shakya			
 	Scott Barron			
 	Scott Gifford			
 	Sebastian Krahmer		
+	Sebastien Roy			
 	Sepherosa Ziehau		
 	Shaun Clowes			
 	Solomon Peachy			
@@ -109,12 +124,16 @@ Additional people who have contributed p
 	Stephen Donnelly		
 	Takashi Yamamoto		
 	Tanaka Shin-ya			
+	Tobias Poschwatta		
 	Tony Li				
 	Torsten Landschoff	 	
 	Uns Lider			
 	Uwe Girlich			
+	Wesley Shields			
 	Xianjie Zhang			
+	Xin Li				
 	Yen Yen Lim
+	Yvan Vanhullebus		
 	Yoann Vandoorselaere		
 
 The original LBL crew:

Added: vendor/libpcap/dist/ChmodBPF/ChmodBPF
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libpcap/dist/ChmodBPF/ChmodBPF	Thu Oct 28 16:22:13 2010	(r214455)
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+. /etc/rc.common
+
+StartService ()
+{
+	#
+	# Unfortunately, Mac OS X's devfs is based on the old FreeBSD
+	# one, not the current one, so there's no way to configure it
+	# to create BPF devices with particular owners or groups.
+	# This startup item will make it owned by the admin group,
+	# with permissions rw-rw----, so that anybody in the admin
+	# group can use programs that capture or send raw packets.
+	#
+	# Change this as appropriate for your site, e.g. to make
+	# it owned by a particular user without changing the permissions,
+	# so only that user and the super-user can capture or send raw
+	# packets, or give it the permissions rw-r-----, so that
+	# only the super-user can send raw packets but anybody in the
+	# admin group can capture packets.
+	#
+	chgrp admin /dev/bpf*
+	chmod g+rw /dev/bpf*
+}
+
+StopService ()
+{
+	return 0;
+}
+
+RestartService () { StartService; }
+
+RunService "$1"

Added: vendor/libpcap/dist/ChmodBPF/StartupParameters.plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libpcap/dist/ChmodBPF/StartupParameters.plist	Thu Oct 28 16:22:13 2010	(r214455)
@@ -0,0 +1,4 @@
+{
+  Description     = "Change BPF permissions";
+  Provides        = ("ChmodBPF");
+}

Modified: vendor/libpcap/dist/INSTALL.txt
==============================================================================
--- vendor/libpcap/dist/INSTALL.txt	Thu Oct 28 15:43:14 2010	(r214454)
+++ vendor/libpcap/dist/INSTALL.txt	Thu Oct 28 16:22:13 2010	(r214455)
@@ -1,4 +1,4 @@
-@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.21.2.8 2008-06-12 20:25:38 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.29 2008-06-12 20:21:51 guy Exp $ (LBL)
 
 To build libpcap, run "./configure" (a shell script). The configure
 script will determine your system attributes and generate an

Modified: vendor/libpcap/dist/Makefile.in
==============================================================================
--- vendor/libpcap/dist/Makefile.in	Thu Oct 28 15:43:14 2010	(r214454)
+++ vendor/libpcap/dist/Makefile.in	Thu Oct 28 16:22:13 2010	(r214455)
@@ -17,7 +17,7 @@
 #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
-# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.108.2.28 2008-10-23 22:13:21 guy Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.142 2008-11-22 17:30:24 guy Exp $ (LBL)
 
 #
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -44,14 +44,17 @@ VPATH = @srcdir@
 # You shouldn't need to edit anything below.
 #
 
+LD = /usr/bin/ld
 CC = @CC@
 CCOPT = @V_CCOPT@
 INCLS = -I. @V_INCLS@
 DEFS = @DEFS@ @V_DEFS@
-LIBS = @V_LIBS@
-DAGLIBS = @DAGLIBS@
-DEPLIBS = @DEPLIBS@
+ADDLOBJS = @ADDLOBJS@
+ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
+LIBS = @LIBS@
+LDFLAGS = @LDFLAGS@
 DYEXT = @DYEXT@
+V_RPATH_OPT = @V_RPATH_OPT@
 PROG=libpcap
 
 # Standard CFLAGS
@@ -77,12 +80,13 @@ YACC = @V_YACC@
 	@rm -f $@
 	$(CC) $(CFLAGS) -c $(srcdir)/$*.c
 
-PSRC =	pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@
+PSRC =	pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@
 FSRC =  fad-@V_FINDALLDEVS@.c
 SSRC =  @SSRC@
-CSRC =	pcap.c inet.c gencode.c optimize.c nametoaddr.c \
-	etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
-GENSRC = scanner.c grammar.c version.c
+CSRC =	pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \
+	savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \
+	bpf_image.c bpf_dump.c
+GENSRC = scanner.c grammar.c bpf_filter.c version.c
 LIBOBJS = @LIBOBJS@
 
 SRC =	$(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
@@ -90,8 +94,20 @@ SRC =	$(PSRC) $(FSRC) $(CSRC) $(SSRC) $(
 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
 # hack the extra indirection
 OBJ =	$(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
-HDR = \
-	acconfig.h \
+PUBHDR = \
+	pcap.h \
+	pcap-bpf.h \
+	pcap-namedb.h \
+	pcap/bpf.h \
+	pcap/bluetooth.h \
+	pcap/ipnet.h \
+	pcap/namedb.h \
+	pcap/pcap.h \
+	pcap/sll.h \
+	pcap/vlan.h \
+	pcap/usb.h
+
+HDR = $(PUBHDR) \
 	arcnet.h \
 	atmuni31.h \
 	ethertype.h \
@@ -99,30 +115,23 @@ HDR = \
 	ieee80211.h \
 	llc.h \
 	nlpid.h \
-	pcap/bluetooth.h \
-	pcap/bpf.h \
-	pcap/namedb.h \
-	pcap/pcap.h \
-	pcap/sll.h \
-	pcap/usb.h \
-	pcap/vlan.h \
-	pcap.h \
+	pcap-common.h \
 	pcap-int.h \
-	pcap-namedb.h \
 	pcap-stdinc.h \
 	ppp.h \
+	sf-pcap.h \
+	sf-pcap-ng.h \
 	sunatmpos.h
 
 GENHDR = \
 	scanner.h tokdefs.h version.h
 
-TAGHDR = \
-	pcap-bpf.h
-
 TAGFILES = \
-	$(SRC) $(HDR) $(TAGHDR)
+	$(SRC) $(HDR)
 
-CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
+CLEANFILES = $(OBJ) libpcap.* filtertest findalldevstest selpolltest \
+	opentest $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
+	lex.yy.c pcap-config
 
 MAN1 = pcap-config.1
 
@@ -254,13 +263,14 @@ EXTRA_DIST = \
 	msdos/pktdrvr.c \
 	msdos/pktdrvr.h \
 	msdos/readme.dos \
-	net/bpf_filter.c \
+	opentest.c \
 	org.tcpdump.chmod_bpf.plist \
 	packaging/pcap.spec.in \
 	pcap-bpf.c \
-	pcap-bpf.h \
 	pcap-bt-linux.c \
 	pcap-bt-linux.h \
+	pcap-can-linux.c \
+	pcap-can-linux.h \
 	pcap-config.in \
 	pcap-dag.c \
 	pcap-dag.h \
@@ -280,6 +290,8 @@ EXTRA_DIST = \
 	pcap-sita.h \
 	pcap-sita.c \
 	pcap-sita.html \
+	pcap-snf.c \
+	pcap-snf.h \
 	pcap-snit.c \
 	pcap-snoop.c \
 	pcap-usb-linux.c \
@@ -287,6 +299,7 @@ EXTRA_DIST = \
 	pcap-win32.c \
 	runlex.sh \
 	scanner.l \
+	selpolltest.c \
 	Win32/Include/Gnuc.h \
 	Win32/Include/addrinfo.h \
 	Win32/Include/bittypes.h \
@@ -311,42 +324,94 @@ EXTRA_DIST = \
 	Win32/Src/inet_net.c \
 	Win32/Src/inet_pton.c
 
-all: libpcap.a pcap-config
+all: libpcap.a shared pcap-config
 
 libpcap.a: $(OBJ)
 	@rm -f $@
-	$(AR) rc $@ $(OBJ) $(LIBS)
+	ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
 	$(RANLIB) $@
 
 shared: libpcap.$(DYEXT)
 
-#
-# XXX - this works with GNU ld, but won't necessarily work with native
-# ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
-#
 libpcap.so: $(OBJ)
 	@rm -f $@
-	$(CC) -shared -Wl,-soname,$@.1 -o $@.`cat $(srcdir)/VERSION` $(OBJ) $(DAGLIBS)
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	@V_SHLIB_CMD@ @V_SHLIB_OPT@ @V_SONAME_OPT@$@.$$MAJOR_VER $(LDFLAGS) \
+	    -o $@.$$VER $(OBJ) $(ADDLOBJS) $(LIBS)
 
 #
 # The following rule succeeds, but the result is untested.
 #
-# XXX - OS X installs the library as "libpcap.A.dylib", with that as the
-# install_name, and sets the current version to 1 as well.  VERSION
-# might contain a not-purely-numeric version number, but
-# -current_version requires a purely numeric version, so this won't
-# work with top-of-tree builds.
+# In Mac OS X, the libpcap dylib has the name "libpcap.A.dylib", with
+# its full path as the install_name, and with the compatibility and
+# current version both set to 1.  The compatibility version is set to
+# 1 so that programs built with a newer version of the library will run
+# against older versions; multi-platform software probably will fail if
+# it uses APIs added in the newer version, but Mac OS X-specific software
+# will use weak linking and check at run time whether those APIs are
+# available.
+#
+# We also use "A" as the major version, and 1 as the compatibility version,
+# but set the current version to the value in VERSION, with any non-numeric
+# stuff stripped off (the compatibility and current version must be of the
+# form X[.Y[.Z]], with Y and Z possibly absent, and with all components
+# numeric).
 #
 libpcap.dylib: $(OBJ)
 	rm -f libpcap*.dylib
-	$(CC) -dynamiclib -undefined error -o libpcap.`cat $(srcdir)/VERSION`.dylib $(OBJ) \
-		-install_name $(libdir)/libpcap.A.dylib \
-		-compatibility_version 1 \
-		-current_version `sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=A; \
+	COMPAT_VER=1; \
+	CURRENT_VER=`sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`; \
+	$(CC) -dynamiclib -undefined error $(LDFLAGS) \
+	    -o libpcap.$$VER.dylib $(OBJ) $(ADDLOBJS) $(LIBS) \
+	    -install_name $(libdir)/libpcap.$$MAJOR_VER.dylib \
+	    -compatibility_version $$COMPAT_VER \
+	    -current_version $$CURRENT_VER
+
+#
+# The HP-UX linker manual says that the convention for a versioned library
+# is libXXX.{number}, not libXXX.sl.{number}.  That appears to be the case
+# on at least one HP-UX 11.00 system; libXXX.sl is a symlink to
+# libXXX.{number}.
+#
+# The manual also says "library-level versioning" (think "sonames") was
+# added in HP-UX 10.0.
+#
+# XXX - this assumes we're using the HP linker, rather than the GNU
+# linker, even with GCC.
+#
+libpcap.sl: $(OBJ)
+	@MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	rm -f libpcap.$$MAJOR_VER
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	ld -b $(LDFLAGS) -o libpcap.$$MAJOR_VER +h libpcap.$$MAJOR_VER \
+	    $(OBJ) $(ADDLOBJS) $(LIBS)
+
+#
+# AIX is different from everybody else.  A shared library is an archive
+# library with one or more shared-object components.  We still build a
+# normal static archive library on AIX, for the benefit of the traditional
+# scheme of building libpcap and tcpdump in subdirectories of the
+# same directory, with tcpdump statically linked with the libpcap
+# in question, but we also build a shared library as "libpcap.shareda"
+# and install *it*, rather than the static library, as "libpcap.a".
+#
+libpcap.shareda: $(OBJ)
+	@rm -f $@ shr.o
+	$(CC) @V_SHLIB_OPT@ -o shr.o $(OBJ) $(ADDLOBJS) $(LDFLAGS) $(LIBS)
+	ar rc $@ shr.o
+
+#
+# For platforms that don't support shared libraries (or on which we
+# don't support shared libraries).
+#
+libpcap.none:
 
 scanner.c: $(srcdir)/scanner.l
 	@rm -f $@
-	./runlex.sh $(LEX) -o$@ $<
+	$(srcdir)/runlex.sh $(LEX) -o$@ $<
 
 scanner.o: scanner.c tokdefs.h
 	$(CC) $(CFLAGS) -c scanner.c
@@ -372,7 +437,13 @@ snprintf.o: $(srcdir)/missing/snprintf.c
 
 version.c: $(srcdir)/VERSION
 	@rm -f $@
-	sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
+	if grep GIT ${srcdir}/VERSION >/dev/null; then \
+		read ver <${srcdir}/VERSION; \
+		echo $$ver | tr -d '\012'; \
+		date +_%Y_%m_%d; \
+	else \
+		cat ${srcdir}/VERSION; \
+	fi | sed -e 's/.*/char pcap_version[] = "&";/' > $@
 
 #
 # NOTE: this really is supposed to be static; importing a string
@@ -383,7 +454,13 @@ version.c: $(srcdir)/VERSION
 #
 version.h: $(srcdir)/VERSION
 	@rm -f $@
-	sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
+	if grep GIT ${srcdir}/VERSION >/dev/null; then \
+		read ver <${srcdir}/VERSION; \
+		echo $$ver | tr -d '\012'; \
+		date +_%Y_%m_%d; \
+	else \
+		cat ${srcdir}/VERSION; \
+	fi | sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' > $@
 
 bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
 	rm -f bpf_filter.c
@@ -395,12 +472,13 @@ bpf_filter.o: bpf_filter.c
 #
 # Generate the pcap-config script.
 #
-pcap-config: pcap-config.in Makefile
+pcap-config: $(srcdir)/pcap-config.in
 	@rm -f $@ $@.tmp
 	sed -e 's|@includedir[@]|$(includedir)|g' \
 	    -e 's|@libdir[@]|$(libdir)|g' \
-	    -e 's|@DEPLIBS[@]|$(DEPLIBS)|g' \
-	    pcap-config.in >$@.tmp
+	    -e 's|@LIBS[@]|$(LIBS)|g' \
+	    -e 's|@V_RPATH_OPT[@]|$(V_RPATH_OPT)|g' \
+	    $(srcdir)/pcap-config.in >$@.tmp
 	mv $@.tmp $@
 	chmod a+x $@
 
@@ -408,16 +486,20 @@ pcap-config: pcap-config.in Makefile
 # Test programs - not built by default, and not installed.
 #
 filtertest: filtertest.c libpcap.a
-	$(CC) $(CFLAGS) -I. -L. -o filtertest filtertest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o filtertest $(srcdir)/filtertest.c libpcap.a $(LIBS)
 
 findalldevstest: findalldevstest.c libpcap.a
-	$(CC) $(CFLAGS) -I. -L. -o findalldevstest findalldevstest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o findalldevstest $(srcdir)/findalldevstest.c libpcap.a $(LIBS)
+
+selpolltest: selpolltest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o selpolltest $(srcdir)/selpolltest.c libpcap.a $(LIBS)
+
+opentest: opentest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o opentest $(srcdir)/opentest.c libpcap.a $(LIBS)
 
-install: libpcap.a pcap-config
+install: install-shared install-archive pcap-config
 	[ -d $(DESTDIR)$(libdir) ] || \
 	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
-	$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
-	$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
 	[ -d $(DESTDIR)$(includedir) ] || \
 	    (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
 	[ -d $(DESTDIR)$(includedir)/pcap ] || \
@@ -430,91 +512,151 @@ install: libpcap.a pcap-config
 	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@)
 	[ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \
 	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@)
-	$(INSTALL_DATA) $(srcdir)/pcap/pcap.h \
-	    $(DESTDIR)$(includedir)/pcap/pcap.h
-	$(INSTALL_DATA) $(srcdir)/pcap/bpf.h \
-	    $(DESTDIR)$(includedir)/pcap/bpf.h
-	$(INSTALL_DATA) $(srcdir)/pcap/namedb.h \
-	    $(DESTDIR)$(includedir)/pcap/namedb.h
-	$(INSTALL_DATA) $(srcdir)/pcap/sll.h \
-	    $(DESTDIR)$(includedir)/pcap/sll.h
-	$(INSTALL_DATA) $(srcdir)/pcap/usb.h \
-	    $(DESTDIR)$(includedir)/pcap/usb.h
-	$(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
-	$(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
-	    $(DESTDIR)$(includedir)/pcap-bpf.h
-	$(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
-	    $(DESTDIR)$(includedir)/pcap-namedb.h
+	for i in $(PUBHDR); do \
+		$(INSTALL_DATA) $(srcdir)/$$i \
+		    $(DESTDIR)$(includedir)/$$i; done
+	[ -d $(DESTDIR)$(bindir) ] || \
+	    (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
 	$(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config
 	for i in $(MAN1); do \
 		$(INSTALL_DATA) $(srcdir)/$$i \
 		    $(DESTDIR)$(mandir)/man1/$$i; done
-	for i in $(MAN3PCAP); do \
+	for i in $(MAN3PCAP_NOEXPAND); do \
 		$(INSTALL_DATA) $(srcdir)/$$i \
 		    $(DESTDIR)$(mandir)/man3/$$i; done
+	for i in $(MAN3PCAP_EXPAND:.in=); do \
+		$(INSTALL_DATA) $$i \
+		    $(DESTDIR)$(mandir)/man3/$$i; done
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_name.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_major_version.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_next_ex.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_setnonblock.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
 	for i in $(MANFILE); do \
-		$(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manfile.in/.manfile/'` \
+		$(INSTALL_DATA) `echo $$i | sed 's/.manfile.in/.manfile/'` \
 		    $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
 	for i in $(MANMISC); do \
-		$(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manmisc.in/.manmisc/'` \
+		$(INSTALL_DATA) `echo $$i | sed 's/.manmisc.in/.manmisc/'` \
 		    $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
 
 install-shared: install-shared-$(DYEXT)
 install-shared-so: libpcap.so
-	$(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	$(INSTALL_PROGRAM) libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$VER; \
+	ln -sf libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \
+	ln -sf libpcap.so.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.so
 install-shared-dylib: libpcap.dylib
-	$(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
-	VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.A.dylib;  ln -sf libpcap.A.dylib libpcap.dylib
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=A; \
+	$(INSTALL_PROGRAM) libpcap.$$VER.dylib $(DESTDIR)$(libdir)/libpcap.$$VER.dylib; \
+	ln -sf libpcap.$$VER.dylib $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER.dylib; \
+	ln -sf libpcap.$$MAJOR_VER.dylib $(DESTDIR)$(libdir)/libpcap.dylib
+install-shared-sl: libpcap.sl
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	$(INSTALL_PROGRAM) libpcap.$$MAJOR_VER $(DESTDIR)$(libdir)
+	ln -sf libpcap.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.sl
+install-shared-shareda: libpcap.shareda
+	#
+	# AIX shared libraries are weird.  They're archive libraries
+	# with one or more shared object components.
+	#
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	$(INSTALL_PROGRAM) libpcap.shareda $(DESTDIR)$(libdir)/libpcap.a
+install-shared-none:
 
-uninstall:
+install-archive: install-archive-$(DYEXT)
+install-archive-so install-archive-dylib install-archive-sl install-archive-none: libpcap.a
+	#
+	# Most platforms have separate suffixes for shared and
+	# archive libraries, so we install both.
+	#
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
+	$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
+install-archive-shareda:
+	#
+	# AIX, however, doesn't, so we don't install the archive
+	# library on AIX.
+	#
+
+uninstall: uninstall-shared
 	rm -f $(DESTDIR)$(libdir)/libpcap.a
-	rm -f $(DESTDIR)$(includedir)/pcap/pcap.h
-	rm -f $(DESTDIR)$(includedir)/pcap/bpf.h
-	rm -f $(DESTDIR)$(includedir)/pcap/namedb.h
-	rm -f $(DESTDIR)$(includedir)/pcap/sll.h
-	rm -f $(DESTDIR)$(includedir)/pcap/usb.h
+	for i in $(PUBHDR); do \
+		rm -f $(DESTDIR)$(includedir)/$$i; done
 	-rmdir $(DESTDIR)$(includedir)/pcap
-	rm -f $(DESTDIR)$(includedir)/pcap.h
-	rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
-	rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
+	rm -f $(DESTDIR)/$(bindir)/pcap-config
 	for i in $(MAN1); do \
 		rm -f $(DESTDIR)$(mandir)/man1/$$i; done
 	for i in $(MAN3PCAP); do \
 		rm -f $(DESTDIR)$(mandir)/man3/$$i; done
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
 	for i in $(MANFILE); do \
 		rm -f $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
 	for i in $(MANMISC); do \
 		rm -f $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
 
+uninstall-shared: uninstall-shared-$(DYEXT)
+uninstall-shared-so:
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.so.$$VER; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.so
+uninstall-shared-dylib:
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=A; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.$$VER.dylib; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER.dylib; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.dylib
+uninstall-shared-sl:
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.sl
+uninstall-shared-shareda:
+	rm -f $(DESTDIR)$(libdir)/libpcap.a
+uninstall-shared-none:
+
 clean:
-	rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
+	rm -f $(CLEANFILES)
 
 distclean: clean
 	rm -f Makefile config.cache config.log config.status \
@@ -530,7 +672,7 @@ packaging/pcap.spec: packaging/pcap.spec
 	RPMVERSION=`cat VERSION | sed s/-.*//g`; \
 		sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $<   > $@
 
-releasetar:
+releasetar: 
 	@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
 	   mkdir $$name; \
 	   tar cf - $(CSRC) $(HDR) $(MAN1) $(MAN3PCAP_EXPAND) \

Modified: vendor/libpcap/dist/README
==============================================================================
--- vendor/libpcap/dist/README	Thu Oct 28 15:43:14 2010	(r214454)
+++ vendor/libpcap/dist/README	Thu Oct 28 16:22:13 2010	(r214455)
@@ -1,19 +1,17 @@
-@(#) $Header: /tcpdump/master/libpcap/README,v 1.30.4.3 2008-10-17 10:39:20 ken Exp $ (LBL)
+@(#) $Header: /tcpdump/master/libpcap/README,v 1.34 2008-12-14 19:44:14 guy Exp $ (LBL)
 
-LIBPCAP 1.0.0
+LIBPCAP 1.x.y
 
 www.tcpdump.org
 
 Please send inquiries/comments/reports to:
 	tcpdump-workers@lists.tcpdump.org
 
-Anonymous CVS is available via:
-	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master login
-	(password "anoncvs")
-	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout libpcap
+Anonymous Git is available via:
+	git clone git://bpf.tcpdump.org/libpcap
 
-Version 1.0.0 of LIBPCAP can be retrieved with the CVS tag "libpcap_1_0":
-	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_1_0 libpcap
+Version 1.x.y of LIBPCAP can be retrieved with the CVS tag "libpcap_1_{x}rel{y}":
+	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_1_{x}rel{y} libpcap
 
 Please submit patches against the master copy to the libpcap project on
 sourceforge.net.
@@ -80,10 +78,10 @@ information on configuring that option.
 Note to Linux distributions and *BSD systems that include libpcap:
 
 There's now a rule to make a shared library, which should work on Linux 
-and *BSD (and OS X).
+and *BSD, among other platforms.
 
 It sets the soname of the library to "libpcap.so.1"; this is what it 
-should be, *NOT* libpcap.so.1.0 or libpcap.so.1.0.0 or something such as 
+should be, *NOT* libpcap.so.1.x or libpcap.so.1.x.y or something such as 
 that.
 
 We've been maintaining binary compatibility between libpcap releases for 

Added: vendor/libpcap/dist/README.Win32
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libpcap/dist/README.Win32	Thu Oct 28 16:22:13 2010	(r214455)
@@ -0,0 +1,46 @@
+Under Win32, libpcap is integrated in the WinPcap packet capture system. 
+WinPcap provides a framework that allows libpcap to capture the packets 
+under Windows 95, Windows 98, Windows ME, Windows NT 4, Windows 2000 
+and Windows XP.
+WinPcap binaries and source code can be found at http://winpcap.polito.it: 
+they include also a developer's pack with all the necessary to compile 
+libpcap-based applications under Windows.
+
+How to compile libpcap with Visual Studio
+-----------------------------------------
+
+In order to compile libpcap you will need:
+
+- version 6 (or higher) of Microsoft Visual Studio
+- The November 2001 (or later) edition of Microsoft Platform 
+Software Development Kit (SDK), that contains some necessary includes 
+for IPv6 support. You can download it from http://www.microsoft.com/sdk
+- the latest WinPcap sources from http://winpcap.polito.it/install 
+
+The WinPcap source code already contains a recent (usually the latest 
+stable) version of libpcap. If you need to compile a different one, 
+simply download it from www.tcpdump.org and copy the sources in the 
+winpcap\wpcap\libpcap folder of the WinPcap distribution. If you want to
+compile a libpcap source retrieved from the tcpdump.org Git, you will 
+have to create the scanner and the grammar by hand (with lex and yacc) 
+or with the cygnus makefile, since The Visual Studio project is not able
+to build them.
+
+Open the project file winpcap\wpcap\prj\wpcap.dsw with Visual Studio and 
+build wpcap.dll. wpcap.lib, the library file to link with the applications, 
+will be generated in winpcap\wpcap\lib\. wpcap.dll will be generated in 
+winpcap\wpcap\prj\release or winpcap\wpcap\prj\debug depending on the type 
+of binary that is being created.
+
+How to compile libpcap with Cygnus
+----------------------------------
+
+To build wpcap.dll, cd to the directory WPCAP/PRJ of the WinPcap source code 
+distribution and type "make". libwpcap.a, the library file to link with the 
+applications, will be generated in winpcap\wpcap\lib\. wpcap.dll will be 
+generated in winpcap\wpcap\prj.
+
+Remember, you CANNOT use the MSVC-generated .lib files with gcc, use 
+libwpcap.a instead.
+
+"make install" installs wpcap.dll in the Windows system folder.

Added: vendor/libpcap/dist/README.aix
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libpcap/dist/README.aix	Thu Oct 28 16:22:13 2010	(r214455)
@@ -0,0 +1,81 @@
+Using BPF:
+
+(1) AIX 4.x's version of BPF is undocumented and somewhat unstandard; the
+    current BPF support code includes changes that should work around
+    that; it appears to compile and work on at least one AIX 4.3.3
+    machine.
+
+    Note that the BPF driver and the "/dev/bpf" devices might not exist
+    on your machine; AIX's tcpdump loads the driver and creates the
+    devices if they don't already exist.  Our libpcap should do the
+    same, and the configure script should detect that it's on an AIX
+    system and choose BPF even if the devices aren't there.
+
+(2) If libpcap doesn't compile on your machine when configured to use
+    BPF, or if the workarounds fail to make it work correctly, you
+    should send to tcpdump-workers@lists.tcpdump.org a detailed bug
+    report (if the compile fails, send us the compile error messages;
+    if it compiles but fails to work correctly, send us as detailed as
+    possible a description of the symptoms, including indications of the
+    network link-layer type being wrong or time stamps being wrong).
+
+    If you fix the problems yourself, please submit a patch to
+
+	http://sourceforge.net/projects/libpcap/
+
+    so we can incorporate them into the next release.
+
+    If you don't fix the problems yourself, you can, as a workaround,
+    make libpcap use DLPI instead of BPF.
+
+    This can be done by specifying the flag:
+
+       --with-pcap=dlpi
+
+    to the "configure" script for libpcap.
+
+If you use DLPI:
+
+(1) It is a good idea to have the latest version of the DLPI driver on
+    your system, since certain versions may be buggy and cause your AIX
+    system to crash.  DLPI is included in the fileset bos.rte.tty.  I
+    found that the DLPI driver that came with AIX 4.3.2 was buggy, and
+    had to upgrade to bos.rte.tty 4.3.2.4:
+
+	    lslpp -l bos.rte.tty
+
+	    bos.rte.tty     4.3.2.4  COMMITTED  Base TTY Support and Commands
+
+    Updates for AIX filesets can be obtained from:
+    ftp://service.software.ibm.com/aix/fixes/
+
+    These updates can be installed with the smit program.
+
+(2) After compiling libpcap, you need to make sure that the DLPI driver
+    is loaded.  Type:
+
+	    strload -q -d dlpi
+
+    If the result is:
+
+	    dlpi: yes
+
+    then the DLPI driver is loaded correctly.
+
+    If it is:
+
+	    dlpi: no
+
+    Then you need to type:
+
+	    strload -f /etc/dlpi.conf
+ 
+    Check again with strload -q -d dlpi that the dlpi driver is loaded.  
+
+    Alternatively, you can uncomment the lines for DLPI in
+    /etc/pse.conf and reboot the machine; this way DLPI will always
+    be loaded when you boot your system.
+
+(3) There appears to be a problem in the DLPI code in some versions of
+    AIX, causing a warning about DL_PROMISC_MULTI failing; this might
+    be responsible for DLPI not being able to capture outgoing packets.

Added: vendor/libpcap/dist/README.dag
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libpcap/dist/README.dag	Thu Oct 28 16:22:13 2010	(r214455)
@@ -0,0 +1,114 @@
+
+The following instructions apply if you have a Linux or FreeBSD platform and
+want libpcap to support the DAG range of passive network monitoring cards from
+Endace (http://www.endace.com, see below for further contact details).
+
+1) Install and build the DAG software distribution by following the
+instructions supplied with that package. Current Endace customers can download
+the DAG software distibution from https://www.endace.com
+
+2) Configure libcap. To allow the 'configure' script to locate the DAG
+software distribution use the '--with-dag' option:
+
+        ./configure --with-dag=DIR
+
+Where DIR is the root of the DAG software distribution, for example
+/var/src/dag. If the DAG software is correctly detected 'configure' will
+report:
+
+        checking whether we have DAG API... yes

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 16:23: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 7C639106564A;
	Thu, 28 Oct 2010 16:23:26 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 677958FC16;
	Thu, 28 Oct 2010 16:23: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 o9SGNQGs014423;
	Thu, 28 Oct 2010 16:23:26 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SGNQCX014411;
	Thu, 28 Oct 2010 16:23:26 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010281623.o9SGNQCX014411@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 28 Oct 2010 16:23:26 +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: r214456 - in vendor/tcpdump/dist: . lbl missing tests
	win32 win32/Include win32/Include/Arpa win32/Include/Netinet
	win32/Src win32/prj
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 16:23:26 -0000

Author: rpaulo
Date: Thu Oct 28 16:23:25 2010
New Revision: 214456
URL: http://svn.freebsd.org/changeset/base/214456

Log:
  Update tcpdump to 4.1.1.
  
  Changes:
  
  Thu.    April 1, 2010.  guy@alum.mit.edu.
    Summary for 4.1.1 tcpdump release
          Fix build on systems with PF, such as FreeBSD and OpenBSD.
          Don't blow up if a zero-length link-layer address is passed to
            linkaddr_string().
  
  Thu.    March 11, 2010.  ken@netfunctional.ca/guy@alum.mit.edu.
    Summary for 4.1.0 tcpdump release
          Fix printing of MAC addresses for VLAN frames with a length
            field
          Add some additional bounds checks and use the EXTRACT_ macros
            more
          Add a -b flag to print the AS number in BGP packets in ASDOT
            notation rather than ASPLAIN notation
          Add ICMPv6 RFC 5006 support
          Decode the access flags in NFS access requests
          Handle the new DLT_ for memory-mapped USB captures on Linux
          Make the default snapshot (-s) the maximum
          Print name of device (when -L is used)
          Support for OpenSolaris (and SXCE build 125 and later)
          Print new TCP flags
          Add support for RPL DIO
          Add support for TCP User Timeout (UTO)
          Add support for non-standard Ethertypes used by 3com PPPoE gear
          Add support for 802.11n and 802.11s
          Add support for Transparent Ethernet Bridge ethertype in GRE
          Add 4 byte AS support for BGP printer
          Add support for the MDT SAFI 66 BG printer
          Add basic IPv6 support to print-olsr
          Add USB printer
          Add printer for ForCES
          Handle frames with an FCS
          Handle 802.11n Control Wrapper, Block Acq Req and Block Ack frames
          Fix TCP sequence number printing
          Report 802.2 packets as 802.2 instead of 802.3
          Don't include -L/usr/lib in LDFLAGS
          On x86_64 Linux, look in lib64 directory too
          Lots of code clean ups
          Autoconf clean ups
          Update testcases to make output changes
          Fix compiling with/out smi (--with{,out}-smi)
          Fix compiling without IPv6 support (--disable-ipv6)

Added:
  vendor/tcpdump/dist/Makefile-devel-adds   (contents, props changed)
  vendor/tcpdump/dist/Readme.Win32
  vendor/tcpdump/dist/forces.h   (contents, props changed)
  vendor/tcpdump/dist/ipnet.h   (contents, props changed)
  vendor/tcpdump/dist/print-forces.c   (contents, props changed)
  vendor/tcpdump/dist/print-ipnet.c   (contents, props changed)
  vendor/tcpdump/dist/print-usb.c   (contents, props changed)
  vendor/tcpdump/dist/signature.c   (contents, props changed)
  vendor/tcpdump/dist/signature.h   (contents, props changed)
  vendor/tcpdump/dist/tcpdump.1.in   (contents, props changed)
  vendor/tcpdump/dist/tests/
  vendor/tcpdump/dist/tests/02-sunrise-sunset-esp.puu
  vendor/tcpdump/dist/tests/08-sunrise-sunset-aes.puu
  vendor/tcpdump/dist/tests/08-sunrise-sunset-esp2.puu
  vendor/tcpdump/dist/tests/TESTLIST
  vendor/tcpdump/dist/tests/TESTonce   (contents, props changed)
  vendor/tcpdump/dist/tests/TESTrun.sh   (contents, props changed)
  vendor/tcpdump/dist/tests/bgp-infinite-loop.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/bgp_vpn_attrset.out
  vendor/tcpdump/dist/tests/bgp_vpn_attrset.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/chdlc-slarp-short.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/chdlc-slarp.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/dio.out
  vendor/tcpdump/dist/tests/dio.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/e1000g.out
  vendor/tcpdump/dist/tests/e1000g.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/eapon1.gdbinit
  vendor/tcpdump/dist/tests/eapon1.out
  vendor/tcpdump/dist/tests/eapon1.puu
  vendor/tcpdump/dist/tests/eapon2.puu
  vendor/tcpdump/dist/tests/esp-secrets.txt   (contents, props changed)
  vendor/tcpdump/dist/tests/esp0.out
  vendor/tcpdump/dist/tests/esp1.gdbinit
  vendor/tcpdump/dist/tests/esp1.out
  vendor/tcpdump/dist/tests/esp2.gdbinit
  vendor/tcpdump/dist/tests/esp2.out
  vendor/tcpdump/dist/tests/esp3.gdbinit
  vendor/tcpdump/dist/tests/esp4.gdbinit
  vendor/tcpdump/dist/tests/esp5.gdbinit
  vendor/tcpdump/dist/tests/esp5.out
  vendor/tcpdump/dist/tests/espudp1.out
  vendor/tcpdump/dist/tests/espudp1.puu
  vendor/tcpdump/dist/tests/forces1.out
  vendor/tcpdump/dist/tests/forces1.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/forces1vvv.out
  vendor/tcpdump/dist/tests/forces1vvvv.out
  vendor/tcpdump/dist/tests/forces2.out
  vendor/tcpdump/dist/tests/forces2.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/forces2v.out
  vendor/tcpdump/dist/tests/forces2vv.out
  vendor/tcpdump/dist/tests/ikev2.puu
  vendor/tcpdump/dist/tests/ikev2four.out
  vendor/tcpdump/dist/tests/ikev2four.puu
  vendor/tcpdump/dist/tests/ikev2fourv.out
  vendor/tcpdump/dist/tests/ikev2fourv4.out
  vendor/tcpdump/dist/tests/ikev2pI2-secrets.txt   (contents, props changed)
  vendor/tcpdump/dist/tests/ikev2pI2.out
  vendor/tcpdump/dist/tests/ikev2pI2.puu
  vendor/tcpdump/dist/tests/isakmp-delete-segfault.puu
  vendor/tcpdump/dist/tests/isakmp-identification-segfault.puu
  vendor/tcpdump/dist/tests/isakmp-pointer-loop.puu
  vendor/tcpdump/dist/tests/isakmp1.out
  vendor/tcpdump/dist/tests/isakmp2.out
  vendor/tcpdump/dist/tests/isakmp3.out
  vendor/tcpdump/dist/tests/isakmp4.out
  vendor/tcpdump/dist/tests/isakmp4500.puu
  vendor/tcpdump/dist/tests/isis-infinite-loop.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/ldp-infinite-loop.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/lmp.out
  vendor/tcpdump/dist/tests/lmp.puu
  vendor/tcpdump/dist/tests/lmp.sh   (contents, props changed)
  vendor/tcpdump/dist/tests/lspping-fec-ldp.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/lspping-fec-rsvp.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/mpls-ldp-hello.out
  vendor/tcpdump/dist/tests/mpls-ldp-hello.puu
  vendor/tcpdump/dist/tests/mpls-traceroute.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/ospf-gmpls.out
  vendor/tcpdump/dist/tests/ospf-gmpls.puu
  vendor/tcpdump/dist/tests/print-A.out
  vendor/tcpdump/dist/tests/print-AA.out
  vendor/tcpdump/dist/tests/print-capX.out
  vendor/tcpdump/dist/tests/print-capXX.out
  vendor/tcpdump/dist/tests/print-flags.puu
  vendor/tcpdump/dist/tests/print-flags.sh   (contents, props changed)
  vendor/tcpdump/dist/tests/print-x.out
  vendor/tcpdump/dist/tests/print-xx.out
  vendor/tcpdump/dist/tests/rsvp-infinite-loop.pcap   (contents, props changed)
  vendor/tcpdump/dist/win32/
  vendor/tcpdump/dist/win32/Include/
  vendor/tcpdump/dist/win32/Include/Arpa/
  vendor/tcpdump/dist/win32/Include/Arpa/tftp.h   (contents, props changed)
  vendor/tcpdump/dist/win32/Include/Netinet/
  vendor/tcpdump/dist/win32/Include/Netinet/in_systm.h   (contents, props changed)
  vendor/tcpdump/dist/win32/Include/Netinet/ip.h   (contents, props changed)
  vendor/tcpdump/dist/win32/Include/errno.h   (contents, props changed)
  vendor/tcpdump/dist/win32/Include/getopt.h   (contents, props changed)
  vendor/tcpdump/dist/win32/Include/inetprivate.h   (contents, props changed)
  vendor/tcpdump/dist/win32/Include/telnet.h   (contents, props changed)
  vendor/tcpdump/dist/win32/Include/w32_fzs.h   (contents, props changed)
  vendor/tcpdump/dist/win32/Src/
  vendor/tcpdump/dist/win32/Src/getopt.c   (contents, props changed)
  vendor/tcpdump/dist/win32/prj/
  vendor/tcpdump/dist/win32/prj/GNUmakefile
  vendor/tcpdump/dist/win32/prj/WinDump.dsp
  vendor/tcpdump/dist/win32/prj/WinDump.dsw
Deleted:
  vendor/tcpdump/dist/missing/getaddrinfo.c
  vendor/tcpdump/dist/tcpdump.1
Modified:
  vendor/tcpdump/dist/CHANGES
  vendor/tcpdump/dist/CREDITS
  vendor/tcpdump/dist/INSTALL.txt
  vendor/tcpdump/dist/Makefile.in
  vendor/tcpdump/dist/README
  vendor/tcpdump/dist/VERSION
  vendor/tcpdump/dist/acconfig.h
  vendor/tcpdump/dist/aclocal.m4
  vendor/tcpdump/dist/addrtoname.c
  vendor/tcpdump/dist/af.c
  vendor/tcpdump/dist/af.h
  vendor/tcpdump/dist/atmuni31.h
  vendor/tcpdump/dist/bootp.h
  vendor/tcpdump/dist/bpf_dump.c
  vendor/tcpdump/dist/checksum.c
  vendor/tcpdump/dist/config.guess
  vendor/tcpdump/dist/config.h.in
  vendor/tcpdump/dist/config.sub
  vendor/tcpdump/dist/configure
  vendor/tcpdump/dist/configure.in
  vendor/tcpdump/dist/ethertype.h
  vendor/tcpdump/dist/gmpls.c
  vendor/tcpdump/dist/gmpls.h
  vendor/tcpdump/dist/gmt2local.h
  vendor/tcpdump/dist/icmp6.h
  vendor/tcpdump/dist/ieee802_11.h
  vendor/tcpdump/dist/ieee802_11_radio.h
  vendor/tcpdump/dist/interface.h
  vendor/tcpdump/dist/ip6.h
  vendor/tcpdump/dist/ipproto.c
  vendor/tcpdump/dist/ipproto.h
  vendor/tcpdump/dist/isakmp.h
  vendor/tcpdump/dist/l2vpn.c
  vendor/tcpdump/dist/l2vpn.h
  vendor/tcpdump/dist/lbl/os-sunos4.h
  vendor/tcpdump/dist/lbl/os-ultrix4.h
  vendor/tcpdump/dist/missing/addrinfo.h
  vendor/tcpdump/dist/netdissect.h
  vendor/tcpdump/dist/nfs.h
  vendor/tcpdump/dist/nlpid.c
  vendor/tcpdump/dist/nlpid.h
  vendor/tcpdump/dist/oui.c
  vendor/tcpdump/dist/oui.h
  vendor/tcpdump/dist/print-802_11.c
  vendor/tcpdump/dist/print-ap1394.c
  vendor/tcpdump/dist/print-arcnet.c
  vendor/tcpdump/dist/print-atalk.c
  vendor/tcpdump/dist/print-atm.c
  vendor/tcpdump/dist/print-bfd.c
  vendor/tcpdump/dist/print-bgp.c
  vendor/tcpdump/dist/print-bootp.c
  vendor/tcpdump/dist/print-bt.c
  vendor/tcpdump/dist/print-cdp.c
  vendor/tcpdump/dist/print-cfm.c
  vendor/tcpdump/dist/print-dccp.c
  vendor/tcpdump/dist/print-dhcp6.c
  vendor/tcpdump/dist/print-domain.c
  vendor/tcpdump/dist/print-enc.c
  vendor/tcpdump/dist/print-esp.c
  vendor/tcpdump/dist/print-ether.c
  vendor/tcpdump/dist/print-fr.c
  vendor/tcpdump/dist/print-gre.c
  vendor/tcpdump/dist/print-icmp6.c
  vendor/tcpdump/dist/print-ip.c
  vendor/tcpdump/dist/print-ip6.c
  vendor/tcpdump/dist/print-isakmp.c
  vendor/tcpdump/dist/print-isoclns.c
  vendor/tcpdump/dist/print-juniper.c
  vendor/tcpdump/dist/print-l2tp.c
  vendor/tcpdump/dist/print-lane.c
  vendor/tcpdump/dist/print-llc.c
  vendor/tcpdump/dist/print-lldp.c
  vendor/tcpdump/dist/print-lspping.c
  vendor/tcpdump/dist/print-nfs.c
  vendor/tcpdump/dist/print-ntp.c
  vendor/tcpdump/dist/print-olsr.c
  vendor/tcpdump/dist/print-ospf.c
  vendor/tcpdump/dist/print-pflog.c
  vendor/tcpdump/dist/print-pim.c
  vendor/tcpdump/dist/print-ppp.c
  vendor/tcpdump/dist/print-rrcp.c
  vendor/tcpdump/dist/print-rsvp.c
  vendor/tcpdump/dist/print-rx.c
  vendor/tcpdump/dist/print-sctp.c
  vendor/tcpdump/dist/print-sip.c
  vendor/tcpdump/dist/print-sll.c
  vendor/tcpdump/dist/print-smb.c
  vendor/tcpdump/dist/print-sunrpc.c
  vendor/tcpdump/dist/print-symantec.c
  vendor/tcpdump/dist/print-tcp.c
  vendor/tcpdump/dist/print-tftp.c
  vendor/tcpdump/dist/print-token.c
  vendor/tcpdump/dist/print-udp.c
  vendor/tcpdump/dist/setsignal.h
  vendor/tcpdump/dist/sll.h
  vendor/tcpdump/dist/smbutil.c
  vendor/tcpdump/dist/strcasecmp.c
  vendor/tcpdump/dist/tcp.h
  vendor/tcpdump/dist/tcpdump-stdinc.h
  vendor/tcpdump/dist/tcpdump.c
  vendor/tcpdump/dist/tftp.h
  vendor/tcpdump/dist/timed.h
  vendor/tcpdump/dist/token.h
  vendor/tcpdump/dist/util.c

Modified: vendor/tcpdump/dist/CHANGES
==============================================================================
--- vendor/tcpdump/dist/CHANGES	Thu Oct 28 16:22:13 2010	(r214455)
+++ vendor/tcpdump/dist/CHANGES	Thu Oct 28 16:23:25 2010	(r214456)
@@ -1,4 +1,45 @@
-$Header: /tcpdump/master/tcpdump/CHANGES,v 1.98.2.2 2008-10-15 23:26:30 ken Exp $
+Thu.	April 1, 2010.  guy@alum.mit.edu.
+  Summary for 4.1.1 tcpdump release
+	Fix build on systems with PF, such as FreeBSD and OpenBSD.
+	Don't blow up if a zero-length link-layer address is passed to
+	  linkaddr_string(). 
+
+Thu.	March 11, 2010.  ken@netfunctional.ca/guy@alum.mit.edu.
+  Summary for 4.1.0 tcpdump release
+	Fix printing of MAC addresses for VLAN frames with a length
+	  field
+	Add some additional bounds checks and use the EXTRACT_ macros
+	  more
+	Add a -b flag to print the AS number in BGP packets in ASDOT
+	  notation rather than ASPLAIN notation
+	Add ICMPv6 RFC 5006 support
+	Decode the access flags in NFS access requests
+	Handle the new DLT_ for memory-mapped USB captures on Linux
+	Make the default snapshot (-s) the maximum
+	Print name of device (when -L is used)
+	Support for OpenSolaris (and SXCE build 125 and later)
+	Print new TCP flags
+	Add support for RPL DIO
+	Add support for TCP User Timeout (UTO)
+	Add support for non-standard Ethertypes used by 3com PPPoE gear
+	Add support for 802.11n and 802.11s
+	Add support for Transparent Ethernet Bridge ethertype in GRE
+	Add 4 byte AS support for BGP printer
+	Add support for the MDT SAFI 66 BG printer
+	Add basic IPv6 support to print-olsr
+	Add USB printer
+	Add printer for ForCES
+	Handle frames with an FCS
+	Handle 802.11n Control Wrapper, Block Acq Req and Block Ack frames
+	Fix TCP sequence number printing 
+	Report 802.2 packets as 802.2 instead of 802.3
+	Don't include -L/usr/lib in LDFLAGS
+	On x86_64 Linux, look in lib64 directory too
+	Lots of code clean ups
+	Autoconf clean ups
+	Update testcases to make output changes
+	Fix compiling with/out smi (--with{,out}-smi)
+	Fix compiling without IPv6 support (--disable-ipv6)
 
 Mon.    October 27, 2008.  ken@netfunctional.ca.  Summary for 4.0.0 tcpdump release
         Add support for Bluetooth Sniffing

Modified: vendor/tcpdump/dist/CREDITS
==============================================================================
--- vendor/tcpdump/dist/CREDITS	Thu Oct 28 16:22:13 2010	(r214455)
+++ vendor/tcpdump/dist/CREDITS	Thu Oct 28 16:23:25 2010	(r214456)
@@ -27,6 +27,7 @@ Additional people who have contributed p
 	Ben Byer			
 	Atsushi Onoe			
 	Ben Smithurst			
+	Bert Vermeulen			
 	Bjoern A. Zeeb			
 	Brent L. Bates			
 	Brian Ginsbach			
@@ -44,11 +45,15 @@ Additional people who have contributed p
 	Daniel Hagerty 			
 	Darren Reed			
 	David Binderman			
+	David Horn			
 	David Smith			
 	David Young			
 	Don Ebright			
 	Eddie Kohler			
+	Elmar Kirchner			
+	Fang Wang			
 	Florent Drouin			
+	Florian Forster			
 	Francis Dupont			
 	Francisco Matias Cuenca-Acuna	
 	Francois-Xavier Le Bail		
@@ -68,8 +73,10 @@ Additional people who have contributed p
 	Heinz-Ado Arnolds		
 	Hendrik Scholz			
 	Ian McDonald			
-        Jacek Tobiasz                   
+	Ilpo Järvinen			
+	Jacek Tobiasz			
 	Jakob Schlyter			
+	Jamal Hadi Salim 		
 	Jan Oravec			
 	Jason R. Thorpe			
 	Jefferson Ogata 		
@@ -78,10 +85,12 @@ Additional people who have contributed p
 	Jim Hutchins			
         Jonathan Heusser                
 	Tatuya Jinmei			
+	João Medeiros			
 	Joerg Mayer			
-	Jørgen Thomsen			 
+	Jørgen Thomsen			 
 	Julian Cowley			
 	Kaarthik Sivakumar		
+	Karl Norby			
 	Kazushi Sugyo			
 	Kelly Carmichael		
 	Ken Hornstein			
@@ -92,7 +101,8 @@ Additional people who have contributed p
 	Larry Lile			
 	Lennert Buytenhek 		
 	Loris Degioanni			
-	Love Hörnquist-Åstrand		
+	Love Hörnquist-Åstrand		
+	Lucas C. Villa Real		
 	Luis Martin Garcia		
 	Maciej W. Rozycki		
 	Manu Pathak			
@@ -100,12 +110,13 @@ Additional people who have contributed p
 	Marc A. Lehmann			
 	Mark Ellzey Thomas		
 	Marko Kiiskila			
-	Markus Schöpflin		
+	Markus Schöpflin		
 	Marshall Rose			
 	Martin Husemann			
 	Max Laier			
 	Michael A. Meffie III		
 	Michael Madore			
+	Michael Riepe			
 	Michael Shalayeff		
 	Michael Shields			
 	Michael T. Stolarchuk		
@@ -132,13 +143,16 @@ Additional people who have contributed p
 	Peter Fales			
 	Peter Jeremy			
 					
+	Peter Volkov			
 	Phil Wood			
 	Rafal Maszkowski		
+	Randy Sofia			
 	Raphael Raimbault		
 	Rick Cheng                      
 	Rick Jones			
 	Rick Watson			
 	Rob Braun			
+	Robert Edmonds			
 	Roderick Schertler		
 	Sagun Shakya			
 	Sami Farin			
@@ -155,11 +169,14 @@ Additional people who have contributed p
 	Terry Kennedy			
 	Timo Koskiahde
 	Tony Li				
+	Toshihiro Kanda			
 	Uns Lider			
 	Victor Oppleman			
 	Wesley Griffin			
+	Wesley Shields			
 	Wilbert de Graaf		
-        Will Drewry                     
+	Will Drewry			
+	William J. Hulley		
 	Yen Yen Lim
 	Yoshifumi Nishida
 

Modified: vendor/tcpdump/dist/INSTALL.txt
==============================================================================
--- vendor/tcpdump/dist/INSTALL.txt	Thu Oct 28 16:22:13 2010	(r214455)
+++ vendor/tcpdump/dist/INSTALL.txt	Thu Oct 28 16:23:25 2010	(r214456)
@@ -1,4 +1,4 @@
-@(#) $Header: /tcpdump/master/tcpdump/INSTALL.txt,v 1.1.2.1 2008-02-06 10:49:22 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/INSTALL.txt,v 1.2 2008-02-06 10:47:53 guy Exp $ (LBL)
 
 If you have not built libpcap, and your system does not have libpcap
 installed, install libpcap first.  Your system might provide a version
@@ -221,6 +221,7 @@ print-tftp.c	- Trivial File Transfer Pro
 print-timed.c	- BSD time daemon protocol printer routines
 print-token.c	- Token Ring printer routines
 print-udp.c	- UDP printer routines
+print-usb.c	- USB printer routines
 print-vjc.c	- PPP Van Jacobson compression (RFC1144) printer routines
 print-vrrp.c	- Virtual Router Redundancy Protocol
 print-wb.c	- White Board printer routines

Added: vendor/tcpdump/dist/Makefile-devel-adds
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/tcpdump/dist/Makefile-devel-adds	Thu Oct 28 16:23:25 2010	(r214456)
@@ -0,0 +1,22 @@
+#
+# Auto-regenerate configure script or Makefile when things change.
+# From autoconf.info .  Works best with GNU Make.
+#
+${srcdir}/configure: configure.in
+	cd ${srcdir} && autoconf
+
+# autoheader might not change config.h.in, so touch a stamp file.
+${srcdir}/config.h.in: ${srcdir}/stamp-h.in
+${srcdir}/stamp-h.in: configure.in acconfig.h
+	cd ${srcdir} && autoheader
+	echo timestamp > ${srcdir}/stamp-h.in
+
+config.h: stamp-h
+stamp-h: ${srcdir}/config.h.in config.status
+	./config.status
+
+Makefile: Makefile.in config.status
+	./config.status
+
+config.status: ${srcdir}/configure
+	./config.status --recheck

Modified: vendor/tcpdump/dist/Makefile.in
==============================================================================
--- vendor/tcpdump/dist/Makefile.in	Thu Oct 28 16:22:13 2010	(r214455)
+++ vendor/tcpdump/dist/Makefile.in	Thu Oct 28 16:23:25 2010	(r214456)
@@ -17,7 +17,7 @@
 #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
-# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.317.2.4 2008-05-27 07:14:26 guy Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.325 2008-11-21 23:17:26 guy Exp $ (LBL)
 
 #
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -77,7 +77,7 @@ CSRC =	addrtoname.c af.c checksum.c cpac
 	print-eap.c print-eigrp.c\
 	print-esp.c print-ether.c print-fddi.c print-fr.c \
 	print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
-	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c \
+	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \
 	print-ipx.c print-isoclns.c print-juniper.c print-krb.c \
 	print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
         print-lmp.c print-lspping.c print-lwapp.c \
@@ -88,9 +88,9 @@ CSRC =	addrtoname.c af.c checksum.c cpac
 	print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \
 	print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
 	print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
-	print-timed.c print-token.c print-udld.c print-udp.c \
-	print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \
-	print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c
+	print-timed.c print-token.c print-udld.c print-udp.c print-usb.c \
+	print-vjc.c print-vqp.c print-vrrp.c print-vtp.c print-forces.c \
+	print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c
 
 LIBNETDISSECT_SRC=print-isakmp.c
 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o)
@@ -128,6 +128,7 @@ HDR = \
 	ethertype.h \
 	extract.h \
 	fddi.h \
+	forces.h \
 	gmpls.h \
 	gmt2local.h \
 	icmp6.h \
@@ -139,6 +140,7 @@ HDR = \
 	ip.h \
 	ip6.h \
 	ipfc.h \
+	ipnet.h \
 	ipproto.h \
 	ipsec_doi.h \
 	ipx.h \
@@ -171,6 +173,7 @@ HDR = \
 	sctpConstants.h \
 	sctpHeader.h \
 	setsignal.h \
+	signature.h \
 	slcompress.h \
 	slip.h \
 	sll.h \
@@ -204,6 +207,7 @@ EXTRA_DIST = \
 	INSTALL.txt \
 	LICENSE \
 	Makefile.in \
+	Makefile-devel-adds \
 	README \
 	Readme.Win32 \
 	VERSION \
@@ -226,7 +230,6 @@ EXTRA_DIST = \
 	missing/bittypes.h \
 	missing/dlnames.c \
 	missing/datalinks.c \
-	missing/getaddrinfo.c \
 	missing/getnameinfo.c \
 	missing/inet_aton.c \
 	missing/inet_ntop.c \
@@ -258,7 +261,83 @@ EXTRA_DIST = \
 	smbutil.c \
 	stime.awk \
 	strcasecmp.c \
-	tcpdump.1 \
+	tcpdump.1.in \
+	tests/02-sunrise-sunset-esp.puu \
+	tests/08-sunrise-sunset-aes.puu \
+	tests/08-sunrise-sunset-esp2.puu \
+	tests/TESTLIST \
+	tests/TESTonce \
+	tests/TESTrun.sh \
+	tests/bgp-infinite-loop.pcap \
+	tests/bgp_vpn_attrset.out \
+	tests/bgp_vpn_attrset.pcap \
+	tests/chdlc-slarp-short.pcap \
+	tests/chdlc-slarp.pcap \
+	tests/dio.out \
+	tests/dio.pcap \
+	tests/e1000g.out \
+	tests/e1000g.pcap \
+	tests/eapon1.gdbinit \
+	tests/eapon1.out \
+	tests/eapon1.puu \
+	tests/eapon2.puu \
+	tests/esp-secrets.txt \
+	tests/esp0.out \
+	tests/esp1.gdbinit \
+	tests/esp1.out \
+	tests/esp2.gdbinit \
+	tests/esp2.out \
+	tests/esp3.gdbinit \
+	tests/esp4.gdbinit \
+	tests/esp5.gdbinit \
+	tests/esp5.out \
+	tests/espudp1.out \
+	tests/espudp1.puu \
+	tests/forces1.out \
+	tests/forces1.pcap \
+	tests/forces1vvv.out \
+	tests/forces1vvvv.out \
+	tests/forces2.out \
+	tests/forces2.pcap \
+	tests/forces2v.out \
+	tests/forces2vv.out \
+	tests/ikev2.puu \
+	tests/ikev2four.out \
+	tests/ikev2four.puu \
+	tests/ikev2fourv.out \
+	tests/ikev2fourv4.out \
+	tests/ikev2pI2-secrets.txt \
+	tests/ikev2pI2.out \
+	tests/ikev2pI2.puu \
+	tests/isakmp-delete-segfault.puu \
+	tests/isakmp-identification-segfault.puu \
+	tests/isakmp-pointer-loop.puu \
+	tests/isakmp1.out \
+	tests/isakmp2.out \
+	tests/isakmp3.out \
+	tests/isakmp4.out \
+	tests/isakmp4500.puu \
+	tests/isis-infinite-loop.pcap \
+	tests/ldp-infinite-loop.pcap \
+	tests/lmp.out \
+	tests/lmp.puu \
+	tests/lmp.sh \
+	tests/lspping-fec-ldp.pcap \
+	tests/lspping-fec-rsvp.pcap \
+	tests/mpls-ldp-hello.out \
+	tests/mpls-ldp-hello.puu \
+	tests/mpls-traceroute.pcap \
+	tests/ospf-gmpls.out \
+	tests/ospf-gmpls.puu \
+	tests/print-A.out \
+	tests/print-AA.out \
+	tests/print-capX.out \
+	tests/print-capXX.out \
+	tests/print-flags.puu \
+	tests/print-flags.sh \
+	tests/print-x.out \
+	tests/print-xx.out \
+	tests/rsvp-infinite-loop.pcap \
 	vfprintf.c \
 	win32/Include/Arpa/tftp.h \
 	win32/Include/errno.h \
@@ -312,14 +391,13 @@ version.o: version.c
 
 version.c: $(srcdir)/VERSION
 	@rm -f $@
-	if grep CVS ${srcdir}/VERSION >/dev/null; then \
+	if grep GIT ${srcdir}/VERSION >/dev/null; then \
 		read ver <${srcdir}/VERSION; \
 		echo $$ver | tr -d '\012'; \
 		date +_%Y_%m_%d; \
 	else \
 		cat ${srcdir}/VERSION; \
-	fi | sed -e 's/.*/char version[] = "&";/' > $@
-
+	fi | sed -e 's/.*/const char version[] = "&";/' > $@
 
 install: all
 	[ -d $(DESTDIR)$(sbindir) ] || \
@@ -328,7 +406,7 @@ install: all
 	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION`
 	[ -d $(DESTDIR)$(mandir)/man1 ] || \
 	    (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
-	$(INSTALL_DATA) $(srcdir)/$(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
+	$(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
 
 uninstall:
 	rm -f $(DESTDIR)$(sbindir)/$(PROG)
@@ -340,11 +418,15 @@ lint: $(GENSRC)
 	    grep -v 'possible pointer alignment problem'
 
 clean:
-	rm -f $(CLEANFILES)
+	rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz
 
 distclean:
 	rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
-	    config.h gnuc.h os-proto.h stamp-h stamp-h.in
+	    config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1
+
+check: tcpdump
+	uudecode --help || (echo "No uudecode program found, not running tests"; echo "apt-get/rpm install sharutils?"; exit 1)
+	(cd tests && ./TESTrun.sh)
 
 tags: $(TAGFILES)
 	ctags -wtd $(TAGFILES)

Modified: vendor/tcpdump/dist/README
==============================================================================
--- vendor/tcpdump/dist/README	Thu Oct 28 16:22:13 2010	(r214455)
+++ vendor/tcpdump/dist/README	Thu Oct 28 16:23:25 2010	(r214456)
@@ -1,19 +1,17 @@
-@(#) $Header: /tcpdump/master/tcpdump/README,v 1.66.2.1 2008-05-30 01:38:20 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/README,v 1.68 2008-12-15 00:05:27 guy Exp $ (LBL)
 
-TCPDUMP 3.9
+TCPDUMP 4.x.y
 Now maintained by "The Tcpdump Group"
 See 		www.tcpdump.org
 
 Please send inquiries/comments/reports to:
 	tcpdump-workers@lists.tcpdump.org
 
-Anonymous CVS is available via:
-	cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master login
-	(password "anoncvs")
-	cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout tcpdump
+Anonymous Git is available via:
+	git clone git://bpf.tcpdump.org/tcpdump
 
-Version 3.9 of TCPDUMP can be retrieved with the CVS tag "tcpdump_3_9rel1":
-	cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_9rel1 tcpdump
+Version 4.x.y of TCPDUMP can be retrieved with the CVS tag "tcpdump_4_xrely":
+	cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_4_xrely tcpdump
 
 Please submit patches against the master copy to the tcpdump project on
 sourceforge.net.

Added: vendor/tcpdump/dist/Readme.Win32
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/tcpdump/dist/Readme.Win32	Thu Oct 28 16:23:25 2010	(r214456)
@@ -0,0 +1,24 @@
+To build tcpdump under Windows, you need:
+
+- version 6 (or higher) of Microsoft Visual Studio or the Cygnus gnu 
+C compiler.
+- The November 2001 (or later) edition of Microsoft Platform 
+Software Development Kit (SDK), that contains some necessary includes 
+for IPv6 support. You can download it from http://www.microsoft.com/sdk
+- the WinPcap source code, that includes libpcap for win32. Download it
+from http://winpcap.polito.it or download libpcap sources from
+http://www.tcpdump.org and follow the instructions in the README.Win32
+file.
+
+First, extract tcpdump and WinPcap in the same folder, and build WinPcap.
+
+The Visual Studio project and the cygwin makefile are in the Win32\prj
+folder.
+
+From Visual Studio, open windump.dsw and build the program. The release 
+version of the WinDump.exe executable file will be created in the 
+windump\win32\prj\release directory . The debug version will be generated
+in windump\win32\prj\debug.
+
+From cygnus, go to windump\win32\prj\ and type "make". WinDump.exe will be
+created in the same directory.
\ No newline at end of file

Modified: vendor/tcpdump/dist/VERSION
==============================================================================
--- vendor/tcpdump/dist/VERSION	Thu Oct 28 16:22:13 2010	(r214455)
+++ vendor/tcpdump/dist/VERSION	Thu Oct 28 16:23:25 2010	(r214456)
@@ -1 +1 @@
-4.0.0
+4.1.1

Modified: vendor/tcpdump/dist/acconfig.h
==============================================================================
--- vendor/tcpdump/dist/acconfig.h	Thu Oct 28 16:22:13 2010	(r214455)
+++ vendor/tcpdump/dist/acconfig.h	Thu Oct 28 16:23:25 2010	(r214456)
@@ -2,32 +2,18 @@
  * make them to acconfig.h and rerun autoheader */
 @TOP@
 
-/* Define if you have SSLeay 0.9.0b with the buggy cast128. */
-#undef HAVE_BUGGY_CAST128
-
 /* Define if you enable IPv6 support */
 #undef INET6
 
 /* Define if you enable support for the libsmi. */
 #undef LIBSMI
 
-/* Define if you have the  header file.  */
-#undef HAVE_SMI_H
-
 /* define if you have struct __res_state_ext */
 #undef HAVE_RES_STATE_EXT
 
 /* define if your struct __res_state has the nsort member */
 #undef HAVE_NEW_RES_STATE
 
-/*
- * define if struct ether_header.ether_dhost is a struct with ether_addr_octet
- */
-#undef ETHER_HEADER_HAS_EA
-
-/* define if struct ether_arp contains arp_xsha */
-#undef ETHER_ARP_HAS_X
-
 /* define if you have the addrinfo function. */
 #undef HAVE_ADDRINFO
 
@@ -43,18 +29,9 @@
 /* define if INADDRSZ is defined (XXX not used!) */
 #undef HAVE_INADDRSZ
 
-/* define if this is a development version, to use additional prototypes. */
-#undef HAVE_OS_PROTO_H
-
-/* define if  defines __P() */
-#undef HAVE_PORTABLE_PROTOTYPE
-
 /* define if RES_USE_INET6 is defined */
 #undef HAVE_RES_USE_INET6
 
-/* define if struct sockaddr has the sa_len member */
-#undef HAVE_SOCKADDR_SA_LEN
-
 /* define if you have struct sockaddr_storage */
 #undef HAVE_SOCKADDR_STORAGE
 
@@ -91,18 +68,6 @@
 /* define if you have getrpcbynumber() */
 #undef HAVE_GETRPCBYNUMBER
 
-/* define if unaligned memory accesses fail */
-#undef LBL_ALIGN
-
-/* The successful return value from signal (?)XXX */
-#undef RETSIGVAL
-
-/* Define this on IRIX */
-#undef _BSD_SIGNALS
-
-/* For HP/UX ANSI compiler? */
-#undef _HPUX_SOURCE
-
 /* AIX hack. */
 #undef _SUN
 
@@ -115,14 +80,6 @@
 /* Whether or not to include the possibly-buggy SMB printer */
 #undef TCPDUMP_DO_SMB
 
-/* Long story short: aclocal.m4 depends on autoconf 2.13
- * implementation details wrt "const"; newer versions
- * have different implementation details so for now we
- * put "const" here.  This may cause duplicate definitions
- * in config.h but that should be OK since they're the same.
- */
-#undef const
-
 /* Define if you have the dnet_htoa function.  */
 #undef HAVE_DNET_HTOA
 

Modified: vendor/tcpdump/dist/aclocal.m4
==============================================================================
--- vendor/tcpdump/dist/aclocal.m4	Thu Oct 28 16:22:13 2010	(r214455)
+++ vendor/tcpdump/dist/aclocal.m4	Thu Oct 28 16:23:25 2010	(r214456)
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.113.2.3 2008-09-25 21:50:04 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.116 2008-09-25 21:45:50 guy Exp $ (LBL)
 dnl
 dnl Copyright (c) 1995, 1996, 1997, 1998
 dnl	The Regents of the University of California.  All rights reserved.
@@ -23,27 +23,23 @@ dnl LBL autoconf macros
 dnl
 
 dnl
-dnl Determine which compiler we're using (cc or gcc)
-dnl If using gcc, determine the version number
-dnl If using cc, require that it support ansi prototypes
-dnl If using gcc, use -O2 (otherwise use -O)
-dnl If using cc, explicitly specify /usr/local/include
+dnl Do whatever AC_LBL_C_INIT work is necessary before using AC_PROG_CC.
 dnl
-dnl usage:
-dnl
-dnl	AC_LBL_C_INIT(copt, incls)
-dnl
-dnl results:
-dnl
-dnl	$1 (copt set)
-dnl	$2 (incls set)
-dnl	CC
-dnl	LDFLAGS
-dnl	ac_cv_lbl_gcc_vers
-dnl	LBL_CFLAGS
-dnl
-AC_DEFUN(AC_LBL_C_INIT,
-    [AC_PREREQ(2.12)
+dnl It appears that newer versions of autoconf (2.64 and later) will,
+dnl if you use AC_TRY_COMPILE in a macro, stick AC_PROG_CC at the
+dnl beginning of the macro, even if the macro itself calls AC_PROG_CC.
+dnl See the "Prerequisite Macros" and "Expanded Before Required" sections
+dnl in the Autoconf documentation.
+dnl
+dnl This causes a steaming heap of fail in our case, as we were, in
+dnl AC_LBL_C_INIT, doing the tests we now do in AC_LBL_C_INIT_BEFORE_CC,
+dnl calling AC_PROG_CC, and then doing the tests we now do in
+dnl AC_LBL_C_INIT.  Now, we run AC_LBL_C_INIT_BEFORE_CC, AC_PROG_CC,
+dnl and AC_LBL_C_INIT at the top level.
+dnl
+AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC,
+    [AC_PREREQ(2.50)
+    AC_BEFORE([$0], [AC_LBL_C_INIT])
     AC_BEFORE([$0], [AC_PROG_CC])
     AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
     AC_BEFORE([$0], [AC_LBL_DEVEL])
@@ -72,7 +68,33 @@ AC_DEFUN(AC_LBL_C_INIT,
 	    CC=cc
 	    export CC
     fi
-    AC_PROG_CC
+])
+
+dnl
+dnl Determine which compiler we're using (cc or gcc)
+dnl If using gcc, determine the version number
+dnl If using cc, require that it support ansi prototypes
+dnl If using gcc, use -O2 (otherwise use -O)
+dnl If using cc, explicitly specify /usr/local/include
+dnl
+dnl usage:
+dnl
+dnl	AC_LBL_C_INIT(copt, incls)
+dnl
+dnl results:
+dnl
+dnl	$1 (copt set)
+dnl	$2 (incls set)
+dnl	CC
+dnl	LDFLAGS
+dnl	ac_cv_lbl_gcc_vers
+dnl	LBL_CFLAGS
+dnl
+AC_DEFUN(AC_LBL_C_INIT,
+    [AC_PREREQ(2.50)
+    AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
+    AC_BEFORE([$0], [AC_LBL_DEVEL])
+    AC_BEFORE([$0], [AC_LBL_SHLIBS_INIT])
     if test "$GCC" = yes ; then
 	    if test "$SHLICC2" = yes ; then
 		    ac_cv_lbl_gcc_vers=2
@@ -117,8 +139,26 @@ AC_DEFUN(AC_LBL_C_INIT,
 				    AC_MSG_ERROR(see the INSTALL doc for more info)
 			    fi
 			    CFLAGS="$savedcflags"
-			    V_CCOPT="-Aa $V_CCOPT"
-			    AC_DEFINE(_HPUX_SOURCE)
+			    $1="-Aa $$1"
+			    AC_DEFINE(_HPUX_SOURCE,1,[needed on HP-UX])
+			    ;;
+
+		    osf*)
+			    AC_MSG_CHECKING(for ansi mode in DEC compiler ($CC -std1))
+			    savedcflags="$CFLAGS"
+			    CFLAGS="-std1"
+			    AC_CACHE_VAL(ac_cv_lbl_cc_osf1_cc_std1,
+				AC_TRY_COMPILE(
+				    [#include ],
+				    [int frob(int, char *)],
+				    ac_cv_lbl_cc_osf1_cc_std1=yes,
+				    ac_cv_lbl_cc_osf1_cc_std1=no))
+			    AC_MSG_RESULT($ac_cv_lbl_cc_osf1_cc_std1)
+			    if test $ac_cv_lbl_cc_osf1_cc_std1 = no ; then
+				    AC_MSG_ERROR(see the INSTALL doc for more info)
+			    fi
+			    CFLAGS="$savedcflags"
+			    $1="-std1 $$1"
 			    ;;
 
 		    *)
@@ -132,11 +172,15 @@ AC_DEFUN(AC_LBL_C_INIT,
 	    case "$host_os" in
 
 	    irix*)
-		    V_CCOPT="$V_CCOPT -xansi -signed -O"
+		    $1="$$1 -xansi -signed -O"
 		    ;;
 
 	    osf*)
-		    V_CCOPT="$V_CCOPT -std1 -O"
+	    	    #
+		    # Presumed to be DEC OSF/1, Digital UNIX, or
+		    # Tru64 UNIX.
+		    #
+		    $1="$$1 -O"
 		    ;;
 
 	    ultrix*)
@@ -150,14 +194,14 @@ AC_DEFUN(AC_LBL_C_INIT,
 			    ac_cv_lbl_cc_const_proto=no))
 		    AC_MSG_RESULT($ac_cv_lbl_cc_const_proto)
 		    if test $ac_cv_lbl_cc_const_proto = no ; then
-			    AC_DEFINE(const,)
+			    AC_DEFINE(const,[],
+			        [to handle Ultrix compilers that don't support const in prototypes])
 		    fi
 		    ;;
 	    esac
     fi
 ])
 
-
 #
 # Try compiling a sample of the type of code that appears in
 # gencode.c with "inline", "__inline__", and "__inline".
@@ -167,8 +211,13 @@ AC_DEFUN(AC_LBL_C_INIT,
 # at least some versions of HP's C compiler can inline that, but can't
 # inline a function that returns a struct pointer.
 #
+# Make sure we use the V_CCOPT flags, because some of those might
+# disable inlining.
+#
 AC_DEFUN(AC_LBL_C_INLINE,
     [AC_MSG_CHECKING(for inline)
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$V_CCOPT"
     AC_CACHE_VAL(ac_cv_lbl_inline, [
 	ac_cv_lbl_inline=""
 	ac_lbl_cc_inline=no
@@ -196,6 +245,7 @@ AC_DEFUN(AC_LBL_C_INLINE,
 	if test "$ac_lbl_cc_inline" = yes ; then
 	    ac_cv_lbl_inline=$ac_lbl_inline
 	fi])
+    CFLAGS="$save_CFLAGS"
     if test ! -z "$ac_cv_lbl_inline" ; then
 	AC_MSG_RESULT($ac_cv_lbl_inline)
     else
@@ -238,9 +288,10 @@ AC_DEFUN(AC_LBL_LIBPCAP,
     libpcap=FAIL
     lastdir=FAIL
     places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
-	egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
+	egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
     for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do
-	    basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//'`
+	    basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
+	        sed -e 's/-PRE-GIT$//' `
 	    if test $lastdir = $basedir ; then
 		    dnl skip alphas when an actual release is present
 		    continue;
@@ -254,43 +305,60 @@ AC_DEFUN(AC_LBL_LIBPCAP,
     done
     if test $libpcap = FAIL ; then
 	    AC_MSG_RESULT(not found)
-	    AC_CHECK_LIB(pcap, main, libpcap="-lpcap")
-	    if test $libpcap = FAIL ; then
+
+	    #
+	    # Look for pcap-config.
+	    #
+	    AC_PATH_PROG(PCAP_CONFIG, pcap-config)
+	    if test -n "$PCAP_CONFIG" ; then
+		#
+		# Found - use it to get the include flags for
+		# libpcap and the flags to link with libpcap.
+		#
+		$2="`\"$PCAP_CONFIG\" --cflags` $$2"
+		libpcap="`\"$PCAP_CONFIG\" --libs`"
+	    else
+		#
+		# Not found; look for pcap.
+		#
+		AC_CHECK_LIB(pcap, main, libpcap="-lpcap")
+		if test $libpcap = FAIL ; then
 		    AC_MSG_ERROR(see the INSTALL doc for more info)
-	    fi
-	    dnl
-	    dnl Some versions of Red Hat Linux put "pcap.h" in
-	    dnl "/usr/include/pcap"; had the LBL folks done so,
-	    dnl that would have been a good idea, but for
-	    dnl the Red Hat folks to do so just breaks source
-	    dnl compatibility with other systems.
-	    dnl
-	    dnl We work around this by assuming that, as we didn't
-	    dnl find a local libpcap, libpcap is in /usr/lib or
-	    dnl /usr/local/lib and that the corresponding header
-	    dnl file is under one of those directories; if we don't
-	    dnl find it in either of those directories, we check to
-	    dnl see if it's in a "pcap" subdirectory of them and,
-	    dnl if so, add that subdirectory to the "-I" list.
-	    dnl
-	    dnl (We now also put pcap.h in /usr/include/pcap, but we
-	    dnl leave behind a /usr/include/pcap.h that includes it,
-	    dnl so you can still just include .)
-	    dnl
-	    AC_MSG_CHECKING(for extraneous pcap header directories)
-	    if test \( ! -r /usr/local/include/pcap.h \) -a \
+		fi
+		dnl
+		dnl Some versions of Red Hat Linux put "pcap.h" in
+		dnl "/usr/include/pcap"; had the LBL folks done so,
+		dnl that would have been a good idea, but for
+		dnl the Red Hat folks to do so just breaks source
+		dnl compatibility with other systems.
+		dnl
+		dnl We work around this by assuming that, as we didn't
+		dnl find a local libpcap, libpcap is in /usr/lib or
+		dnl /usr/local/lib and that the corresponding header
+		dnl file is under one of those directories; if we don't
+		dnl find it in either of those directories, we check to
+		dnl see if it's in a "pcap" subdirectory of them and,
+		dnl if so, add that subdirectory to the "-I" list.
+		dnl
+		dnl (We now also put pcap.h in /usr/include/pcap, but we
+		dnl leave behind a /usr/include/pcap.h that includes it,
+		dnl so you can still just include .)
+		dnl
+		AC_MSG_CHECKING(for extraneous pcap header directories)
+		if test \( ! -r /usr/local/include/pcap.h \) -a \
 			\( ! -r /usr/include/pcap.h \); then
-		if test -r /usr/local/include/pcap/pcap.h; then
-		    d="/usr/local/include/pcap"
-		elif test -r /usr/include/pcap/pcap.h; then
-		    d="/usr/include/pcap"
+		    if test -r /usr/local/include/pcap/pcap.h; then
+			d="/usr/local/include/pcap"
+		    elif test -r /usr/include/pcap/pcap.h; then
+			d="/usr/include/pcap"
+		    fi
+		fi
+		if test -z "$d" ; then
+		    AC_MSG_RESULT(not found)
+		else
+		    $2="-I$d $$2"
+		    AC_MSG_RESULT(found -- -I$d added)
 		fi
-	    fi
-	    if test -z "$d" ; then
-		AC_MSG_RESULT(not found)
-	    else
-		$2="-I$d $$2"
-		AC_MSG_RESULT(found -- -I$d added)
 	    fi
     else
 	    $1=$libpcap
@@ -304,26 +372,50 @@ AC_DEFUN(AC_LBL_LIBPCAP,
                     AC_MSG_ERROR(cannot find pcap.h, see INSTALL)
  	    fi
 	    AC_MSG_RESULT($libpcap)
+	    AC_PATH_PROG(PCAP_CONFIG, pcap-config,, $d)
+	    if test -n "$PCAP_CONFIG"; then
+		#
+		# The libpcap directory has a pcap-config script.
+		# Use it to get any additioal libraries needed
+		# to link with the libpcap archive library in
+		# that directory
+		#
+		libpcap="$libpcap `\"$PCAP_CONFIG\" --additional-libs --static`"
+	    fi
     fi
     LIBS="$libpcap $LIBS"
-    case "$host_os" in
+    if ! test -n "$PCAP_CONFIG" ; then
+	#
+	# We don't have pcap-config; find out any additional link flags
+	# we need.  (If we have pcap-config, we assume it tells us what
+	# we need.)
+	#
+	case "$host_os" in
 
-    aix*)
+	aix*)
+	    #
+	    # If libpcap is DLPI-based, we have to use /lib/pse.exp if
+	    # present, as we use the STREAMS routines.
+	    #
+	    # (XXX - true only if we're linking with a static libpcap?)
+	    #
 	    pseexe="/lib/pse.exp"
 	    AC_MSG_CHECKING(for $pseexe)
 	    if test -f $pseexe ; then
 		    AC_MSG_RESULT(yes)
 		    LIBS="$LIBS -I:$pseexe"
 	    fi
+
+	    #
+	    # If libpcap is BPF-based, we need "-lodm" and "-lcfg", as
+	    # we use them to load the BPF module.
 	    #
-	    # We need "-lodm" and "-lcfg", as libpcap requires them on
-	    # AIX, and we just build a static libpcap.a and thus can't
-	    # arrange that when you link with libpcap you automatically
-	    # link with those libraries.
+	    # (XXX - true only if we're linking with a static libpcap?)
 	    #
 	    LIBS="$LIBS -lodm -lcfg"
 	    ;;
-    esac
+	esac
+    fi
 
     dnl
     dnl Check for "pcap_list_datalinks()", "pcap_set_datalink()",
@@ -383,14 +475,14 @@ AC_DEFUN(AC_LBL_TYPE_SIGNAL,
     [AC_BEFORE([$0], [AC_LBL_LIBPCAP])
     AC_TYPE_SIGNAL
     if test "$ac_cv_type_signal" = void ; then
-	    AC_DEFINE(RETSIGVAL,)
+	    AC_DEFINE(RETSIGVAL,[],[return value of signal handlers])
     else
-	    AC_DEFINE(RETSIGVAL,(0))
+	    AC_DEFINE(RETSIGVAL,(0),[return value of signal handlers])
     fi
     case "$host_os" in
 
     irix*)
-	    AC_DEFINE(_BSD_SIGNALS)
+	    AC_DEFINE(_BSD_SIGNALS,1,[get BSD semantics on Irix])
 	    ;;
 
     *)
@@ -439,65 +531,6 @@ AC_DEFUN(AC_LBL_FIXINCLUDES,
     fi])
 
 dnl
-dnl Check for flex, default to lex
-dnl Require flex 2.4 or higher
-dnl Check for bison, default to yacc
-dnl Default to lex/yacc if both flex and bison are not available
-dnl Define the yy prefix string if using flex and bison
-dnl
-dnl usage:
-dnl
-dnl	AC_LBL_LEX_AND_YACC(lex, yacc, yyprefix)
-dnl
-dnl results:
-dnl
-dnl	$1 (lex set)
-dnl	$2 (yacc appended)
-dnl	$3 (optional flex and bison -P prefix)
-dnl
-AC_DEFUN(AC_LBL_LEX_AND_YACC,
-    [AC_ARG_WITH(flex, [  --without-flex          don't use flex])
-    AC_ARG_WITH(bison, [  --without-bison         don't use bison])
-    if test "$with_flex" = no ; then
-	    $1=lex
-    else
-	    AC_CHECK_PROGS($1, flex, lex)
-    fi
-    if test "$$1" = flex ; then
-	    # The -V flag was added in 2.4
-	    AC_MSG_CHECKING(for flex 2.4 or higher)
-	    AC_CACHE_VAL(ac_cv_lbl_flex_v24,
-		if flex -V >/dev/null 2>&1; then
-			ac_cv_lbl_flex_v24=yes
-		else
-			ac_cv_lbl_flex_v24=no
-		fi)
-	    AC_MSG_RESULT($ac_cv_lbl_flex_v24)
-	    if test $ac_cv_lbl_flex_v24 = no ; then
-		    s="2.4 or higher required"
-		    AC_MSG_WARN(ignoring obsolete flex executable ($s))
-		    $1=lex
-	    fi
-    fi
-    if test "$with_bison" = no ; then
-	    $2=yacc
-    else
-	    AC_CHECK_PROGS($2, bison, yacc)
-    fi
-    if test "$$2" = bison ; then
-	    $2="$$2 -y"
-    fi
-    if test "$$1" != lex -a "$$2" = yacc -o "$$1" = lex -a "$$2" != yacc ; then
-	    AC_MSG_WARN(don't have both flex and bison; reverting to lex/yacc)
-	    $1=lex
-	    $2=yacc
-    fi
-    if test "$$1" = flex -a -n "$3" ; then
-	    $1="$$1 -P$3"
-	    $2="$$2 -p $3"
-    fi])
-
-dnl
 dnl Checks to see if union wait is used with WEXITSTATUS()
 dnl
 dnl usage:
@@ -521,9 +554,9 @@ AC_DEFUN(AC_LBL_UNION_WAIT,
 	    ac_cv_lbl_union_wait=yes))
     AC_MSG_RESULT($ac_cv_lbl_union_wait)
     if test $ac_cv_lbl_union_wait = yes ; then
-	    AC_DEFINE(DECLWAITSTATUS,union wait)
+	    AC_DEFINE(DECLWAITSTATUS,union wait,[type for wait])
     else
-	    AC_DEFINE(DECLWAITSTATUS,int)
+	    AC_DEFINE(DECLWAITSTATUS,int,[type for wait])
     fi])
 
 dnl
@@ -538,7 +571,7 @@ dnl
 dnl	HAVE_SOCKADDR_SA_LEN (defined)
 dnl
 AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN,
-    [AC_MSG_CHECKING(if sockaddr struct has sa_len member)
+    [AC_MSG_CHECKING(if sockaddr struct has the sa_len member)
     AC_CACHE_VAL(ac_cv_lbl_sockaddr_has_sa_len,
 	AC_TRY_COMPILE([
 #	include 
@@ -548,7 +581,7 @@ AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN,
 	ac_cv_lbl_sockaddr_has_sa_len=no))
     AC_MSG_RESULT($ac_cv_lbl_sockaddr_has_sa_len)
     if test $ac_cv_lbl_sockaddr_has_sa_len = yes ; then
-	    AC_DEFINE(HAVE_SOCKADDR_SA_LEN)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 16:31: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 E7B49106566C;
	Thu, 28 Oct 2010 16:31:39 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D4EA68FC1C;
	Thu, 28 Oct 2010 16:31: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 o9SGVdka014928;
	Thu, 28 Oct 2010 16:31:39 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SGVdtZ014923;
	Thu, 28 Oct 2010 16:31:39 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 28 Oct 2010 16:31: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: r214457 - 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, 28 Oct 2010 16:31:40 -0000

Author: attilio
Date: Thu Oct 28 16:31:39 2010
New Revision: 214457
URL: http://svn.freebsd.org/changeset/base/214457

Log:
  Merge nexus.c from amd64 and i386 to x86 subtree.
  
  Sponsored by:	Sandvine Incorporated
  Tested by:	gianni

Added:
  head/sys/x86/x86/nexus.c
     - copied, changed from r214446, head/sys/i386/i386/nexus.c
Deleted:
  head/sys/amd64/amd64/nexus.c
  head/sys/i386/i386/nexus.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	Thu Oct 28 16:23:25 2010	(r214456)
+++ head/sys/conf/files.amd64	Thu Oct 28 16:31:39 2010	(r214457)
@@ -121,7 +121,6 @@ amd64/amd64/minidump_machdep.c	standard
 amd64/amd64/mp_machdep.c	optional	smp
 amd64/amd64/mp_watchdog.c	optional	mp_watchdog smp
 amd64/amd64/mpboot.S		optional	smp
-amd64/amd64/nexus.c		standard
 amd64/amd64/pmap.c		standard
 amd64/amd64/prof_machdep.c	optional	profiling-routine
 amd64/amd64/sigtramp.S		standard
@@ -325,3 +324,4 @@ x86/x86/mca.c			standard
 x86/x86/mptable.c		optional	mptable
 x86/x86/mptable_pci.c		optional	mptable pci
 x86/x86/msi.c			optional	pci
+x86/x86/nexus.c			standard

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Thu Oct 28 16:23:25 2010	(r214456)
+++ head/sys/conf/files.i386	Thu Oct 28 16:31:39 2010	(r214457)
@@ -290,7 +290,6 @@ i386/xen/mp_machdep.c		optional xen smp
 i386/i386/mp_watchdog.c		optional mp_watchdog smp
 i386/i386/mpboot.s		optional smp native
 i386/xen/mptable.c		optional apic xen
-i386/i386/nexus.c		standard
 i386/i386/perfmon.c		optional perfmon
 i386/i386/pmap.c		optional native
 i386/xen/pmap.c			optional xen
@@ -399,3 +398,4 @@ x86/x86/mca.c			standard
 x86/x86/mptable.c		optional apic native
 x86/x86/mptable_pci.c		optional apic pci
 x86/x86/msi.c			optional apic pci
+x86/x86/nexus.c			standard

Modified: head/sys/conf/files.pc98
==============================================================================
--- head/sys/conf/files.pc98	Thu Oct 28 16:23:25 2010	(r214456)
+++ head/sys/conf/files.pc98	Thu Oct 28 16:31:39 2010	(r214457)
@@ -156,7 +156,6 @@ i386/i386/mp_clock.c		optional smp
 i386/i386/mp_machdep.c		optional smp
 i386/i386/mp_watchdog.c		optional mp_watchdog smp
 i386/i386/mpboot.s		optional smp
-i386/i386/nexus.c		standard
 i386/i386/perfmon.c		optional perfmon
 i386/i386/pmap.c		standard
 i386/i386/ptrace_machdep.c	standard
@@ -259,3 +258,4 @@ x86/x86/mca.c			standard
 x86/x86/mptable.c		optional apic
 x86/x86/mptable_pci.c		optional apic pci
 x86/x86/msi.c			optional apic pci
+x86/x86/nexus.c			standard

Copied and modified: head/sys/x86/x86/nexus.c (from r214446, head/sys/i386/i386/nexus.c)
==============================================================================
--- head/sys/i386/i386/nexus.c	Thu Oct 28 07:58:06 2010	(r214446, copy source)
+++ head/sys/x86/x86/nexus.c	Thu Oct 28 16:31:39 2010	(r214457)
@@ -41,13 +41,20 @@ __FBSDID("$FreeBSD$");
  * and I/O memory address space.
  */
 
+#ifdef __amd64__
+#define	DEV_APIC
+#else
 #include "opt_apic.h"
+#endif
 #include "opt_isa.h"
 
 #include 
 #include 
 #include 
 #include 
+#ifdef __amd64__
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -60,6 +67,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef __amd64__
+#include 
+#include 
+#endif
 #include 
 #include 
 
@@ -77,6 +88,14 @@ __FBSDID("$FreeBSD$");
 #endif
 #include 
 
+#ifdef __amd64__
+#define	RMAN_BUS_SPACE_IO	AMD64_BUS_SPACE_IO
+#define	RMAN_BUS_SPACE_MEM	AMD64_BUS_SPACE_MEM
+#else
+#define	RMAN_BUS_SPACE_IO	I386_BUS_SPACE_IO
+#define	RMAN_BUS_SPACE_MEM	I386_BUS_SPACE_MEM
+#endif
+
 static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
 
 #define DEVTONX(dev)	((struct nexus_device *)device_get_ivars(dev))
@@ -416,7 +435,7 @@ nexus_activate_resource(device_t bus, de
 #else
 		rman_set_bushandle(r, rman_get_start(r));
 #endif
-		rman_set_bustag(r, I386_BUS_SPACE_IO);
+		rman_set_bustag(r, RMAN_BUS_SPACE_IO);
 		break;
 	case SYS_RES_MEMORY:
 #ifdef PC98
@@ -427,7 +446,7 @@ nexus_activate_resource(device_t bus, de
 #endif
 		vaddr = pmap_mapdev(rman_get_start(r), rman_get_size(r));
 		rman_set_virtual(r, vaddr);
-		rman_set_bustag(r, I386_BUS_SPACE_MEM);
+		rman_set_bustag(r, RMAN_BUS_SPACE_MEM);
 #ifdef PC98
 		/* PC-98: the type of bus_space_handle_t is the structure. */
 		bh->bsh_base = (bus_addr_t) vaddr;
@@ -649,6 +668,42 @@ ram_probe(device_t dev)
 	return (0);
 }
 
+#ifdef __amd64__
+static int
+ram_attach(device_t dev)
+{
+	struct bios_smap *smapbase, *smap, *smapend;
+	struct resource *res;
+	caddr_t kmdp;
+	uint32_t smapsize;
+	int error, rid;
+
+	/* Retrieve the system memory map from the loader. */
+	kmdp = preload_search_by_type("elf kernel");
+	if (kmdp == NULL)
+		kmdp = preload_search_by_type("elf64 kernel");  
+	smapbase = (struct bios_smap *)preload_search_info(kmdp,
+	    MODINFO_METADATA | MODINFOMD_SMAP);
+	smapsize = *((u_int32_t *)smapbase - 1);
+	smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
+
+	rid = 0;
+	for (smap = smapbase; smap < smapend; smap++) {
+		if (smap->type != SMAP_TYPE_MEMORY || smap->length == 0)
+			continue;
+		error = bus_set_resource(dev, SYS_RES_MEMORY, rid, smap->base,
+		    smap->length);
+		if (error)
+			panic("ram_attach: resource %d failed set with %d", rid,
+			    error);
+		res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0);
+		if (res == NULL)
+			panic("ram_attach: resource %d failed to attach", rid);
+		rid++;
+	}
+	return (0);
+}
+#else
 static int
 ram_attach(device_t dev)
 {
@@ -688,6 +743,7 @@ ram_attach(device_t dev)
 	}
 	return (0);
 }
+#endif
 
 static device_method_t ram_methods[] = {
 	/* Device interface */

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 16:46: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 71448106566C;
	Thu, 28 Oct 2010 16:46:27 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5F30C8FC1D;
	Thu, 28 Oct 2010 16:46: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 o9SGkR0v016902;
	Thu, 28 Oct 2010 16:46:27 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SGkRki016900;
	Thu, 28 Oct 2010 16:46:27 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281646.o9SGkRki016900@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 16:46:27 +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: r214458 - 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: Thu, 28 Oct 2010 16:46:27 -0000

Author: tuexen
Date: Thu Oct 28 16:46:27 2010
New Revision: 214458
URL: http://svn.freebsd.org/changeset/base/214458

Log:
  MFC r210495:
  
  Fix a bug where the length of a FORWARD-TSN chunk was set incorrectly in
  the chunk. This resulted in malformed frames.
  Remove a duplicate assignment.

Modified:
  stable/8/sys/netinet/sctp_output.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)

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 16:31:39 2010	(r214457)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 16:46:27 2010	(r214458)
@@ -2281,7 +2281,6 @@ sctp_is_ifa_addr_acceptable(struct sctp_
 {
 	uint8_t dest_is_global = 0;
 
-
 	/*
 	 * Here we determine if its a acceptable address. A acceptable
 	 * address means it is the same scope or higher scope but we can
@@ -9813,7 +9812,8 @@ sctp_fill_in_rest:
 			 * peer ack point
 			 */
 			advance_peer_ack_point = last->rec.data.TSN_seq;
-			space_needed -= (cnt_of_skipped * sizeof(struct sctp_strseq));
+			space_needed = sizeof(struct sctp_forward_tsn_chunk) +
+			    cnt_of_skipped * sizeof(struct sctp_strseq);
 		}
 		chk->send_size = space_needed;
 		/* Setup the chunk */
@@ -9822,8 +9822,6 @@ sctp_fill_in_rest:
 		fwdtsn->ch.chunk_flags = 0;
 		fwdtsn->ch.chunk_type = SCTP_FORWARD_CUM_TSN;
 		fwdtsn->new_cumulative_tsn = htonl(advance_peer_ack_point);
-		chk->send_size = (sizeof(struct sctp_forward_tsn_chunk) +
-		    (cnt_of_skipped * sizeof(struct sctp_strseq)));
 		SCTP_BUF_LEN(chk->data) = chk->send_size;
 		fwdtsn++;
 		/*-

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 16:49: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 D0D25106564A;
	Thu, 28 Oct 2010 16:49:11 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BEA9A8FC12;
	Thu, 28 Oct 2010 16:49: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 o9SGnBpF017082;
	Thu, 28 Oct 2010 16:49:11 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SGnB3E017080;
	Thu, 28 Oct 2010 16:49:11 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281649.o9SGnB3E017080@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 16:49:11 +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: r214459 - 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: Thu, 28 Oct 2010 16:49:11 -0000

Author: tuexen
Date: Thu Oct 28 16:49:11 2010
New Revision: 214459
URL: http://svn.freebsd.org/changeset/base/214459

Log:
  MFC r210714:
  
  Cleanup code.

Modified:
  stable/8/sys/netinet/sctp_output.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)

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 16:46:27 2010	(r214458)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 16:49:11 2010	(r214459)
@@ -9748,8 +9748,7 @@ sctp_fill_in_rest:
 		unsigned int cnt_of_skipped = 0;
 
 		TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) {
-			if ((at->sent != SCTP_FORWARD_TSN_SKIP)	/* && (at->sent !=
-			        SCTP_DATAGRAM_ACKED) */ ) {
+			if (at->sent != SCTP_FORWARD_TSN_SKIP) {
 				/* no more to look at */
 				break;
 			}

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 16:51: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 9DF99106564A;
	Thu, 28 Oct 2010 16:51:57 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 713948FC0A;
	Thu, 28 Oct 2010 16:51: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 o9SGpvC1017246;
	Thu, 28 Oct 2010 16:51:57 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SGpvDI017244;
	Thu, 28 Oct 2010 16:51:57 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281651.o9SGpvDI017244@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 16:51:57 +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: r214460 - 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: Thu, 28 Oct 2010 16:51:57 -0000

Author: tuexen
Date: Thu Oct 28 16:51:57 2010
New Revision: 214460
URL: http://svn.freebsd.org/changeset/base/214460

Log:
  MFC r210866:
  
  Fix a bug where endpoints bound to wildcard addresses where
  using addresses not announced to the peer due to address
  scoping.

Modified:
  stable/8/sys/netinet/sctp_output.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)

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 16:49:11 2010	(r214459)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 16:51:57 2010	(r214460)
@@ -2740,6 +2740,15 @@ sctp_select_nth_preferred_addr_from_ifn_
 			}
 		}
 		if (stcb) {
+			if (sctp_is_address_in_scope(ifa,
+			    stcb->asoc.ipv4_addr_legal,
+			    stcb->asoc.ipv6_addr_legal,
+			    stcb->asoc.loopback_scope,
+			    stcb->asoc.ipv4_local_scope,
+			    stcb->asoc.local_scope,
+			    stcb->asoc.site_scope, 0) == 0) {
+				continue;
+			}
 			if (((non_asoc_addr_ok == 0) &&
 			    (sctp_is_addr_restricted(stcb, sifa))) ||
 			    (non_asoc_addr_ok &&
@@ -2783,6 +2792,15 @@ sctp_count_num_preferred_boundall(struct
 			continue;
 		}
 		if (stcb) {
+			if (sctp_is_address_in_scope(ifa,
+			    stcb->asoc.ipv4_addr_legal,
+			    stcb->asoc.ipv6_addr_legal,
+			    stcb->asoc.loopback_scope,
+			    stcb->asoc.ipv4_local_scope,
+			    stcb->asoc.local_scope,
+			    stcb->asoc.site_scope, 0) == 0) {
+				continue;
+			}
 			if (((non_asoc_addr_ok == 0) &&
 			    (sctp_is_addr_restricted(stcb, sifa))) ||
 			    (non_asoc_addr_ok &&
@@ -2963,6 +2981,15 @@ bound_all_plan_b:
 		if (sifa == NULL)
 			continue;
 		if (stcb) {
+			if (sctp_is_address_in_scope(sifa,
+			    stcb->asoc.ipv4_addr_legal,
+			    stcb->asoc.ipv6_addr_legal,
+			    stcb->asoc.loopback_scope,
+			    stcb->asoc.ipv4_local_scope,
+			    stcb->asoc.local_scope,
+			    stcb->asoc.site_scope, 0) == 0) {
+				continue;
+			}
 			if (((non_asoc_addr_ok == 0) &&
 			    (sctp_is_addr_restricted(stcb, sifa))) ||
 			    (non_asoc_addr_ok &&
@@ -3005,6 +3032,15 @@ plan_d:
 			if (sifa == NULL)
 				continue;
 			if (stcb) {
+				if (sctp_is_address_in_scope(sifa,
+				    stcb->asoc.ipv4_addr_legal,
+				    stcb->asoc.ipv6_addr_legal,
+				    stcb->asoc.loopback_scope,
+				    stcb->asoc.ipv4_local_scope,
+				    stcb->asoc.local_scope,
+				    stcb->asoc.site_scope, 0) == 0) {
+					continue;
+				}
 				if (((non_asoc_addr_ok == 0) &&
 				    (sctp_is_addr_restricted(stcb, sifa))) ||
 				    (non_asoc_addr_ok &&

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 16:53: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 E737B106566B;
	Thu, 28 Oct 2010 16:53:54 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D516F8FC15;
	Thu, 28 Oct 2010 16:53: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 o9SGrswF017374;
	Thu, 28 Oct 2010 16:53:54 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SGrsVT017372;
	Thu, 28 Oct 2010 16:53:54 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281653.o9SGrsVT017372@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 16:53: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: r214461 - 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, 28 Oct 2010 16:53:55 -0000

Author: tuexen
Date: Thu Oct 28 16:53:54 2010
New Revision: 214461
URL: http://svn.freebsd.org/changeset/base/214461

Log:
  MFC r211030:
  Fix a bug where MSG_TRUNC was not returned in all necessary cases for
  SOCK_DGRAM socket. MSG_TRUNC was only returned when some mbufs could
  not be copied to the application. If some data was left in the last
  mbuf, it was correctly discarded, but MSG_TRUNC was not set.

Modified:
  stable/8/sys/kern/uipc_socket.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)

Modified: stable/8/sys/kern/uipc_socket.c
==============================================================================
--- stable/8/sys/kern/uipc_socket.c	Thu Oct 28 16:51:57 2010	(r214460)
+++ stable/8/sys/kern/uipc_socket.c	Thu Oct 28 16:53:54 2010	(r214461)
@@ -2225,7 +2225,12 @@ soreceive_dgram(struct socket *so, struc
 			m_freem(m);
 			return (error);
 		}
-		m = m_free(m);
+		if (len == m->m_len)
+			m = m_free(m);
+		else {
+			m->m_data += len;
+			m->m_len -= len;
+		}
 	}
 	if (m != NULL)
 		flags |= MSG_TRUNC;

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 16:57: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 BDCD5106566B;
	Thu, 28 Oct 2010 16:57:48 +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 8E18F8FC1F;
	Thu, 28 Oct 2010 16:57:48 +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 3DA5346B49;
	Thu, 28 Oct 2010 12:57:48 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 20B3E8A009;
	Thu, 28 Oct 2010 12:57:47 -0400 (EDT)
From: John Baldwin 
To: Attilio Rao 
Date: Thu, 28 Oct 2010 12:57:05 -0400
User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; )
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
In-Reply-To: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201010281257.05481.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Thu, 28 Oct 2010 12:57:47 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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, 28 Oct 2010 16:57:48 -0000

On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
> Author: attilio
> Date: Thu Oct 28 16:31:39 2010
> New Revision: 214457
> URL: http://svn.freebsd.org/changeset/base/214457
> 
> Log:
>   Merge nexus.c from amd64 and i386 to x86 subtree.
>   
>   Sponsored by:	Sandvine Incorporated
>   Tested by:	gianni
> 
> Added:
>   head/sys/x86/x86/nexus.c
>      - copied, changed from r214446, head/sys/i386/i386/nexus.c
> Deleted:
>   head/sys/amd64/amd64/nexus.c
>   head/sys/i386/i386/nexus.c
> Modified:
>   head/sys/conf/files.amd64
>   head/sys/conf/files.i386
>   head/sys/conf/files.pc98
> 
==============================================================================
> --- head/sys/conf/files.pc98	Thu Oct 28 16:23:25 2010	(r214456)
> +++ head/sys/conf/files.pc98	Thu Oct 28 16:31:39 2010	(r214457)
> @@ -156,7 +156,6 @@ i386/i386/mp_clock.c		optional smp
>  i386/i386/mp_machdep.c		optional smp
>  i386/i386/mp_watchdog.c		optional mp_watchdog smp
>  i386/i386/mpboot.s		optional smp
> -i386/i386/nexus.c		standard
>  i386/i386/perfmon.c		optional perfmon
>  i386/i386/pmap.c		standard
>  i386/i386/ptrace_machdep.c	standard
> @@ -259,3 +258,4 @@ x86/x86/mca.c			standard
>  x86/x86/mptable.c		optional apic
>  x86/x86/mptable_pci.c		optional apic pci
>  x86/x86/msi.c			optional apic pci
> +x86/x86/nexus.c			standard
> 
> Copied and modified: head/sys/x86/x86/nexus.c (from r214446, 
head/sys/i386/i386/nexus.c)
> 
==============================================================================
> --- head/sys/i386/i386/nexus.c	Thu Oct 28 07:58:06 2010	(r214446, copy 
source)
> +++ head/sys/x86/x86/nexus.c	Thu Oct 28 16:31:39 2010	(r214457)
> @@ -41,13 +41,20 @@ __FBSDID("$FreeBSD$");
>   * and I/O memory address space.
>   */
>  
> +#ifdef __amd64__
> +#define	DEV_APIC
> +#else
>  #include "opt_apic.h"
> +#endif
>  #include "opt_isa.h"
>  
>  #include 
>  #include 
>  #include 
>  #include 
> +#ifdef __amd64__
> +#include 
> +#endif
>  #include 
>  #include 
>  #include 
> @@ -60,6 +67,10 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  
> +#ifdef __amd64__
> +#include 
> +#include 
> +#endif
>  #include 
>  #include 
>  
> @@ -77,6 +88,14 @@ __FBSDID("$FreeBSD$");
>  #endif
>  #include 
>  
> +#ifdef __amd64__
> +#define	RMAN_BUS_SPACE_IO	AMD64_BUS_SPACE_IO
> +#define	RMAN_BUS_SPACE_MEM	AMD64_BUS_SPACE_MEM
> +#else
> +#define	RMAN_BUS_SPACE_IO	I386_BUS_SPACE_IO
> +#define	RMAN_BUS_SPACE_MEM	I386_BUS_SPACE_MEM
> +#endif
> +

Perhaps we should be using X86_BUS_SPACE_* instead?

> @@ -649,6 +668,42 @@ ram_probe(device_t dev)
>  	return (0);
>  }
>  
> +#ifdef __amd64__
> +static int
> +ram_attach(device_t dev)
> +{
> +	struct bios_smap *smapbase, *smap, *smapend;
> +	struct resource *res;
> +	caddr_t kmdp;
> +	uint32_t smapsize;
> +	int error, rid;
> +
> +	/* Retrieve the system memory map from the loader. */
> +	kmdp = preload_search_by_type("elf kernel");
> +	if (kmdp == NULL)
> +		kmdp = preload_search_by_type("elf64 kernel");  
> +	smapbase = (struct bios_smap *)preload_search_info(kmdp,
> +	    MODINFO_METADATA | MODINFOMD_SMAP);
> +	smapsize = *((u_int32_t *)smapbase - 1);
> +	smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
> +
> +	rid = 0;
> +	for (smap = smapbase; smap < smapend; smap++) {
> +		if (smap->type != SMAP_TYPE_MEMORY || smap->length == 0)
> +			continue;
> +		error = bus_set_resource(dev, SYS_RES_MEMORY, rid, smap->base,
> +		    smap->length);
> +		if (error)
> +			panic("ram_attach: resource %d failed set with %d", rid,
> +			    error);
> +		res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0);
> +		if (res == NULL)
> +			panic("ram_attach: resource %d failed to attach", rid);
> +		rid++;
> +	}
> +	return (0);
> +}
> +#else
>  static int
>  ram_attach(device_t dev)
>  {
> @@ -688,6 +743,7 @@ ram_attach(device_t dev)
>  	}
>  	return (0);
>  }
> +#endif

It would be better to merge these two routines.  The loader now passes the 
smap to i386 kernels as well, so ram_attach() should probably be changed to 
try the amd64 approach first and if that fails fall back to using the 
phys_avail[] array instead.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 16:58: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 753D11065673;
	Thu, 28 Oct 2010 16:58:13 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 61C8A8FC1A;
	Thu, 28 Oct 2010 16:58: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 o9SGwDPV017622;
	Thu, 28 Oct 2010 16:58:13 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SGwD1c017608;
	Thu, 28 Oct 2010 16:58:13 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281658.o9SGwD1c017608@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 16:58: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: r214462 - in stable/8/sys: netinet netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 16:58:13 -0000

Author: tuexen
Date: Thu Oct 28 16:58:12 2010
New Revision: 214462
URL: http://svn.freebsd.org/changeset/base/214462

Log:
  MFC 211944:
  
  Fix the switching on/off of CMT using sysctl and socket option.
  Fix the switching on/off of PF and NR-SACKs using sysctl.
  Add minor improvement in handling malloc failures.
  Improve the address checks when sending.

Modified:
  stable/8/sys/netinet/sctp.h
  stable/8/sys/netinet/sctp_cc_functions.c
  stable/8/sys/netinet/sctp_indata.c
  stable/8/sys/netinet/sctp_input.c
  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_peeloff.c
  stable/8/sys/netinet/sctp_timer.c
  stable/8/sys/netinet/sctp_usrreq.c
  stable/8/sys/netinet/sctputil.c
  stable/8/sys/netinet6/sctp6_usrreq.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)

Modified: stable/8/sys/netinet/sctp.h
==============================================================================
--- stable/8/sys/netinet/sctp.h	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp.h	Thu Oct 28 16:58:12 2010	(r214462)
@@ -155,10 +155,8 @@ struct sctp_paramhdr {
 /* CMT ON/OFF socket option */
 #define SCTP_CMT_ON_OFF                 0x00001200
 #define SCTP_CMT_USE_DAC                0x00001201
-/* EY - NR_SACK on/off socket option */
-#define SCTP_NR_SACK_ON_OFF                 0x00001300
 /* JRS - Pluggable Congestion Control Socket option */
-#define SCTP_PLUGGABLE_CC				0x00001202
+#define SCTP_PLUGGABLE_CC               0x00001202
 
 /* read only */
 #define SCTP_GET_SNDBUF_USE		0x00001101

Modified: stable/8/sys/netinet/sctp_cc_functions.c
==============================================================================
--- stable/8/sys/netinet/sctp_cc_functions.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp_cc_functions.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -71,7 +71,8 @@ sctp_cwnd_update_after_fr(struct sctp_tc
 	 * (net->fast_retran_loss_recovery == 0)))
 	 */
 	TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
-		if ((asoc->fast_retran_loss_recovery == 0) || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 1)) {
+		if ((asoc->fast_retran_loss_recovery == 0) ||
+		    (asoc->sctp_cmt_on_off == 1)) {
 			/* out of a RFC2582 Fast recovery window? */
 			if (net->net_ack > 0) {
 				/*
@@ -232,11 +233,11 @@ sctp_cwnd_update_after_sack(struct sctp_
 			 * 
 			 * Should we stop any running T3 timer here?
 			 */
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) &&
-			    SCTP_BASE_SYSCTL(sctp_cmt_pf) &&
+			if ((asoc->sctp_cmt_on_off == 1) &&
+			    (asoc->sctp_cmt_pf > 0) &&
 			    ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) {
 				net->dest_state &= ~SCTP_ADDR_PF;
-				net->cwnd = net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf);
+				net->cwnd = net->mtu * asoc->sctp_cmt_pf;
 				SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n",
 				    net, net->cwnd);
 				/*
@@ -260,7 +261,9 @@ sctp_cwnd_update_after_sack(struct sctp_
 		 */
 #endif
 
-		if (asoc->fast_retran_loss_recovery && will_exit == 0 && SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) {
+		if (asoc->fast_retran_loss_recovery &&
+		    (will_exit == 0) &&
+		    (asoc->sctp_cmt_on_off == 0)) {
 			/*
 			 * If we are in loss recovery we skip any cwnd
 			 * update
@@ -271,7 +274,8 @@ sctp_cwnd_update_after_sack(struct sctp_
 		 * CMT: CUC algorithm. Update cwnd if pseudo-cumack has
 		 * moved.
 		 */
-		if (accum_moved || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && net->new_pseudo_cumack)) {
+		if (accum_moved ||
+		    ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) {
 			/* If the cumulative ack moved we can proceed */
 			if (net->cwnd <= net->ssthresh) {
 				/* We are in slow start */
@@ -697,7 +701,8 @@ sctp_hs_cwnd_update_after_fr(struct sctp
 	 * (net->fast_retran_loss_recovery == 0)))
 	 */
 	TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
-		if ((asoc->fast_retran_loss_recovery == 0) || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 1)) {
+		if ((asoc->fast_retran_loss_recovery == 0) ||
+		    (asoc->sctp_cmt_on_off == 1)) {
 			/* out of a RFC2582 Fast recovery window? */
 			if (net->net_ack > 0) {
 				/*
@@ -850,11 +855,11 @@ sctp_hs_cwnd_update_after_sack(struct sc
 			 * 
 			 * Should we stop any running T3 timer here?
 			 */
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) &&
-			    SCTP_BASE_SYSCTL(sctp_cmt_pf) &&
+			if ((asoc->sctp_cmt_on_off == 1) &&
+			    (asoc->sctp_cmt_pf > 0) &&
 			    ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) {
 				net->dest_state &= ~SCTP_ADDR_PF;
-				net->cwnd = net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf);
+				net->cwnd = net->mtu * asoc->sctp_cmt_pf;
 				SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n",
 				    net, net->cwnd);
 				/*
@@ -878,7 +883,9 @@ sctp_hs_cwnd_update_after_sack(struct sc
 		 */
 #endif
 
-		if (asoc->fast_retran_loss_recovery && will_exit == 0 && SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) {
+		if (asoc->fast_retran_loss_recovery &&
+		    (will_exit == 0) &&
+		    (asoc->sctp_cmt_on_off == 0)) {
 			/*
 			 * If we are in loss recovery we skip any cwnd
 			 * update
@@ -889,7 +896,8 @@ sctp_hs_cwnd_update_after_sack(struct sc
 		 * CMT: CUC algorithm. Update cwnd if pseudo-cumack has
 		 * moved.
 		 */
-		if (accum_moved || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && net->new_pseudo_cumack)) {
+		if (accum_moved ||
+		    ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) {
 			/* If the cumulative ack moved we can proceed */
 			if (net->cwnd <= net->ssthresh) {
 				/* We are in slow start */
@@ -1333,11 +1341,11 @@ sctp_htcp_cwnd_update_after_sack(struct 
 			 * 
 			 * Should we stop any running T3 timer here?
 			 */
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) &&
-			    SCTP_BASE_SYSCTL(sctp_cmt_pf) &&
+			if ((asoc->sctp_cmt_on_off == 1) &&
+			    (asoc->sctp_cmt_pf > 0) &&
 			    ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) {
 				net->dest_state &= ~SCTP_ADDR_PF;
-				net->cwnd = net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf);
+				net->cwnd = net->mtu * asoc->sctp_cmt_pf;
 				SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n",
 				    net, net->cwnd);
 				/*
@@ -1361,7 +1369,9 @@ sctp_htcp_cwnd_update_after_sack(struct 
 		 */
 #endif
 
-		if (asoc->fast_retran_loss_recovery && will_exit == 0 && SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) {
+		if (asoc->fast_retran_loss_recovery &&
+		    will_exit == 0 &&
+		    (asoc->sctp_cmt_on_off == 0)) {
 			/*
 			 * If we are in loss recovery we skip any cwnd
 			 * update
@@ -1372,7 +1382,8 @@ sctp_htcp_cwnd_update_after_sack(struct 
 		 * CMT: CUC algorithm. Update cwnd if pseudo-cumack has
 		 * moved.
 		 */
-		if (accum_moved || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && net->new_pseudo_cumack)) {
+		if (accum_moved ||
+		    ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) {
 			htcp_cong_avoid(stcb, net);
 			measure_achieved_throughput(stcb, net);
 		} else {
@@ -1412,7 +1423,8 @@ sctp_htcp_cwnd_update_after_fr(struct sc
 	 * (net->fast_retran_loss_recovery == 0)))
 	 */
 	TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
-		if ((asoc->fast_retran_loss_recovery == 0) || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 1)) {
+		if ((asoc->fast_retran_loss_recovery == 0) ||
+		    (asoc->sctp_cmt_on_off == 1)) {
 			/* out of a RFC2582 Fast recovery window? */
 			if (net->net_ack > 0) {
 				/*

Modified: stable/8/sys/netinet/sctp_indata.c
==============================================================================
--- stable/8/sys/netinet/sctp_indata.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp_indata.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -2475,7 +2475,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 		    (stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq)	/* hit limit of pkts */
 		    ) {
 
-			if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off)) &&
+			if ((stcb->asoc.sctp_cmt_on_off == 1) &&
 			    (SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) &&
 			    (stcb->asoc.send_sack == 0) &&
 			    (stcb->asoc.numduptsns == 0) &&
@@ -3265,7 +3265,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 	}
 
 	/* CMT DAC algo: finding out if SACK is a mixed SACK */
-	if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
+	if ((asoc->sctp_cmt_on_off == 1) &&
+	    SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
 		TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
 			if (net->saw_newack)
 				num_dests_sacked++;
@@ -3381,7 +3382,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 			if (tp1->sent < SCTP_DATAGRAM_RESEND) {
 				tp1->sent++;
 			}
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
+			if ((asoc->sctp_cmt_on_off == 1) &&
+			    SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
 				/*
 				 * CMT DAC algorithm: If SACK flag is set to
 				 * 0, then lowest_newack test will not pass
@@ -3405,7 +3407,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 					tp1->sent++;
 				}
 			}
-		} else if ((tp1->rec.data.doing_fast_retransmit) && (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) {
+		} else if ((tp1->rec.data.doing_fast_retransmit) &&
+		    (asoc->sctp_cmt_on_off == 0)) {
 			/*
 			 * For those that have done a FR we must take
 			 * special consideration if we strike. I.e the
@@ -3445,7 +3448,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 						tp1->sent++;
 					}
 					strike_flag = 1;
-					if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
+					if ((asoc->sctp_cmt_on_off == 1) &&
+					    SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
 						/*
 						 * CMT DAC algorithm: If
 						 * SACK flag is set to 0,
@@ -3505,7 +3509,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 			if (tp1->sent < SCTP_DATAGRAM_RESEND) {
 				tp1->sent++;
 			}
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
+			if ((asoc->sctp_cmt_on_off == 1) &&
+			    SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
 				/*
 				 * CMT DAC algorithm: If SACK flag is set to
 				 * 0, then lowest_newack test will not pass
@@ -3584,7 +3589,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 				SCTP_STAT_INCR(sctps_sendmultfastretrans);
 			}
 			sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
+			if (asoc->sctp_cmt_on_off == 1) {
 				/*
 				 * CMT: Using RTX_SSTHRESH policy for CMT.
 				 * If CMT is being used, then pick dest with
@@ -3593,7 +3598,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 				tp1->no_fr_allowed = 1;
 				alt = tp1->whoTo;
 				/* sa_ignore NO_NULL_CHK */
-				if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) {
+				if (asoc->sctp_cmt_pf > 0) {
 					/*
 					 * JRS 5/18/07 - If CMT PF is on,
 					 * use the PF version of
@@ -4800,7 +4805,7 @@ sctp_handle_sack(struct mbuf *m, int off
 	/*******************************************/
 	/* cancel ALL T3-send timer if accum moved */
 	/*******************************************/
-	if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
+	if (asoc->sctp_cmt_on_off == 1) {
 		TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
 			if (net->new_pseudo_cumack)
 				sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
@@ -5100,7 +5105,9 @@ done_with_it:
 	 * to be done. Setting this_sack_lowest_newack to the cum_ack will
 	 * automatically ensure that.
 	 */
-	if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac) && (cmt_dac_flag == 0)) {
+	if ((asoc->sctp_cmt_on_off == 1) &&
+	    SCTP_BASE_SYSCTL(sctp_cmt_use_dac) &&
+	    (cmt_dac_flag == 0)) {
 		this_sack_lowest_newack = cum_ack;
 	}
 	if ((num_seg > 0) || (num_nr_seg > 0)) {

Modified: stable/8/sys/netinet/sctp_input.c
==============================================================================
--- stable/8/sys/netinet/sctp_input.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp_input.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -618,16 +618,16 @@ sctp_handle_heartbeat_ack(struct sctp_he
 	 * timer is running, for the destination, stop the timer because a
 	 * PF-heartbeat was received.
 	 */
-	if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) &&
-	    SCTP_BASE_SYSCTL(sctp_cmt_pf) &&
-	    (net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) {
+	if ((stcb->asoc.sctp_cmt_on_off == 1) &&
+	    (stcb->asoc.sctp_cmt_pf > 0) &&
+	    ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) {
 		if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) {
 			sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
 			    stcb, net,
 			    SCTP_FROM_SCTP_INPUT + SCTP_LOC_5);
 		}
 		net->dest_state &= ~SCTP_ADDR_PF;
-		net->cwnd = net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf);
+		net->cwnd = net->mtu * stcb->asoc.sctp_cmt_pf;
 		SCTPDBG(SCTP_DEBUG_INPUT1, "Destination %p moved from PF to reachable with cwnd %d.\n",
 		    net, net->cwnd);
 	}
@@ -2723,6 +2723,7 @@ sctp_handle_cookie_echo(struct mbuf *m, 
 			inp->sctp_mobility_features = (*inp_p)->sctp_mobility_features;
 			inp->sctp_socket = so;
 			inp->sctp_frag_point = (*inp_p)->sctp_frag_point;
+			inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off;
 			inp->partial_delivery_point = (*inp_p)->partial_delivery_point;
 			inp->sctp_context = (*inp_p)->sctp_context;
 			inp->inp_starting_point_for_iterator = NULL;
@@ -3067,7 +3068,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;
@@ -4586,8 +4587,6 @@ process_control_chunks:
 			return (NULL);
 			break;
 		case SCTP_SELECTIVE_ACK:
-			SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n");
-			SCTP_STAT_INCR(sctps_recvsacks);
 			{
 				struct sctp_sack_chunk *sack;
 				int abort_now = 0;
@@ -4597,6 +4596,8 @@ process_control_chunks:
 				int offset_seg, offset_dup;
 				int nonce_sum_flag;
 
+				SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n");
+				SCTP_STAT_INCR(sctps_recvsacks);
 				if (stcb == NULL) {
 					SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing SACK chunk\n");
 					break;
@@ -4673,8 +4674,6 @@ process_control_chunks:
 			 * nr_sack chunk
 			 */
 		case SCTP_NR_SELECTIVE_ACK:
-			SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n");
-			SCTP_STAT_INCR(sctps_recvsacks);
 			{
 				struct sctp_nr_sack_chunk *nr_sack;
 				int abort_now = 0;
@@ -4684,13 +4683,10 @@ process_control_chunks:
 				int offset_seg, offset_dup;
 				int nonce_sum_flag;
 
-				/*
-				 * EY nr_sacks have not been negotiated but
-				 * the peer end sent an nr_sack, silently
-				 * discard the chunk
-				 */
-				if (!(SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-				    stcb->asoc.peer_supports_nr_sack)) {
+				SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n");
+				SCTP_STAT_INCR(sctps_recvsacks);
+				if ((stcb->asoc.sctp_nr_sack_on_off == 0) ||
+				    (stcb->asoc.peer_supports_nr_sack == 0)) {
 					goto unknown_chunk;
 				}
 				if (stcb == NULL) {

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -3686,7 +3686,8 @@ sctp_lowlevel_chunk_output(struct sctp_i
 						 * Stop any running T3
 						 * timers here?
 						 */
-						if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) {
+						if ((stcb->asoc.sctp_cmt_on_off == 1) &&
+						    (stcb->asoc.sctp_cmt_pf > 0)) {
 							net->dest_state &= ~SCTP_ADDR_PF;
 							SCTPDBG(SCTP_DEBUG_OUTPUT1, "Destination %p moved from PF to unreachable.\n",
 							    net);
@@ -4323,11 +4324,7 @@ sctp_send_initiate(struct sctp_inpcb *in
 	if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) {
 		pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION;
 	}
-	/*
-	 * EY  if the initiator supports nr_sacks, need to report that to
-	 * responder in INIT chunk
-	 */
-	if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)) {
+	if (stcb->asoc.sctp_nr_sack_on_off == 1) {
 		pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK;
 	}
 	p_len = sizeof(*pr_supported) + num_ext;
@@ -5447,10 +5444,6 @@ do_a_abort:
 	pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET;
 	if (!SCTP_BASE_SYSCTL(sctp_auth_disable))
 		pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION;
-	/*
-	 * EY  if the sysctl variable is set, tell the assoc. initiator that
-	 * we do nr_sack
-	 */
 	if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off))
 		pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK;
 	p_len = sizeof(*pr_supported) + num_ext;
@@ -7267,7 +7260,8 @@ sctp_fill_outqueue(struct sctp_tcb *stcb
 		if (sp == NULL) {
 			break;
 		}
-		if ((sp->net != net) && (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) {
+		if ((sp->net != net) &&
+		    (asoc->sctp_cmt_on_off == 0)) {
 			/* none for this network */
 			if (locked) {
 				break;
@@ -7326,11 +7320,11 @@ sctp_fill_outqueue(struct sctp_tcb *stcb
 		*quit_now = 1;
 
 	if (total_moved == 0) {
-		if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) &&
+		if ((stcb->asoc.sctp_cmt_on_off == 0) &&
 		    (net == stcb->asoc.primary_destination)) {
 			/* ran dry for primary network net */
 			SCTP_STAT_INCR(sctps_primary_randry);
-		} else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
+		} else if (stcb->asoc.sctp_cmt_on_off == 1) {
 			/* ran dry with CMT on */
 			SCTP_STAT_INCR(sctps_cmt_randry);
 		}
@@ -7363,7 +7357,8 @@ sctp_move_to_an_alt(struct sctp_tcb *stc
 	 * destination using the PF algorithm for finding alternate
 	 * destinations.
 	 */
-	if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) {
+	if ((asoc->sctp_cmt_on_off == 1) &&
+	    (asoc->sctp_cmt_pf > 0)) {
 		a_net = sctp_find_alternate_net(stcb, net, 2);
 	} else {
 		a_net = sctp_find_alternate_net(stcb, net, 0);
@@ -7499,7 +7494,8 @@ sctp_med_chunk_output(struct sctp_inpcb 
 				}
 				continue;
 			}
-			if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) && (net->ref_count < 2)) {
+			if ((asoc->sctp_cmt_on_off == 0) &&
+			    (net->ref_count < 2)) {
 				/* nothing can be in queue for this guy */
 				if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) {
 					sctp_log_cwnd(stcb, net, 2,
@@ -7534,7 +7530,7 @@ sctp_med_chunk_output(struct sctp_inpcb 
 		*reason_code = 8;
 		return (0);
 	}
-	if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
+	if (asoc->sctp_cmt_on_off == 1) {
 		/* get the last start point */
 		start_at = asoc->last_net_cmt_send_started;
 		if (start_at == NULL) {
@@ -7560,7 +7556,7 @@ again_one_more_time:
 			break;
 		}
 		tsns_sent = 0xa;
-		if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) && (net->ref_count < 2)) {
+		if ((asoc->sctp_cmt_on_off == 0) && (net->ref_count < 2)) {
 			/*
 			 * Ref-count of 1 so we cannot have data or control
 			 * queued to this address. Skip it (non-CMT).
@@ -8034,15 +8030,15 @@ again_one_more_time:
 			}
 		}
 		/* JRI: if dest is in PF state, do not send data to it */
-		if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) &&
-		    SCTP_BASE_SYSCTL(sctp_cmt_pf) &&
+		if ((asoc->sctp_cmt_on_off == 1) &&
+		    (asoc->sctp_cmt_pf > 0) &&
 		    (net->dest_state & SCTP_ADDR_PF)) {
 			goto no_data_fill;
 		}
 		if (net->flight_size >= net->cwnd) {
 			goto no_data_fill;
 		}
-		if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off)) &&
+		if ((asoc->sctp_cmt_on_off == 1) &&
 		    (net->flight_size > max_rwnd_per_dest)) {
 			goto no_data_fill;
 		}
@@ -8096,7 +8092,7 @@ again_one_more_time:
 					break;
 				}
 				nchk = TAILQ_NEXT(chk, sctp_next);
-				if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
+				if (asoc->sctp_cmt_on_off == 1) {
 					if (chk->whoTo != net) {
 						/*
 						 * For CMT, steal the data
@@ -8271,8 +8267,8 @@ no_data_fill:
 				 * restart it.
 				 */
 				sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net);
-			} else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) &&
-				    SCTP_BASE_SYSCTL(sctp_cmt_pf) &&
+			} else if ((asoc->sctp_cmt_on_off == 1) &&
+				    (asoc->sctp_cmt_pf > 0) &&
 				    pf_hbflag &&
 				    ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) &&
 			    (!SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer))) {
@@ -9579,8 +9575,8 @@ sctp_chunk_output(struct sctp_inpcb *inp
 			 */
 			if (net->ref_count > 1)
 				sctp_move_to_an_alt(stcb, asoc, net);
-		} else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) &&
-			    SCTP_BASE_SYSCTL(sctp_cmt_pf) &&
+		} else if ((asoc->sctp_cmt_on_off == 1) &&
+			    (asoc->sctp_cmt_pf > 0) &&
 		    ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) {
 			/*
 			 * JRS 5/14/07 - If CMT PF is on and the current
@@ -9926,8 +9922,8 @@ sctp_send_sack(struct sctp_tcb *stcb)
 	uint8_t flags;
 	uint8_t type;
 
-	if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-	    stcb->asoc.peer_supports_nr_sack) {
+	if ((stcb->asoc.sctp_nr_sack_on_off == 1) &&
+	    (stcb->asoc.peer_supports_nr_sack == 1)) {
 		type = SCTP_NR_SELECTIVE_ACK;
 	} else {
 		type = SCTP_SELECTIVE_ACK;
@@ -10071,7 +10067,8 @@ sctp_send_sack(struct sctp_tcb *stcb)
 	else
 		flags = 0;
 
-	if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
+	if ((asoc->sctp_cmt_on_off == 1) &&
+	    SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) {
 		/*-
 		 * CMT DAC algorithm: If 2 (i.e., 0x10) packets have been
 		 * received, then set high bit to 1, else 0. Reset
@@ -10839,7 +10836,8 @@ sctp_send_hb(struct sctp_tcb *stcb, int 
 	 * heartbeat is being sent is in PF state, do NOT do threshold
 	 * management.
 	 */
-	if ((SCTP_BASE_SYSCTL(sctp_cmt_pf) == 0) || ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF)) {
+	if ((stcb->asoc.sctp_cmt_pf == 0) ||
+	    ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF)) {
 		/* ok we have a destination that needs a beat */
 		/* lets do the theshold management Qiaobing style */
 		if (sctp_threshold_management(stcb->sctp_ep, stcb, net,
@@ -12105,7 +12103,7 @@ sctp_sosend(struct socket *so,
 	struct sctp_sndrcvinfo srcv;
 	struct sockaddr *addr_to_use;
 
-#ifdef INET6
+#if defined(INET) && defined(INET6)
 	struct sockaddr_in sin;
 
 #endif
@@ -12120,7 +12118,7 @@ sctp_sosend(struct socket *so,
 		}
 	}
 	addr_to_use = addr;
-#if defined(INET6)  && !defined(__Userspace__)	/* TODO port in6_sin6_2_sin */
+#if defined(INET) && defined(INET6)
 	if ((addr) && (addr->sa_family == AF_INET6)) {
 		struct sockaddr_in6 *sin6;
 
@@ -12212,20 +12210,33 @@ sctp_lower_sosend(struct socket *so,
 	SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %d\n",
 	    addr,
 	    sndlen);
-	/*-
+	/**
 	 * Pre-screen address, if one is given the sin-len
 	 * must be set correctly!
 	 */
 	if (addr) {
-		if ((addr->sa_family == AF_INET) &&
-		    (addr->sa_len != sizeof(struct sockaddr_in))) {
-			SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
-			error = EINVAL;
-			goto out_unlocked;
-		} else if ((addr->sa_family == AF_INET6) &&
-		    (addr->sa_len != sizeof(struct sockaddr_in6))) {
-			SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
-			error = EINVAL;
+		switch (addr->sa_family) {
+#if defined(INET)
+		case AF_INET:
+			if (addr->sa_len != sizeof(struct sockaddr_in)) {
+				SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
+				error = EINVAL;
+				goto out_unlocked;
+			}
+			break;
+#endif
+#if defined(INET6)
+		case AF_INET6:
+			if (addr->sa_len != sizeof(struct sockaddr_in6)) {
+				SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
+				error = EINVAL;
+				goto out_unlocked;
+			}
+			break;
+#endif
+		default:
+			SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EAFNOSUPPORT);
+			error = EAFNOSUPPORT;
 			goto out_unlocked;
 		}
 	}
@@ -12657,7 +12668,8 @@ sctp_lower_sosend(struct socket *so,
 		error = EINVAL;
 		goto out_unlocked;
 	}
-	if ((net->flight_size > net->cwnd) && (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) {
+	if ((net->flight_size > net->cwnd) &&
+	    (asoc->sctp_cmt_on_off == 0)) {
 		/*-
 		 * CMT: Added check for CMT above. net above is the primary
 		 * dest. If CMT is ON, sender should always attempt to send
@@ -13075,7 +13087,7 @@ skip_preblock:
 				goto skip_out_eof;
 			}
 			if ((net->flight_size > net->cwnd) &&
-			    (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) {
+			    (asoc->sctp_cmt_on_off == 0)) {
 				queue_only = 1;
 			} else if (asoc->ifp_had_enobuf) {
 				SCTP_STAT_INCR(sctps_ifnomemqueued);
@@ -13349,7 +13361,7 @@ skip_out_eof:
 		some_on_control = 1;
 	}
 	if ((net->flight_size > net->cwnd) &&
-	    (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) {
+	    (stcb->asoc.sctp_cmt_on_off == 0)) {
 		queue_only = 1;
 	} else if (asoc->ifp_had_enobuf) {
 		SCTP_STAT_INCR(sctps_ifnomemqueued);

Modified: stable/8/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -2385,6 +2385,7 @@ sctp_inpcb_alloc(struct socket *so, uint
 	inp->sctp_associd_counter = 1;
 	inp->partial_delivery_point = SCTP_SB_LIMIT_RCV(so) >> SCTP_PARTIAL_DELIVERY_SHIFT;
 	inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT;
+	inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off);
 	/* init the small hash table we use to track asocid <-> tcb */
 	inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark);
 	if (inp->sctp_asocidhash == NULL) {
@@ -6241,10 +6242,7 @@ sctp_load_addresses_from_init(struct sct
 					stcb->asoc.peer_supports_pktdrop = 1;
 					break;
 				case SCTP_NR_SELECTIVE_ACK:
-					if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off))
-						stcb->asoc.peer_supports_nr_sack = 1;
-					else
-						stcb->asoc.peer_supports_nr_sack = 0;
+					stcb->asoc.peer_supports_nr_sack = 1;
 					break;
 				case SCTP_STREAM_RESET:
 					stcb->asoc.peer_supports_strreset = 1;

Modified: stable/8/sys/netinet/sctp_pcb.h
==============================================================================
--- stable/8/sys/netinet/sctp_pcb.h	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp_pcb.h	Thu Oct 28 16:58:12 2010	(r214462)
@@ -389,6 +389,7 @@ struct sctp_inpcb {
 	uint32_t sctp_frag_point;
 	uint32_t partial_delivery_point;
 	uint32_t sctp_context;
+	uint32_t sctp_cmt_on_off;
 	struct sctp_nonpad_sndrcvinfo def_send;
 	/*-
 	 * These three are here for the sosend_dgram

Modified: stable/8/sys/netinet/sctp_peeloff.c
==============================================================================
--- stable/8/sys/netinet/sctp_peeloff.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp_peeloff.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -112,6 +112,7 @@ sctp_do_peeloff(struct socket *head, str
 	n_inp->sctp_features = inp->sctp_features;
 	n_inp->sctp_mobility_features = inp->sctp_mobility_features;
 	n_inp->sctp_frag_point = inp->sctp_frag_point;
+	n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off;
 	n_inp->partial_delivery_point = inp->partial_delivery_point;
 	n_inp->sctp_context = inp->sctp_context;
 	n_inp->inp_starting_point_for_iterator = NULL;
@@ -183,6 +184,7 @@ sctp_get_peeloff(struct socket *head, sc
 	    (SCTP_PCB_COPY_FLAGS & inp->sctp_flags));
 	n_inp->sctp_features = inp->sctp_features;
 	n_inp->sctp_frag_point = inp->sctp_frag_point;
+	n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off;
 	n_inp->partial_delivery_point = inp->partial_delivery_point;
 	n_inp->sctp_context = inp->sctp_context;
 	n_inp->inp_starting_point_for_iterator = NULL;

Modified: stable/8/sys/netinet/sctp_timer.c
==============================================================================
--- stable/8/sys/netinet/sctp_timer.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp_timer.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -215,7 +215,8 @@ sctp_threshold_management(struct sctp_in
 				 * not in PF state.
 				 */
 				/* Stop any running T3 timers here? */
-				if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) {
+				if ((stcb->asoc.sctp_cmt_on_off == 1) &&
+				    (stcb->asoc.sctp_cmt_pf > 0)) {
 					net->dest_state &= ~SCTP_ADDR_PF;
 					SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n",
 					    net);
@@ -419,7 +420,7 @@ sctp_find_alternate_net(struct sctp_tcb 
 				return (net);
 			}
 			min_errors_net->dest_state &= ~SCTP_ADDR_PF;
-			min_errors_net->cwnd = min_errors_net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf);
+			min_errors_net->cwnd = min_errors_net->mtu * stcb->asoc.sctp_cmt_pf;
 			if (SCTP_OS_TIMER_PENDING(&min_errors_net->rxt_timer.timer)) {
 				sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
 				    stcb, min_errors_net,
@@ -843,7 +844,7 @@ start_again:
 			/*
 			 * CMT: Do not allow FRs on retransmitted TSNs.
 			 */
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 1) {
+			if (stcb->asoc.sctp_cmt_on_off == 1) {
 				chk->no_fr_allowed = 1;
 			}
 #ifdef THIS_SHOULD_NOT_BE_DONE
@@ -1038,7 +1039,8 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp,
 	 * addition, find an alternate destination with PF-based
 	 * find_alt_net().
 	 */
-	if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) {
+	if ((stcb->asoc.sctp_cmt_on_off == 1) &&
+	    (stcb->asoc.sctp_cmt_pf > 0)) {
 		if ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF) {
 			net->dest_state |= SCTP_ADDR_PF;
 			net->last_active = sctp_get_tick_count();
@@ -1046,7 +1048,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp,
 			    net);
 		}
 		alt = sctp_find_alternate_net(stcb, net, 2);
-	} else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
+	} else if (stcb->asoc.sctp_cmt_on_off == 1) {
 		/*
 		 * CMT: Using RTX_SSTHRESH policy for CMT. If CMT is being
 		 * used, then pick dest with largest ssthresh for any
@@ -1162,7 +1164,9 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp,
 				net->dest_state |= SCTP_ADDR_WAS_PRIMARY;
 			}
 		}
-	} else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf) && (net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) {
+	} else if ((stcb->asoc.sctp_cmt_on_off == 1) &&
+		    (stcb->asoc.sctp_cmt_pf > 0) &&
+	    ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) {
 		/*
 		 * JRS 5/14/07 - If the destination hasn't failed completely
 		 * but is in PF state, a PF-heartbeat needs to be sent

Modified: stable/8/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/8/sys/netinet/sctp_usrreq.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctp_usrreq.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -300,7 +300,8 @@ sctp_notify(struct sctp_inpcb *inp,
 			 * PF state.
 			 */
 			/* Stop any running T3 timers here? */
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) {
+			if ((stcb->asoc.sctp_cmt_on_off == 1) &&
+			    (stcb->asoc.sctp_cmt_pf > 0)) {
 				net->dest_state &= ~SCTP_ADDR_PF;
 				SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n",
 				    net);
@@ -1717,42 +1718,14 @@ flags_out:
 			struct sctp_assoc_value *av;
 
 			SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize);
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
-				SCTP_FIND_STCB(inp, stcb, av->assoc_id);
-				if (stcb) {
-					av->assoc_value = stcb->asoc.sctp_cmt_on_off;
-					SCTP_TCB_UNLOCK(stcb);
-
-				} else {
-					SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
-					error = ENOTCONN;
-				}
-			} else {
-				SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
-				error = ENOPROTOOPT;
-			}
-			*optsize = sizeof(*av);
-		}
-		break;
-		/* EY - set socket option for nr_sacks  */
-	case SCTP_NR_SACK_ON_OFF:
-		{
-			struct sctp_assoc_value *av;
-
-			SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize);
-			if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)) {
-				SCTP_FIND_STCB(inp, stcb, av->assoc_id);
-				if (stcb) {
-					av->assoc_value = stcb->asoc.sctp_nr_sack_on_off;
-					SCTP_TCB_UNLOCK(stcb);
-
-				} else {
-					SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
-					error = ENOTCONN;
-				}
+			SCTP_FIND_STCB(inp, stcb, av->assoc_id);
+			if (stcb) {
+				av->assoc_value = stcb->asoc.sctp_cmt_on_off;
+				SCTP_TCB_UNLOCK(stcb);
 			} else {
-				SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
-				error = ENOPROTOOPT;
+				SCTP_INP_RLOCK(inp);
+				av->assoc_value = inp->sctp_cmt_on_off;
+				SCTP_INP_RUNLOCK(inp);
 			}
 			*optsize = sizeof(*av);
 		}
@@ -2827,44 +2800,28 @@ sctp_setopt(struct socket *so, int optna
 		}
 		break;
 	case SCTP_CMT_ON_OFF:
-		{
+		if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
 			struct sctp_assoc_value *av;
 
 			SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize);
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
-				SCTP_FIND_STCB(inp, stcb, av->assoc_id);
-				if (stcb) {
-					stcb->asoc.sctp_cmt_on_off = (uint8_t) av->assoc_value;
-					SCTP_TCB_UNLOCK(stcb);
-				} else {
-					SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
-					error = ENOTCONN;
-				}
-			} else {
-				SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
-				error = ENOPROTOOPT;
-			}
-		}
-		break;
-		/* EY nr_sack_on_off socket option */
-	case SCTP_NR_SACK_ON_OFF:
-		{
-			struct sctp_assoc_value *av;
-
-			SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize);
-			if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)) {
-				SCTP_FIND_STCB(inp, stcb, av->assoc_id);
-				if (stcb) {
-					stcb->asoc.sctp_nr_sack_on_off = (uint8_t) av->assoc_value;
-					SCTP_TCB_UNLOCK(stcb);
-				} else {
-					SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
-					error = ENOTCONN;
-				}
+			SCTP_FIND_STCB(inp, stcb, av->assoc_id);
+			if (stcb) {
+				if (av->assoc_value != 0)
+					stcb->asoc.sctp_cmt_on_off = 1;
+				else
+					stcb->asoc.sctp_cmt_on_off = 0;
+				SCTP_TCB_UNLOCK(stcb);
 			} else {
-				SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
-				error = ENOPROTOOPT;
+				SCTP_INP_WLOCK(inp);
+				if (av->assoc_value != 0)
+					inp->sctp_cmt_on_off = 1;
+				else
+					inp->sctp_cmt_on_off = 0;
+				SCTP_INP_WUNLOCK(inp);
 			}
+		} else {
+			SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
+			error = ENOPROTOOPT;
 		}
 		break;
 		/* JRS - Set socket option for pluggable congestion control */

Modified: stable/8/sys/netinet/sctputil.c
==============================================================================
--- stable/8/sys/netinet/sctputil.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet/sctputil.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -893,10 +893,8 @@ sctp_init_asoc(struct sctp_inpcb *m, str
 	asoc->max_burst = m->sctp_ep.max_burst;
 	asoc->heart_beat_delay = TICKS_TO_MSEC(m->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]);
 	asoc->cookie_life = m->sctp_ep.def_cookie_life;
-	asoc->sctp_cmt_on_off = (uint8_t) SCTP_BASE_SYSCTL(sctp_cmt_on_off);
-	/* EY Init nr_sack variable */
+	asoc->sctp_cmt_on_off = m->sctp_cmt_on_off;
 	asoc->sctp_nr_sack_on_off = (uint8_t) SCTP_BASE_SYSCTL(sctp_nr_sack_on_off);
-	/* JRS 5/21/07 - Init CMT PF variables */
 	asoc->sctp_cmt_pf = (uint8_t) SCTP_BASE_SYSCTL(sctp_cmt_pf);
 	asoc->sctp_frag_point = m->sctp_frag_point;
 #ifdef INET
@@ -4210,7 +4208,7 @@ void
 sctp_print_address_pkt(struct ip *iph, struct sctphdr *sh)
 {
 	switch (iph->ip_v) {
-	case IPVERSION:
+		case IPVERSION:
 		{
 			struct sockaddr_in lsa, fsa;
 

Modified: stable/8/sys/netinet6/sctp6_usrreq.c
==============================================================================
--- stable/8/sys/netinet6/sctp6_usrreq.c	Thu Oct 28 16:53:54 2010	(r214461)
+++ stable/8/sys/netinet6/sctp6_usrreq.c	Thu Oct 28 16:58:12 2010	(r214462)
@@ -414,7 +414,8 @@ sctp6_notify(struct sctp_inpcb *inp,
 			 * PF state.
 			 */
 			/* Stop any running T3 timers here? */
-			if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) {
+			if ((stcb->asoc.sctp_cmt_on_off == 1) &&
+			    (stcb->asoc.sctp_cmt_pf > 0)) {
 				net->dest_state &= ~SCTP_ADDR_PF;
 				SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n",
 				    net);
@@ -1069,6 +1070,8 @@ sctp6_getaddr(struct socket *so, struct 
 	 * Do the malloc first in case it blocks.
 	 */
 	SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6);
+	if (sin6 == NULL)
+		return ENOMEM;
 	sin6->sin6_family = AF_INET6;
 	sin6->sin6_len = sizeof(*sin6);
 
@@ -1173,6 +1176,8 @@ sctp6_peeraddr(struct socket *so, struct
 		return (ENOTCONN);
 	}
 	SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6);
+	if (sin6 == NULL)
+		return (ENOMEM);
 	sin6->sin6_family = AF_INET6;
 	sin6->sin6_len = sizeof(*sin6);
 

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 17:00: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 E457F1065670;
	Thu, 28 Oct 2010 17:00:31 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D1DCD8FC26;
	Thu, 28 Oct 2010 17:00: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 o9SH0V7A017780;
	Thu, 28 Oct 2010 17:00:31 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SH0VGg017778;
	Thu, 28 Oct 2010 17:00:31 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281700.o9SH0VGg017778@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 17:00: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: r214463 - 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: Thu, 28 Oct 2010 17:00:32 -0000

Author: tuexen
Date: Thu Oct 28 17:00:31 2010
New Revision: 214463
URL: http://svn.freebsd.org/changeset/base/214463

Log:
  MFC r211950:
  
  Bugfix: Do not send a packet drop report in response to a received
          INIT-ACK with incorrect CRC.

Modified:
  stable/8/sys/netinet/sctp_output.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)

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 16:58:12 2010	(r214462)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 17:00:31 2010	(r214463)
@@ -11001,9 +11001,12 @@ sctp_send_packet_dropped(struct sctp_tcb
 		switch (ch->chunk_type) {
 		case SCTP_PACKET_DROPPED:
 		case SCTP_ABORT_ASSOCIATION:
-			/*-
-			 * we don't respond with an PKT-DROP to an ABORT
-			 * or PKT-DROP
+		case SCTP_INITIATION_ACK:
+			/**
+			 * We don't respond with an PKT-DROP to an ABORT
+			 * or PKT-DROP. We also do not respond to an
+			 * INIT-ACK, because we can't know if the initiation
+			 * tag is correct or not.
 			 */
 			sctp_free_a_chunk(stcb, chk);
 			return;

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 17:02: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 ADBB71065732;
	Thu, 28 Oct 2010 17:02:36 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A1668FC1C;
	Thu, 28 Oct 2010 17:02: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 o9SH2ald017929;
	Thu, 28 Oct 2010 17:02:36 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SH2aIC017920;
	Thu, 28 Oct 2010 17:02:36 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281702.o9SH2aIC017920@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 17:02: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: r214464 - in stable/8/sys: netinet netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 17:02:36 -0000

Author: tuexen
Date: Thu Oct 28 17:02:36 2010
New Revision: 214464
URL: http://svn.freebsd.org/changeset/base/214464

Log:
  MFC 211969:
  
  Fix the the SCTP_WITH_NO_CSUM option when used in combination with
  interface supporting CRC offload. While at it, make use of the
  feature that the loopback interface provides CRC offloading.

Modified:
  stable/8/sys/netinet/sctp_crc32.c
  stable/8/sys/netinet/sctp_crc32.h
  stable/8/sys/netinet/sctp_input.c
  stable/8/sys/netinet/sctp_os_bsd.h
  stable/8/sys/netinet/sctp_output.c
  stable/8/sys/netinet/sctp_sysctl.c
  stable/8/sys/netinet/sctp_sysctl.h
  stable/8/sys/netinet6/sctp6_usrreq.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)

Modified: stable/8/sys/netinet/sctp_crc32.c
==============================================================================
--- stable/8/sys/netinet/sctp_crc32.c	Thu Oct 28 17:00:31 2010	(r214463)
+++ stable/8/sys/netinet/sctp_crc32.c	Thu Oct 28 17:02:36 2010	(r214464)
@@ -115,20 +115,15 @@ sctp_calculate_cksum(struct mbuf *m, uin
 	return (base);
 }
 
-#else
-
-uint32_t
-sctp_calculate_cksum(struct mbuf *m, uint32_t offset)
-{
-	return (0);
-}
-
 #endif				/* !defined(SCTP_WITH_NO_CSUM) */
 
 
 void
 sctp_delayed_cksum(struct mbuf *m, uint32_t offset)
 {
+#if defined(SCTP_WITH_NO_CSUM)
+	panic("sctp_delayed_cksum() called when using no SCTP CRC.");
+#else
 	struct ip *ip;
 	uint32_t checksum;
 
@@ -149,4 +144,5 @@ sctp_delayed_cksum(struct mbuf *m, uint3
 		return;
 	}
 	*(uint32_t *) (m->m_data + offset) = checksum;
+#endif
 }

Modified: stable/8/sys/netinet/sctp_crc32.h
==============================================================================
--- stable/8/sys/netinet/sctp_crc32.h	Thu Oct 28 17:00:31 2010	(r214463)
+++ stable/8/sys/netinet/sctp_crc32.h	Thu Oct 28 17:02:36 2010	(r214464)
@@ -36,11 +36,12 @@ __FBSDID("$FreeBSD$");
 #ifndef __crc32c_h__
 #define __crc32c_h__
 
-#if defined(_KERNEL) || defined(__Userspace__)
-
+#if defined(_KERNEL)
+#if !defined(SCTP_WITH_NO_CSUM)
 uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t);
+
+#endif
 void sctp_delayed_cksum(struct mbuf *, uint32_t offset);
 
 #endif				/* _KERNEL */
-
 #endif				/* __crc32c_h__ */

Modified: stable/8/sys/netinet/sctp_input.c
==============================================================================
--- stable/8/sys/netinet/sctp_input.c	Thu Oct 28 17:00:31 2010	(r214463)
+++ stable/8/sys/netinet/sctp_input.c	Thu Oct 28 17:02:36 2010	(r214464)
@@ -3068,7 +3068,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;
@@ -5717,14 +5717,17 @@ sctp_input_with_port(struct mbuf *i_pak,
 	struct ip *ip;
 	struct sctphdr *sh;
 	struct sctp_inpcb *inp = NULL;
-
-	uint32_t check, calc_check;
 	struct sctp_nets *net;
 	struct sctp_tcb *stcb = NULL;
 	struct sctp_chunkhdr *ch;
 	int refcount_up = 0;
 	int length, mlen, offset;
 
+#if !defined(SCTP_WITH_NO_CSUM)
+	uint32_t check, calc_check;
+
+#endif
+
 	if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) {
 		SCTP_RELEASE_PKT(i_pak);
 		return;
@@ -5799,18 +5802,14 @@ sctp_input_with_port(struct mbuf *i_pak,
 	    m->m_pkthdr.len,
 	    if_name(m->m_pkthdr.rcvif),
 	    m->m_pkthdr.csum_flags);
+#if defined(SCTP_WITH_NO_CSUM)
+	SCTP_STAT_INCR(sctps_recvnocrc);
+#else
 	if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) {
 		SCTP_STAT_INCR(sctps_recvhwcrc);
 		goto sctp_skip_csum_4;
 	}
 	check = sh->checksum;	/* save incoming checksum */
-	if ((check == 0) && (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback)) &&
-	    ((ip->ip_src.s_addr == ip->ip_dst.s_addr) ||
-	    (SCTP_IS_IT_LOOPBACK(m)))
-	    ) {
-		SCTP_STAT_INCR(sctps_recvnocrc);
-		goto sctp_skip_csum_4;
-	}
 	sh->checksum = 0;	/* prepare for calc */
 	calc_check = sctp_calculate_cksum(m, iphlen);
 	sh->checksum = check;
@@ -5840,6 +5839,7 @@ sctp_input_with_port(struct mbuf *i_pak,
 		goto bad;
 	}
 sctp_skip_csum_4:
+#endif
 	/* destination port of 0 is illegal, based on RFC2960. */
 	if (sh->dest_port == 0) {
 		SCTP_STAT_INCR(sctps_hdrops);

Modified: stable/8/sys/netinet/sctp_os_bsd.h
==============================================================================
--- stable/8/sys/netinet/sctp_os_bsd.h	Thu Oct 28 17:00:31 2010	(r214463)
+++ stable/8/sys/netinet/sctp_os_bsd.h	Thu Oct 28 17:02:36 2010	(r214464)
@@ -433,20 +433,21 @@ typedef struct rtentry sctp_rtentry_t;
  */
 #define SCTP_IP_OUTPUT(result, o_pak, ro, stcb, vrf_id) \
 { \
-	int o_flgs = 0; \
-	if (stcb && stcb->sctp_ep && stcb->sctp_ep->sctp_socket) { \
-		o_flgs = IP_RAWOUTPUT | (stcb->sctp_ep->sctp_socket->so_options & SO_DONTROUTE); \
-	} else { \
-		o_flgs = IP_RAWOUTPUT; \
-	} \
+	int o_flgs = IP_RAWOUTPUT; \
+	struct sctp_tcb *local_stcb = stcb; \
+	if (local_stcb && \
+	    local_stcb->sctp_ep && \
+	    local_stcb->sctp_ep->sctp_socket) \
+		o_flgs |= local_stcb->sctp_ep->sctp_socket->so_options & SO_DONTROUTE; \
 	result = ip_output(o_pak, NULL, ro, o_flgs, 0, NULL); \
 }
 
 #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \
 { \
- 	if (stcb && stcb->sctp_ep) \
+	struct sctp_tcb *local_stcb = stcb; \
+	if (local_stcb && local_stcb->sctp_ep) \
 		result = ip6_output(o_pak, \
-				    ((struct in6pcb *)(stcb->sctp_ep))->in6p_outputopts, \
+				    ((struct in6pcb *)(local_stcb->sctp_ep))->in6p_outputopts, \
 				    (ro), 0, 0, ifp, NULL); \
 	else \
 		result = ip6_output(o_pak, NULL, (ro), 0, 0, ifp, NULL); \

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 17:00:31 2010	(r214463)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 17:02:36 2010	(r214464)
@@ -3741,6 +3741,9 @@ sctp_lowlevel_chunk_output(struct sctp_i
 #endif
 		SCTP_ATTACH_CHAIN(o_pak, m, packet_length);
 		if (port) {
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
 			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
 			    (stcb) &&
 			    (stcb->asoc.loopback_scope))) {
@@ -3749,17 +3752,16 @@ sctp_lowlevel_chunk_output(struct sctp_i
 			} else {
 				SCTP_STAT_INCR(sctps_sendnocrc);
 			}
+#endif
 			SCTP_ENABLE_UDP_CSUM(o_pak);
 		} else {
-			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
-			    (stcb) &&
-			    (stcb->asoc.loopback_scope))) {
-				m->m_pkthdr.csum_flags = CSUM_SCTP;
-				m->m_pkthdr.csum_data = 0;
-				SCTP_STAT_INCR(sctps_sendhwcrc);
-			} else {
-				SCTP_STAT_INCR(sctps_sendnocrc);
-			}
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
+			m->m_pkthdr.csum_flags = CSUM_SCTP;
+			m->m_pkthdr.csum_data = 0;
+			SCTP_STAT_INCR(sctps_sendhwcrc);
+#endif
 		}
 		/* send it out.  table id is taken from stcb */
 #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
@@ -4051,6 +4053,9 @@ sctp_lowlevel_chunk_output(struct sctp_i
 #endif
 		SCTP_ATTACH_CHAIN(o_pak, m, packet_length);
 		if (port) {
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
 			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
 			    (stcb) &&
 			    (stcb->asoc.loopback_scope))) {
@@ -4059,10 +4064,14 @@ sctp_lowlevel_chunk_output(struct sctp_i
 			} else {
 				SCTP_STAT_INCR(sctps_sendnocrc);
 			}
+#endif
 			if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), packet_length - sizeof(struct ip6_hdr))) == 0) {
 				udp->uh_sum = 0xffff;
 			}
 		} else {
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
 			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
 			    (stcb) &&
 			    (stcb->asoc.loopback_scope))) {
@@ -4072,6 +4081,7 @@ sctp_lowlevel_chunk_output(struct sctp_i
 			} else {
 				SCTP_STAT_INCR(sctps_sendnocrc);
 			}
+#endif
 		}
 		/* send it out. table id is taken from stcb */
 #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
@@ -10571,7 +10581,6 @@ sctp_send_shutdown_complete2(struct mbuf
 	if (iph_out != NULL) {
 		sctp_route_t ro;
 		int ret;
-		struct sctp_tcb *stcb = NULL;
 
 		mlen = SCTP_BUF_LEN(mout);
 		bzero(&ro, sizeof ro);
@@ -10582,17 +10591,25 @@ sctp_send_shutdown_complete2(struct mbuf
 			sctp_packet_log(mout, mlen);
 #endif
 		if (port) {
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
 			comp_cp->sh.checksum = sctp_calculate_cksum(mout, offset_out);
 			SCTP_STAT_INCR(sctps_sendswcrc);
+#endif
 			SCTP_ENABLE_UDP_CSUM(mout);
 		} else {
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
 			mout->m_pkthdr.csum_flags = CSUM_SCTP;
 			mout->m_pkthdr.csum_data = 0;
 			SCTP_STAT_INCR(sctps_sendhwcrc);
+#endif
 		}
 		SCTP_ATTACH_CHAIN(o_pak, mout, mlen);
 		/* out it goes */
-		SCTP_IP_OUTPUT(ret, o_pak, &ro, stcb, vrf_id);
+		SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id);
 
 		/* Free the route if we got one back */
 		if (ro.ro_rt)
@@ -10602,7 +10619,6 @@ sctp_send_shutdown_complete2(struct mbuf
 	if (ip6_out != NULL) {
 		struct route_in6 ro;
 		int ret;
-		struct sctp_tcb *stcb = NULL;
 		struct ifnet *ifp = NULL;
 
 		bzero(&ro, sizeof(ro));
@@ -10613,29 +10629,25 @@ sctp_send_shutdown_complete2(struct mbuf
 #endif
 		SCTP_ATTACH_CHAIN(o_pak, mout, mlen);
 		if (port) {
-			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
-			    (stcb) &&
-			    (stcb->asoc.loopback_scope))) {
-				comp_cp->sh.checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr));
-				SCTP_STAT_INCR(sctps_sendswcrc);
-			} else {
-				SCTP_STAT_INCR(sctps_sendnocrc);
-			}
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
+			comp_cp->sh.checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr));
+			SCTP_STAT_INCR(sctps_sendswcrc);
+#endif
 			if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), mlen - sizeof(struct ip6_hdr))) == 0) {
 				udp->uh_sum = 0xffff;
 			}
 		} else {
-			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
-			    (stcb) &&
-			    (stcb->asoc.loopback_scope))) {
-				mout->m_pkthdr.csum_flags = CSUM_SCTP;
-				mout->m_pkthdr.csum_data = 0;
-				SCTP_STAT_INCR(sctps_sendhwcrc);
-			} else {
-				SCTP_STAT_INCR(sctps_sendnocrc);
-			}
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
+			mout->m_pkthdr.csum_flags = CSUM_SCTP;
+			mout->m_pkthdr.csum_data = 0;
+			SCTP_STAT_INCR(sctps_sendhwcrc);
+#endif
 		}
-		SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, stcb, vrf_id);
+		SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id);
 
 		/* Free the route if we got one back */
 		if (ro.ro_rt)
@@ -11632,7 +11644,6 @@ sctp_send_abort(struct mbuf *m, int iphl
 	}
 	if (iph_out != NULL) {
 		sctp_route_t ro;
-		struct sctp_tcb *stcb = NULL;
 		int ret;
 
 		/* zap the stack pointer to the route */
@@ -11652,15 +11663,23 @@ sctp_send_abort(struct mbuf *m, int iphl
 #endif
 		SCTP_ATTACH_CHAIN(o_pak, mout, len);
 		if (port) {
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
 			abm->sh.checksum = sctp_calculate_cksum(mout, iphlen_out);
 			SCTP_STAT_INCR(sctps_sendswcrc);
+#endif
 			SCTP_ENABLE_UDP_CSUM(o_pak);
 		} else {
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
 			mout->m_pkthdr.csum_flags = CSUM_SCTP;
 			mout->m_pkthdr.csum_data = 0;
 			SCTP_STAT_INCR(sctps_sendhwcrc);
+#endif
 		}
-		SCTP_IP_OUTPUT(ret, o_pak, &ro, stcb, vrf_id);
+		SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id);
 
 		/* Free the route if we got one back */
 		if (ro.ro_rt)
@@ -11670,7 +11689,6 @@ sctp_send_abort(struct mbuf *m, int iphl
 	if (ip6_out != NULL) {
 		struct route_in6 ro;
 		int ret;
-		struct sctp_tcb *stcb = NULL;
 		struct ifnet *ifp = NULL;
 
 		/* zap the stack pointer to the route */
@@ -11687,29 +11705,25 @@ sctp_send_abort(struct mbuf *m, int iphl
 #endif
 		SCTP_ATTACH_CHAIN(o_pak, mout, len);
 		if (port) {
-			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
-			    (stcb) &&
-			    (stcb->asoc.loopback_scope))) {
-				abm->sh.checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr));
-				SCTP_STAT_INCR(sctps_sendswcrc);
-			} else {
-				SCTP_STAT_INCR(sctps_sendnocrc);
-			}
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
+			abm->sh.checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr));
+			SCTP_STAT_INCR(sctps_sendswcrc);
+#endif
 			if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) {
 				udp->uh_sum = 0xffff;
 			}
 		} else {
-			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
-			    (stcb) &&
-			    (stcb->asoc.loopback_scope))) {
-				mout->m_pkthdr.csum_flags = CSUM_SCTP;
-				mout->m_pkthdr.csum_data = 0;
-				SCTP_STAT_INCR(sctps_sendhwcrc);
-			} else {
-				SCTP_STAT_INCR(sctps_sendnocrc);
-			}
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
+			mout->m_pkthdr.csum_flags = CSUM_SCTP;
+			mout->m_pkthdr.csum_data = 0;
+			SCTP_STAT_INCR(sctps_sendhwcrc);
+#endif
 		}
-		SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, stcb, vrf_id);
+		SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id);
 
 		/* Free the route if we got one back */
 		if (ro.ro_rt)
@@ -11872,7 +11886,6 @@ sctp_send_operr_to(struct mbuf *m, int i
 	}
 	if (iph_out != NULL) {
 		sctp_route_t ro;
-		struct sctp_tcb *stcb = NULL;
 		int ret;
 
 		/* zap the stack pointer to the route */
@@ -11890,15 +11903,23 @@ sctp_send_operr_to(struct mbuf *m, int i
 #endif
 		SCTP_ATTACH_CHAIN(o_pak, mout, len);
 		if (port) {
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
 			sh_out->checksum = sctp_calculate_cksum(mout, iphlen_out);
 			SCTP_STAT_INCR(sctps_sendswcrc);
+#endif
 			SCTP_ENABLE_UDP_CSUM(o_pak);
 		} else {
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
 			mout->m_pkthdr.csum_flags = CSUM_SCTP;
 			mout->m_pkthdr.csum_data = 0;
 			SCTP_STAT_INCR(sctps_sendhwcrc);
+#endif
 		}
-		SCTP_IP_OUTPUT(ret, o_pak, &ro, stcb, vrf_id);
+		SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id);
 
 		/* Free the route if we got one back */
 		if (ro.ro_rt)
@@ -11908,7 +11929,6 @@ sctp_send_operr_to(struct mbuf *m, int i
 	if (ip6_out != NULL) {
 		struct route_in6 ro;
 		int ret;
-		struct sctp_tcb *stcb = NULL;
 		struct ifnet *ifp = NULL;
 
 		/* zap the stack pointer to the route */
@@ -11923,29 +11943,25 @@ sctp_send_operr_to(struct mbuf *m, int i
 #endif
 		SCTP_ATTACH_CHAIN(o_pak, mout, len);
 		if (port) {
-			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
-			    (stcb) &&
-			    (stcb->asoc.loopback_scope))) {
-				sh_out->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr));
-				SCTP_STAT_INCR(sctps_sendswcrc);
-			} else {
-				SCTP_STAT_INCR(sctps_sendnocrc);
-			}
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
+			sh_out->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr));
+			SCTP_STAT_INCR(sctps_sendswcrc);
+#endif
 			if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) {
 				udp->uh_sum = 0xffff;
 			}
 		} else {
-			if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
-			    (stcb) &&
-			    (stcb->asoc.loopback_scope))) {
-				mout->m_pkthdr.csum_flags = CSUM_SCTP;
-				mout->m_pkthdr.csum_data = 0;
-				SCTP_STAT_INCR(sctps_sendhwcrc);
-			} else {
-				SCTP_STAT_INCR(sctps_sendnocrc);
-			}
+#if defined(SCTP_WITH_NO_CSUM)
+			SCTP_STAT_INCR(sctps_sendnocrc);
+#else
+			mout->m_pkthdr.csum_flags = CSUM_SCTP;
+			mout->m_pkthdr.csum_data = 0;
+			SCTP_STAT_INCR(sctps_sendhwcrc);
+#endif
 		}
-		SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, stcb, vrf_id);
+		SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id);
 
 		/* Free the route if we got one back */
 		if (ro.ro_rt)

Modified: stable/8/sys/netinet/sctp_sysctl.c
==============================================================================
--- stable/8/sys/netinet/sctp_sysctl.c	Thu Oct 28 17:00:31 2010	(r214463)
+++ stable/8/sys/netinet/sctp_sysctl.c	Thu Oct 28 17:02:36 2010	(r214464)
@@ -54,7 +54,9 @@ sctp_init_sysctls()
 	SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_ecn_nonce) = SCTPCTL_ECN_NONCE_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT;
+#if !defined(SCTP_WITH_NO_CSUM)
 	SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT;
+#endif
 	SCTP_BASE_SYSCTL(sctp_strict_init) = SCTPCTL_STRICT_INIT_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT;
@@ -568,7 +570,9 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS)
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_nonce), SCTPCTL_ECN_NONCE_MIN, SCTPCTL_ECN_NONCE_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX);
+#if !defined(SCTP_WITH_NO_CSUM)
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX);
+#endif
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_init), SCTPCTL_STRICT_INIT_MIN, SCTPCTL_STRICT_INIT_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX);
@@ -829,9 +833,11 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, st
     &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU",
     SCTPCTL_STRICT_SACKS_DESC);
 
+#if !defined(SCTP_WITH_NO_CSUM)
 SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_INT | CTLFLAG_RW,
     &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU",
     SCTPCTL_LOOPBACK_NOCSUM_DESC);
+#endif
 
 SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_INT | CTLFLAG_RW,
     &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU",

Modified: stable/8/sys/netinet/sctp_sysctl.h
==============================================================================
--- stable/8/sys/netinet/sctp_sysctl.h	Thu Oct 28 17:00:31 2010	(r214463)
+++ stable/8/sys/netinet/sctp_sysctl.h	Thu Oct 28 17:02:36 2010	(r214464)
@@ -45,7 +45,9 @@ struct sctp_sysctl {
 	uint32_t sctp_ecn_enable;
 	uint32_t sctp_ecn_nonce;
 	uint32_t sctp_strict_sacks;
+#if !defined(SCTP_WITH_NO_CSUM)
 	uint32_t sctp_no_csum_on_loopback;
+#endif
 	uint32_t sctp_strict_init;
 	uint32_t sctp_peer_chunk_oh;
 	uint32_t sctp_max_burst_default;

Modified: stable/8/sys/netinet6/sctp6_usrreq.c
==============================================================================
--- stable/8/sys/netinet6/sctp6_usrreq.c	Thu Oct 28 17:00:31 2010	(r214463)
+++ stable/8/sys/netinet6/sctp6_usrreq.c	Thu Oct 28 17:02:36 2010	(r214464)
@@ -72,7 +72,6 @@ sctp6_input(struct mbuf **i_pak, int *of
 	struct sctp_inpcb *in6p = NULL;
 	struct sctp_nets *net;
 	int refcount_up = 0;
-	uint32_t check, calc_check;
 	uint32_t vrf_id = 0;
 	struct inpcb *in6p_ip;
 	struct sctp_chunkhdr *ch;
@@ -80,6 +79,11 @@ sctp6_input(struct mbuf **i_pak, int *of
 	uint8_t ecn_bits;
 	struct sctp_tcb *stcb = NULL;
 	int pkt_len = 0;
+
+#if !defined(SCTP_WITH_NO_CSUM)
+	uint32_t check, calc_check;
+
+#endif
 	int off = *offp;
 	uint16_t port = 0;
 
@@ -133,6 +137,9 @@ sctp6_input(struct mbuf **i_pak, int *of
 	    m->m_pkthdr.len,
 	    if_name(m->m_pkthdr.rcvif),
 	    m->m_pkthdr.csum_flags);
+#if defined(SCTP_WITH_NO_CSUM)
+	SCTP_STAT_INCR(sctps_recvnocrc);
+#else
 	if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) {
 		SCTP_STAT_INCR(sctps_recvhwcrc);
 		goto sctp_skip_csum;
@@ -171,6 +178,7 @@ sctp6_input(struct mbuf **i_pak, int *of
 	sh->checksum = calc_check;
 
 sctp_skip_csum:
+#endif
 	net = NULL;
 	/*
 	 * Locate pcb and tcb for datagram sctp_findassociation_addr() wants

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 17:04: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 7D1CC1065670;
	Thu, 28 Oct 2010 17:04:32 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6AEC68FC1B;
	Thu, 28 Oct 2010 17:04: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 o9SH4Wqk018060;
	Thu, 28 Oct 2010 17:04:32 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SH4WfQ018058;
	Thu, 28 Oct 2010 17:04:32 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281704.o9SH4WfQ018058@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 17:04:32 +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: r214465 - 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: Thu, 28 Oct 2010 17:04:33 -0000

Author: tuexen
Date: Thu Oct 28 17:04:32 2010
New Revision: 214465
URL: http://svn.freebsd.org/changeset/base/214465

Log:
  MFC 212099:
  Fix the the SCTP_WITH_NO_CSUM option when used in combination with
  interface supporting CRC offload. While at it, make use of the
  feature that the loopback interface provides CRC offloading.

Modified:
  stable/8/sys/netinet/sctp_pcb.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)

Modified: stable/8/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 17:02:36 2010	(r214464)
+++ stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 17:04:32 2010	(r214465)
@@ -5988,7 +5988,7 @@ sctp_load_addresses_from_init(struct sct
 				}
 				p4 = (struct sctp_ipv4addr_param *)phdr;
 				sin.sin_addr.s_addr = p4->addr;
-				if (IN_MULTICAST(sin.sin_addr.s_addr)) {
+				if (IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) {
 					/* Skip multi-cast addresses */
 					goto next_param;
 				}

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 17:17: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 0F9B11065673;
	Thu, 28 Oct 2010 17:17:46 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F06518FC15;
	Thu, 28 Oct 2010 17:17: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 o9SHHjmE018698;
	Thu, 28 Oct 2010 17:17:45 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SHHjnB018692;
	Thu, 28 Oct 2010 17:17:45 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <201010281717.o9SHHjnB018692@svn.freebsd.org>
From: Randall Stewart 
Date: Thu, 28 Oct 2010 17:17:45 +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: r214466 - 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: Thu, 28 Oct 2010 17:17:46 -0000

Author: rrs
Date: Thu Oct 28 17:17:45 2010
New Revision: 214466
URL: http://svn.freebsd.org/changeset/base/214466

Log:
  MFC of 212225
  
  Fix some CLANG warnings. One clang warning is left
  due to the fact that its bogus.. nam->sa_family will
  not change from AF_INET6 to AF_INET (but clang
  thinks it does ;-D)

Modified:
  stable/8/sys/netinet/sctp_input.c
  stable/8/sys/netinet/sctp_output.c
  stable/8/sys/netinet/sctp_pcb.c
  stable/8/sys/netinet/sctp_timer.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)

Modified: stable/8/sys/netinet/sctp_input.c
==============================================================================
--- stable/8/sys/netinet/sctp_input.c	Thu Oct 28 17:04:32 2010	(r214465)
+++ stable/8/sys/netinet/sctp_input.c	Thu Oct 28 17:17:45 2010	(r214466)
@@ -535,7 +535,7 @@ sctp_handle_heartbeat_ack(struct sctp_he
 	struct sockaddr_storage store;
 	struct sockaddr_in *sin;
 	struct sockaddr_in6 *sin6;
-	struct sctp_nets *r_net;
+	struct sctp_nets *r_net, *f_net;
 	struct timeval tv;
 	int req_prim = 0;
 
@@ -581,16 +581,16 @@ sctp_handle_heartbeat_ack(struct sctp_he
 			stcb->asoc.primary_destination = r_net;
 			r_net->dest_state &= ~SCTP_ADDR_WAS_PRIMARY;
 			r_net->dest_state &= ~SCTP_ADDR_REQ_PRIMARY;
-			r_net = TAILQ_FIRST(&stcb->asoc.nets);
-			if (r_net != stcb->asoc.primary_destination) {
+			f_net = TAILQ_FIRST(&stcb->asoc.nets);
+			if (f_net != r_net) {
 				/*
 				 * first one on the list is NOT the primary
 				 * sctp_cmpaddr() is much more efficent if
 				 * the primary is the first on the list,
 				 * make it so.
 				 */
-				TAILQ_REMOVE(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next);
-				TAILQ_INSERT_HEAD(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next);
+				TAILQ_REMOVE(&stcb->asoc.nets, r_net, sctp_next);
+				TAILQ_INSERT_HEAD(&stcb->asoc.nets, r_net, sctp_next);
 			}
 			req_prim = 1;
 		}
@@ -4685,14 +4685,14 @@ process_control_chunks:
 
 				SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n");
 				SCTP_STAT_INCR(sctps_recvsacks);
-				if ((stcb->asoc.sctp_nr_sack_on_off == 0) ||
-				    (stcb->asoc.peer_supports_nr_sack == 0)) {
-					goto unknown_chunk;
-				}
 				if (stcb == NULL) {
 					SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing NR-SACK chunk\n");
 					break;
 				}
+				if ((stcb->asoc.sctp_nr_sack_on_off == 0) ||
+				    (stcb->asoc.peer_supports_nr_sack == 0)) {
+					goto unknown_chunk;
+				}
 				if (chk_length < sizeof(struct sctp_nr_sack_chunk)) {
 					SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on NR-SACK chunk, too small\n");
 					break;

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 17:04:32 2010	(r214465)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 17:17:45 2010	(r214466)
@@ -9840,9 +9840,12 @@ sctp_fill_in_rest:
 			at = TAILQ_FIRST(&asoc->sent_queue);
 			for (i = 0; i < cnt_of_skipped; i++) {
 				tp1 = TAILQ_NEXT(at, sctp_next);
+				if (tp1 == NULL) {
+					break;
+				}
 				at = tp1;
 			}
-			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) {
+			if (at && SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) {
 				sctp_misc_ints(SCTP_FWD_TSN_CHECK,
 				    0xff, cnt_of_skipped, at->rec.data.TSN_seq,
 				    asoc->advanced_peer_ack_point);
@@ -9852,7 +9855,8 @@ sctp_fill_in_rest:
 			 * last now points to last one I can report, update
 			 * peer ack point
 			 */
-			advance_peer_ack_point = last->rec.data.TSN_seq;
+			if (last)
+				advance_peer_ack_point = last->rec.data.TSN_seq;
 			space_needed = sizeof(struct sctp_forward_tsn_chunk) +
 			    cnt_of_skipped * sizeof(struct sctp_strseq);
 		}
@@ -9885,6 +9889,8 @@ sctp_fill_in_rest:
 		at = TAILQ_FIRST(&asoc->sent_queue);
 		for (i = 0; i < cnt_of_skipped; i++) {
 			tp1 = TAILQ_NEXT(at, sctp_next);
+			if (tp1 == NULL)
+				break;
 			if (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) {
 				/* We don't report these */
 				i--;
@@ -10560,7 +10566,8 @@ sctp_send_shutdown_complete2(struct mbuf
 		udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port));
 		udp->uh_dport = port;
 		udp->uh_ulen = htons(sizeof(struct sctp_shutdown_complete_msg) + sizeof(struct udphdr));
-		udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP));
+		if (iph_out)
+			udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP));
 		offset_out += sizeof(struct udphdr);
 		comp_cp = (struct sctp_shutdown_complete_msg *)((caddr_t)comp_cp + sizeof(struct udphdr));
 	}

Modified: stable/8/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 17:04:32 2010	(r214465)
+++ stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 17:17:45 2010	(r214466)
@@ -517,7 +517,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo
 		    sizeof(struct sctp_ifn), SCTP_M_IFN);
 		if (sctp_ifnp == NULL) {
 #ifdef INVARIANTS
-			panic("No memory for IFN:%u", sctp_ifnp->ifn_index);
+			panic("No memory for IFN");
 #endif
 			return (NULL);
 		}
@@ -5902,7 +5902,7 @@ sctp_load_addresses_from_init(struct sct
 			}
 #endif
 		default:
-			sa = NULL;
+			return (-1);
 			break;
 		}
 	} else {

Modified: stable/8/sys/netinet/sctp_timer.c
==============================================================================
--- stable/8/sys/netinet/sctp_timer.c	Thu Oct 28 17:04:32 2010	(r214465)
+++ stable/8/sys/netinet/sctp_timer.c	Thu Oct 28 17:17:45 2010	(r214466)
@@ -482,6 +482,9 @@ sctp_find_alternate_net(struct sctp_tcb 
 
 	if (mnet == NULL) {
 		mnet = TAILQ_FIRST(&stcb->asoc.nets);
+		if (mnet == NULL) {
+			return (NULL);
+		}
 	}
 	do {
 		alt = TAILQ_NEXT(mnet, sctp_next);
@@ -491,6 +494,9 @@ sctp_find_alternate_net(struct sctp_tcb 
 				break;
 			}
 			alt = TAILQ_FIRST(&stcb->asoc.nets);
+			if (alt == NULL) {
+				return (NULL);
+			}
 		}
 		if (alt->ro.ro_rt == NULL) {
 			if (alt->ro._s_addr) {
@@ -517,6 +523,9 @@ sctp_find_alternate_net(struct sctp_tcb 
 		once = 0;
 		mnet = net;
 		do {
+			if (mnet == NULL) {
+				return (TAILQ_FIRST(&stcb->asoc.nets));
+			}
 			alt = TAILQ_NEXT(mnet, sctp_next);
 			if (alt == NULL) {
 				once++;

Modified: stable/8/sys/netinet/sctputil.c
==============================================================================
--- stable/8/sys/netinet/sctputil.c	Thu Oct 28 17:04:32 2010	(r214465)
+++ stable/8/sys/netinet/sctputil.c	Thu Oct 28 17:17:45 2010	(r214466)
@@ -340,7 +340,7 @@ sctp_log_lock(struct sctp_inpcb *inp, st
 		sctp_clog.x.lock.create_lock = SCTP_LOCK_UNKNOWN;
 	}
 	sctp_clog.x.lock.info_lock = rw_wowned(&SCTP_BASE_INFO(ipi_ep_mtx));
-	if (inp->sctp_socket) {
+	if (inp && (inp->sctp_socket)) {
 		sctp_clog.x.lock.sock_lock = mtx_owned(&(inp->sctp_socket->so_rcv.sb_mtx));
 		sctp_clog.x.lock.sockrcvbuf_lock = mtx_owned(&(inp->sctp_socket->so_rcv.sb_mtx));
 		sctp_clog.x.lock.socksndbuf_lock = mtx_owned(&(inp->sctp_socket->so_snd.sb_mtx));
@@ -4208,7 +4208,7 @@ void
 sctp_print_address_pkt(struct ip *iph, struct sctphdr *sh)
 {
 	switch (iph->ip_v) {
-		case IPVERSION:
+	case IPVERSION:
 		{
 			struct sockaddr_in lsa, fsa;
 
@@ -5684,7 +5684,9 @@ get_more_data:
 				if ((SCTP_BUF_NEXT(m) == NULL) &&
 				    (control->end_added)) {
 					out_flags |= MSG_EOR;
-					if ((control->do_not_ref_stcb == 0) && ((control->spec_flags & M_NOTIFICATION) == 0))
+					if ((control->do_not_ref_stcb == 0) &&
+					    (control->stcb != NULL) &&
+					    ((control->spec_flags & M_NOTIFICATION) == 0))
 						control->stcb->asoc.strmin[control->sinfo_stream].delivery_started = 0;
 				}
 				if (control->spec_flags & M_NOTIFICATION) {

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 17:21: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 373E3106566B;
	Thu, 28 Oct 2010 17:21:36 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by mx1.freebsd.org (Postfix) with ESMTP id 91A8A8FC14;
	Thu, 28 Oct 2010 17:21:35 +0000 (UTC)
Received: by qyk7 with SMTP id 7so5061610qyk.13
	for ; Thu, 28 Oct 2010 10:21:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=gX9IMByX9I62+n02gzEiommMKBInxX3WrdwXyVPFuGE=;
	b=gxPP30vkMuBkR5/uKaw1UbZIGORv5PcjPBsOrd06WIh/5tYcz3vVPLXmW9AnmHiDcd
	xatMinmNpBN6tRFh7nRW38ezueW6P+mpXkbdCaGxmWDWrWUA40P1oIwEdHaXSuk5IfU7
	xSKd9/gA2QeGeLvg9+kMVlA8WimuhA5WedFZ4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=qk8eD4pZ/ZWsOHXcnLQpPTTy2G2rHL1Ev+23HJ6yz1oX92V9v3nqCCY/0Y/YU2O9NK
	IxvFKax5I/iK4COJcGzGtx3tWS1VGiiU3TIoY03dzcR5f7tHiCcwiC7FjRJoxK4I4t+5
	YnV4djAV3WDBRDDTanv+k9JJgTGhVR43Y+POA=
MIME-Version: 1.0
Received: by 10.229.224.81 with SMTP id in17mr5845671qcb.81.1288286494550;
	Thu, 28 Oct 2010 10:21:34 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.237.9 with HTTP; Thu, 28 Oct 2010 10:21:34 -0700 (PDT)
In-Reply-To: <201010281257.05481.jhb@freebsd.org>
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010281257.05481.jhb@freebsd.org>
Date: Thu, 28 Oct 2010 19:21:34 +0200
X-Google-Sender-Auth: DourtyZ_MWrdNLSDgB4fz5-583Q
Message-ID: 
From: Attilio Rao 
To: John Baldwin 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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, 28 Oct 2010 17:21:36 -0000

2010/10/28 John Baldwin :
> On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
>> Author: attilio
>> Date: Thu Oct 28 16:31:39 2010
>> New Revision: 214457
>> URL: http://svn.freebsd.org/changeset/base/214457
>>
>> Log:
>> =C2=A0 Merge nexus.c from amd64 and i386 to x86 subtree.
>>
>> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated
>> =C2=A0 Tested by: =C2=A0gianni
>>
>
> It would be better to merge these two routines. =C2=A0The loader now pass=
es the
> smap to i386 kernels as well, so ram_attach() should probably be changed =
to
> try the amd64 approach first and if that fails fall back to using the
> phys_avail[] array instead.

What do you think about this patch?:
Index: nexus.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
--- nexus.c     (revision 214457)
+++ nexus.c     (working copy)
@@ -52,9 +52,7 @@
 #include 
 #include 
 #include 
-#ifdef __amd64__
 #include 
-#endif
 #include 
 #include 
 #include 
@@ -67,12 +65,10 @@
 #include 
 #include 

-#ifdef __amd64__
 #include 
-#include 
-#endif
 #include 
 #include 
+#include 

 #ifdef DEV_APIC
 #include "pcib_if.h"
@@ -89,11 +85,13 @@
 #include 

 #ifdef __amd64__
-#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
-#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
+#define        X86_BUS_SPACE_IO        AMD64_BUS_SPACE_IO
+#define        X86_BUS_SPACE_MEM       AMD64_BUS_SPACE_MEM
+#define        ELF_KERN_STR            "elf64 kernel"
 #else
-#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
-#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
+#define        X86_BUS_SPACE_IO        I386_BUS_SPACE_IO
+#define        X86_BUS_SPACE_MEM       I386_BUS_SPACE_MEM
+#define        ELF_KERN_STR            "elf32 kernel"
 #endif

 static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
@@ -435,7 +433,7 @@
 #else
                rman_set_bushandle(r, rman_get_start(r));
 #endif
-               rman_set_bustag(r, RMAN_BUS_SPACE_IO);
+               rman_set_bustag(r, X86_BUS_SPACE_IO);
                break;
        case SYS_RES_MEMORY:
 #ifdef PC98
@@ -446,7 +444,7 @@
 #endif
                vaddr =3D pmap_mapdev(rman_get_start(r), rman_get_size(r));
                rman_set_virtual(r, vaddr);
-               rman_set_bustag(r, RMAN_BUS_SPACE_MEM);
+               rman_set_bustag(r, X86_BUS_SPACE_MEM);
 #ifdef PC98
                /* PC-98: the type of bus_space_handle_t is the structure. =
*/
                bh->bsh_base =3D (bus_addr_t) vaddr;
@@ -668,20 +666,20 @@
        return (0);
 }

-#ifdef __amd64__
 static int
 ram_attach(device_t dev)
 {
        struct bios_smap *smapbase, *smap, *smapend;
        struct resource *res;
+       vm_paddr_t *p;
        caddr_t kmdp;
        uint32_t smapsize;
-       int error, rid;
+       int error, i, rid;

        /* Retrieve the system memory map from the loader. */
        kmdp =3D preload_search_by_type("elf kernel");
        if (kmdp =3D=3D NULL)
-               kmdp =3D preload_search_by_type("elf64 kernel");
+               kmdp =3D preload_search_by_type(ELF_KERN_STR);
        smapbase =3D (struct bios_smap *)preload_search_info(kmdp,
            MODINFO_METADATA | MODINFOMD_SMAP);
        smapsize =3D *((u_int32_t *)smapbase - 1);
@@ -701,16 +699,11 @@
                        panic("ram_attach: resource %d failed to attach", r=
id);
                rid++;
        }
-       return (0);
-}
-#else
-static int
-ram_attach(device_t dev)
-{
-       struct resource *res;
-       vm_paddr_t *p;
-       int error, i, rid;

+       /* If at least one smap attached, return. */
+       if (rid !=3D 0)
+               return (0);
+
        /*
         * We use the dump_avail[] array rather than phys_avail[] for
         * the memory map as phys_avail[] contains holes for kernel
@@ -724,7 +717,7 @@
         */
        for (i =3D 0, p =3D dump_avail; p[1] !=3D 0; i++, p +=3D 2) {
                rid =3D i;
-#ifdef PAE
+#if !defined(__amd64__) && defined(PAE)
                /*
                 * Resources use long's to track resources, so we can't
                 * include memory regions above 4GB.
@@ -743,7 +736,6 @@
        }
        return (0);
 }
-#endif

 static device_method_t ram_methods[] =3D {
        /* Device interface */

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 17:44: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 E62C11065781;
	Thu, 28 Oct 2010 17:44:26 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au
	[211.29.132.190])
	by mx1.freebsd.org (Postfix) with ESMTP id 611478FC17;
	Thu, 28 Oct 2010 17:44:25 +0000 (UTC)
Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au
	(c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165])
	by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o9SHiKYD027722
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 29 Oct 2010 04:44:23 +1100
Date: Fri, 29 Oct 2010 04:44:20 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: John Baldwin 
In-Reply-To: <201010281257.05481.jhb@freebsd.org>
Message-ID: <20101029042046.L899@besplex.bde.org>
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010281257.05481.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: Attilio Rao , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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, 28 Oct 2010 17:44:27 -0000

On Thu, 28 Oct 2010, John Baldwin wrote:

> On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:

>> Log:
>>   Merge nexus.c from amd64 and i386 to x86 subtree.
>> ...

> ==============================================================================
>> --- head/sys/i386/i386/nexus.c	Thu Oct 28 07:58:06 2010	(r214446, copy
> source)
>> ...
>> @@ -77,6 +88,14 @@ __FBSDID("$FreeBSD$");
>>  #endif
>>  #include 
>>
>> +#ifdef __amd64__
>> +#define	RMAN_BUS_SPACE_IO	AMD64_BUS_SPACE_IO
>> +#define	RMAN_BUS_SPACE_MEM	AMD64_BUS_SPACE_MEM
>> +#else
>> +#define	RMAN_BUS_SPACE_IO	I386_BUS_SPACE_IO
>> +#define	RMAN_BUS_SPACE_MEM	I386_BUS_SPACE_MEM
>> +#endif
>> +
>
> Perhaps we should be using X86_BUS_SPACE_* instead?

Why not just BUS_SPACE_*?  The semantics are in the suffix.  You would
only need the prefix if an arch supported both its own bus spaces and
another arch's bus spaces.

I use the following horribleness in one tree partly to work around
gratuitously different spellings of BUS_SPACE_MEM.  The memory bus
space is currently used only for ia64, but works for amd64 and ia64
and might work for all arches; there are massive ifdefs to avoid
using it, and less-meassive ifdefs would be needed to use different
spellings of it.

% diff -c2 ./dev/fb/fbreg.h~ ./dev/fb/fbreg.h
% *** ./dev/fb/fbreg.h~	Wed Jun  3 09:29:27 2009
% --- ./dev/fb/fbreg.h	Wed Jun 17 02:23:39 2009
% ***************
% *** 35,75 ****
% 
%   /* some macros */
% ! #ifdef __i386__
% ! #define bcopy_io(s, d, c)	generic_bcopy((void *)(s), (void *)(d), (c))
% ! #define bcopy_toio(s, d, c)	generic_bcopy((void *)(s), (void *)(d), (c))
% ! #define bcopy_fromio(s, d, c)	generic_bcopy((void *)(s), (void *)(d), (c))
% ! #define bzero_io(d, c)		generic_bzero((void *)(d), (c))
% ! #define fill_io(p, d, c)	fill((p), (void *)(d), (c))
% ! #define fillw_io(p, d, c)	fillw((p), (void *)(d), (c))
% ! void generic_bcopy(const void *s, void *d, size_t c);
% ! void generic_bzero(void *d, size_t c);
% ! #elif defined(__amd64__)
% ! #define bcopy_io(s, d, c)	bcopy((void *)(s), (void *)(d), (c))
% ! #define bcopy_toio(s, d, c)	bcopy((void *)(s), (void *)(d), (c))
% ! #define bcopy_fromio(s, d, c)	bcopy((void *)(s), (void *)(d), (c))
% ! #define bzero_io(d, c)		bzero((void *)(d), (c))
% ! #define fill_io(p, d, c)	fill((p), (void *)(d), (c))
% ! #define fillw_io(p, d, c)	fillw((p), (void *)(d), (c))
% ! #elif defined(__ia64__) || defined(__sparc64__)
% ! #if defined(__ia64__)
%   #include 
%   #define	bcopy_fromio(s, d, c)	\
% ! 	bus_space_read_region_1(IA64_BUS_SPACE_MEM, s, 0, (void*)(d), c)
%   #define	bcopy_io(s, d, c)	\
% ! 	bus_space_copy_region_1(IA64_BUS_SPACE_MEM, s, 0, d, 0, c)
%   #define	bcopy_toio(s, d, c)	\
% ! 	bus_space_write_region_1(IA64_BUS_SPACE_MEM, d, 0, (void*)(s), c)
%   #define	bzero_io(d, c)		\
% ! 	bus_space_set_region_1(IA64_BUS_SPACE_MEM, (intptr_t)(d), 0, 0, c)
%   #define	fill_io(p, d, c)	\
% ! 	bus_space_set_region_1(IA64_BUS_SPACE_MEM, (intptr_t)(d), 0, p, c)
%   #define	fillw_io(p, d, c)	\
% ! 	bus_space_set_region_2(IA64_BUS_SPACE_MEM, (intptr_t)(d), 0, p, c)
% ! #define	readb(a)		bus_space_read_1(IA64_BUS_SPACE_MEM, a, 0)
% ! #define	readw(a)		bus_space_read_2(IA64_BUS_SPACE_MEM, a, 0)
% ! #define	writeb(a, v)		bus_space_write_1(IA64_BUS_SPACE_MEM, a, 0, v)
% ! #define	writew(a, v)		bus_space_write_2(IA64_BUS_SPACE_MEM, a, 0, v)
% ! #define	writel(a, v)		bus_space_write_4(IA64_BUS_SPACE_MEM, a, 0, v)
% ! #endif /* __ia64__ */
%   static __inline void
%   fillw(int val, uint16_t *buf, size_t size)
% --- 35,74 ----
% 
%   /* some macros */
% ! #if defined(__amd64__) || defined(__i386__) ||  defined(__ia64__) || \
% !     defined(__sparc64__)
% ! /* XXX __sparc64__ doesn't seem to belong here. */
% ! #if defined(__amd64__) || defined(__i386__) ||  defined(__ia64__)
%   #include 
% + #endif
% + /* XXX fix gratuitous MD spelling: */
% + #ifdef __amd64__
% + #define	BUS_SPACE_MEM	AMD64_BUS_SPACE_MEM
% + #endif
% + #ifdef __i386__
% + #define	BUS_SPACE_MEM	I386_BUS_SPACE_MEM
% + #endif
% + #ifdef __ia64__
% + #define	BUS_SPACE_MEM	IA64_BUS_SPACE_MEM
% + #endif
% + #if defined(__amd64__) || defined(__i386__) ||  defined(__ia64__)
%   #define	bcopy_fromio(s, d, c)	\
% ! 	bus_space_read_region_1(BUS_SPACE_MEM, s, 0, (void*)(d), c)
%   #define	bcopy_io(s, d, c)	\
% ! 	bus_space_copy_region_1(BUS_SPACE_MEM, s, 0, d, 0, c)
%   #define	bcopy_toio(s, d, c)	\
% ! 	bus_space_write_region_1(BUS_SPACE_MEM, d, 0, (void*)(s), c)
%   #define	bzero_io(d, c)		\
% ! 	bus_space_set_region_1(BUS_SPACE_MEM, (intptr_t)(d), 0, 0, c)
%   #define	fill_io(p, d, c)	\
% ! 	bus_space_set_region_1(BUS_SPACE_MEM, (intptr_t)(d), 0, p, c)
%   #define	fillw_io(p, d, c)	\
% ! 	bus_space_set_region_2(BUS_SPACE_MEM, (intptr_t)(d), 0, p, c)
% ! #define	readb(a)		bus_space_read_1(BUS_SPACE_MEM, a, 0)
% ! #define	readw(a)		bus_space_read_2(BUS_SPACE_MEM, a, 0)
% ! #define	writeb(a, v)		bus_space_write_1(BUS_SPACE_MEM, a, 0, v)
% ! #define	writew(a, v)		bus_space_write_2(BUS_SPACE_MEM, a, 0, v)
% ! #define	writel(a, v)		bus_space_write_4(BUS_SPACE_MEM, a, 0, v)
% ! #endif /* __amd64__ || __i386__ || __ia64__ */
% ! /* fillw for __amd64__ || __i386__ || __ia64__ and || __sparc64__ too, ugh. */
%   static __inline void
%   fillw(int val, uint16_t *buf, size_t size)
% ***************
% *** 102,106 ****
%   #define fillw(p, d, c)		memsetw((d), (p), (c))
%   #define fillw_io(p, d, c)	memsetw_io((d), (p), (c))
% ! #endif /* !__i386__ */
% 
%   /* video function table */
% --- 101,105 ----
%   #define fillw(p, d, c)		memsetw((d), (p), (c))
%   #define fillw_io(p, d, c)	memsetw_io((d), (p), (c))
% ! #endif
% 
%   /* video function table */

>> @@ -649,6 +668,42 @@ ram_probe(device_t dev)
>>  	return (0);
>>  }
>>
>> +#ifdef __amd64__
>> +static int
>> +ram_attach(device_t dev)
>> ...
>> +#else
>>  static int
>>  ram_attach(device_t dev)
>>  {
>> @@ -688,6 +743,7 @@ ram_attach(device_t dev)
>>  	}
>>  	return (0);
>>  }
>> +#endif
>
> It would be better to merge these two routines.  The loader now passes the
> smap to i386 kernels as well, so ram_attach() should probably be changed to
> try the amd64 approach first and if that fails fall back to using the
> phys_avail[] array instead.

Or if it is MD, it doesn't belong under x86.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 17:50: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 E5B211065673;
	Thu, 28 Oct 2010 17:50:23 +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 B53158FC19;
	Thu, 28 Oct 2010 17:50:23 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 490E746B2E;
	Thu, 28 Oct 2010 13:50:23 -0400 (EDT)
Date: Thu, 28 Oct 2010 18:50:23 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Gary Jennejohn 
In-Reply-To: <20101028095538.24147119@ernst.jennejohn.org>
Message-ID: 
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: Doug Barton , d@delphij.net, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Bruce Evans ,
	svn-src-head@FreeBSD.org, Alexander Best ,
	Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 17:50:24 -0000

On Thu, 28 Oct 2010, Gary Jennejohn wrote:

>>> The -P option assumes that the underlying storage overwrites file block 
>>> when data is written on existing offset.  Several factors including the 
>>> file system and its backing store could defeat the assumption, this 
>>> includes, but is not limited to file systems that uses Copy-On-Write 
>>> strategy (e.g. ZFS or UFS when snapshot is being used), or backing 
>>> datastore that does journaling, etc.  In addition, only regular files are 
>>> overwritten, other types of files are not.
>>
>> Summary: it is very hard to tell whether -P works, even when you think you 
>> know what all the subsystems are doing.
>
> All this discussion leads me to the conclusion that we should just remove 
> the -P functionality and add a remark to the man page that that was done 
> because it isn't guaranteed to work on all file systems.
>
> Why give users a false sense of security?  If they're concerned about data 
> security then they should use geli or something similar.

I'm not sure I entirely agree with this conclusion: there are times when -P 
can be quite effective at removing data from a system, and not having it 
available when it could work might also be problematic.

Part of the problem here is that we have successfully abstracted away a lot of 
information going up the storage stack.  One possibly solution to this problem 
is to add ways for that information to propagate better -- in the same way 
that the end-to-end argument in network design is moderated by the reality 
that performance can be dramatically improved if information gathering can be 
done with an awareness of lower layers (for example, PMTU discovery), even if 
decisions about how to use that information are at the endpoints only.

For example, you could imagine a pathconf() call that asks the file system if 
overwriting a file is likely to result in the data going away -- UFS could 
answer "yes" unless it's snapshotting the file system, and ZFS could simply 
answer "no".

In FreeBSD 9, we're going to have two common file system configurations: ZFS 
and UFS+SUJ; the latter will do overwriting of files just fine on most current 
media.

Robert

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 17:50: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 693561065694;
	Thu, 28 Oct 2010 17:50:50 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5650A8FC20;
	Thu, 28 Oct 2010 17:50: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 o9SHooN9020143;
	Thu, 28 Oct 2010 17:50:50 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SHoor1020139;
	Thu, 28 Oct 2010 17:50:50 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281750.o9SHoor1020139@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 17:50: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: r214467 - 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: Thu, 28 Oct 2010 17:50:50 -0000

Author: tuexen
Date: Thu Oct 28 17:50:50 2010
New Revision: 214467
URL: http://svn.freebsd.org/changeset/base/214467

Log:
  MFC 209289:
  Fix a rece condition in the shutdown handling.
  The race condition resulted in a panic.

Modified:
  stable/8/sys/netinet/sctp.h
  stable/8/sys/netinet/sctp_usrreq.c
  stable/8/sys/netinet/sctputil.c

Modified: stable/8/sys/netinet/sctp.h
==============================================================================
--- stable/8/sys/netinet/sctp.h	Thu Oct 28 17:17:45 2010	(r214466)
+++ stable/8/sys/netinet/sctp.h	Thu Oct 28 17:50:50 2010	(r214467)
@@ -440,6 +440,7 @@ struct sctp_error_unrecognized_chunk {
 #define SCTP_PCB_FLAGS_BLOCKING_IO	0x08000000
 #define SCTP_PCB_FLAGS_SOCKET_GONE	0x10000000
 #define SCTP_PCB_FLAGS_SOCKET_ALLGONE	0x20000000
+#define SCTP_PCB_FLAGS_SOCKET_CANT_READ	0x40000000
 /* flags to copy to new PCB */
 #define SCTP_PCB_COPY_FLAGS		(SCTP_PCB_FLAGS_BOUNDALL|\
 					 SCTP_PCB_FLAGS_WAKEINPUT|\

Modified: stable/8/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/8/sys/netinet/sctp_usrreq.c	Thu Oct 28 17:17:45 2010	(r214466)
+++ stable/8/sys/netinet/sctp_usrreq.c	Thu Oct 28 17:50:50 2010	(r214467)
@@ -948,11 +948,30 @@ sctp_flush(struct socket *so, int how)
 	 * they will not be able to read the data, the socket will block
 	 * that from happening.
 	 */
+	struct sctp_inpcb *inp;
+
+	inp = (struct sctp_inpcb *)so->so_pcb;
+	if (inp == NULL) {
+		SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+		return EINVAL;
+	}
+	SCTP_INP_RLOCK(inp);
+	/* For the 1 to many model this does nothing */
+	if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) {
+		SCTP_INP_RUNLOCK(inp);
+		return (0);
+	}
+	SCTP_INP_RUNLOCK(inp);
 	if ((how == PRU_FLUSH_RD) || (how == PRU_FLUSH_RDWR)) {
 		/*
 		 * First make sure the sb will be happy, we don't use these
 		 * except maybe the count
 		 */
+		SCTP_INP_WLOCK(inp);
+		SCTP_INP_READ_LOCK(inp);
+		inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ;
+		SCTP_INP_READ_UNLOCK(inp);
+		SCTP_INP_WUNLOCK(inp);
 		so->so_rcv.sb_cc = 0;
 		so->so_rcv.sb_mbcnt = 0;
 		so->so_rcv.sb_mb = NULL;

Modified: stable/8/sys/netinet/sctputil.c
==============================================================================
--- stable/8/sys/netinet/sctputil.c	Thu Oct 28 17:17:45 2010	(r214466)
+++ stable/8/sys/netinet/sctputil.c	Thu Oct 28 17:50:50 2010	(r214467)
@@ -3183,6 +3183,9 @@ sctp_notify_partial_delivery_indication(
 		/* event not enabled */
 		return;
 	}
+	if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ) {
+		return;
+	}
 	m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_DONTWAIT, 1, MT_DATA);
 	if (m_notify == NULL)
 		/* no space left */
@@ -4369,6 +4372,17 @@ sctp_add_to_readq(struct sctp_inpcb *inp
 	}
 	if (inp_read_lock_held == 0)
 		SCTP_INP_READ_LOCK(inp);
+	if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ) {
+		sctp_free_remote_addr(control->whoFrom);
+		if (control->data) {
+			sctp_m_freem(control->data);
+			control->data = NULL;
+		}
+		SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_readq), control);
+		if (inp_read_lock_held == 0)
+			SCTP_INP_READ_UNLOCK(inp);
+		return;
+	}
 	if (!(control->spec_flags & M_NOTIFICATION)) {
 		atomic_add_int(&inp->total_recvs, 1);
 		if (!control->do_not_ref_stcb) {
@@ -4409,6 +4423,8 @@ sctp_add_to_readq(struct sctp_inpcb *inp
 		control->tail_mbuf = prev;
 	} else {
 		/* Everything got collapsed out?? */
+		sctp_free_remote_addr(control->whoFrom);
+		SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_readq), control);
 		if (inp_read_lock_held == 0)
 			SCTP_INP_READ_UNLOCK(inp);
 		return;
@@ -4481,6 +4497,10 @@ get_out:
 		}
 		return (-1);
 	}
+	if (inp && (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ)) {
+		SCTP_INP_READ_UNLOCK(inp);
+		return 0;
+	}
 	if (control->end_added) {
 		/* huh this one is complete? */
 		goto get_out;

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:14: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 4C4B21065675;
	Thu, 28 Oct 2010 18:14:33 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1FC058FC26;
	Thu, 28 Oct 2010 18:14: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 o9SIEXZe021286;
	Thu, 28 Oct 2010 18:14:33 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SIEXoR021285;
	Thu, 28 Oct 2010 18:14:33 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010281814.o9SIEXoR021285@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 28 Oct 2010 18:14: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: r214468 - vendor/tcpdump/4.1.1
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 18:14:33 -0000

Author: rpaulo
Date: Thu Oct 28 18:14:32 2010
New Revision: 214468
URL: http://svn.freebsd.org/changeset/base/214468

Log:
  Tag tcpdump-4.1.1.

Added:
  vendor/tcpdump/4.1.1/
     - copied from r214467, vendor/tcpdump/dist/

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:15: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 0EB0F106566B;
	Thu, 28 Oct 2010 18:15:08 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D27A98FC25;
	Thu, 28 Oct 2010 18:15: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 o9SIF7g6021356;
	Thu, 28 Oct 2010 18:15:07 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SIF74j021355;
	Thu, 28 Oct 2010 18:15:07 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010281815.o9SIF74j021355@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 28 Oct 2010 18:15:07 +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: r214469 - vendor/libpcap/1.1.1
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 18:15:08 -0000

Author: rpaulo
Date: Thu Oct 28 18:15:07 2010
New Revision: 214469
URL: http://svn.freebsd.org/changeset/base/214469

Log:
  Tag libpcap 1.1.1.

Added:
  vendor/libpcap/1.1.1/
     - copied from r214468, vendor/libpcap/dist/

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:15: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 724261065693;
	Thu, 28 Oct 2010 18:15: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 40A348FC1D;
	Thu, 28 Oct 2010 18:15: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 CE70A46B49;
	Thu, 28 Oct 2010 14:15:51 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8D0E78A029;
	Thu, 28 Oct 2010 14:15:50 -0400 (EDT)
From: John Baldwin 
To: Attilio Rao 
Date: Thu, 28 Oct 2010 14:11:40 -0400
User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; )
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010281257.05481.jhb@freebsd.org>
	
In-Reply-To: 
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201010281411.40423.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Thu, 28 Oct 2010 14:15:50 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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, 28 Oct 2010 18:15:52 -0000

On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
> 2010/10/28 John Baldwin :
> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
> >> Author: attilio
> >> Date: Thu Oct 28 16:31:39 2010
> >> New Revision: 214457
> >> URL: http://svn.freebsd.org/changeset/base/214457
> >>
> >> Log:
> >>   Merge nexus.c from amd64 and i386 to x86 subtree.
> >>
> >>   Sponsored by:       Sandvine Incorporated
> >>   Tested by:  gianni
> >>
> >
> > It would be better to merge these two routines.  The loader now passes the
> > smap to i386 kernels as well, so ram_attach() should probably be changed to
> > try the amd64 approach first and if that fails fall back to using the
> > phys_avail[] array instead.
> 
> What do you think about this patch?:
> Index: nexus.c
> ===================================================================
> --- nexus.c     (revision 214457)
> +++ nexus.c     (working copy)
> @@ -52,9 +52,7 @@
>  #include 
>  #include 
>  #include 
> -#ifdef __amd64__
>  #include 
> -#endif
>  #include 
>  #include 
>  #include 
> @@ -67,12 +65,10 @@
>  #include 
>  #include 
> 
> -#ifdef __amd64__
>  #include 
> -#include 
> -#endif
>  #include 
>  #include 
> +#include 
> 
>  #ifdef DEV_APIC
>  #include "pcib_if.h"
> @@ -89,11 +85,13 @@
>  #include 
> 
>  #ifdef __amd64__
> -#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
> -#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
> +#define        X86_BUS_SPACE_IO        AMD64_BUS_SPACE_IO
> +#define        X86_BUS_SPACE_MEM       AMD64_BUS_SPACE_MEM
> +#define        ELF_KERN_STR            "elf64 kernel"
>  #else
> -#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
> -#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
> +#define        X86_BUS_SPACE_IO        I386_BUS_SPACE_IO
> +#define        X86_BUS_SPACE_MEM       I386_BUS_SPACE_MEM
> +#define        ELF_KERN_STR            "elf32 kernel"
>  #endif

I would not do this.  What I meant is that amd64 and i386 should be
changed to both use X86_BUS_SPACE_* and {AMD64,I386}_BUS_SPACE_* should be
retired.  This would involve changing the bus space code itself slightly,
but it could perhaps be shared as a result.  Alternatively as bde@ notes
we could just drop the MD prefix entirely and have BUS_SPACE_* instead.

However, I wouldn't make any changes to just nexus.c for the BUS_SPACE_*
stuff.

> @@ -668,20 +666,20 @@
>         return (0);
>  }
> 
> -#ifdef __amd64__
>  static int
>  ram_attach(device_t dev)
>  {
>         struct bios_smap *smapbase, *smap, *smapend;
>         struct resource *res;
> +       vm_paddr_t *p;
>         caddr_t kmdp;
>         uint32_t smapsize;
> -       int error, rid;
> +       int error, i, rid;
> 
>         /* Retrieve the system memory map from the loader. */
>         kmdp = preload_search_by_type("elf kernel");
>         if (kmdp == NULL)
> -               kmdp = preload_search_by_type("elf64 kernel");
> +               kmdp = preload_search_by_type(ELF_KERN_STR);
>         smapbase = (struct bios_smap *)preload_search_info(kmdp,
>             MODINFO_METADATA | MODINFOMD_SMAP);
>         smapsize = *((u_int32_t *)smapbase - 1);

It would be nice if ELF_KERN_STR could be autogenerated as something like:

"elf ## __ELF_WORD_SIZE ## kernel" instead of needing an #ifdef.

> @@ -701,16 +699,11 @@
>                         panic("ram_attach: resource %d failed to attach", rid);
>                 rid++;
>         }
> -       return (0);
> -}
> -#else
> -static int
> -ram_attach(device_t dev)
> -{
> -       struct resource *res;
> -       vm_paddr_t *p;
> -       int error, i, rid;
> 
> +       /* If at least one smap attached, return. */
> +       if (rid != 0)
> +               return (0);
> +

Perhaps this instead:

	/* If we found an SMAP, return. */
	if (smapbase != NULL)
		return (0);

>         /*
>          * We use the dump_avail[] array rather than phys_avail[] for
>          * the memory map as phys_avail[] contains holes for kernel
> @@ -724,7 +717,7 @@
>          */
>         for (i = 0, p = dump_avail; p[1] != 0; i++, p += 2) {
>                 rid = i;
> -#ifdef PAE
> +#if !defined(__amd64__) && defined(PAE)
>                 /*
>                  * Resources use long's to track resources, so we can't
>                  * include memory regions above 4GB.

No need for this bit, PAE is never true on amd64, so it can just be used
directly in x86 code.

> @@ -743,7 +736,6 @@
>         }
>         return (0);
>  }
> -#endif
> 
>  static device_method_t ram_methods[] = {
>         /* Device interface */
> 

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:22:19 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 5B2D5106566B; Thu, 28 Oct 2010 18:22:19 +0000 (UTC)
Date: Thu, 28 Oct 2010 18:22:19 +0000
From: Alexander Best 
To: Robert Watson 
Message-ID: <20101028182219.GA36559@freebsd.org>
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
	
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
Cc: Doug Barton , d@delphij.net, svn-src-all@FreeBSD.org,
	Gary Jennejohn ,
	src-committers@FreeBSD.org, Bruce Evans ,
	svn-src-head@FreeBSD.org, Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 18:22:19 -0000

On Thu Oct 28 10, Robert Watson wrote:
> On Thu, 28 Oct 2010, Gary Jennejohn wrote:
> 
> >>>The -P option assumes that the underlying storage overwrites file block 
> >>>when data is written on existing offset.  Several factors including the 
> >>>file system and its backing store could defeat the assumption, this 
> >>>includes, but is not limited to file systems that uses Copy-On-Write 
> >>>strategy (e.g. ZFS or UFS when snapshot is being used), or backing 
> >>>datastore that does journaling, etc.  In addition, only regular files 
> >>>are overwritten, other types of files are not.
> >>
> >>Summary: it is very hard to tell whether -P works, even when you think 
> >>you know what all the subsystems are doing.
> >
> >All this discussion leads me to the conclusion that we should just remove 
> >the -P functionality and add a remark to the man page that that was done 
> >because it isn't guaranteed to work on all file systems.
> >
> >Why give users a false sense of security?  If they're concerned about data 
> >security then they should use geli or something similar.
> 
> I'm not sure I entirely agree with this conclusion: there are times when -P 
> can be quite effective at removing data from a system, and not having it 
> available when it could work might also be problematic.
> 
> Part of the problem here is that we have successfully abstracted away a lot 
> of information going up the storage stack.  One possibly solution to this 
> problem is to add ways for that information to propagate better -- in the 
> same way that the end-to-end argument in network design is moderated by the 
> reality that performance can be dramatically improved if information 
> gathering can be done with an awareness of lower layers (for example, PMTU 
> discovery), even if decisions about how to use that information are at the 
> endpoints only.
> 
> For example, you could imagine a pathconf() call that asks the file system 
> if overwriting a file is likely to result in the data going away -- UFS 
> could answer "yes" unless it's snapshotting the file system, and ZFS could 
> simply answer "no".
> 
> In FreeBSD 9, we're going to have two common file system configurations: 
> ZFS and UFS+SUJ; the latter will do overwriting of files just fine on most 
> current media.

i agree. however from this discussion it's become quite obvious that securely
deleting any data on a certain media is a very complex topic. when the -P
option got implemented into rm, securely deleting files was quite an easy and
intuitive task. this has clearly changed. so the question arises, if securely
removing data (maybe also directory entries) shouldn't be handled by a
specially designed utility?

the pathconf() idea looks very primising. should the return values ("yes" or
"no") simply be hardcoded for every fs? or should they be returned by a routine
which actually veryfies on the fly if overwriting files is possible?

alex

ps: please keep in mind that an import of fusefs might happen in the next few
months, so the fs situation on freebsd might change.

> 
> Robert

-- 
a13x

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18: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 7B15A106566C;
	Thu, 28 Oct 2010 18:25:58 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com
	[209.85.213.54])
	by mx1.freebsd.org (Postfix) with ESMTP id BC8F88FC14;
	Thu, 28 Oct 2010 18:25:57 +0000 (UTC)
Received: by ywh2 with SMTP id 2so944866ywh.13
	for ; Thu, 28 Oct 2010 11:25:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=USqmfz5pyg4LRhfjlRX/iFtf1NkV6+htDtwxH4Aa2r8=;
	b=ANEr67uGaOrmNnBEf6FR7SnPm8GD0I0QvrXTP3C/JuVNu1lFggfW7SkD4alc+Oggwa
	PMSoDELb4erchPMjTjTUeDX76Nh4BTxxbRBrqmvRsd59lEmR1i0Oi52K0/o71sK0YUz2
	rsntpB9xmP12c1uPqHjycCfv8QrBwdoI5CGdc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=gQn906XuvC5DvjF6sA/vmy8TC3xe7aPKdjdyvDbJFgg73MmL6PueGIEObOE4hmZqDh
	vhQrdm9GH3Fm0I64m+ex4cgZe7X9e+QD+DO/4hQsGkeM/X4jGtstkwvlCixQD/EsH4e+
	TV36bPOJKR7FOknJxCW9+MsVzBKVQ0Tu2N/Eo=
MIME-Version: 1.0
Received: by 10.90.2.20 with SMTP id 20mr3194500agb.69.1288290357129; Thu, 28
	Oct 2010 11:25:57 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.90.70.19 with HTTP; Thu, 28 Oct 2010 11:25:57 -0700 (PDT)
In-Reply-To: <4CC9483C.7050507@freebsd.org>
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
	
	<4CC803A8.3040602@freebsd.org>
	<20101027082122.GD1848@garage.freebsd.pl>
	<4CC85552.2020100@freebsd.org>
	<20101027133307.GQ2392@deviant.kiev.zoral.com.ua>
	
	<4CC851CC.80509@freebsd.org>
	
	<4CC9483C.7050507@freebsd.org>
Date: Thu, 28 Oct 2010 11:25:57 -0700
X-Google-Sender-Auth: -ipgJtTNOwM53RqE-A2F3pPkK8A
Message-ID: 
From: Garrett Cooper 
To: David Xu 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: src-committers@freebsd.org, Pawel Jakub Dawidek ,
	svn-src-all@freebsd.org, Andriy Gapon ,
	svn-src-head@freebsd.org, Kostik Belousov 
Subject: Re: svn commit: r214409 - 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, 28 Oct 2010 18:25:58 -0000

On Thu, Oct 28, 2010 at 2:54 AM, David Xu  wrote:
> Garrett Cooper wrote:
>>
>> On Wed, Oct 27, 2010 at 9:22 AM, Andriy Gapon  wrote:
>>>
>>> [patch attachment was lost]
>>
>> Ugh... Mailman hates me I guess :(...
>>
>>> on 27/10/2010 19:07 Garrett Cooper said the following:
>>>>
>>>> =A0 =A0How about this patch? I implemented this as a readonly tunable =
and
>>>
>>> I don't think that it's correct to call it a tunable or use
>>> CTLFLAG_RDTUN.
>>> As I understand it is a read-only sysctl.
>>
>> Converted to CTLFLAG_RD.
>>
>>>> sysconf tunable, because (AFAIK) the value that is being tested
>>>> shouldn't change during runtime after the system has been booted up,
>>>> and figuring that the value wasn't going to change it was better to
>>>> lose 4/8 bytes on the kernel stack instead of having to recompute the
>>>> value every time in a function call, with the associated lost heap /
>>>> stack memory in the process, as the assumption is that this libcall
>>>> was going to be called frequently by some programs.
>
> The patch looks fine to me. ;-)

If no one opposes the change, could you please commit the patch for me Davi=
d?
Thanks!
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:50: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 252DC106566B;
	Thu, 28 Oct 2010 18:50:36 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 112198FC0A;
	Thu, 28 Oct 2010 18:50: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 o9SIoZ7t023116;
	Thu, 28 Oct 2010 18:50:35 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SIoZXI023112;
	Thu, 28 Oct 2010 18:50:35 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281850.o9SIoZXI023112@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 18:50: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: r214470 - in stable/8/sys: kern 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: Thu, 28 Oct 2010 18:50:36 -0000

Author: tuexen
Date: Thu Oct 28 18:50:35 2010
New Revision: 214470
URL: http://svn.freebsd.org/changeset/base/214470

Log:
  MFC 212242:
  
  Implement correct handling of address parameter and
  sendinfo for SCTP send calls.

Modified:
  stable/8/sys/kern/uipc_syscalls.c
  stable/8/sys/netinet/sctp_output.c
  stable/8/sys/netinet/sctp_uio.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)

Modified: stable/8/sys/kern/uipc_syscalls.c
==============================================================================
--- stable/8/sys/kern/uipc_syscalls.c	Thu Oct 28 18:15:07 2010	(r214469)
+++ stable/8/sys/kern/uipc_syscalls.c	Thu Oct 28 18:50:35 2010	(r214470)
@@ -2385,7 +2385,6 @@ sctp_generic_sendmsg (td, uap)
 	struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL;
 	struct socket *so;
 	struct file *fp = NULL;
-	int use_rcvinfo = 1;
 	int error = 0, len;
 	struct sockaddr *to = NULL;
 #ifdef KTRACE
@@ -2438,7 +2437,7 @@ sctp_generic_sendmsg (td, uap)
 	CURVNET_SET(so->so_vnet);
 	error = sctp_lower_sosend(so, to, &auio,
 		    (struct mbuf *)NULL, (struct mbuf *)NULL,
-		    uap->flags, use_rcvinfo, u_sinfo, td);
+		    uap->flags, u_sinfo, td);
 	CURVNET_RESTORE();
 	if (error) {
 		if (auio.uio_resid != len && (error == ERESTART ||
@@ -2489,7 +2488,6 @@ sctp_generic_sendmsg_iov(td, uap)
 	struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL;
 	struct socket *so;
 	struct file *fp = NULL;
-	int use_rcvinfo = 1;
 	int error=0, len, i;
 	struct sockaddr *to = NULL;
 #ifdef KTRACE
@@ -2556,7 +2554,7 @@ sctp_generic_sendmsg_iov(td, uap)
 	CURVNET_SET(so->so_vnet);
 	error = sctp_lower_sosend(so, to, &auio,
 		    (struct mbuf *)NULL, (struct mbuf *)NULL,
-		    uap->flags, use_rcvinfo, u_sinfo, td);
+		    uap->flags, u_sinfo, td);
 	CURVNET_RESTORE();
 	if (error) {
 		if (auio.uio_resid != len && (error == ERESTART ||

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 18:15:07 2010	(r214469)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 18:50:35 2010	(r214470)
@@ -12158,7 +12158,7 @@ sctp_sosend(struct socket *so,
 	error = sctp_lower_sosend(so, addr_to_use, uio, top,
 	    control,
 	    flags,
-	    use_rcvinfo, &srcv
+	    use_rcvinfo ? &srcv : NULL
 	    ,p
 	    );
 	return (error);
@@ -12172,7 +12172,6 @@ sctp_lower_sosend(struct socket *so,
     struct mbuf *i_pak,
     struct mbuf *control,
     int flags,
-    int use_rcvinfo,
     struct sctp_sndrcvinfo *srcv
     ,
     struct thread *p
@@ -12200,8 +12199,10 @@ sctp_lower_sosend(struct socket *so,
 	int got_all_of_the_send = 0;
 	int hold_tcblock = 0;
 	int non_blocking = 0;
-	int temp_flags = 0;
 	uint32_t local_add_more, local_soresv = 0;
+	uint16_t port;
+	uint16_t sinfo_flags;
+	sctp_assoc_t sinfo_assoc_id;
 
 	error = 0;
 	net = NULL;
@@ -12236,28 +12237,39 @@ sctp_lower_sosend(struct socket *so,
 	SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %d\n",
 	    addr,
 	    sndlen);
+	if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
+	    (inp->sctp_socket->so_qlimit)) {
+		/* The listener can NOT send */
+		SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOTCONN);
+		error = ENOTCONN;
+		goto out_unlocked;
+	}
 	/**
 	 * Pre-screen address, if one is given the sin-len
 	 * must be set correctly!
 	 */
 	if (addr) {
-		switch (addr->sa_family) {
+		union sctp_sockstore *raddr = (union sctp_sockstore *)addr;
+
+		switch (raddr->sa.sa_family) {
 #if defined(INET)
 		case AF_INET:
-			if (addr->sa_len != sizeof(struct sockaddr_in)) {
+			if (raddr->sin.sin_len != sizeof(struct sockaddr_in)) {
 				SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
 				error = EINVAL;
 				goto out_unlocked;
 			}
+			port = raddr->sin.sin_port;
 			break;
 #endif
 #if defined(INET6)
 		case AF_INET6:
-			if (addr->sa_len != sizeof(struct sockaddr_in6)) {
+			if (raddr->sin6.sin6_len != sizeof(struct sockaddr_in6)) {
 				SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
 				error = EINVAL;
 				goto out_unlocked;
 			}
+			port = raddr->sin6.sin6_port;
 			break;
 #endif
 		default:
@@ -12265,32 +12277,34 @@ sctp_lower_sosend(struct socket *so,
 			error = EAFNOSUPPORT;
 			goto out_unlocked;
 		}
-	}
-	hold_tcblock = 0;
+	} else
+		port = 0;
 
-	if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
-	    (inp->sctp_socket->so_qlimit)) {
-		/* The listener can NOT send */
-		SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOTCONN);
-		error = ENOTCONN;
-		goto out_unlocked;
-	}
-	if ((use_rcvinfo) && srcv) {
-		if (INVALID_SINFO_FLAG(srcv->sinfo_flags) ||
-		    PR_SCTP_INVALID_POLICY(srcv->sinfo_flags)) {
+	if (srcv) {
+		sinfo_flags = srcv->sinfo_flags;
+		sinfo_assoc_id = srcv->sinfo_assoc_id;
+		if (INVALID_SINFO_FLAG(sinfo_flags) ||
+		    PR_SCTP_INVALID_POLICY(sinfo_flags)) {
 			SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
 			error = EINVAL;
 			goto out_unlocked;
 		}
 		if (srcv->sinfo_flags)
 			SCTP_STAT_INCR(sctps_sends_with_flags);
-
-		if (srcv->sinfo_flags & SCTP_SENDALL) {
-			/* its a sendall */
-			error = sctp_sendall(inp, uio, top, srcv);
-			top = NULL;
-			goto out_unlocked;
-		}
+	} else {
+		sinfo_flags = inp->def_send.sinfo_flags;
+		sinfo_assoc_id = inp->def_send.sinfo_assoc_id;
+	}
+	if (sinfo_flags & SCTP_SENDALL) {
+		/* its a sendall */
+		error = sctp_sendall(inp, uio, top, srcv);
+		top = NULL;
+		goto out_unlocked;
+	}
+	if ((sinfo_flags & SCTP_ADDR_OVER) && (addr == NULL)) {
+		SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
+		error = EINVAL;
+		goto out_unlocked;
 	}
 	/* now we must find the assoc */
 	if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) ||
@@ -12306,80 +12320,8 @@ sctp_lower_sosend(struct socket *so,
 		SCTP_TCB_LOCK(stcb);
 		hold_tcblock = 1;
 		SCTP_INP_RUNLOCK(inp);
-		if (addr) {
-			/* Must locate the net structure if addr given */
-			net = sctp_findnet(stcb, addr);
-			if (net) {
-				/* validate port was 0 or correct */
-				struct sockaddr_in *sin;
-
-				sin = (struct sockaddr_in *)addr;
-				if ((sin->sin_port != 0) &&
-				    (sin->sin_port != stcb->rport)) {
-					net = NULL;
-				}
-			}
-			temp_flags |= SCTP_ADDR_OVER;
-		} else
-			net = stcb->asoc.primary_destination;
-		if (addr && (net == NULL)) {
-			/* Could not find address, was it legal */
-			if (addr->sa_family == AF_INET) {
-				struct sockaddr_in *sin;
-
-				sin = (struct sockaddr_in *)addr;
-				if (sin->sin_addr.s_addr == 0) {
-					if ((sin->sin_port == 0) ||
-					    (sin->sin_port == stcb->rport)) {
-						net = stcb->asoc.primary_destination;
-					}
-				}
-			} else {
-				struct sockaddr_in6 *sin6;
-
-				sin6 = (struct sockaddr_in6 *)addr;
-				if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
-					if ((sin6->sin6_port == 0) ||
-					    (sin6->sin6_port == stcb->rport)) {
-						net = stcb->asoc.primary_destination;
-					}
-				}
-			}
-		}
-		if (net == NULL) {
-			SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
-			error = EINVAL;
-			goto out_unlocked;
-		}
-	} else if (use_rcvinfo && srcv && srcv->sinfo_assoc_id) {
-		stcb = sctp_findassociation_ep_asocid(inp, srcv->sinfo_assoc_id, 0);
-		if (stcb) {
-			if (addr)
-				/*
-				 * Must locate the net structure if addr
-				 * given
-				 */
-				net = sctp_findnet(stcb, addr);
-			else
-				net = stcb->asoc.primary_destination;
-			if ((srcv->sinfo_flags & SCTP_ADDR_OVER) &&
-			    ((net == NULL) || (addr == NULL))) {
-				struct sockaddr_in *sin;
-
-				if (addr == NULL) {
-					SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
-					error = EINVAL;
-					goto out_unlocked;
-				}
-				sin = (struct sockaddr_in *)addr;
-				/* Validate port is 0 or correct */
-				if ((sin->sin_port != 0) &&
-				    (sin->sin_port != stcb->rport)) {
-					net = NULL;
-				}
-			}
-		}
-		hold_tcblock = 0;
+	} else if (sinfo_assoc_id) {
+		stcb = sctp_findassociation_ep_asocid(inp, sinfo_assoc_id, 0);
 	} else if (addr) {
 		/*-
 		 * Since we did not use findep we must
@@ -12452,10 +12394,8 @@ sctp_lower_sosend(struct socket *so,
 			 */
 			uint32_t vrf_id;
 
-			if ((use_rcvinfo) && (srcv) &&
-			    ((srcv->sinfo_flags & SCTP_ABORT) ||
-			    ((srcv->sinfo_flags & SCTP_EOF) &&
-			    (sndlen == 0)))) {
+			if ((sinfo_flags & SCTP_ABORT) ||
+			    ((sinfo_flags & SCTP_EOF) && (sndlen == 0))) {
 				/*-
 				 * User asks to abort a non-existant assoc,
 				 * or EOF a non-existant assoc with no data
@@ -12584,10 +12524,25 @@ sctp_lower_sosend(struct socket *so,
 			 * structure may now have an update and thus we may need to
 			 * change it BEFORE we append the message.
 			 */
-			net = stcb->asoc.primary_destination;
-			asoc = &stcb->asoc;
 		}
 	}
+	if (srcv == NULL)
+		srcv = (struct sctp_sndrcvinfo *)&stcb->asoc.def_send;
+	if (srcv->sinfo_flags & SCTP_ADDR_OVER) {
+		if (addr)
+			net = sctp_findnet(stcb, addr);
+		else
+			net = NULL;
+		if ((net == NULL) ||
+		    ((port != 0) && (port != stcb->rport))) {
+			SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
+			error = EINVAL;
+			goto out_unlocked;
+		}
+	} else {
+		net = stcb->asoc.primary_destination;
+	}
+
 	if ((SCTP_SO_IS_NBIO(so)
 	    || (flags & MSG_NBIO)
 	    )) {
@@ -12658,10 +12613,6 @@ sctp_lower_sosend(struct socket *so,
 	    (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) {
 		queue_only = 1;
 	}
-	if ((use_rcvinfo == 0) || (srcv == NULL)) {
-		/* Grab the default stuff from the asoc */
-		srcv = (struct sctp_sndrcvinfo *)&stcb->asoc.def_send;
-	}
 	/* we are now done with all control */
 	if (control) {
 		sctp_m_freem(control);
@@ -12671,8 +12622,7 @@ sctp_lower_sosend(struct socket *so,
 	    (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) ||
 	    (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) ||
 	    (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) {
-		if ((use_rcvinfo) &&
-		    (srcv->sinfo_flags & SCTP_ABORT)) {
+		if (srcv->sinfo_flags & SCTP_ABORT) {
 			;
 		} else {
 			SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ECONNRESET);
@@ -12684,16 +12634,6 @@ sctp_lower_sosend(struct socket *so,
 	if (p) {
 		p->td_ru.ru_msgsnd++;
 	}
-	if (stcb) {
-		if (((srcv->sinfo_flags | temp_flags) & SCTP_ADDR_OVER) == 0) {
-			net = stcb->asoc.primary_destination;
-		}
-	}
-	if (net == NULL) {
-		SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
-		error = EINVAL;
-		goto out_unlocked;
-	}
 	if ((net->flight_size > net->cwnd) &&
 	    (asoc->sctp_cmt_on_off == 0)) {
 		/*-

Modified: stable/8/sys/netinet/sctp_uio.h
==============================================================================
--- stable/8/sys/netinet/sctp_uio.h	Thu Oct 28 18:15:07 2010	(r214469)
+++ stable/8/sys/netinet/sctp_uio.h	Thu Oct 28 18:50:35 2010	(r214470)
@@ -982,6 +982,23 @@ union sctp_sockstore {
 	struct sockaddr sa;
 };
 
+
+/***********************************/
+/* And something for us old timers */
+/***********************************/
+
+#ifndef ntohll
+#include 
+#define ntohll(x) be64toh(x)
+#endif
+
+#ifndef htonll
+#include 
+#define htonll(x) htobe64(x)
+#endif
+/***********************************/
+
+
 struct xsctp_inpcb {
 	uint32_t last;
 	uint32_t flags;
@@ -1079,7 +1096,6 @@ sctp_lower_sosend(struct socket *so,
     struct mbuf *i_pak,
     struct mbuf *control,
     int flags,
-    int use_rcvinfo,
     struct sctp_sndrcvinfo *srcv
     ,struct thread *p
 );

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:52: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 4C89B106564A;
	Thu, 28 Oct 2010 18:52:49 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 38AFB8FC08;
	Thu, 28 Oct 2010 18:52: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 o9SIqnDL023268;
	Thu, 28 Oct 2010 18:52:49 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SIqnc2023266;
	Thu, 28 Oct 2010 18:52:49 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281852.o9SIqnc2023266@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 18:52:49 +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: r214471 - 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: Thu, 28 Oct 2010 18:52:49 -0000

Author: tuexen
Date: Thu Oct 28 18:52:48 2010
New Revision: 214471
URL: http://svn.freebsd.org/changeset/base/214471

Log:
  MFC 212380:
  * Remove code which has no effect.
  * Clean up the handling in sctp_lower_sosend().

Modified:
  stable/8/sys/netinet/sctp_output.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)

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 18:50:35 2010	(r214470)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 18:52:48 2010	(r214471)
@@ -12124,7 +12124,6 @@ sctp_sosend(struct socket *so,
     struct thread *p
 )
 {
-	struct sctp_inpcb *inp;
 	int error, use_rcvinfo = 0;
 	struct sctp_sndrcvinfo srcv;
 	struct sockaddr *addr_to_use;
@@ -12134,7 +12133,6 @@ sctp_sosend(struct socket *so,
 
 #endif
 
-	inp = (struct sctp_inpcb *)so->so_pcb;
 	if (control) {
 		/* process cmsg snd/rcv info (maybe a assoc-id) */
 		if (sctp_find_cmsg(SCTP_SNDRCV, (void *)&srcv, control,
@@ -12182,7 +12180,7 @@ sctp_lower_sosend(struct socket *so,
 	struct mbuf *top = NULL;
 	int queue_only = 0, queue_only_for_init = 0;
 	int free_cnt_applied = 0;
-	int un_sent = 0;
+	int un_sent;
 	int now_filled = 0;
 	unsigned int inqueue_bytes = 0;
 	struct sctp_block_entry be;
@@ -12525,9 +12523,10 @@ sctp_lower_sosend(struct socket *so,
 			 * change it BEFORE we append the message.
 			 */
 		}
-	}
+	} else
+		asoc = &stcb->asoc;
 	if (srcv == NULL)
-		srcv = (struct sctp_sndrcvinfo *)&stcb->asoc.def_send;
+		srcv = (struct sctp_sndrcvinfo *)&asoc->def_send;
 	if (srcv->sinfo_flags & SCTP_ADDR_OVER) {
 		if (addr)
 			net = sctp_findnet(stcb, addr);
@@ -12542,14 +12541,10 @@ sctp_lower_sosend(struct socket *so,
 	} else {
 		net = stcb->asoc.primary_destination;
 	}
-
-	if ((SCTP_SO_IS_NBIO(so)
-	    || (flags & MSG_NBIO)
-	    )) {
-		non_blocking = 1;
-	}
-	asoc = &stcb->asoc;
 	atomic_add_int(&stcb->total_sends, 1);
+	/* Keep the stcb from being freed under our feet */
+	atomic_add_int(&asoc->refcnt, 1);
+	free_cnt_applied = 1;
 
 	if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NO_FRAGMENT)) {
 		if (sndlen > asoc->smallest_mtu) {
@@ -12558,6 +12553,11 @@ sctp_lower_sosend(struct socket *so,
 			goto out_unlocked;
 		}
 	}
+	if ((SCTP_SO_IS_NBIO(so)
+	    || (flags & MSG_NBIO)
+	    )) {
+		non_blocking = 1;
+	}
 	/* would we block? */
 	if (non_blocking) {
 		if (hold_tcblock == 0) {
@@ -12581,17 +12581,6 @@ sctp_lower_sosend(struct socket *so,
 		atomic_add_int(&stcb->asoc.sb_send_resv, sndlen);
 	}
 	local_soresv = sndlen;
-	/* Keep the stcb from being freed under our feet */
-	if (free_cnt_applied) {
-#ifdef INVARIANTS
-		panic("refcnt already incremented");
-#else
-		printf("refcnt:1 already incremented?\n");
-#endif
-	} else {
-		atomic_add_int(&stcb->asoc.refcnt, 1);
-		free_cnt_applied = 1;
-	}
 	if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) {
 		SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ECONNRESET);
 		error = ECONNRESET;
@@ -12634,26 +12623,6 @@ sctp_lower_sosend(struct socket *so,
 	if (p) {
 		p->td_ru.ru_msgsnd++;
 	}
-	if ((net->flight_size > net->cwnd) &&
-	    (asoc->sctp_cmt_on_off == 0)) {
-		/*-
-		 * CMT: Added check for CMT above. net above is the primary
-		 * dest. If CMT is ON, sender should always attempt to send
-		 * with the output routine sctp_fill_outqueue() that loops
-		 * through all destination addresses. Therefore, if CMT is
-		 * ON, queue_only is NOT set to 1 here, so that
-		 * sctp_chunk_output() can be called below.
-		 */
-		queue_only = 1;
-	} else if (asoc->ifp_had_enobuf) {
-		SCTP_STAT_INCR(sctps_ifnomemqueued);
-		if (net->flight_size > (net->mtu * 2))
-			queue_only = 1;
-		asoc->ifp_had_enobuf = 0;
-	} else {
-		un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) +
-		    (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk)));
-	}
 	/* Are we aborting? */
 	if (srcv->sinfo_flags & SCTP_ABORT) {
 		struct mbuf *mm;
@@ -12857,7 +12826,6 @@ sctp_lower_sosend(struct socket *so,
 			}
 			inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk));
 		}
-		inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk));
 		if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) {
 			max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes;
 		} else {
@@ -12886,9 +12854,7 @@ skip_preblock:
 	if (top == NULL) {
 		struct sctp_stream_queue_pending *sp;
 		struct sctp_stream_out *strm;
-		uint32_t sndout, initial_out;
-
-		initial_out = uio->uio_resid;
+		uint32_t sndout;
 
 		SCTP_TCB_SEND_LOCK(stcb);
 		if ((asoc->stream_locked) &&
@@ -13052,29 +13018,34 @@ skip_preblock:
 				/* Non-blocking io in place out */
 				goto skip_out_eof;
 			}
+			/* What about the INIT, send it maybe */
+			if (queue_only_for_init) {
+				if (hold_tcblock == 0) {
+					SCTP_TCB_LOCK(stcb);
+					hold_tcblock = 1;
+				}
+				if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
+					/* a collision took us forward? */
+					queue_only = 0;
+				} else {
+					sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
+					SCTP_SET_STATE(asoc, SCTP_STATE_COOKIE_WAIT);
+					queue_only = 1;
+				}
+			}
 			if ((net->flight_size > net->cwnd) &&
 			    (asoc->sctp_cmt_on_off == 0)) {
+				SCTP_STAT_INCR(sctps_send_cwnd_avoid);
 				queue_only = 1;
 			} else if (asoc->ifp_had_enobuf) {
 				SCTP_STAT_INCR(sctps_ifnomemqueued);
-				if (net->flight_size > (net->mtu * 2)) {
+				if (net->flight_size > (2 * net->mtu)) {
 					queue_only = 1;
-				} else {
-					queue_only = 0;
 				}
 				asoc->ifp_had_enobuf = 0;
-				un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) +
-				    (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk)));
-			} else {
-				un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) +
-				    (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk)));
-				if (net->flight_size > net->cwnd) {
-					queue_only = 1;
-					SCTP_STAT_INCR(sctps_send_cwnd_avoid);
-				} else {
-					queue_only = 0;
-				}
 			}
+			un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) +
+			    (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk)));
 			if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) &&
 			    (stcb->asoc.total_flight > 0) &&
 			    (stcb->asoc.stream_queue_cnt < SCTP_MAX_DATA_BUNDLING) &&
@@ -13098,7 +13069,6 @@ skip_preblock:
 				SCTP_STAT_INCR(sctps_naglesent);
 				nagle_applies = 0;
 			}
-			/* What about the INIT, send it maybe */
 			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) {
 
 				sctp_misc_ints(SCTP_CWNDLOG_PRESEND, queue_only_for_init, queue_only,
@@ -13107,22 +13077,8 @@ skip_preblock:
 				    stcb->asoc.total_flight,
 				    stcb->asoc.chunks_on_out_queue, stcb->asoc.total_flight_count);
 			}
-			if (queue_only_for_init) {
-				if (hold_tcblock == 0) {
-					SCTP_TCB_LOCK(stcb);
-					hold_tcblock = 1;
-				}
-				if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
-					/* a collision took us forward? */
-					queue_only_for_init = 0;
-					queue_only = 0;
-				} else {
-					sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
-					SCTP_SET_STATE(asoc, SCTP_STATE_COOKIE_WAIT);
-					queue_only_for_init = 0;
-					queue_only = 1;
-				}
-			}
+			if (queue_only_for_init)
+				queue_only_for_init = 0;
 			if ((queue_only == 0) && (nagle_applies == 0)) {
 				/*-
 				 * need to start chunk output
@@ -13215,7 +13171,7 @@ skip_preblock:
 		if (uio->uio_resid == 0) {
 			got_all_of_the_send = 1;
 		}
-	} else if (top) {
+	} else {
 		/* We send in a 0, since we do NOT have any locks */
 		error = sctp_msg_append(stcb, net, top, srcv, 0);
 		top = NULL;
@@ -13326,29 +13282,33 @@ skip_out_eof:
 	if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue)) {
 		some_on_control = 1;
 	}
+	if (queue_only_for_init) {
+		if (hold_tcblock == 0) {
+			SCTP_TCB_LOCK(stcb);
+			hold_tcblock = 1;
+		}
+		if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
+			/* a collision took us forward? */
+			queue_only = 0;
+		} else {
+			sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
+			SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT);
+			queue_only = 1;
+		}
+	}
 	if ((net->flight_size > net->cwnd) &&
 	    (stcb->asoc.sctp_cmt_on_off == 0)) {
+		SCTP_STAT_INCR(sctps_send_cwnd_avoid);
 		queue_only = 1;
 	} else if (asoc->ifp_had_enobuf) {
 		SCTP_STAT_INCR(sctps_ifnomemqueued);
-		if (net->flight_size > (net->mtu * 2)) {
+		if (net->flight_size > (2 * net->mtu)) {
 			queue_only = 1;
-		} else {
-			queue_only = 0;
 		}
 		asoc->ifp_had_enobuf = 0;
-		un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) +
-		    (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk)));
-	} else {
-		un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) +
-		    (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk)));
-		if (net->flight_size > net->cwnd) {
-			queue_only = 1;
-			SCTP_STAT_INCR(sctps_send_cwnd_avoid);
-		} else {
-			queue_only = 0;
-		}
 	}
+	un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) +
+	    (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk)));
 	if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) &&
 	    (stcb->asoc.total_flight > 0) &&
 	    (stcb->asoc.stream_queue_cnt < SCTP_MAX_DATA_BUNDLING) &&
@@ -13371,22 +13331,15 @@ skip_out_eof:
 		SCTP_STAT_INCR(sctps_naglesent);
 		nagle_applies = 0;
 	}
-	if (queue_only_for_init) {
-		if (hold_tcblock == 0) {
-			SCTP_TCB_LOCK(stcb);
-			hold_tcblock = 1;
-		}
-		if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
-			/* a collision took us forward? */
-			queue_only_for_init = 0;
-			queue_only = 0;
-		} else {
-			sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
-			SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT);
-			queue_only_for_init = 0;
-			queue_only = 1;
-		}
+	if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) {
+		sctp_misc_ints(SCTP_CWNDLOG_PRESEND, queue_only_for_init, queue_only,
+		    nagle_applies, un_sent);
+		sctp_misc_ints(SCTP_CWNDLOG_PRESEND, stcb->asoc.total_output_queue_size,
+		    stcb->asoc.total_flight,
+		    stcb->asoc.chunks_on_out_queue, stcb->asoc.total_flight_count);
 	}
+	if (queue_only_for_init)
+		queue_only_for_init = 0;
 	if ((queue_only == 0) && (nagle_applies == 0) && (stcb->asoc.peers_rwnd && un_sent)) {
 		/* we can attempt to send too. */
 		if (hold_tcblock == 0) {

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:55: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 CF0FA1065679;
	Thu, 28 Oct 2010 18:55:29 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BC1E58FC13;
	Thu, 28 Oct 2010 18:55: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 o9SItTkR023451;
	Thu, 28 Oct 2010 18:55:29 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SItTu0023449;
	Thu, 28 Oct 2010 18:55:29 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281855.o9SItTu0023449@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 18:55: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: r214472 - stable/8/sys/netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 18:55:29 -0000

Author: tuexen
Date: Thu Oct 28 18:55:29 2010
New Revision: 214472
URL: http://svn.freebsd.org/changeset/base/214472

Log:
  MFC r212699:
  
  Remove unused variables.

Modified:
  stable/8/sys/netinet6/sctp6_usrreq.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)

Modified: stable/8/sys/netinet6/sctp6_usrreq.c
==============================================================================
--- stable/8/sys/netinet6/sctp6_usrreq.c	Thu Oct 28 18:52:48 2010	(r214471)
+++ stable/8/sys/netinet6/sctp6_usrreq.c	Thu Oct 28 18:55:29 2010	(r214472)
@@ -73,7 +73,11 @@ sctp6_input(struct mbuf **i_pak, int *of
 	struct sctp_nets *net;
 	int refcount_up = 0;
 	uint32_t vrf_id = 0;
+
+#ifdef IPSEC
 	struct inpcb *in6p_ip;
+
+#endif
 	struct sctp_chunkhdr *ch;
 	int length, offset, iphlen;
 	uint8_t ecn_bits;
@@ -224,11 +228,11 @@ sctp_skip_csum:
 	} else if (stcb == NULL) {
 		refcount_up = 1;
 	}
-	in6p_ip = (struct inpcb *)in6p;
 #ifdef IPSEC
 	/*
 	 * Check AH/ESP integrity.
 	 */
+	in6p_ip = (struct inpcb *)in6p;
 	if (in6p_ip && (ipsec6_in_reject(m, in6p_ip))) {
 /* XXX */
 		MODULE_GLOBAL(ipsec6stat).in_polvio++;
@@ -813,7 +817,6 @@ sctp6_send(struct socket *so, int flags,
     struct mbuf *control, struct thread *p)
 {
 	struct sctp_inpcb *inp;
-	struct inpcb *in_inp;
 	struct in6pcb *inp6;
 
 #ifdef INET
@@ -832,7 +835,6 @@ sctp6_send(struct socket *so, int flags,
 		SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
 		return EINVAL;
 	}
-	in_inp = (struct inpcb *)inp;
 	inp6 = (struct in6pcb *)inp;
 	/*
 	 * For the TCP model we may get a NULL addr, if we are a connected

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:57: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 35DCE106564A;
	Thu, 28 Oct 2010 18:57:17 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 08C198FC0C;
	Thu, 28 Oct 2010 18:57: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 o9SIvGmo023606;
	Thu, 28 Oct 2010 18:57:16 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SIvGhO023604;
	Thu, 28 Oct 2010 18:57:16 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281857.o9SIvGhO023604@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 18:57:16 +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: r214473 - 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: Thu, 28 Oct 2010 18:57:17 -0000

Author: tuexen
Date: Thu Oct 28 18:57:16 2010
New Revision: 214473
URL: http://svn.freebsd.org/changeset/base/214473

Log:
  MFC r212702:
  * Use !TAILQ_EMPTY() for checking if a tail queue is not empty.
  * Remove assignment without any effect.

Modified:
  stable/8/sys/netinet/sctp_cc_functions.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)

Modified: stable/8/sys/netinet/sctp_cc_functions.c
==============================================================================
--- stable/8/sys/netinet/sctp_cc_functions.c	Thu Oct 28 18:55:29 2010	(r214472)
+++ stable/8/sys/netinet/sctp_cc_functions.c	Thu Oct 28 18:57:16 2010	(r214473)
@@ -171,7 +171,7 @@ sctp_cwnd_update_after_sack(struct sctp_
 			 * So, first of all do we need to have a Early FR
 			 * timer running?
 			 */
-			if (((TAILQ_FIRST(&asoc->sent_queue)) &&
+			if ((!TAILQ_EMPTY(&asoc->sent_queue) &&
 			    (net->ref_count > 1) &&
 			    (net->flight_size < net->cwnd)) ||
 			    (reneged_all)) {
@@ -656,7 +656,6 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *s
 	int old_cwnd = net->cwnd;
 
 	cur_val = net->cwnd >> 10;
-	indx = net->last_hs_used;
 	if (cur_val < sctp_cwnd_adjust[0].cwnd) {
 		/* normal mode */
 		net->ssthresh = net->cwnd / 2;
@@ -793,7 +792,7 @@ sctp_hs_cwnd_update_after_sack(struct sc
 			 * So, first of all do we need to have a Early FR
 			 * timer running?
 			 */
-			if (((TAILQ_FIRST(&asoc->sent_queue)) &&
+			if ((!TAILQ_EMPTY(&asoc->sent_queue) &&
 			    (net->ref_count > 1) &&
 			    (net->flight_size < net->cwnd)) ||
 			    (reneged_all)) {
@@ -1279,7 +1278,7 @@ sctp_htcp_cwnd_update_after_sack(struct 
 			 * So, first of all do we need to have a Early FR
 			 * timer running?
 			 */
-			if (((TAILQ_FIRST(&asoc->sent_queue)) &&
+			if ((!TAILQ_EMPTY(&asoc->sent_queue) &&
 			    (net->ref_count > 1) &&
 			    (net->flight_size < net->cwnd)) ||
 			    (reneged_all)) {

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:57: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 0F97E106566C;
	Thu, 28 Oct 2010 18:57:44 +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 D25338FC21;
	Thu, 28 Oct 2010 18:57:43 +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 3398946B09;
	Thu, 28 Oct 2010 14:57:43 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 441778A009;
	Thu, 28 Oct 2010 14:57:42 -0400 (EDT)
From: John Baldwin 
To: Attilio Rao 
Date: Thu, 28 Oct 2010 14:57:19 -0400
User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; )
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	
	<201010281411.40423.jhb@freebsd.org>
In-Reply-To: <201010281411.40423.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201010281457.19804.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Thu, 28 Oct 2010 14:57:42 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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, 28 Oct 2010 18:57:44 -0000

On Thursday, October 28, 2010 2:11:40 pm John Baldwin wrote:
> On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
> > +       vm_paddr_t *p;
> >         caddr_t kmdp;
> >         uint32_t smapsize;
> > -       int error, rid;
> > +       int error, i, rid;
> > 
> >         /* Retrieve the system memory map from the loader. */
> >         kmdp = preload_search_by_type("elf kernel");
> >         if (kmdp == NULL)
> > -               kmdp = preload_search_by_type("elf64 kernel");
> > +               kmdp = preload_search_by_type(ELF_KERN_STR);
> >         smapbase = (struct bios_smap *)preload_search_info(kmdp,
> >             MODINFO_METADATA | MODINFOMD_SMAP);
> >         smapsize = *((u_int32_t *)smapbase - 1);
> 
> It would be nice if ELF_KERN_STR could be autogenerated as something like:
> 
> "elf ## __ELF_WORD_SIZE ## kernel" instead of needing an #ifdef.

This works in my testing:

#include 
#include 

int
main(void)
{
        printf("%s\n", "elf" __XSTRING(__ELF_WORD_SIZE) " kernel");
        return (0);
}

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 18:59: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 13F821065673;
	Thu, 28 Oct 2010 18:59:10 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 014FB8FC26;
	Thu, 28 Oct 2010 18:59: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 o9SIx99e024079;
	Thu, 28 Oct 2010 18:59:09 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SIx9so024077;
	Thu, 28 Oct 2010 18:59:09 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281859.o9SIx9so024077@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 18:59:09 +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: r214474 - 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: Thu, 28 Oct 2010 18:59:10 -0000

Author: tuexen
Date: Thu Oct 28 18:59:09 2010
New Revision: 214474
URL: http://svn.freebsd.org/changeset/base/214474

Log:
  MFC r212704:
  Remove assignment without effect.

Modified:
  stable/8/sys/netinet/sctp_sysctl.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)

Modified: stable/8/sys/netinet/sctp_sysctl.c
==============================================================================
--- stable/8/sys/netinet/sctp_sysctl.c	Thu Oct 28 18:57:16 2010	(r214473)
+++ stable/8/sys/netinet/sctp_sysctl.c	Thu Oct 28 18:59:09 2010	(r214474)
@@ -200,8 +200,6 @@ copy_out_local_addresses(struct sctp_inp
 		ipv6_addr_legal = 0;
 	}
 
-	error = 0;
-
 	/* neither Mac OS X nor FreeBSD support mulitple routing functions */
 	if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) {
 		SCTP_INP_RUNLOCK(inp);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:00: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 BC783106566B;
	Thu, 28 Oct 2010 19:00:45 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A9B2D8FC1E;
	Thu, 28 Oct 2010 19:00: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 o9SJ0jPK024428;
	Thu, 28 Oct 2010 19:00:45 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJ0jdM024426;
	Thu, 28 Oct 2010 19:00:45 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281900.o9SJ0jdM024426@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:00:45 +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: r214475 - 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: Thu, 28 Oct 2010 19:00:45 -0000

Author: tuexen
Date: Thu Oct 28 19:00:45 2010
New Revision: 214475
URL: http://svn.freebsd.org/changeset/base/214475

Log:
  MFC r212707:
  Remove unused variable/assignment.

Modified:
  stable/8/sys/netinet/sctp_bsd_addr.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)

Modified: stable/8/sys/netinet/sctp_bsd_addr.c
==============================================================================
--- stable/8/sys/netinet/sctp_bsd_addr.c	Thu Oct 28 18:59:09 2010	(r214474)
+++ stable/8/sys/netinet/sctp_bsd_addr.c	Thu Oct 28 19:00:45 2010	(r214475)
@@ -298,7 +298,6 @@ sctp_init_vrf_list(int vrfid)
 void
 sctp_addr_change(struct ifaddr *ifa, int cmd)
 {
-	struct sctp_ifa *ifap = NULL;
 	uint32_t ifa_flags = 0;
 
 	/*
@@ -339,7 +338,7 @@ sctp_addr_change(struct ifaddr *ifa, int
 		return;
 	}
 	if (cmd == RTM_ADD) {
-		ifap = sctp_add_addr_to_vrf(SCTP_DEFAULT_VRFID, (void *)ifa->ifa_ifp,
+		(void)sctp_add_addr_to_vrf(SCTP_DEFAULT_VRFID, (void *)ifa->ifa_ifp,
 		    ifa->ifa_ifp->if_index, ifa->ifa_ifp->if_type,
 		    ifa->ifa_ifp->if_xname,
 		    (void *)ifa, ifa->ifa_addr, ifa_flags, 1);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19: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 B8254106564A;
	Thu, 28 Oct 2010 19:03:26 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A564B8FC18;
	Thu, 28 Oct 2010 19: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 o9SJ3Qrk024945;
	Thu, 28 Oct 2010 19:03:26 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJ3QoR024943;
	Thu, 28 Oct 2010 19:03:26 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281903.o9SJ3QoR024943@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:03:26 +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: r214476 - 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: Thu, 28 Oct 2010 19:03:26 -0000

Author: tuexen
Date: Thu Oct 28 19:03:26 2010
New Revision: 214476
URL: http://svn.freebsd.org/changeset/base/214476

Log:
  MFC r212711:
  Use TAILQ_EMPTY() for testing if a tail queue is empty.
  Set whoFrom to NULL after freeing whoFrom.

Modified:
  stable/8/sys/netinet/sctp_indata.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)

Modified: stable/8/sys/netinet/sctp_indata.c
==============================================================================
--- stable/8/sys/netinet/sctp_indata.c	Thu Oct 28 19:00:45 2010	(r214475)
+++ stable/8/sys/netinet/sctp_indata.c	Thu Oct 28 19:03:26 2010	(r214476)
@@ -708,9 +708,10 @@ protocol_error:
 					control->data = NULL;
 					asoc->size_on_all_streams -= control->length;
 					sctp_ucount_decr(asoc->cnt_on_all_streams);
-					if (control->whoFrom)
+					if (control->whoFrom) {
 						sctp_free_remote_addr(control->whoFrom);
-					control->whoFrom = NULL;
+						control->whoFrom = NULL;
+					}
 					sctp_free_a_readq(stcb, control);
 					return;
 				} else {
@@ -4845,7 +4846,7 @@ sctp_handle_sack(struct mbuf *m, int off
 			if (asoc->pr_sctp_cnt != 0)
 				asoc->pr_sctp_cnt--;
 		}
-		if ((TAILQ_FIRST(&asoc->sent_queue) == NULL) &&
+		if (TAILQ_EMPTY(&asoc->sent_queue) &&
 		    (asoc->total_flight > 0)) {
 #ifdef INVARIANTS
 			panic("Warning flight size is postive and should be 0");
@@ -5818,7 +5819,7 @@ sctp_handle_forward_tsn(struct sctp_tcb 
 	 */
 	sctp_slide_mapping_arrays(stcb);
 
-	if (TAILQ_FIRST(&asoc->reasmqueue)) {
+	if (!TAILQ_EMPTY(&asoc->reasmqueue)) {
 		/* now lets kick out and check for more fragmented delivery */
 		/* sa_ignore NO_NULL_CHK */
 		sctp_deliver_reasm_check(stcb, &stcb->asoc);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:05: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 09164106564A;
	Thu, 28 Oct 2010 19:05:22 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E94018FC1C;
	Thu, 28 Oct 2010 19:05: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 o9SJ5Lk3025348;
	Thu, 28 Oct 2010 19:05:21 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJ5LYh025339;
	Thu, 28 Oct 2010 19:05:21 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281905.o9SJ5LYh025339@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:05: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: r214477 - 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: Thu, 28 Oct 2010 19:05:22 -0000

Author: tuexen
Date: Thu Oct 28 19:05:21 2010
New Revision: 214477
URL: http://svn.freebsd.org/changeset/base/214477

Log:
  MFC r212712:
  Delay the assignment of a path for DATA chunk until they hit
  the sent_queue. Honor a given path when the SCTP_ADDR_OVER
  flag is set.

Modified:
  stable/8/sys/netinet/sctp_asconf.c
  stable/8/sys/netinet/sctp_asconf.h
  stable/8/sys/netinet/sctp_input.c
  stable/8/sys/netinet/sctp_output.c
  stable/8/sys/netinet/sctp_output.h
  stable/8/sys/netinet/sctp_pcb.c
  stable/8/sys/netinet/sctp_timer.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)

Modified: stable/8/sys/netinet/sctp_asconf.c
==============================================================================
--- stable/8/sys/netinet/sctp_asconf.c	Thu Oct 28 19:03:26 2010	(r214476)
+++ stable/8/sys/netinet/sctp_asconf.c	Thu Oct 28 19:05:21 2010	(r214477)
@@ -581,8 +581,8 @@ sctp_process_asconf_set_primary(struct m
 			}
 			if (sctp_is_mobility_feature_on(stcb->sctp_ep,
 			    SCTP_MOBILITY_BASE)) {
-				sctp_move_chunks_from_deleted_prim(stcb,
-				    stcb->asoc.primary_destination);
+				sctp_move_chunks_from_net(stcb,
+				    stcb->asoc.deleted_primary);
 			}
 			sctp_delete_prim_timer(stcb->sctp_ep, stcb,
 			    stcb->asoc.deleted_primary);
@@ -1041,47 +1041,6 @@ sctp_asconf_nets_cleanup(struct sctp_tcb
 	}
 }
 
-void
-sctp_move_chunks_from_deleted_prim(struct sctp_tcb *stcb, struct sctp_nets *dst)
-{
-	struct sctp_association *asoc;
-	struct sctp_stream_out *outs;
-	struct sctp_tmit_chunk *chk;
-	struct sctp_stream_queue_pending *sp;
-
-	if (dst->dest_state & SCTP_ADDR_UNCONFIRMED) {
-		return;
-	}
-	if (stcb->asoc.deleted_primary == NULL) {
-		return;
-	}
-	asoc = &stcb->asoc;
-
-	/*
-	 * now through all the streams checking for chunks sent to our bad
-	 * network.
-	 */
-	TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) {
-		/* now clean up any chunks here */
-		TAILQ_FOREACH(sp, &outs->outqueue, next) {
-			if (sp->net == asoc->deleted_primary) {
-				sctp_free_remote_addr(sp->net);
-				sp->net = dst;
-				atomic_add_int(&dst->ref_count, 1);
-			}
-		}
-	}
-	/* Now check the pending queue */
-	TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) {
-		if (chk->whoTo == asoc->deleted_primary) {
-			sctp_free_remote_addr(chk->whoTo);
-			chk->whoTo = dst;
-			atomic_add_int(&dst->ref_count, 1);
-		}
-	}
-
-}
-
 
 void
 sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *dstnet)
@@ -2080,13 +2039,11 @@ sctp_asconf_iterator_ep(struct sctp_inpc
 	struct sctp_asconf_iterator *asc;
 	struct sctp_ifa *ifa;
 	struct sctp_laddr *l;
-	int type;
 	int cnt_invalid = 0;
 
 	asc = (struct sctp_asconf_iterator *)ptr;
 	LIST_FOREACH(l, &asc->list_of_work, sctp_nxt_addr) {
 		ifa = l->ifa;
-		type = l->action;
 		if (ifa->address.sa.sa_family == AF_INET6) {
 			/* invalid if we're not a v6 endpoint */
 			if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {

Modified: stable/8/sys/netinet/sctp_asconf.h
==============================================================================
--- stable/8/sys/netinet/sctp_asconf.h	Thu Oct 28 19:03:26 2010	(r214476)
+++ stable/8/sys/netinet/sctp_asconf.h	Thu Oct 28 19:05:21 2010	(r214477)
@@ -80,8 +80,6 @@ sctp_check_address_list(struct sctp_tcb 
     struct sockaddr *, uint16_t, uint16_t, uint16_t, uint16_t);
 
 extern void
-     sctp_move_chunks_from_deleted_prim(struct sctp_tcb *, struct sctp_nets *);
-extern void
      sctp_assoc_immediate_retrans(struct sctp_tcb *, struct sctp_nets *);
 extern void
      sctp_net_immediate_retrans(struct sctp_tcb *, struct sctp_nets *);

Modified: stable/8/sys/netinet/sctp_input.c
==============================================================================
--- stable/8/sys/netinet/sctp_input.c	Thu Oct 28 19:03:26 2010	(r214476)
+++ stable/8/sys/netinet/sctp_input.c	Thu Oct 28 19:05:21 2010	(r214477)
@@ -232,7 +232,10 @@ sctp_is_there_unsent_data(struct sctp_tc
 				}
 				atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1);
 				TAILQ_REMOVE(&strq->outqueue, sp, next);
-				sctp_free_remote_addr(sp->net);
+				if (sp->net) {
+					sctp_free_remote_addr(sp->net);
+					sp->net = NULL;
+				}
 				if (sp->data) {
 					sctp_m_freem(sp->data);
 					sp->data = NULL;
@@ -263,7 +266,7 @@ sctp_process_init(struct sctp_init_chunk
 	/* save off parameters */
 	asoc->peer_vtag = ntohl(init->initiate_tag);
 	asoc->peers_rwnd = ntohl(init->a_rwnd);
-	if (TAILQ_FIRST(&asoc->nets)) {
+	if (!TAILQ_EMPTY(&asoc->nets)) {
 		/* update any ssthresh's that may have a default */
 		TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) {
 			lnet->ssthresh = asoc->peers_rwnd;
@@ -318,8 +321,10 @@ sctp_process_init(struct sctp_init_chunk
 						sctp_m_freem(sp->data);
 						sp->data = NULL;
 					}
-					sctp_free_remote_addr(sp->net);
-					sp->net = NULL;
+					if (sp->net) {
+						sctp_free_remote_addr(sp->net);
+						sp->net = NULL;
+					}
 					/* Free the chunk */
 					sctp_free_a_strmoq(stcb, sp);
 					/* sa_ignore FREED_MEMORY */
@@ -650,8 +655,8 @@ sctp_handle_heartbeat_ack(struct sctp_he
 			}
 			if (sctp_is_mobility_feature_on(stcb->sctp_ep,
 			    SCTP_MOBILITY_BASE)) {
-				sctp_move_chunks_from_deleted_prim(stcb,
-				    stcb->asoc.primary_destination);
+				sctp_move_chunks_from_net(stcb,
+				    stcb->asoc.deleted_primary);
 			}
 			sctp_delete_prim_timer(stcb->sctp_ep, stcb,
 			    stcb->asoc.deleted_primary);

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 19:03:26 2010	(r214476)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 19:05:21 2010	(r214477)
@@ -5911,10 +5911,10 @@ sctp_msg_append(struct sctp_tcb *stcb,
 	sp->strseq = 0;
 	if (sp->sinfo_flags & SCTP_ADDR_OVER) {
 		sp->net = net;
+		atomic_add_int(&sp->net->ref_count, 1);
 	} else {
-		sp->net = stcb->asoc.primary_destination;
+		sp->net = NULL;
 	}
-	atomic_add_int(&sp->net->ref_count, 1);
 	(void)SCTP_GETTIME_TIMEVAL(&sp->ts);
 	sp->stream = srcv->sinfo_stream;
 	sp->msg_is_complete = 1;
@@ -6513,7 +6513,6 @@ sctp_toss_old_asconf(struct sctp_tcb *st
 
 static void
 sctp_clean_up_datalist(struct sctp_tcb *stcb,
-
     struct sctp_association *asoc,
     struct sctp_tmit_chunk **data_list,
     int bundle_at,
@@ -6524,7 +6523,9 @@ sctp_clean_up_datalist(struct sctp_tcb *
 
 	for (i = 0; i < bundle_at; i++) {
 		/* off of the send queue */
-		if (i) {
+		TAILQ_REMOVE(&asoc->send_queue, data_list[i], sctp_next);
+		asoc->send_queue_cnt--;
+		if (i > 0) {
 			/*
 			 * Any chunk NOT 0 you zap the time chunk 0 gets
 			 * zapped or set based on if a RTO measurment is
@@ -6535,9 +6536,10 @@ sctp_clean_up_datalist(struct sctp_tcb *
 		/* record time */
 		data_list[i]->sent_rcv_time = net->last_sent_time;
 		data_list[i]->rec.data.fast_retran_tsn = data_list[i]->rec.data.TSN_seq;
-		TAILQ_REMOVE(&asoc->send_queue,
-		    data_list[i],
-		    sctp_next);
+		if (data_list[i]->whoTo == NULL) {
+			data_list[i]->whoTo = net;
+			atomic_add_int(&net->ref_count, 1);
+		}
 		/* on to the sent queue */
 		tp1 = TAILQ_LAST(&asoc->sent_queue, sctpchunk_listhead);
 		if ((tp1) && (compare_with_wrap(tp1->rec.data.TSN_seq,
@@ -6565,7 +6567,6 @@ sctp_clean_up_datalist(struct sctp_tcb *
 all_done:
 		/* This does not lower until the cum-ack passes it */
 		asoc->sent_queue_cnt++;
-		asoc->send_queue_cnt--;
 		if ((asoc->peers_rwnd <= 0) &&
 		    (asoc->total_flight == 0) &&
 		    (bundle_at == 1)) {
@@ -6703,7 +6704,7 @@ sctp_can_we_split_this(struct sctp_tcb *
 }
 
 static uint32_t
-sctp_move_to_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net,
+sctp_move_to_outqueue(struct sctp_tcb *stcb,
     struct sctp_stream_out *strq,
     uint32_t goal_mtu,
     uint32_t frag_point,
@@ -6772,7 +6773,10 @@ one_more_time:
 			}
 			atomic_subtract_int(&asoc->stream_queue_cnt, 1);
 			TAILQ_REMOVE(&strq->outqueue, sp, next);
-			sctp_free_remote_addr(sp->net);
+			if (sp->net) {
+				sctp_free_remote_addr(sp->net);
+				sp->net = NULL;
+			}
 			if (sp->data) {
 				sctp_m_freem(sp->data);
 				sp->data = NULL;
@@ -7089,8 +7093,11 @@ dont_do_it:
 	chk->rec.data.timetodrop = sp->ts;
 	chk->flags = sp->act_flags;
 
-	chk->whoTo = net;
-	atomic_add_int(&chk->whoTo->ref_count, 1);
+	if (sp->net) {
+		chk->whoTo = sp->net;
+		atomic_add_int(&chk->whoTo->ref_count, 1);
+	} else
+		chk->whoTo = NULL;
 
 	if (sp->holds_key_ref) {
 		chk->auth_keyid = sp->auth_keyid;
@@ -7175,7 +7182,10 @@ dont_do_it:
 			send_lock_up = 1;
 		}
 		TAILQ_REMOVE(&strq->outqueue, sp, next);
-		sctp_free_remote_addr(sp->net);
+		if (sp->net) {
+			sctp_free_remote_addr(sp->net);
+			sp->net = NULL;
+		}
 		if (sp->data) {
 			sctp_m_freem(sp->data);
 			sp->data = NULL;
@@ -7248,31 +7258,29 @@ sctp_fill_outqueue(struct sctp_tcb *stcb
 	goal_mtu &= 0xfffffffc;
 	if (asoc->locked_on_sending) {
 		/* We are stuck on one stream until the message completes. */
-		strqn = strq = asoc->locked_on_sending;
+		strq = asoc->locked_on_sending;
 		locked = 1;
 	} else {
-		strqn = strq = sctp_select_a_stream(stcb, asoc);
+		strq = sctp_select_a_stream(stcb, asoc);
 		locked = 0;
 	}
-
+	strqn = strq;
 	while ((goal_mtu > 0) && strq) {
 		sp = TAILQ_FIRST(&strq->outqueue);
-		/*
-		 * If CMT is off, we must validate that the stream in
-		 * question has the first item pointed towards are network
-		 * destionation requested by the caller. Note that if we
-		 * turn out to be locked to a stream (assigning TSN's then
-		 * we must stop, since we cannot look for another stream
-		 * with data to send to that destination). In CMT's case, by
-		 * skipping this check, we will send one data packet towards
-		 * the requested net.
-		 */
 		if (sp == NULL) {
 			break;
 		}
-		if ((sp->net != net) &&
-		    (asoc->sctp_cmt_on_off == 0)) {
-			/* none for this network */
+		/**
+		 * Honor the users' choice if given. If not given,
+		 * pull it only to the primary path in case of not using
+		 * CMT.
+		 */
+		if (((sp->net != NULL) &&
+		    (sp->net != net)) ||
+		    ((sp->net == NULL) &&
+		    (asoc->sctp_cmt_on_off == 0) &&
+		    (asoc->primary_destination != net))) {
+			/* Do not pull to this network */
 			if (locked) {
 				break;
 			} else {
@@ -7289,7 +7297,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb
 		}
 		giveup = 0;
 		bail = 0;
-		moved_how_much = sctp_move_to_outqueue(stcb, net, strq, goal_mtu, frag_point, &locked,
+		moved_how_much = sctp_move_to_outqueue(stcb, strq, goal_mtu, frag_point, &locked,
 		    &giveup, eeor_mode, &bail);
 		if (moved_how_much)
 			asoc->last_out_stream = strq;
@@ -7353,43 +7361,32 @@ sctp_fix_ecn_echo(struct sctp_associatio
 	}
 }
 
-static void
-sctp_move_to_an_alt(struct sctp_tcb *stcb,
-    struct sctp_association *asoc,
-    struct sctp_nets *net)
+void
+sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net)
 {
+	struct sctp_association *asoc;
+	struct sctp_stream_out *outs;
 	struct sctp_tmit_chunk *chk;
-	struct sctp_nets *a_net;
+	struct sctp_stream_queue_pending *sp;
 
-	SCTP_TCB_LOCK_ASSERT(stcb);
-	/*
-	 * JRS 5/14/07 - If CMT PF is turned on, find an alternate
-	 * destination using the PF algorithm for finding alternate
-	 * destinations.
-	 */
-	if ((asoc->sctp_cmt_on_off == 1) &&
-	    (asoc->sctp_cmt_pf > 0)) {
-		a_net = sctp_find_alternate_net(stcb, net, 2);
-	} else {
-		a_net = sctp_find_alternate_net(stcb, net, 0);
+	if (net == NULL) {
+		return;
 	}
-	if ((a_net != net) &&
-	    ((a_net->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE)) {
-		/*
-		 * We only proceed if a valid alternate is found that is not
-		 * this one and is reachable. Here we must move all chunks
-		 * queued in the send queue off of the destination address
-		 * to our alternate.
-		 */
-		TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) {
-			if (chk->whoTo == net) {
-				/* Move the chunk to our alternate */
-				sctp_free_remote_addr(chk->whoTo);
-				chk->whoTo = a_net;
-				atomic_add_int(&a_net->ref_count, 1);
+	asoc = &stcb->asoc;
+	TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) {
+		TAILQ_FOREACH(sp, &outs->outqueue, next) {
+			if (sp->net == net) {
+				sctp_free_remote_addr(sp->net);
+				sp->net = NULL;
 			}
 		}
 	}
+	TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) {
+		if (chk->whoTo == net) {
+			sctp_free_remote_addr(chk->whoTo);
+			chk->whoTo = NULL;
+		}
+	}
 }
 
 int
@@ -7497,7 +7494,8 @@ sctp_med_chunk_output(struct sctp_inpcb 
 			 * copy by reference (we hope).
 			 */
 			net->window_probe = 0;
-			if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) || (net->dest_state & SCTP_ADDR_UNCONFIRMED)) {
+			if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) ||
+			    (net->dest_state & SCTP_ADDR_UNCONFIRMED)) {
 				if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) {
 					sctp_log_cwnd(stcb, net, 1,
 					    SCTP_CWND_LOG_FILL_OUTQ_CALLED);
@@ -7505,6 +7503,7 @@ sctp_med_chunk_output(struct sctp_inpcb 
 				continue;
 			}
 			if ((asoc->sctp_cmt_on_off == 0) &&
+			    (asoc->primary_destination != net) &&
 			    (net->ref_count < 2)) {
 				/* nothing can be in queue for this guy */
 				if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) {
@@ -7534,9 +7533,9 @@ sctp_med_chunk_output(struct sctp_inpcb 
 	}
 	/* now service each destination and send out what we can for it */
 	/* Nothing to send? */
-	if ((TAILQ_FIRST(&asoc->control_send_queue) == NULL) &&
-	    (TAILQ_FIRST(&asoc->asconf_send_queue) == NULL) &&
-	    (TAILQ_FIRST(&asoc->send_queue) == NULL)) {
+	if (TAILQ_EMPTY(&asoc->control_send_queue) &&
+	    TAILQ_EMPTY(&asoc->asconf_send_queue) &&
+	    TAILQ_EMPTY(&asoc->send_queue)) {
 		*reason_code = 8;
 		return (0);
 	}
@@ -7566,15 +7565,17 @@ again_one_more_time:
 			break;
 		}
 		tsns_sent = 0xa;
-		if ((asoc->sctp_cmt_on_off == 0) && (net->ref_count < 2)) {
+		if ((asoc->sctp_cmt_on_off == 0) &&
+		    (asoc->primary_destination != net) &&
+		    (net->ref_count < 2)) {
 			/*
 			 * Ref-count of 1 so we cannot have data or control
 			 * queued to this address. Skip it (non-CMT).
 			 */
 			continue;
 		}
-		if ((TAILQ_FIRST(&asoc->control_send_queue) == NULL) &&
-		    (TAILQ_FIRST(&asoc->asconf_send_queue) == NULL) &&
+		if (TAILQ_EMPTY(&asoc->control_send_queue) &&
+		    TAILQ_EMPTY(&asoc->asconf_send_queue) &&
 		    (net->flight_size >= net->cwnd)) {
 			/*
 			 * Nothing on control or asconf and flight is full,
@@ -7778,7 +7779,7 @@ again_one_more_time:
 							 * unreachable
 							 * during this send
 							 */
-							sctp_move_to_an_alt(stcb, asoc, net);
+							sctp_move_chunks_from_net(stcb, net);
 						}
 						*reason_code = 7;
 						continue;
@@ -8001,7 +8002,7 @@ again_one_more_time:
 							 * unreachable
 							 * during this send
 							 */
-							sctp_move_to_an_alt(stcb, asoc, net);
+							sctp_move_chunks_from_net(stcb, net);
 						}
 						*reason_code = 7;
 						continue;
@@ -8102,19 +8103,9 @@ again_one_more_time:
 					break;
 				}
 				nchk = TAILQ_NEXT(chk, sctp_next);
-				if (asoc->sctp_cmt_on_off == 1) {
-					if (chk->whoTo != net) {
-						/*
-						 * For CMT, steal the data
-						 * to this network if its
-						 * not set here.
-						 */
-						sctp_free_remote_addr(chk->whoTo);
-						chk->whoTo = net;
-						atomic_add_int(&chk->whoTo->ref_count, 1);
-					}
-				} else if (chk->whoTo != net) {
-					/* No, not sent to this net */
+				if ((chk->whoTo != NULL) &&
+				    (chk->whoTo != net)) {
+					/* Don't send the chunk on this net */
 					continue;
 				}
 				if ((chk->send_size > omtu) && ((chk->flags & CHUNK_FLAGS_FRAGMENT_OK) == 0)) {
@@ -8330,7 +8321,7 @@ no_data_fill:
 					 * Destination went unreachable
 					 * during this send
 					 */
-					sctp_move_to_an_alt(stcb, asoc, net);
+					sctp_move_chunks_from_net(stcb, net);
 				}
 				*reason_code = 6;
 				/*-
@@ -9584,7 +9575,7 @@ sctp_chunk_output(struct sctp_inpcb *inp
 			 * out wheel to this alternate address.
 			 */
 			if (net->ref_count > 1)
-				sctp_move_to_an_alt(stcb, asoc, net);
+				sctp_move_chunks_from_net(stcb, net);
 		} else if ((asoc->sctp_cmt_on_off == 1) &&
 			    (asoc->sctp_cmt_pf > 0) &&
 		    ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) {
@@ -9594,7 +9585,7 @@ sctp_chunk_output(struct sctp_inpcb *inp
 			 * to an alternate desination.
 			 */
 			if (net->ref_count > 1)
-				sctp_move_to_an_alt(stcb, asoc, net);
+				sctp_move_chunks_from_net(stcb, net);
 		} else {
 			/*-
 			 * if ((asoc->sat_network) || (net->addr_is_local))
@@ -12103,10 +12094,10 @@ skip_copy:
 	} else {
 		if (sp->sinfo_flags & SCTP_ADDR_OVER) {
 			sp->net = net;
+			atomic_add_int(&sp->net->ref_count, 1);
 		} else {
-			sp->net = asoc->primary_destination;
+			sp->net = NULL;
 		}
-		atomic_add_int(&sp->net->ref_count, 1);
 		sctp_set_prsctp_policy(sp);
 	}
 out_now:

Modified: stable/8/sys/netinet/sctp_output.h
==============================================================================
--- stable/8/sys/netinet/sctp_output.h	Thu Oct 28 19:03:26 2010	(r214476)
+++ stable/8/sys/netinet/sctp_output.h	Thu Oct 28 19:05:21 2010	(r214477)
@@ -129,6 +129,8 @@ void sctp_toss_old_asconf(struct sctp_tc
 
 void sctp_fix_ecn_echo(struct sctp_association *);
 
+void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net);
+
 int
 sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
     struct mbuf *, struct thread *, int);

Modified: stable/8/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 19:03:26 2010	(r214476)
+++ stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 19:05:21 2010	(r214477)
@@ -4843,7 +4843,10 @@ sctp_free_assoc(struct sctp_inpcb *inp, 
 					sp->tail_mbuf = NULL;
 				}
 			}
-			sctp_free_remote_addr(sp->net);
+			if (sp->net) {
+				sctp_free_remote_addr(sp->net);
+				sp->net = NULL;
+			}
 			sctp_free_spbufspace(stcb, asoc, sp);
 			if (sp->holds_key_ref)
 				sctp_auth_key_release(stcb, sp->auth_keyid);
@@ -4914,7 +4917,10 @@ sctp_free_assoc(struct sctp_inpcb *inp, 
 			if (chk->holds_key_ref)
 				sctp_auth_key_release(stcb, chk->auth_keyid);
 			ccnt++;
-			sctp_free_remote_addr(chk->whoTo);
+			if (chk->whoTo) {
+				sctp_free_remote_addr(chk->whoTo);
+				chk->whoTo = NULL;
+			}
 			SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk);
 			SCTP_DECR_CHK_COUNT();
 			/* sa_ignore FREED_MEMORY */

Modified: stable/8/sys/netinet/sctp_timer.c
==============================================================================
--- stable/8/sys/netinet/sctp_timer.c	Thu Oct 28 19:03:26 2010	(r214476)
+++ stable/8/sys/netinet/sctp_timer.c	Thu Oct 28 19:05:21 2010	(r214477)
@@ -969,46 +969,6 @@ start_again:
 	return (0);
 }
 
-static void
-sctp_move_all_chunks_to_alt(struct sctp_tcb *stcb,
-    struct sctp_nets *net,
-    struct sctp_nets *alt)
-{
-	struct sctp_association *asoc;
-	struct sctp_stream_out *outs;
-	struct sctp_tmit_chunk *chk;
-	struct sctp_stream_queue_pending *sp;
-
-	if (net == alt)
-		/* nothing to do */
-		return;
-
-	asoc = &stcb->asoc;
-
-	/*
-	 * now through all the streams checking for chunks sent to our bad
-	 * network.
-	 */
-	TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) {
-		/* now clean up any chunks here */
-		TAILQ_FOREACH(sp, &outs->outqueue, next) {
-			if (sp->net == net) {
-				sctp_free_remote_addr(sp->net);
-				sp->net = alt;
-				atomic_add_int(&alt->ref_count, 1);
-			}
-		}
-	}
-	/* Now check the pending queue */
-	TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) {
-		if (chk->whoTo == net) {
-			sctp_free_remote_addr(chk->whoTo);
-			chk->whoTo = alt;
-			atomic_add_int(&alt->ref_count, 1);
-		}
-	}
-
-}
 
 int
 sctp_t3rxt_timer(struct sctp_inpcb *inp,
@@ -1141,7 +1101,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp,
 	}
 	if (net->dest_state & SCTP_ADDR_NOT_REACHABLE) {
 		/* Move all pending over too */
-		sctp_move_all_chunks_to_alt(stcb, net, alt);
+		sctp_move_chunks_from_net(stcb, net);
 
 		/*
 		 * Get the address that failed, to force a new src address
@@ -1256,7 +1216,7 @@ sctp_t1init_timer(struct sctp_inpcb *inp
 
 		alt = sctp_find_alternate_net(stcb, stcb->asoc.primary_destination, 0);
 		if ((alt != NULL) && (alt != stcb->asoc.primary_destination)) {
-			sctp_move_all_chunks_to_alt(stcb, stcb->asoc.primary_destination, alt);
+			sctp_move_chunks_from_net(stcb, stcb->asoc.primary_destination);
 			stcb->asoc.primary_destination = alt;
 		}
 	}
@@ -1396,7 +1356,7 @@ sctp_strreset_timer(struct sctp_inpcb *i
 		 * If the address went un-reachable, we need to move to
 		 * alternates for ALL chk's in queue
 		 */
-		sctp_move_all_chunks_to_alt(stcb, net, alt);
+		sctp_move_chunks_from_net(stcb, net);
 	}
 	/* mark the retran info */
 	if (strrst->sent != SCTP_DATAGRAM_RESEND)
@@ -1487,8 +1447,7 @@ sctp_asconf_timer(struct sctp_inpcb *inp
 			 * If the address went un-reachable, we need to move
 			 * to the alternate for ALL chunks in queue
 			 */
-			sctp_move_all_chunks_to_alt(stcb, net, alt);
-			net = alt;
+			sctp_move_chunks_from_net(stcb, net);
 		}
 		/* mark the retran info */
 		if (asconf->sent != SCTP_DATAGRAM_RESEND)

Modified: stable/8/sys/netinet/sctputil.c
==============================================================================
--- stable/8/sys/netinet/sctputil.c	Thu Oct 28 19:03:26 2010	(r214476)
+++ stable/8/sys/netinet/sctputil.c	Thu Oct 28 19:05:21 2010	(r214477)
@@ -2500,7 +2500,6 @@ sctp_mtu_size_reset(struct sctp_inpcb *i
 	}
 	eff_mtu = mtu - ovh;
 	TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) {
-
 		if (chk->send_size > eff_mtu) {
 			chk->flags |= CHUNK_FLAGS_FRAGMENT_OK;
 		}
@@ -3763,9 +3762,10 @@ sctp_report_all_outbound(struct sctp_tcb
 					sp->data = NULL;
 				}
 			}
-			if (sp->net)
+			if (sp->net) {
 				sctp_free_remote_addr(sp->net);
-			sp->net = NULL;
+				sp->net = NULL;
+			}
 			/* Free the chunk */
 			sctp_free_a_strmoq(stcb, sp);
 			/* sa_ignore FREED_MEMORY */
@@ -4818,7 +4818,10 @@ next_on_sent:
 					chk->rec.data.payloadtype = sp->ppid;
 					chk->rec.data.context = sp->context;
 					chk->flags = sp->act_flags;
-					chk->whoTo = sp->net;
+					if (sp->net)
+						chk->whoTo = sp->net;
+					else
+						chk->whoTo = stcb->asoc.primary_destination;
 					atomic_add_int(&chk->whoTo->ref_count, 1);
 					chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1);
 					stcb->asoc.pr_sctp_cnt++;

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:06: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 D598E106564A;
	Thu, 28 Oct 2010 19:06:17 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C17B48FC1D;
	Thu, 28 Oct 2010 19:06: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 o9SJ6HV1025590;
	Thu, 28 Oct 2010 19:06:17 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJ6HM3025571;
	Thu, 28 Oct 2010 19:06:17 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010281906.o9SJ6HM3025571@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 28 Oct 2010 19:06: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: r214478 - in head/contrib/tcpdump: . lbl missing tests
	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, 28 Oct 2010 19:06:17 -0000

Author: rpaulo
Date: Thu Oct 28 19:06:17 2010
New Revision: 214478
URL: http://svn.freebsd.org/changeset/base/214478

Log:
  Merge tcpdump-4.1.1.

Added:
  head/contrib/tcpdump/Makefile-devel-adds
     - copied unchanged from r214475, vendor/tcpdump/dist/Makefile-devel-adds
  head/contrib/tcpdump/Readme.Win32
     - copied unchanged from r214475, vendor/tcpdump/dist/Readme.Win32
  head/contrib/tcpdump/forces.h
     - copied unchanged from r214475, vendor/tcpdump/dist/forces.h
  head/contrib/tcpdump/ipnet.h
     - copied unchanged from r214475, vendor/tcpdump/dist/ipnet.h
  head/contrib/tcpdump/print-forces.c
     - copied unchanged from r214475, vendor/tcpdump/dist/print-forces.c
  head/contrib/tcpdump/print-ipnet.c
     - copied unchanged from r214475, vendor/tcpdump/dist/print-ipnet.c
  head/contrib/tcpdump/print-usb.c
     - copied unchanged from r214475, vendor/tcpdump/dist/print-usb.c
  head/contrib/tcpdump/signature.c
     - copied unchanged from r214475, vendor/tcpdump/dist/signature.c
  head/contrib/tcpdump/signature.h
     - copied unchanged from r214475, vendor/tcpdump/dist/signature.h
  head/contrib/tcpdump/tcpdump.1.in
     - copied unchanged from r214475, vendor/tcpdump/dist/tcpdump.1.in
  head/contrib/tcpdump/tests/
     - copied from r214475, vendor/tcpdump/dist/tests/
  head/contrib/tcpdump/win32/
     - copied from r214475, vendor/tcpdump/dist/win32/
Deleted:
  head/contrib/tcpdump/missing/getaddrinfo.c
  head/contrib/tcpdump/tcpdump.1
Modified:
  head/contrib/tcpdump/CHANGES
  head/contrib/tcpdump/CREDITS
  head/contrib/tcpdump/INSTALL.txt
  head/contrib/tcpdump/Makefile.in
  head/contrib/tcpdump/README
  head/contrib/tcpdump/VERSION
  head/contrib/tcpdump/acconfig.h
  head/contrib/tcpdump/addrtoname.c
  head/contrib/tcpdump/af.c
  head/contrib/tcpdump/af.h
  head/contrib/tcpdump/atmuni31.h
  head/contrib/tcpdump/bootp.h
  head/contrib/tcpdump/bpf_dump.c
  head/contrib/tcpdump/checksum.c
  head/contrib/tcpdump/config.guess
  head/contrib/tcpdump/config.h.in
  head/contrib/tcpdump/config.sub
  head/contrib/tcpdump/configure
  head/contrib/tcpdump/configure.in
  head/contrib/tcpdump/ethertype.h
  head/contrib/tcpdump/gmpls.c
  head/contrib/tcpdump/gmpls.h
  head/contrib/tcpdump/gmt2local.h
  head/contrib/tcpdump/icmp6.h
  head/contrib/tcpdump/ieee802_11.h
  head/contrib/tcpdump/ieee802_11_radio.h
  head/contrib/tcpdump/interface.h
  head/contrib/tcpdump/ip6.h
  head/contrib/tcpdump/ipproto.c
  head/contrib/tcpdump/ipproto.h
  head/contrib/tcpdump/isakmp.h
  head/contrib/tcpdump/l2vpn.c
  head/contrib/tcpdump/l2vpn.h
  head/contrib/tcpdump/lbl/os-sunos4.h
  head/contrib/tcpdump/lbl/os-ultrix4.h
  head/contrib/tcpdump/missing/addrinfo.h
  head/contrib/tcpdump/netdissect.h
  head/contrib/tcpdump/nfs.h
  head/contrib/tcpdump/nlpid.c
  head/contrib/tcpdump/nlpid.h
  head/contrib/tcpdump/oui.c
  head/contrib/tcpdump/oui.h
  head/contrib/tcpdump/print-802_11.c
  head/contrib/tcpdump/print-ap1394.c
  head/contrib/tcpdump/print-arcnet.c
  head/contrib/tcpdump/print-atm.c
  head/contrib/tcpdump/print-bfd.c
  head/contrib/tcpdump/print-bgp.c
  head/contrib/tcpdump/print-bootp.c
  head/contrib/tcpdump/print-bt.c
  head/contrib/tcpdump/print-cdp.c
  head/contrib/tcpdump/print-cfm.c
  head/contrib/tcpdump/print-dccp.c
  head/contrib/tcpdump/print-dhcp6.c
  head/contrib/tcpdump/print-domain.c
  head/contrib/tcpdump/print-enc.c
  head/contrib/tcpdump/print-esp.c
  head/contrib/tcpdump/print-ether.c
  head/contrib/tcpdump/print-fr.c
  head/contrib/tcpdump/print-gre.c
  head/contrib/tcpdump/print-icmp6.c
  head/contrib/tcpdump/print-ip.c
  head/contrib/tcpdump/print-ip6.c
  head/contrib/tcpdump/print-isakmp.c
  head/contrib/tcpdump/print-isoclns.c
  head/contrib/tcpdump/print-juniper.c
  head/contrib/tcpdump/print-l2tp.c
  head/contrib/tcpdump/print-lane.c
  head/contrib/tcpdump/print-llc.c
  head/contrib/tcpdump/print-lldp.c
  head/contrib/tcpdump/print-lspping.c
  head/contrib/tcpdump/print-nfs.c
  head/contrib/tcpdump/print-ntp.c
  head/contrib/tcpdump/print-olsr.c
  head/contrib/tcpdump/print-ospf.c
  head/contrib/tcpdump/print-pflog.c
  head/contrib/tcpdump/print-pim.c
  head/contrib/tcpdump/print-ppp.c
  head/contrib/tcpdump/print-rrcp.c
  head/contrib/tcpdump/print-rsvp.c
  head/contrib/tcpdump/print-rx.c
  head/contrib/tcpdump/print-sctp.c
  head/contrib/tcpdump/print-sip.c
  head/contrib/tcpdump/print-sll.c
  head/contrib/tcpdump/print-smb.c
  head/contrib/tcpdump/print-sunrpc.c
  head/contrib/tcpdump/print-symantec.c
  head/contrib/tcpdump/print-tcp.c
  head/contrib/tcpdump/print-tftp.c
  head/contrib/tcpdump/print-token.c
  head/contrib/tcpdump/print-udp.c
  head/contrib/tcpdump/setsignal.h
  head/contrib/tcpdump/sll.h
  head/contrib/tcpdump/smbutil.c
  head/contrib/tcpdump/strcasecmp.c
  head/contrib/tcpdump/tcp.h
  head/contrib/tcpdump/tcpdump-stdinc.h
  head/contrib/tcpdump/tcpdump.c
  head/contrib/tcpdump/tftp.h
  head/contrib/tcpdump/timed.h
  head/contrib/tcpdump/token.h
  head/contrib/tcpdump/util.c
Directory Properties:
  head/contrib/tcpdump/   (props changed)

Modified: head/contrib/tcpdump/CHANGES
==============================================================================
--- head/contrib/tcpdump/CHANGES	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/CHANGES	Thu Oct 28 19:06:17 2010	(r214478)
@@ -1,4 +1,45 @@
-$Header: /tcpdump/master/tcpdump/CHANGES,v 1.98.2.2 2008-10-15 23:26:30 ken Exp $
+Thu.	April 1, 2010.  guy@alum.mit.edu.
+  Summary for 4.1.1 tcpdump release
+	Fix build on systems with PF, such as FreeBSD and OpenBSD.
+	Don't blow up if a zero-length link-layer address is passed to
+	  linkaddr_string(). 
+
+Thu.	March 11, 2010.  ken@netfunctional.ca/guy@alum.mit.edu.
+  Summary for 4.1.0 tcpdump release
+	Fix printing of MAC addresses for VLAN frames with a length
+	  field
+	Add some additional bounds checks and use the EXTRACT_ macros
+	  more
+	Add a -b flag to print the AS number in BGP packets in ASDOT
+	  notation rather than ASPLAIN notation
+	Add ICMPv6 RFC 5006 support
+	Decode the access flags in NFS access requests
+	Handle the new DLT_ for memory-mapped USB captures on Linux
+	Make the default snapshot (-s) the maximum
+	Print name of device (when -L is used)
+	Support for OpenSolaris (and SXCE build 125 and later)
+	Print new TCP flags
+	Add support for RPL DIO
+	Add support for TCP User Timeout (UTO)
+	Add support for non-standard Ethertypes used by 3com PPPoE gear
+	Add support for 802.11n and 802.11s
+	Add support for Transparent Ethernet Bridge ethertype in GRE
+	Add 4 byte AS support for BGP printer
+	Add support for the MDT SAFI 66 BG printer
+	Add basic IPv6 support to print-olsr
+	Add USB printer
+	Add printer for ForCES
+	Handle frames with an FCS
+	Handle 802.11n Control Wrapper, Block Acq Req and Block Ack frames
+	Fix TCP sequence number printing 
+	Report 802.2 packets as 802.2 instead of 802.3
+	Don't include -L/usr/lib in LDFLAGS
+	On x86_64 Linux, look in lib64 directory too
+	Lots of code clean ups
+	Autoconf clean ups
+	Update testcases to make output changes
+	Fix compiling with/out smi (--with{,out}-smi)
+	Fix compiling without IPv6 support (--disable-ipv6)
 
 Mon.    October 27, 2008.  ken@netfunctional.ca.  Summary for 4.0.0 tcpdump release
         Add support for Bluetooth Sniffing

Modified: head/contrib/tcpdump/CREDITS
==============================================================================
--- head/contrib/tcpdump/CREDITS	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/CREDITS	Thu Oct 28 19:06:17 2010	(r214478)
@@ -27,6 +27,7 @@ Additional people who have contributed p
 	Ben Byer			
 	Atsushi Onoe			
 	Ben Smithurst			
+	Bert Vermeulen			
 	Bjoern A. Zeeb			
 	Brent L. Bates			
 	Brian Ginsbach			
@@ -44,11 +45,15 @@ Additional people who have contributed p
 	Daniel Hagerty 			
 	Darren Reed			
 	David Binderman			
+	David Horn			
 	David Smith			
 	David Young			
 	Don Ebright			
 	Eddie Kohler			
+	Elmar Kirchner			
+	Fang Wang			
 	Florent Drouin			
+	Florian Forster			
 	Francis Dupont			
 	Francisco Matias Cuenca-Acuna	
 	Francois-Xavier Le Bail		
@@ -68,8 +73,10 @@ Additional people who have contributed p
 	Heinz-Ado Arnolds		
 	Hendrik Scholz			
 	Ian McDonald			
-        Jacek Tobiasz                   
+	Ilpo Järvinen			
+	Jacek Tobiasz			
 	Jakob Schlyter			
+	Jamal Hadi Salim 		
 	Jan Oravec			
 	Jason R. Thorpe			
 	Jefferson Ogata 		
@@ -78,10 +85,12 @@ Additional people who have contributed p
 	Jim Hutchins			
         Jonathan Heusser                
 	Tatuya Jinmei			
+	João Medeiros			
 	Joerg Mayer			
-	Jørgen Thomsen			 
+	Jørgen Thomsen			 
 	Julian Cowley			
 	Kaarthik Sivakumar		
+	Karl Norby			
 	Kazushi Sugyo			
 	Kelly Carmichael		
 	Ken Hornstein			
@@ -92,7 +101,8 @@ Additional people who have contributed p
 	Larry Lile			
 	Lennert Buytenhek 		
 	Loris Degioanni			
-	Love Hörnquist-Åstrand		
+	Love Hörnquist-Åstrand		
+	Lucas C. Villa Real		
 	Luis Martin Garcia		
 	Maciej W. Rozycki		
 	Manu Pathak			
@@ -100,12 +110,13 @@ Additional people who have contributed p
 	Marc A. Lehmann			
 	Mark Ellzey Thomas		
 	Marko Kiiskila			
-	Markus Schöpflin		
+	Markus Schöpflin		
 	Marshall Rose			
 	Martin Husemann			
 	Max Laier			
 	Michael A. Meffie III		
 	Michael Madore			
+	Michael Riepe			
 	Michael Shalayeff		
 	Michael Shields			
 	Michael T. Stolarchuk		
@@ -132,13 +143,16 @@ Additional people who have contributed p
 	Peter Fales			
 	Peter Jeremy			
 					
+	Peter Volkov			
 	Phil Wood			
 	Rafal Maszkowski		
+	Randy Sofia			
 	Raphael Raimbault		
 	Rick Cheng                      
 	Rick Jones			
 	Rick Watson			
 	Rob Braun			
+	Robert Edmonds			
 	Roderick Schertler		
 	Sagun Shakya			
 	Sami Farin			
@@ -155,11 +169,14 @@ Additional people who have contributed p
 	Terry Kennedy			
 	Timo Koskiahde
 	Tony Li				
+	Toshihiro Kanda			
 	Uns Lider			
 	Victor Oppleman			
 	Wesley Griffin			
+	Wesley Shields			
 	Wilbert de Graaf		
-        Will Drewry                     
+	Will Drewry			
+	William J. Hulley		
 	Yen Yen Lim
 	Yoshifumi Nishida
 

Modified: head/contrib/tcpdump/INSTALL.txt
==============================================================================
--- head/contrib/tcpdump/INSTALL.txt	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/INSTALL.txt	Thu Oct 28 19:06:17 2010	(r214478)
@@ -1,4 +1,4 @@
-@(#) $Header: /tcpdump/master/tcpdump/INSTALL.txt,v 1.1.2.1 2008-02-06 10:49:22 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/INSTALL.txt,v 1.2 2008-02-06 10:47:53 guy Exp $ (LBL)
 
 If you have not built libpcap, and your system does not have libpcap
 installed, install libpcap first.  Your system might provide a version
@@ -221,6 +221,7 @@ print-tftp.c	- Trivial File Transfer Pro
 print-timed.c	- BSD time daemon protocol printer routines
 print-token.c	- Token Ring printer routines
 print-udp.c	- UDP printer routines
+print-usb.c	- USB printer routines
 print-vjc.c	- PPP Van Jacobson compression (RFC1144) printer routines
 print-vrrp.c	- Virtual Router Redundancy Protocol
 print-wb.c	- White Board printer routines

Copied: head/contrib/tcpdump/Makefile-devel-adds (from r214475, vendor/tcpdump/dist/Makefile-devel-adds)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/tcpdump/Makefile-devel-adds	Thu Oct 28 19:06:17 2010	(r214478, copy of r214475, vendor/tcpdump/dist/Makefile-devel-adds)
@@ -0,0 +1,22 @@
+#
+# Auto-regenerate configure script or Makefile when things change.
+# From autoconf.info .  Works best with GNU Make.
+#
+${srcdir}/configure: configure.in
+	cd ${srcdir} && autoconf
+
+# autoheader might not change config.h.in, so touch a stamp file.
+${srcdir}/config.h.in: ${srcdir}/stamp-h.in
+${srcdir}/stamp-h.in: configure.in acconfig.h
+	cd ${srcdir} && autoheader
+	echo timestamp > ${srcdir}/stamp-h.in
+
+config.h: stamp-h
+stamp-h: ${srcdir}/config.h.in config.status
+	./config.status
+
+Makefile: Makefile.in config.status
+	./config.status
+
+config.status: ${srcdir}/configure
+	./config.status --recheck

Modified: head/contrib/tcpdump/Makefile.in
==============================================================================
--- head/contrib/tcpdump/Makefile.in	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/Makefile.in	Thu Oct 28 19:06:17 2010	(r214478)
@@ -17,7 +17,7 @@
 #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
-# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.317.2.4 2008-05-27 07:14:26 guy Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.325 2008-11-21 23:17:26 guy Exp $ (LBL)
 
 #
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -77,7 +77,7 @@ CSRC =	addrtoname.c af.c checksum.c cpac
 	print-eap.c print-eigrp.c\
 	print-esp.c print-ether.c print-fddi.c print-fr.c \
 	print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
-	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c \
+	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \
 	print-ipx.c print-isoclns.c print-juniper.c print-krb.c \
 	print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
         print-lmp.c print-lspping.c print-lwapp.c \
@@ -88,9 +88,9 @@ CSRC =	addrtoname.c af.c checksum.c cpac
 	print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \
 	print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
 	print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
-	print-timed.c print-token.c print-udld.c print-udp.c \
-	print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \
-	print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c
+	print-timed.c print-token.c print-udld.c print-udp.c print-usb.c \
+	print-vjc.c print-vqp.c print-vrrp.c print-vtp.c print-forces.c \
+	print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c
 
 LIBNETDISSECT_SRC=print-isakmp.c
 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o)
@@ -128,6 +128,7 @@ HDR = \
 	ethertype.h \
 	extract.h \
 	fddi.h \
+	forces.h \
 	gmpls.h \
 	gmt2local.h \
 	icmp6.h \
@@ -139,6 +140,7 @@ HDR = \
 	ip.h \
 	ip6.h \
 	ipfc.h \
+	ipnet.h \
 	ipproto.h \
 	ipsec_doi.h \
 	ipx.h \
@@ -171,6 +173,7 @@ HDR = \
 	sctpConstants.h \
 	sctpHeader.h \
 	setsignal.h \
+	signature.h \
 	slcompress.h \
 	slip.h \
 	sll.h \
@@ -204,6 +207,7 @@ EXTRA_DIST = \
 	INSTALL.txt \
 	LICENSE \
 	Makefile.in \
+	Makefile-devel-adds \
 	README \
 	Readme.Win32 \
 	VERSION \
@@ -226,7 +230,6 @@ EXTRA_DIST = \
 	missing/bittypes.h \
 	missing/dlnames.c \
 	missing/datalinks.c \
-	missing/getaddrinfo.c \
 	missing/getnameinfo.c \
 	missing/inet_aton.c \
 	missing/inet_ntop.c \
@@ -258,7 +261,83 @@ EXTRA_DIST = \
 	smbutil.c \
 	stime.awk \
 	strcasecmp.c \
-	tcpdump.1 \
+	tcpdump.1.in \
+	tests/02-sunrise-sunset-esp.puu \
+	tests/08-sunrise-sunset-aes.puu \
+	tests/08-sunrise-sunset-esp2.puu \
+	tests/TESTLIST \
+	tests/TESTonce \
+	tests/TESTrun.sh \
+	tests/bgp-infinite-loop.pcap \
+	tests/bgp_vpn_attrset.out \
+	tests/bgp_vpn_attrset.pcap \
+	tests/chdlc-slarp-short.pcap \
+	tests/chdlc-slarp.pcap \
+	tests/dio.out \
+	tests/dio.pcap \
+	tests/e1000g.out \
+	tests/e1000g.pcap \
+	tests/eapon1.gdbinit \
+	tests/eapon1.out \
+	tests/eapon1.puu \
+	tests/eapon2.puu \
+	tests/esp-secrets.txt \
+	tests/esp0.out \
+	tests/esp1.gdbinit \
+	tests/esp1.out \
+	tests/esp2.gdbinit \
+	tests/esp2.out \
+	tests/esp3.gdbinit \
+	tests/esp4.gdbinit \
+	tests/esp5.gdbinit \
+	tests/esp5.out \
+	tests/espudp1.out \
+	tests/espudp1.puu \
+	tests/forces1.out \
+	tests/forces1.pcap \
+	tests/forces1vvv.out \
+	tests/forces1vvvv.out \
+	tests/forces2.out \
+	tests/forces2.pcap \
+	tests/forces2v.out \
+	tests/forces2vv.out \
+	tests/ikev2.puu \
+	tests/ikev2four.out \
+	tests/ikev2four.puu \
+	tests/ikev2fourv.out \
+	tests/ikev2fourv4.out \
+	tests/ikev2pI2-secrets.txt \
+	tests/ikev2pI2.out \
+	tests/ikev2pI2.puu \
+	tests/isakmp-delete-segfault.puu \
+	tests/isakmp-identification-segfault.puu \
+	tests/isakmp-pointer-loop.puu \
+	tests/isakmp1.out \
+	tests/isakmp2.out \
+	tests/isakmp3.out \
+	tests/isakmp4.out \
+	tests/isakmp4500.puu \
+	tests/isis-infinite-loop.pcap \
+	tests/ldp-infinite-loop.pcap \
+	tests/lmp.out \
+	tests/lmp.puu \
+	tests/lmp.sh \
+	tests/lspping-fec-ldp.pcap \
+	tests/lspping-fec-rsvp.pcap \
+	tests/mpls-ldp-hello.out \
+	tests/mpls-ldp-hello.puu \
+	tests/mpls-traceroute.pcap \
+	tests/ospf-gmpls.out \
+	tests/ospf-gmpls.puu \
+	tests/print-A.out \
+	tests/print-AA.out \
+	tests/print-capX.out \
+	tests/print-capXX.out \
+	tests/print-flags.puu \
+	tests/print-flags.sh \
+	tests/print-x.out \
+	tests/print-xx.out \
+	tests/rsvp-infinite-loop.pcap \
 	vfprintf.c \
 	win32/Include/Arpa/tftp.h \
 	win32/Include/errno.h \
@@ -312,14 +391,13 @@ version.o: version.c
 
 version.c: $(srcdir)/VERSION
 	@rm -f $@
-	if grep CVS ${srcdir}/VERSION >/dev/null; then \
+	if grep GIT ${srcdir}/VERSION >/dev/null; then \
 		read ver <${srcdir}/VERSION; \
 		echo $$ver | tr -d '\012'; \
 		date +_%Y_%m_%d; \
 	else \
 		cat ${srcdir}/VERSION; \
-	fi | sed -e 's/.*/char version[] = "&";/' > $@
-
+	fi | sed -e 's/.*/const char version[] = "&";/' > $@
 
 install: all
 	[ -d $(DESTDIR)$(sbindir) ] || \
@@ -328,7 +406,7 @@ install: all
 	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION`
 	[ -d $(DESTDIR)$(mandir)/man1 ] || \
 	    (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
-	$(INSTALL_DATA) $(srcdir)/$(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
+	$(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
 
 uninstall:
 	rm -f $(DESTDIR)$(sbindir)/$(PROG)
@@ -340,11 +418,15 @@ lint: $(GENSRC)
 	    grep -v 'possible pointer alignment problem'
 
 clean:
-	rm -f $(CLEANFILES)
+	rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz
 
 distclean:
 	rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
-	    config.h gnuc.h os-proto.h stamp-h stamp-h.in
+	    config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1
+
+check: tcpdump
+	uudecode --help || (echo "No uudecode program found, not running tests"; echo "apt-get/rpm install sharutils?"; exit 1)
+	(cd tests && ./TESTrun.sh)
 
 tags: $(TAGFILES)
 	ctags -wtd $(TAGFILES)

Modified: head/contrib/tcpdump/README
==============================================================================
--- head/contrib/tcpdump/README	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/README	Thu Oct 28 19:06:17 2010	(r214478)
@@ -1,19 +1,17 @@
-@(#) $Header: /tcpdump/master/tcpdump/README,v 1.66.2.1 2008-05-30 01:38:20 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/README,v 1.68 2008-12-15 00:05:27 guy Exp $ (LBL)
 
-TCPDUMP 3.9
+TCPDUMP 4.x.y
 Now maintained by "The Tcpdump Group"
 See 		www.tcpdump.org
 
 Please send inquiries/comments/reports to:
 	tcpdump-workers@lists.tcpdump.org
 
-Anonymous CVS is available via:
-	cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master login
-	(password "anoncvs")
-	cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout tcpdump
+Anonymous Git is available via:
+	git clone git://bpf.tcpdump.org/tcpdump
 
-Version 3.9 of TCPDUMP can be retrieved with the CVS tag "tcpdump_3_9rel1":
-	cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_9rel1 tcpdump
+Version 4.x.y of TCPDUMP can be retrieved with the CVS tag "tcpdump_4_xrely":
+	cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_4_xrely tcpdump
 
 Please submit patches against the master copy to the tcpdump project on
 sourceforge.net.

Copied: head/contrib/tcpdump/Readme.Win32 (from r214475, vendor/tcpdump/dist/Readme.Win32)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/tcpdump/Readme.Win32	Thu Oct 28 19:06:17 2010	(r214478, copy of r214475, vendor/tcpdump/dist/Readme.Win32)
@@ -0,0 +1,24 @@
+To build tcpdump under Windows, you need:
+
+- version 6 (or higher) of Microsoft Visual Studio or the Cygnus gnu 
+C compiler.
+- The November 2001 (or later) edition of Microsoft Platform 
+Software Development Kit (SDK), that contains some necessary includes 
+for IPv6 support. You can download it from http://www.microsoft.com/sdk
+- the WinPcap source code, that includes libpcap for win32. Download it
+from http://winpcap.polito.it or download libpcap sources from
+http://www.tcpdump.org and follow the instructions in the README.Win32
+file.
+
+First, extract tcpdump and WinPcap in the same folder, and build WinPcap.
+
+The Visual Studio project and the cygwin makefile are in the Win32\prj
+folder.
+
+From Visual Studio, open windump.dsw and build the program. The release 
+version of the WinDump.exe executable file will be created in the 
+windump\win32\prj\release directory . The debug version will be generated
+in windump\win32\prj\debug.
+
+From cygnus, go to windump\win32\prj\ and type "make". WinDump.exe will be
+created in the same directory.
\ No newline at end of file

Modified: head/contrib/tcpdump/VERSION
==============================================================================
--- head/contrib/tcpdump/VERSION	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/VERSION	Thu Oct 28 19:06:17 2010	(r214478)
@@ -1 +1 @@
-4.0.0
+4.1.1

Modified: head/contrib/tcpdump/acconfig.h
==============================================================================
--- head/contrib/tcpdump/acconfig.h	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/acconfig.h	Thu Oct 28 19:06:17 2010	(r214478)
@@ -2,32 +2,18 @@
  * make them to acconfig.h and rerun autoheader */
 @TOP@
 
-/* Define if you have SSLeay 0.9.0b with the buggy cast128. */
-#undef HAVE_BUGGY_CAST128
-
 /* Define if you enable IPv6 support */
 #undef INET6
 
 /* Define if you enable support for the libsmi. */
 #undef LIBSMI
 
-/* Define if you have the  header file.  */
-#undef HAVE_SMI_H
-
 /* define if you have struct __res_state_ext */
 #undef HAVE_RES_STATE_EXT
 
 /* define if your struct __res_state has the nsort member */
 #undef HAVE_NEW_RES_STATE
 
-/*
- * define if struct ether_header.ether_dhost is a struct with ether_addr_octet
- */
-#undef ETHER_HEADER_HAS_EA
-
-/* define if struct ether_arp contains arp_xsha */
-#undef ETHER_ARP_HAS_X
-
 /* define if you have the addrinfo function. */
 #undef HAVE_ADDRINFO
 
@@ -43,18 +29,9 @@
 /* define if INADDRSZ is defined (XXX not used!) */
 #undef HAVE_INADDRSZ
 
-/* define if this is a development version, to use additional prototypes. */
-#undef HAVE_OS_PROTO_H
-
-/* define if  defines __P() */
-#undef HAVE_PORTABLE_PROTOTYPE
-
 /* define if RES_USE_INET6 is defined */
 #undef HAVE_RES_USE_INET6
 
-/* define if struct sockaddr has the sa_len member */
-#undef HAVE_SOCKADDR_SA_LEN
-
 /* define if you have struct sockaddr_storage */
 #undef HAVE_SOCKADDR_STORAGE
 
@@ -91,18 +68,6 @@
 /* define if you have getrpcbynumber() */
 #undef HAVE_GETRPCBYNUMBER
 
-/* define if unaligned memory accesses fail */
-#undef LBL_ALIGN
-
-/* The successful return value from signal (?)XXX */
-#undef RETSIGVAL
-
-/* Define this on IRIX */
-#undef _BSD_SIGNALS
-
-/* For HP/UX ANSI compiler? */
-#undef _HPUX_SOURCE
-
 /* AIX hack. */
 #undef _SUN
 
@@ -115,14 +80,6 @@
 /* Whether or not to include the possibly-buggy SMB printer */
 #undef TCPDUMP_DO_SMB
 
-/* Long story short: aclocal.m4 depends on autoconf 2.13
- * implementation details wrt "const"; newer versions
- * have different implementation details so for now we
- * put "const" here.  This may cause duplicate definitions
- * in config.h but that should be OK since they're the same.
- */
-#undef const
-
 /* Define if you have the dnet_htoa function.  */
 #undef HAVE_DNET_HTOA
 

Modified: head/contrib/tcpdump/addrtoname.c
==============================================================================
--- head/contrib/tcpdump/addrtoname.c	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/addrtoname.c	Thu Oct 28 19:06:17 2010	(r214478)
@@ -88,12 +88,12 @@ struct hnamemem {
 	struct hnamemem *nxt;
 };
 
-struct hnamemem hnametable[HASHNAMESIZE];
-struct hnamemem tporttable[HASHNAMESIZE];
-struct hnamemem uporttable[HASHNAMESIZE];
-struct hnamemem eprototable[HASHNAMESIZE];
-struct hnamemem dnaddrtable[HASHNAMESIZE];
-struct hnamemem ipxsaptable[HASHNAMESIZE];
+static struct hnamemem hnametable[HASHNAMESIZE];
+static struct hnamemem tporttable[HASHNAMESIZE];
+static struct hnamemem uporttable[HASHNAMESIZE];
+static struct hnamemem eprototable[HASHNAMESIZE];
+static struct hnamemem dnaddrtable[HASHNAMESIZE];
+static struct hnamemem ipxsaptable[HASHNAMESIZE];
 
 #if defined(INET6) && defined(WIN32)
 /*
@@ -142,7 +142,7 @@ struct h6namemem {
 	struct h6namemem *nxt;
 };
 
-struct h6namemem h6nametable[HASHNAMESIZE];
+static struct h6namemem h6nametable[HASHNAMESIZE];
 #endif /* INET6 */
 
 struct enamemem {
@@ -155,9 +155,9 @@ struct enamemem {
 	struct enamemem *e_nxt;
 };
 
-struct enamemem enametable[HASHNAMESIZE];
-struct enamemem nsaptable[HASHNAMESIZE];
-struct enamemem bytestringtable[HASHNAMESIZE];
+static struct enamemem enametable[HASHNAMESIZE];
+static struct enamemem nsaptable[HASHNAMESIZE];
+static struct enamemem bytestringtable[HASHNAMESIZE];
 
 struct protoidmem {
 	u_int32_t p_oui;
@@ -166,7 +166,7 @@ struct protoidmem {
 	struct protoidmem *p_nxt;
 };
 
-struct protoidmem protoidtable[HASHNAMESIZE];
+static struct protoidmem protoidtable[HASHNAMESIZE];
 
 /*
  * A faster replacement for inet_ntoa().
@@ -313,7 +313,7 @@ getname6(const u_char *ap)
 }
 #endif /* INET6 */
 
-static char hex[] = "0123456789abcdef";
+static const char hex[] = "0123456789abcdef";
 
 
 /* Find the hash node that corresponds the ether address 'ep' */
@@ -516,13 +516,14 @@ linkaddr_string(const u_char *ep, const 
 	register char *cp;
 	register struct enamemem *tp;
 
-	if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN) {
-            return etheraddr_string(ep);
-        }
-
-        if (type == LINKADDR_FRELAY) {
-            return q922_string(ep);
-        }
+	if (len == 0)
+		return ("");
+
+	if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN)
+		return (etheraddr_string(ep));
+
+	if (type == LINKADDR_FRELAY)
+		return (q922_string(ep));
 
 	tp = lookup_bytestring(ep, len);
 	if (tp->e_name)
@@ -749,7 +750,7 @@ init_eprotoarray(void)
 	}
 }
 
-static struct protoidlist {
+static const struct protoidlist {
 	const u_char protoid[5];
 	const char *name;
 } protoidlist[] = {
@@ -770,7 +771,7 @@ init_protoidarray(void)
 {
 	register int i;
 	register struct protoidmem *tp;
-	struct protoidlist *pl;
+	const struct protoidlist *pl;
 	u_char protoid[5];
 
 	protoid[0] = 0;
@@ -794,7 +795,7 @@ init_protoidarray(void)
 	}
 }
 
-static struct etherlist {
+static const struct etherlist {
 	const u_char addr[6];
 	const char *name;
 } etherlist[] = {
@@ -819,7 +820,7 @@ static struct etherlist {
 static void
 init_etherarray(void)
 {
-	register struct etherlist *el;
+	register const struct etherlist *el;
 	register struct enamemem *tp;
 #ifdef USE_ETHER_NTOHOST
 	char name[256];
@@ -863,7 +864,7 @@ init_etherarray(void)
 	}
 }
 
-static struct tok ipxsap_db[] = {
+static const struct tok ipxsap_db[] = {
 	{ 0x0000, "Unknown" },
 	{ 0x0001, "User" },
 	{ 0x0002, "User Group" },

Modified: head/contrib/tcpdump/af.c
==============================================================================
--- head/contrib/tcpdump/af.c	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/af.c	Thu Oct 28 19:06:17 2010	(r214478)
@@ -28,7 +28,7 @@ static const char rcsid[] _U_ =
 #include "interface.h"
 #include "af.h"
 
-struct tok af_values[] = {
+const struct tok af_values[] = {
     { 0,                      "Reserved"},
     { AFNUM_INET,             "IPv4"},
     { AFNUM_INET6,            "IPv6"},
@@ -50,7 +50,7 @@ struct tok af_values[] = {
     { 0, NULL},
 };
 
-struct tok bsd_af_values[] = {
+const struct tok bsd_af_values[] = {
     { BSD_AFNUM_INET, "IPv4" },
     { BSD_AFNUM_NS, "NS" },
     { BSD_AFNUM_ISO, "ISO" },

Modified: head/contrib/tcpdump/af.h
==============================================================================
--- head/contrib/tcpdump/af.h	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/af.h	Thu Oct 28 19:06:17 2010	(r214478)
@@ -17,8 +17,8 @@
  * Original code by Hannes Gredler (hannes@juniper.net)
  */
 
-extern struct tok af_values[];
-extern struct tok bsd_af_values[];
+extern const struct tok af_values[];
+extern const struct tok bsd_af_values[];
 
 /* RFC1700 address family numbers */
 #define AFNUM_INET	1

Modified: head/contrib/tcpdump/atmuni31.h
==============================================================================
--- head/contrib/tcpdump/atmuni31.h	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/atmuni31.h	Thu Oct 28 19:06:17 2010	(r214478)
@@ -29,7 +29,7 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/atmuni31.h,v 1.2.6.1 2007-10-22 19:39:12 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/atmuni31.h,v 1.3 2007-10-22 19:37:51 guy Exp $ (LBL)
  */
 
 /* Based on UNI3.1 standard by ATM Forum */

Modified: head/contrib/tcpdump/bootp.h
==============================================================================
--- head/contrib/tcpdump/bootp.h	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/bootp.h	Thu Oct 28 19:06:17 2010	(r214478)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.18 2007-08-21 21:59:11 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.19 2008-04-22 09:46:03 hannes Exp $ (LBL) */
 /*
  * Bootstrap Protocol (BOOTP).  RFC951 and RFC1048.
  *
@@ -27,7 +27,8 @@ struct bootp {
 	u_int8_t	bp_hops;	/* gateway hops */
 	u_int32_t	bp_xid;		/* transaction ID */
 	u_int16_t	bp_secs;	/* seconds since boot began */
-	u_int16_t	bp_flags;	/* flags - see bootp_flag_values[] in print-bootp.c */
+	u_int16_t	bp_flags;	/* flags - see bootp_flag_values[]
+					   in print-bootp.c */
 	struct in_addr	bp_ciaddr;	/* client IP address */
 	struct in_addr	bp_yiaddr;	/* 'your' IP address */
 	struct in_addr	bp_siaddr;	/* server IP address */

Modified: head/contrib/tcpdump/bpf_dump.c
==============================================================================
--- head/contrib/tcpdump/bpf_dump.c	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/bpf_dump.c	Thu Oct 28 19:06:17 2010	(r214478)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/bpf_dump.c,v 1.16.4.1 2008-02-14 20:54:53 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/bpf_dump.c,v 1.17 2008-02-14 20:53:49 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H

Modified: head/contrib/tcpdump/checksum.c
==============================================================================
--- head/contrib/tcpdump/checksum.c	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/checksum.c	Thu Oct 28 19:06:17 2010	(r214478)
@@ -31,17 +31,73 @@ static const char rcsid[] _U_ =
 #include 
 #include 
 #include 
+#include 
 
 #include "interface.h"
 
-#define CRC10_POLYNOMIAL 0x633
-static u_int16_t crc10_table[256];
+/*
+ * CRC-10 table generated using the following Python snippet:
+
+import sys
+
+crc_table = []
+for i in range(256):
+	accum = i << 2
+	for j in range(8):
+		accum <<= 1
+		if accum & 0x400:
+			accum ^= 0x633
+	crc_table.append(accum)
+
+for i in range(len(crc_table)/8):
+	for j in range(8):
+		sys.stdout.write("0x%04x, " % crc_table[i*8+j])
+	sys.stdout.write("\n")
+
+ */
+static const u_int16_t crc10_table[256] =
+{
+	0x0000, 0x0233, 0x0255, 0x0066, 0x0299, 0x00aa, 0x00cc, 0x02ff,
+	0x0301, 0x0132, 0x0154, 0x0367, 0x0198, 0x03ab, 0x03cd, 0x01fe,
+	0x0031, 0x0202, 0x0264, 0x0057, 0x02a8, 0x009b, 0x00fd, 0x02ce,
+	0x0330, 0x0103, 0x0165, 0x0356, 0x01a9, 0x039a, 0x03fc, 0x01cf,
+	0x0062, 0x0251, 0x0237, 0x0004, 0x02fb, 0x00c8, 0x00ae, 0x029d,
+	0x0363, 0x0150, 0x0136, 0x0305, 0x01fa, 0x03c9, 0x03af, 0x019c,
+	0x0053, 0x0260, 0x0206, 0x0035, 0x02ca, 0x00f9, 0x009f, 0x02ac,
+	0x0352, 0x0161, 0x0107, 0x0334, 0x01cb, 0x03f8, 0x039e, 0x01ad,
+	0x00c4, 0x02f7, 0x0291, 0x00a2, 0x025d, 0x006e, 0x0008, 0x023b,
+	0x03c5, 0x01f6, 0x0190, 0x03a3, 0x015c, 0x036f, 0x0309, 0x013a,
+	0x00f5, 0x02c6, 0x02a0, 0x0093, 0x026c, 0x005f, 0x0039, 0x020a,
+	0x03f4, 0x01c7, 0x01a1, 0x0392, 0x016d, 0x035e, 0x0338, 0x010b,
+	0x00a6, 0x0295, 0x02f3, 0x00c0, 0x023f, 0x000c, 0x006a, 0x0259,
+	0x03a7, 0x0194, 0x01f2, 0x03c1, 0x013e, 0x030d, 0x036b, 0x0158,
+	0x0097, 0x02a4, 0x02c2, 0x00f1, 0x020e, 0x003d, 0x005b, 0x0268,
+	0x0396, 0x01a5, 0x01c3, 0x03f0, 0x010f, 0x033c, 0x035a, 0x0169,
+	0x0188, 0x03bb, 0x03dd, 0x01ee, 0x0311, 0x0122, 0x0144, 0x0377,
+	0x0289, 0x00ba, 0x00dc, 0x02ef, 0x0010, 0x0223, 0x0245, 0x0076,
+	0x01b9, 0x038a, 0x03ec, 0x01df, 0x0320, 0x0113, 0x0175, 0x0346,
+	0x02b8, 0x008b, 0x00ed, 0x02de, 0x0021, 0x0212, 0x0274, 0x0047,
+	0x01ea, 0x03d9, 0x03bf, 0x018c, 0x0373, 0x0140, 0x0126, 0x0315,
+	0x02eb, 0x00d8, 0x00be, 0x028d, 0x0072, 0x0241, 0x0227, 0x0014,
+	0x01db, 0x03e8, 0x038e, 0x01bd, 0x0342, 0x0171, 0x0117, 0x0324,
+	0x02da, 0x00e9, 0x008f, 0x02bc, 0x0043, 0x0270, 0x0216, 0x0025,
+	0x014c, 0x037f, 0x0319, 0x012a, 0x03d5, 0x01e6, 0x0180, 0x03b3,
+	0x024d, 0x007e, 0x0018, 0x022b, 0x00d4, 0x02e7, 0x0281, 0x00b2,
+	0x017d, 0x034e, 0x0328, 0x011b, 0x03e4, 0x01d7, 0x01b1, 0x0382,
+	0x027c, 0x004f, 0x0029, 0x021a, 0x00e5, 0x02d6, 0x02b0, 0x0083,
+	0x012e, 0x031d, 0x037b, 0x0148, 0x03b7, 0x0184, 0x01e2, 0x03d1,
+	0x022f, 0x001c, 0x007a, 0x0249, 0x00b6, 0x0285, 0x02e3, 0x00d0,
+	0x011f, 0x032c, 0x034a, 0x0179, 0x0386, 0x01b5, 0x01d3, 0x03e0,
+	0x021e, 0x002d, 0x004b, 0x0278, 0x0087, 0x02b4, 0x02d2, 0x00e1
+};
 
 static void
 init_crc10_table(void)
 {   
+#define CRC10_POLYNOMIAL 0x633
     register int i, j;
     register u_int16_t accum;
+    u_int16_t verify_crc10_table[256];
     
     for ( i = 0;  i < 256;  i++ )
     {
@@ -50,9 +106,12 @@ init_crc10_table(void)
         {
             if ((accum <<= 1) & 0x400) accum ^= CRC10_POLYNOMIAL;
         }
-        crc10_table[i] = accum;
+        verify_crc10_table[i] = accum;
     }
-    return;
+    assert(memcmp(verify_crc10_table,
+				  crc10_table,
+				  sizeof(verify_crc10_table)) == 0);
+#undef CRC10_POLYNOMIAL
 }
 
 u_int16_t

Modified: head/contrib/tcpdump/config.guess
==============================================================================
--- head/contrib/tcpdump/config.guess	Thu Oct 28 19:05:21 2010	(r214477)
+++ head/contrib/tcpdump/config.guess	Thu Oct 28 19:06:17 2010	(r214478)
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
 
-timestamp='2003-10-16'
+timestamp='2009-12-30'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,23 +18,25 @@ timestamp='2003-10-16'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Originally written by Per Bothner .
-# Please send patches to .  Submit a context
-# diff and a properly formatted ChangeLog entry.
+
+# Originally written by Per Bothner.  Please send patches (context
+# diff format) to  and include a ChangeLog
+# entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # exits with 0.  Otherwise, it exits with 1.
 #
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -53,8 +56,9 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -66,11 +70,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )	# Use stdin as input.
@@ -104,7 +108,7 @@ set_cc_for_build='
 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -123,7 +127,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
 	;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
@@ -158,6 +162,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
@@ -166,7 +171,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep __ELF__ >/dev/null
+			| grep -q __ELF__
 		then
 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 		    # Return netbsd for either.  FIX?
@@ -196,53 +201,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
-	exit 0 ;;
-    amiga:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    arc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    hp300:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mac68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    macppc:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-	echo m88k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvmeppc:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    pegasos:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    pmax:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sgi:OpenBSD:*:*)
-	echo mipseb-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sun3:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:OpenBSD:*:*)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:07: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 D0A771065672;
	Thu, 28 Oct 2010 19:07:05 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BD87D8FC13;
	Thu, 28 Oct 2010 19:07: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 o9SJ75J2025658;
	Thu, 28 Oct 2010 19:07:05 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJ75tw025656;
	Thu, 28 Oct 2010 19:07:05 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281907.o9SJ75tw025656@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:07: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: r214479 - 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: Thu, 28 Oct 2010 19:07:05 -0000

Author: tuexen
Date: Thu Oct 28 19:07:05 2010
New Revision: 214479
URL: http://svn.freebsd.org/changeset/base/214479

Log:
  MFC r212713:
  Remove unused variable/assignment.

Modified:
  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)

Modified: stable/8/sys/netinet/sctputil.c
==============================================================================
--- stable/8/sys/netinet/sctputil.c	Thu Oct 28 19:06:17 2010	(r214478)
+++ stable/8/sys/netinet/sctputil.c	Thu Oct 28 19:07:05 2010	(r214479)
@@ -5135,7 +5135,7 @@ sctp_sorecvmsg(struct socket *so,
 	int my_len = 0;
 	int cp_len = 0, error = 0;
 	struct sctp_queued_to_read *control = NULL, *ctl = NULL, *nxt = NULL;
-	struct mbuf *m = NULL, *embuf = NULL;
+	struct mbuf *m = NULL;
 	struct sctp_tcb *stcb = NULL;
 	int wakeup_read_socket = 0;
 	int freecnt_applied = 0;
@@ -5731,7 +5731,6 @@ get_more_data:
 						sctp_sblog(&so->so_rcv,
 						    control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0);
 					}
-					embuf = m;
 					copied_so_far += cp_len;
 					freed_so_far += cp_len;
 					freed_so_far += MSIZE;
@@ -5783,7 +5782,6 @@ get_more_data:
 						atomic_subtract_int(&stcb->asoc.sb_cc, cp_len);
 					}
 					copied_so_far += cp_len;
-					embuf = m;
 					freed_so_far += cp_len;
 					freed_so_far += MSIZE;
 					if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) {

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:08: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 DE75C1065679;
	Thu, 28 Oct 2010 19:08:50 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CB1C18FC13;
	Thu, 28 Oct 2010 19:08: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 o9SJ8oSI025788;
	Thu, 28 Oct 2010 19:08:50 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJ8ogg025783;
	Thu, 28 Oct 2010 19:08:50 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281908.o9SJ8ogg025783@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:08: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: r214480 - 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: Thu, 28 Oct 2010 19:08:51 -0000

Author: tuexen
Date: Thu Oct 28 19:08:50 2010
New Revision: 214480
URL: http://svn.freebsd.org/changeset/base/214480

Log:
  MFC r212714:
  Remove old debug code.

Modified:
  stable/8/sys/netinet/sctp_output.c
  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)

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 19:07:05 2010	(r214479)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 19:08:50 2010	(r214480)
@@ -3803,9 +3803,6 @@ sctp_lowlevel_chunk_output(struct sctp_i
 					mtu -= sizeof(struct udphdr);
 				}
 				if (mtu && (stcb->asoc.smallest_mtu > mtu)) {
-#ifdef SCTP_PRINT_FOR_B_AND_M
-					SCTP_PRINTF("sctp_mtu_size_reset called after ip_output mtu-change:%d\n", mtu);
-#endif
 					sctp_mtu_size_reset(inp, &stcb->asoc, mtu);
 					net->mtu = mtu;
 				}
@@ -4134,10 +4131,6 @@ sctp_lowlevel_chunk_output(struct sctp_i
 				mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt);
 				if (mtu &&
 				    (stcb->asoc.smallest_mtu > mtu)) {
-#ifdef SCTP_PRINT_FOR_B_AND_M
-					SCTP_PRINTF("sctp_mtu_size_reset called after ip6_output mtu-change:%d\n",
-					    mtu);
-#endif
 					sctp_mtu_size_reset(inp, &stcb->asoc, mtu);
 					net->mtu = mtu;
 					if (net->port) {
@@ -4147,10 +4140,6 @@ sctp_lowlevel_chunk_output(struct sctp_i
 			} else if (ifp) {
 				if (ND_IFINFO(ifp)->linkmtu &&
 				    (stcb->asoc.smallest_mtu > ND_IFINFO(ifp)->linkmtu)) {
-#ifdef SCTP_PRINT_FOR_B_AND_M
-					SCTP_PRINTF("sctp_mtu_size_reset called via ifp ND_IFINFO() linkmtu:%d\n",
-					    ND_IFINFO(ifp)->linkmtu);
-#endif
 					sctp_mtu_size_reset(inp,
 					    &stcb->asoc,
 					    ND_IFINFO(ifp)->linkmtu);

Modified: stable/8/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 19:07:05 2010	(r214479)
+++ stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 19:08:50 2010	(r214480)
@@ -3916,9 +3916,6 @@ sctp_add_remote_addr(struct sctp_tcb *st
 		} else {
 			net->mtu = 0;
 		}
-#ifdef SCTP_PRINT_FOR_B_AND_M
-		SCTP_PRINTF("We have found an interface mtu of %d\n", net->mtu);
-#endif
 		if (net->mtu == 0) {
 			/* Huh ?? */
 			net->mtu = SCTP_DEFAULT_MTU;
@@ -3926,9 +3923,6 @@ sctp_add_remote_addr(struct sctp_tcb *st
 			uint32_t rmtu;
 
 			rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt);
-#ifdef SCTP_PRINT_FOR_B_AND_M
-			SCTP_PRINTF("The route mtu is %d\n", rmtu);
-#endif
 			if (rmtu == 0) {
 				/*
 				 * Start things off to match mtu of
@@ -3946,9 +3940,6 @@ sctp_add_remote_addr(struct sctp_tcb *st
 			}
 		}
 		if (from == SCTP_ALLOC_ASOC) {
-#ifdef SCTP_PRINT_FOR_B_AND_M
-			SCTP_PRINTF("New assoc sets mtu to :%d\n", net->mtu);
-#endif
 			stcb->asoc.smallest_mtu = net->mtu;
 		}
 	} else {
@@ -3966,10 +3957,6 @@ sctp_add_remote_addr(struct sctp_tcb *st
 		net->mtu -= sizeof(struct udphdr);
 	}
 	if (stcb->asoc.smallest_mtu > net->mtu) {
-#ifdef SCTP_PRINT_FOR_B_AND_M
-		SCTP_PRINTF("new address mtu:%d smaller than smallest:%d\n",
-		    net->mtu, stcb->asoc.smallest_mtu);
-#endif
 		stcb->asoc.smallest_mtu = net->mtu;
 	}
 	/* JRS - Use the congestion control given in the CC module */

Modified: stable/8/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/8/sys/netinet/sctp_usrreq.c	Thu Oct 28 19:07:05 2010	(r214479)
+++ stable/8/sys/netinet/sctp_usrreq.c	Thu Oct 28 19:08:50 2010	(r214480)
@@ -111,10 +111,6 @@ sctp_pathmtu_adjustment(struct sctp_inpc
 	/* Adjust that too */
 	stcb->asoc.smallest_mtu = nxtsz;
 	/* now off to subtract IP_DF flag if needed */
-#ifdef SCTP_PRINT_FOR_B_AND_M
-	SCTP_PRINTF("sctp_pathmtu_adjust called inp:%p stcb:%p net:%p nxtsz:%d\n",
-	    inp, stcb, net, nxtsz);
-#endif
 	overhead = IP_HDR_SIZE;
 	if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) {
 		overhead += sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id);
@@ -215,10 +211,6 @@ sctp_notify_mbuf(struct sctp_inpcb *inp,
 	}
 	/* now what about the ep? */
 	if (stcb->asoc.smallest_mtu > nxtsz) {
-#ifdef SCTP_PRINT_FOR_B_AND_M
-		SCTP_PRINTF("notify_mbuf (ICMP) calls sctp_pathmtu_adjust mtu:%d\n",
-		    nxtsz);
-#endif
 		sctp_pathmtu_adjustment(inp, stcb, net, nxtsz);
 	}
 	if (tmr_stopped)
@@ -3806,10 +3798,6 @@ sctp_setopt(struct socket *so, int optna
 						if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) {
 							net->mtu = paddrp->spp_pathmtu + ovh;
 							if (net->mtu < stcb->asoc.smallest_mtu) {
-#ifdef SCTP_PRINT_FOR_B_AND_M
-								SCTP_PRINTF("SCTP_PMTU_DISABLE calls sctp_pathmtu_adjustment:%d\n",
-								    net->mtu);
-#endif
 								sctp_pathmtu_adjustment(inp, stcb, net, net->mtu);
 							}
 						}
@@ -3854,10 +3842,6 @@ sctp_setopt(struct socket *so, int optna
 							if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) {
 								net->mtu = paddrp->spp_pathmtu + ovh;
 								if (net->mtu < stcb->asoc.smallest_mtu) {
-#ifdef SCTP_PRINT_FOR_B_AND_M
-									SCTP_PRINTF("SCTP_PMTU_DISABLE calls sctp_pathmtu_adjustment:%d\n",
-									    net->mtu);
-#endif
 									sctp_pathmtu_adjustment(inp, stcb, net, net->mtu);
 								}
 							}

Modified: stable/8/sys/netinet/sctputil.c
==============================================================================
--- stable/8/sys/netinet/sctputil.c	Thu Oct 28 19:07:05 2010	(r214479)
+++ stable/8/sys/netinet/sctputil.c	Thu Oct 28 19:08:50 2010	(r214480)
@@ -1004,10 +1004,6 @@ sctp_init_asoc(struct sctp_inpcb *m, str
 	asoc->peers_rwnd = SCTP_SB_LIMIT_RCV(m->sctp_socket);
 
 	asoc->smallest_mtu = m->sctp_frag_point;
-#ifdef SCTP_PRINT_FOR_B_AND_M
-	SCTP_PRINTF("smallest_mtu init'd with asoc to :%d\n",
-	    asoc->smallest_mtu);
-#endif
 	asoc->minrto = m->sctp_ep.sctp_minrto;
 	asoc->maxrto = m->sctp_ep.sctp_maxrto;
 
@@ -2488,10 +2484,6 @@ sctp_mtu_size_reset(struct sctp_inpcb *i
 	struct sctp_tmit_chunk *chk;
 	unsigned int eff_mtu, ovh;
 
-#ifdef SCTP_PRINT_FOR_B_AND_M
-	SCTP_PRINTF("sctp_mtu_size_reset(%p, asoc:%p mtu:%d\n",
-	    inp, asoc, mtu);
-#endif
 	asoc->smallest_mtu = mtu;
 	if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
 		ovh = SCTP_MIN_OVERHEAD;

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:08: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 8D27910657E7;
	Thu, 28 Oct 2010 19:08:56 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 78B4C8FC0A;
	Thu, 28 Oct 2010 19:08: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 o9SJ8uuL025830;
	Thu, 28 Oct 2010 19:08:56 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJ8u3K025827;
	Thu, 28 Oct 2010 19:08:56 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010281908.o9SJ8u3K025827@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 28 Oct 2010 19:08: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: r214481 - head/usr.sbin/tcpdump/tcpdump
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 19:08:56 -0000

Author: rpaulo
Date: Thu Oct 28 19:08:56 2010
New Revision: 214481
URL: http://svn.freebsd.org/changeset/base/214481

Log:
  Update for the new tcpdump 4.1.1. The man page is a result of running
  tcpdump's autoconf on FreeBSD.

Added:
  head/usr.sbin/tcpdump/tcpdump/tcpdump.1   (contents, props changed)
Modified:
  head/usr.sbin/tcpdump/tcpdump/Makefile

Modified: head/usr.sbin/tcpdump/tcpdump/Makefile
==============================================================================
--- head/usr.sbin/tcpdump/tcpdump/Makefile	Thu Oct 28 19:08:50 2010	(r214480)
+++ head/usr.sbin/tcpdump/tcpdump/Makefile	Thu Oct 28 19:08:56 2010	(r214481)
@@ -15,7 +15,7 @@ SRCS =	addrtoname.c af.c checksum.c cpac
 	print-cfm.c print-chdlc.c print-cip.c print-cnfp.c print-dccp.c \
 	print-decnet.c print-domain.c print-dtp.c print-dvmrp.c print-enc.c \
 	print-egp.c print-eap.c print-eigrp.c \
-	print-esp.c print-ether.c print-fddi.c print-fr.c \
+	print-esp.c print-ether.c print-fddi.c print-forces.c print-fr.c \
 	print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
 	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c \
 	print-ipx.c print-isakmp.c print-isoclns.c print-juniper.c print-krb.c \
@@ -33,7 +33,7 @@ SRCS =	addrtoname.c af.c checksum.c cpac
 	print-timed.c print-token.c print-udld.c print-udp.c print-vjc.c \
 	print-vqp.c print-vrrp.c print-vtp.c \
 	print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c \
-	print-smb.c smbutil.c \
+	print-smb.c signature.c smbutil.c \
 	version.c
 CLEANFILES+=	version.c
 

Added: head/usr.sbin/tcpdump/tcpdump/tcpdump.1
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/tcpdump/tcpdump/tcpdump.1	Thu Oct 28 19:08:56 2010	(r214481)
@@ -0,0 +1,1722 @@
+.\" $FreeBSD$
+.\" @(#) $Header: /tcpdump/master/tcpdump/tcpdump.1.in,v 1.2 2008-11-09 23:35:03 mcr Exp $ (LBL)
+.\"
+.\"	$NetBSD: tcpdump.8,v 1.9 2003/03/31 00:18:17 perry Exp $
+.\"
+.\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
+.\"	The Regents of the University of California.  All rights reserved.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that: (1) source code distributions
+.\" retain the above copyright notice and this paragraph in its entirety, (2)
+.\" distributions including binary code include the above copyright notice and
+.\" this paragraph in its entirety in the documentation or other materials
+.\" provided with the distribution, and (3) all advertising materials mentioning
+.\" features or use of this software display the following acknowledgement:
+.\" ``This product includes software developed by the University of California,
+.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+.\" the University nor the names of its contributors may be used to endorse
+.\" or promote products derived from this software without specific prior
+.\" written permission.
+.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+.\"
+.TH TCPDUMP 1  "05 March 2009"
+.SH NAME
+tcpdump \- dump traffic on a network
+.SH SYNOPSIS
+.na
+.B tcpdump
+[
+.B \-AbdDefIKlLnNOpqRStuUvxX
+] [
+.B \-B
+.I buffer_size
+] [
+.B \-c
+.I count
+]
+.br
+.ti +8
+[
+.B \-C
+.I file_size
+] [
+.B \-G
+.I rotate_seconds
+] [
+.B \-F
+.I file
+]
+.br
+.ti +8
+[
+.B \-i
+.I interface
+]
+[
+.B \-m
+.I module
+]
+[
+.B \-M
+.I secret
+]
+.br
+.ti +8
+[
+.B \-r
+.I file
+]
+[
+.B \-s
+.I snaplen
+]
+[
+.B \-T
+.I type
+]
+[
+.B \-w
+.I file
+]
+.br
+.ti +8
+[
+.B \-W
+.I filecount
+]
+.br
+.ti +8
+[
+.B \-E
+.I spi@ipaddr algo:secret,...
+]
+.br
+.ti +8
+[
+.B \-y
+.I datalinktype
+]
+[
+.B \-z
+.I postrotate-command
+]
+[
+.B \-Z
+.I user
+]
+.ti +8
+[
+.I expression
+]
+.br
+.ad
+.SH DESCRIPTION
+.LP
+\fITcpdump\fP prints out a description of the contents of packets on a
+network interface that match the boolean \fIexpression\fP.  It can also
+be run with the
+.B \-w
+flag, which causes it to save the packet data to a file for later
+analysis, and/or with the
+.B \-r
+flag, which causes it to read from a saved packet file rather than to
+read packets from a network interface.  In all cases, only packets that
+match
+.I expression
+will be processed by
+.IR tcpdump .
+.LP
+.I Tcpdump
+will, if not run with the
+.B \-c
+flag, continue capturing packets until it is interrupted by a SIGINT
+signal (generated, for example, by typing your interrupt character,
+typically control-C) or a SIGTERM signal (typically generated with the
+.BR kill (1)
+command); if run with the
+.B \-c
+flag, it will capture packets until it is interrupted by a SIGINT or
+SIGTERM signal or the specified number of packets have been processed.
+.LP
+When
+.I tcpdump
+finishes capturing packets, it will report counts of:
+.IP
+packets ``captured'' (this is the number of packets that
+.I tcpdump
+has received and processed);
+.IP
+packets ``received by filter'' (the meaning of this depends on the OS on
+which you're running
+.IR tcpdump ,
+and possibly on the way the OS was configured - if a filter was
+specified on the command line, on some OSes it counts packets regardless
+of whether they were matched by the filter expression and, even if they
+were matched by the filter expression, regardless of whether
+.I tcpdump
+has read and processed them yet, on other OSes it counts only packets that were
+matched by the filter expression regardless of whether
+.I tcpdump
+has read and processed them yet, and on other OSes it counts only
+packets that were matched by the filter expression and were processed by
+.IR tcpdump );
+.IP
+packets ``dropped by kernel'' (this is the number of packets that were
+dropped, due to a lack of buffer space, by the packet capture mechanism
+in the OS on which
+.I tcpdump
+is running, if the OS reports that information to applications; if not,
+it will be reported as 0).
+.LP
+On platforms that support the SIGINFO signal, such as most BSDs
+(including Mac OS X) and Digital/Tru64 UNIX, it will report those counts
+when it receives a SIGINFO signal (generated, for example, by typing
+your ``status'' character, typically control-T, although on some
+platforms, such as Mac OS X, the ``status'' character is not set by
+default, so you must set it with
+.BR stty (1)
+in order to use it) and will continue capturing packets.
+.LP
+Reading packets from a network interface may require that you have
+special privileges; see the
+.B pcap (3PCAP)
+man page for details.  Reading a saved packet file doesn't require
+special privileges.
+.SH OPTIONS
+.TP
+.B \-A
+Print each packet (minus its link level header) in ASCII.  Handy for
+capturing web pages.
+.TP
+.B \-b
+Print the AS number in BGP packets in ASDOT notation rather than ASPLAIN
+notation.
+.TP
+.B \-B
+Set the operating system capture buffer size to \fIbuffer_size\fP.
+.TP
+.B \-c
+Exit after receiving \fIcount\fP packets.
+.TP
+.B \-C
+Before writing a raw packet to a savefile, check whether the file is
+currently larger than \fIfile_size\fP and, if so, close the current
+savefile and open a new one.  Savefiles after the first savefile will
+have the name specified with the
+.B \-w
+flag, with a number after it, starting at 1 and continuing upward.
+The units of \fIfile_size\fP are millions of bytes (1,000,000 bytes,
+not 1,048,576 bytes).
+.TP
+.B \-d
+Dump the compiled packet-matching code in a human readable form to
+standard output and stop.
+.TP
+.B \-dd
+Dump packet-matching code as a
+.B C
+program fragment.
+.TP
+.B \-ddd
+Dump packet-matching code as decimal numbers (preceded with a count).
+.TP
+.B \-D
+Print the list of the network interfaces available on the system and on
+which
+.I tcpdump
+can capture packets.  For each network interface, a number and an
+interface name, possibly followed by a text description of the
+interface, is printed.  The interface name or the number can be supplied
+to the
+.B \-i
+flag to specify an interface on which to capture.
+.IP
+This can be useful on systems that don't have a command to list them
+(e.g., Windows systems, or UNIX systems lacking
+.BR "ifconfig \-a" );
+the number can be useful on Windows 2000 and later systems, where the
+interface name is a somewhat complex string.
+.IP
+The
+.B \-D
+flag will not be supported if
+.I tcpdump
+was built with an older version of
+.I libpcap
+that lacks the
+.B pcap_findalldevs()
+function.
+.TP
+.B \-e
+Print the link-level header on each dump line.
+.TP
+.B \-E
+Use \fIspi@ipaddr algo:secret\fP for decrypting IPsec ESP packets that
+are addressed to \fIaddr\fP and contain Security Parameter Index value
+\fIspi\fP. This combination may be repeated with comma or newline seperation.
+.IP
+Note that setting the secret for IPv4 ESP packets is supported at this time.
+.IP
+Algorithms may be
+\fBdes-cbc\fP,
+\fB3des-cbc\fP,
+\fBblowfish-cbc\fP,
+\fBrc3-cbc\fP,
+\fBcast128-cbc\fP, or
+\fBnone\fP.
+The default is \fBdes-cbc\fP.
+The ability to decrypt packets is only present if \fItcpdump\fP was compiled
+with cryptography enabled.
+.IP
+\fIsecret\fP is the ASCII text for ESP secret key. 
+If preceeded by 0x, then a hex value will be read.
+.IP
+The option assumes RFC2406 ESP, not RFC1827 ESP.
+The option is only for debugging purposes, and
+the use of this option with a true `secret' key is discouraged.
+By presenting IPsec secret key onto command line
+you make it visible to others, via
+.IR ps (1)
+and other occasions.
+.IP
+In addition to the above syntax, the syntax \fIfile name\fP may be used
+to have tcpdump read the provided file in. The file is opened upon 
+receiving the first ESP packet, so any special permissions that tcpdump
+may have been given should already have been given up.
+.TP
+.B \-f
+Print `foreign' IPv4 addresses numerically rather than symbolically
+(this option is intended to get around serious brain damage in
+Sun's NIS server \(em usually it hangs forever translating non-local
+internet numbers).
+.IP
+The test for `foreign' IPv4 addresses is done using the IPv4 address and
+netmask of the interface on which capture is being done.  If that
+address or netmask are not available, available, either because the
+interface on which capture is being done has no address or netmask or
+because the capture is being done on the Linux "any" interface, which
+can capture on more than one interface, this option will not work
+correctly.
+.TP
+.B \-F
+Use \fIfile\fP as input for the filter expression.
+An additional expression given on the command line is ignored.
+.TP
+.B \-G
+If specified, rotates the dump file specified with the
+.B \-w
+option every \fIrotate_seconds\fP seconds.
+Savefiles will have the name specified by
+.B \-w
+which should include a time format as defined by
+.BR strftime (3).
+If no time format is specified, each new file will overwrite the previous.
+.IP
+If used in conjunction with the
+.B \-C
+option, filenames will take the form of `\fIfile\fP'.
+.TP
+.B \-i
+Listen on \fIinterface\fP.
+If unspecified, \fItcpdump\fP searches the system interface list for the
+lowest numbered, configured up interface (excluding loopback).
+Ties are broken by choosing the earliest match.
+.IP
+On Linux systems with 2.2 or later kernels, an
+.I interface
+argument of ``any'' can be used to capture packets from all interfaces.
+Note that captures on the ``any'' device will not be done in promiscuous
+mode.
+.IP
+If the
+.B \-D
+flag is supported, an interface number as printed by that flag can be
+used as the
+.I interface
+argument.
+.TP
+.B \-I
+Put the interface in "monitor mode"; this is supported only on IEEE
+802.11 Wi-Fi interfaces, and supported only on some operating systems.
+.IP
+Note that in monitor mode the adapter might disassociate from the
+network with which it's associated, so that you will not be able to use
+any wireless networks with that adapter.  This could prevent accessing
+files on a network server, or resolving host names or network addresses,
+if you are capturing in monitor mode and are not connected to another
+network with another adapter.
+.IP
+This flag will affect the output of the
+.B \-L
+flag.  If
+.B \-I
+isn't specified, only those link-layer types available when not in
+monitor mode will be shown; if
+.B \-I
+is specified, only those link-layer types available when in monitor mode
+will be shown.
+.TP
+.B \-K
+Don't attempt to verify IP, TCP, or UDP checksums.  This is useful for
+interfaces that perform some or all of those checksum calculation in
+hardware; otherwise, all outgoing TCP checksums will be flagged as bad.
+.TP
+.B \-l
+Make stdout line buffered.
+Useful if you want to see the data
+while capturing it.
+E.g.,
+.br
+``tcpdump\ \ \-l\ \ |\ \ tee dat'' or
+``tcpdump\ \ \-l \ \ > dat\ \ &\ \ tail\ \ \-f\ \ dat''.
+.TP
+.B \-L
+List the known data link types for the interface, in the specified mode,
+and exit.  The list of known data link types may be dependent on the
+specified mode; for example, on some platforms, a Wi-Fi interface might
+support one set of data link types when not in monitor mode (for
+example, it might support only fake Ethernet headers, or might support
+802.11 headers but not support 802.11 headers with radio information)
+and another set of data link types when in monitor mode (for example, it
+might support 802.11 headers, or 802.11 headers with radio information,
+only in monitor mode).
+.TP
+.B \-m
+Load SMI MIB module definitions from file \fImodule\fR.
+This option
+can be used several times to load several MIB modules into \fItcpdump\fP.
+.TP
+.B \-M
+Use \fIsecret\fP as a shared secret for validating the digests found in
+TCP segments with the TCP-MD5 option (RFC 2385), if present.
+.TP
+.B \-n
+Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
+.TP
+.B \-N
+Don't print domain name qualification of host names.
+E.g.,
+if you give this flag then \fItcpdump\fP will print ``nic''
+instead of ``nic.ddn.mil''.
+.TP
+.B \-O
+Do not run the packet-matching code optimizer.
+This is useful only
+if you suspect a bug in the optimizer.
+.TP
+.B \-p
+\fIDon't\fP put the interface
+into promiscuous mode.
+Note that the interface might be in promiscuous
+mode for some other reason; hence, `-p' cannot be used as an abbreviation for
+`ether host {local-hw-addr} or ether broadcast'.
+.TP
+.B \-q
+Quick (quiet?) output.
+Print less protocol information so output
+lines are shorter.
+.TP
+.B \-R
+Assume ESP/AH packets to be based on old specification (RFC1825 to RFC1829).
+If specified, \fItcpdump\fP will not print replay prevention field.
+Since there is no protocol version field in ESP/AH specification,
+\fItcpdump\fP cannot deduce the version of ESP/AH protocol.
+.TP
+.B \-r
+Read packets from \fIfile\fR (which was created with the
+.B \-w
+option).
+Standard input is used if \fIfile\fR is ``-''.
+.TP
+.B \-S
+Print absolute, rather than relative, TCP sequence numbers.
+.TP
+.B \-s
+Snarf \fIsnaplen\fP bytes of data from each packet rather than the
+default of 65535 bytes.
+Packets truncated because of a limited snapshot
+are indicated in the output with ``[|\fIproto\fP]'', where \fIproto\fP
+is the name of the protocol level at which the truncation has occurred.
+Note that taking larger snapshots both increases
+the amount of time it takes to process packets and, effectively,
+decreases the amount of packet buffering.
+This may cause packets to be
+lost.
+You should limit \fIsnaplen\fP to the smallest number that will
+capture the protocol information you're interested in.
+Setting
+\fIsnaplen\fP to 0 sets it to the default of 65535,
+for backwards compatibility with recent older versions of
+.IR tcpdump .
+.TP
+.B \-T
+Force packets selected by "\fIexpression\fP" to be interpreted the
+specified \fItype\fR.
+Currently known types are
+\fBaodv\fR (Ad-hoc On-demand Distance Vector protocol),
+\fBcnfp\fR (Cisco NetFlow protocol),
+\fBrpc\fR (Remote Procedure Call),
+\fBrtp\fR (Real-Time Applications protocol),
+\fBrtcp\fR (Real-Time Applications control protocol),
+\fBsnmp\fR (Simple Network Management Protocol),
+\fBtftp\fR (Trivial File Transfer Protocol),
+\fBvat\fR (Visual Audio Tool),
+and
+\fBwb\fR (distributed White Board).
+.TP
+.B \-t
+\fIDon't\fP print a timestamp on each dump line.
+.TP
+.B \-tt
+Print an unformatted timestamp on each dump line.
+.TP
+.B \-ttt
+Print a delta (micro-second resolution) between current and previous line
+on each dump line.
+.TP
+.B \-tttt
+Print a timestamp in default format proceeded by date on each dump line.
+.TP
+.B \-ttttt
+Print a delta (micro-second resolution) between current and first line
+on each dump line.
+.TP
+.B \-u
+Print undecoded NFS handles.
+.TP
+.B \-U
+Make output saved via the
+.B \-w
+option ``packet-buffered''; i.e., as each packet is saved, it will be
+written to the output file, rather than being written only when the
+output buffer fills.
+.IP
+The
+.B \-U
+flag will not be supported if
+.I tcpdump
+was built with an older version of
+.I libpcap
+that lacks the
+.B pcap_dump_flush()
+function.
+.TP
+.B \-v
+When parsing and printing, produce (slightly more) verbose output.
+For example, the time to live,
+identification, total length and options in an IP packet are printed.
+Also enables additional packet integrity checks such as verifying the
+IP and ICMP header checksum.
+.IP
+When writing to a file with the
+.B \-w
+option, report, every 10 seconds, the number of packets captured.
+.TP
+.B \-vv
+Even more verbose output.
+For example, additional fields are
+printed from NFS reply packets, and SMB packets are fully decoded.
+.TP
+.B \-vvv
+Even more verbose output.
+For example,
+telnet \fBSB\fP ... \fBSE\fP options
+are printed in full.
+With
+.B \-X
+Telnet options are printed in hex as well.
+.TP
+.B \-w
+Write the raw packets to \fIfile\fR rather than parsing and printing
+them out.
+They can later be printed with the \-r option.
+Standard output is used if \fIfile\fR is ``-''.
+See
+.BR pcap-savefile (5)
+for a description of the file format.
+.TP
+.B \-W
+Used in conjunction with the 
+.B \-C 
+option, this will limit the number
+of files created to the specified number, and begin overwriting files
+from the beginning, thus creating a 'rotating' buffer. 
+In addition, it will name
+the files with enough leading 0s to support the maximum number of
+files, allowing them to sort correctly.
+.IP
+Used in conjunction with the 
+.B \-G
+option, this will limit the number of rotated dump files that get
+created, exiting with status 0 when reaching the limit. If used with
+.B \-C
+as well, the behavior will result in cyclical files per timeslice.
+.TP
+.B \-x
+When parsing and printing,
+in addition to printing the headers of each packet, print the data of
+each packet (minus its link level header) in hex. 
+The smaller of the entire packet or
+.I snaplen
+bytes will be printed.  Note that this is the entire link-layer
+packet, so for link layers that pad (e.g. Ethernet), the padding bytes
+will also be printed when the higher layer packet is shorter than the
+required padding.
+.TP
+.B \-xx
+When parsing and printing,
+in addition to printing the headers of each packet, print the data of
+each packet,
+.I including
+its link level header, in hex.
+.TP
+.B \-X
+When parsing and printing,
+in addition to printing the headers of each packet, print the data of
+each packet (minus its link level header) in hex and ASCII.
+This is very handy for analysing new protocols.
+.TP
+.B \-XX
+When parsing and printing,
+in addition to printing the headers of each packet, print the data of
+each packet,
+.I including
+its link level header, in hex and ASCII.
+.TP
+.B \-y
+Set the data link type to use while capturing packets to \fIdatalinktype\fP.
+.TP
+.B \-z
+Used in conjunction with the
+.B -C
+or
+.B -G
+options, this will make
+.I tcpdump
+run "
+.I command file
+" where
+.I file
+is the savefile being closed after each rotation. For example, specifying
+.B \-z gzip
+or
+.B \-z bzip2
+will compress each savefile using gzip or bzip2.
+.IP
+Note that tcpdump will run the command in parallel to the capture, using
+the lowest priority so that this doesn't disturb the capture process.
+.IP
+And in case you would like to use a command that itself takes flags or
+different arguments, you can always write a shell script that will take the
+savefile name as the only argument, make the flags & arguments arrangements
+and execute the command that you want.
+.TP
+.B \-Z
+Drops privileges (if root) and changes user ID to
+.I user
+and the group ID to the primary group of
+.IR user .
+.IP
+This behavior can also be enabled by default at compile time.
+.IP "\fI expression\fP"
+.RS
+selects which packets will be dumped.
+If no \fIexpression\fP
+is given, all packets on the net will be dumped.
+Otherwise,
+only packets for which \fIexpression\fP is `true' will be dumped.
+.LP
+For the \fIexpression\fP syntax, see
+.BR pcap-filter (7).
+.LP
+Expression arguments can be passed to \fItcpdump\fP as either a single
+argument or as multiple arguments, whichever is more convenient.
+Generally, if the expression contains Shell metacharacters, it is
+easier to pass it as a single, quoted argument.
+Multiple arguments are concatenated with spaces before being parsed.
+.SH EXAMPLES
+.LP
+To print all packets arriving at or departing from \fIsundown\fP:
+.RS
+.nf
+\fBtcpdump host sundown\fP
+.fi
+.RE
+.LP
+To print traffic between \fIhelios\fR and either \fIhot\fR or \fIace\fR:
+.RS
+.nf
+\fBtcpdump host helios and \\( hot or ace \\)\fP
+.fi
+.RE
+.LP
+To print all IP packets between \fIace\fR and any host except \fIhelios\fR:
+.RS
+.nf
+\fBtcpdump ip host ace and not helios\fP
+.fi
+.RE
+.LP
+To print all traffic between local hosts and hosts at Berkeley:
+.RS
+.nf
+.B
+tcpdump net ucb-ether
+.fi
+.RE
+.LP
+To print all ftp traffic through internet gateway \fIsnup\fP:
+(note that the expression is quoted to prevent the shell from
+(mis-)interpreting the parentheses):
+.RS
+.nf
+.B
+tcpdump 'gateway snup and (port ftp or ftp-data)'
+.fi
+.RE
+.LP
+To print traffic neither sourced from nor destined for local hosts
+(if you gateway to one other net, this stuff should never make it
+onto your local net).
+.RS
+.nf
+.B
+tcpdump ip and not net \fIlocalnet\fP
+.fi
+.RE
+.LP
+To print the start and end packets (the SYN and FIN packets) of each
+TCP conversation that involves a non-local host.
+.RS
+.nf
+.B
+tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net \fIlocalnet\fP'
+.fi
+.RE
+.LP
+To print all IPv4 HTTP packets to and from port 80, i.e. print only
+packets that contain data, not, for example, SYN and FIN packets and
+ACK-only packets.  (IPv6 is left as an exercise for the reader.)
+.RS
+.nf
+.B
+tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
+.fi
+.RE
+.LP
+To print IP packets longer than 576 bytes sent through gateway \fIsnup\fP:
+.RS
+.nf
+.B
+tcpdump 'gateway snup and ip[2:2] > 576'
+.fi
+.RE
+.LP
+To print IP broadcast or multicast packets that were
+.I not
+sent via Ethernet broadcast or multicast:
+.RS
+.nf
+.B
+tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224'
+.fi
+.RE
+.LP
+To print all ICMP packets that are not echo requests/replies (i.e., not
+ping packets):
+.RS
+.nf
+.B
+tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'
+.fi
+.RE
+.SH OUTPUT FORMAT
+.LP
+The output of \fItcpdump\fP is protocol dependent.
+The following
+gives a brief description and examples of most of the formats.
+.de HD
+.sp 1.5
+.B
+..
+.HD
+Link Level Headers
+.LP
+If the '-e' option is given, the link level header is printed out.
+On Ethernets, the source and destination addresses, protocol,
+and packet length are printed.
+.LP
+On FDDI networks, the  '-e' option causes \fItcpdump\fP to print
+the `frame control' field,  the source and destination addresses,
+and the packet length.
+(The `frame control' field governs the
+interpretation of the rest of the packet.
+Normal packets (such
+as those containing IP datagrams) are `async' packets, with a priority
+value between 0 and 7; for example, `\fBasync4\fR'.
+Such packets
+are assumed to contain an 802.2 Logical Link Control (LLC) packet;
+the LLC header is printed if it is \fInot\fR an ISO datagram or a
+so-called SNAP packet.
+.LP
+On Token Ring networks, the '-e' option causes \fItcpdump\fP to print
+the `access control' and `frame control' fields, the source and
+destination addresses, and the packet length.
+As on FDDI networks,
+packets are assumed to contain an LLC packet.
+Regardless of whether
+the '-e' option is specified or not, the source routing information is
+printed for source-routed packets.
+.LP
+On 802.11 networks, the '-e' option causes \fItcpdump\fP to print
+the `frame control' fields, all of the addresses in the 802.11 header,
+and the packet length.
+As on FDDI networks,
+packets are assumed to contain an LLC packet.
+.LP
+\fI(N.B.: The following description assumes familiarity with
+the SLIP compression algorithm described in RFC-1144.)\fP
+.LP
+On SLIP links, a direction indicator (``I'' for inbound, ``O'' for outbound),
+packet type, and compression information are printed out.
+The packet type is printed first.
+The three types are \fIip\fP, \fIutcp\fP, and \fIctcp\fP.
+No further link information is printed for \fIip\fR packets.
+For TCP packets, the connection identifier is printed following the type.
+If the packet is compressed, its encoded header is printed out.
+The special cases are printed out as
+\fB*S+\fIn\fR and \fB*SA+\fIn\fR, where \fIn\fR is the amount by which
+the sequence number (or sequence number and ack) has changed.
+If it is not a special case,
+zero or more changes are printed.
+A change is indicated by U (urgent pointer), W (window), A (ack),
+S (sequence number), and I (packet ID), followed by a delta (+n or -n),
+or a new value (=n).
+Finally, the amount of data in the packet and compressed header length
+are printed.
+.LP
+For example, the following line shows an outbound compressed TCP packet,
+with an implicit connection identifier; the ack has changed by 6,
+the sequence number by 49, and the packet ID by 6; there are 3 bytes of
+data and 6 bytes of compressed header:
+.RS
+.nf
+\fBO ctcp * A+6 S+49 I+6 3 (6)\fP
+.fi
+.RE
+.HD
+ARP/RARP Packets
+.LP
+Arp/rarp output shows the type of request and its arguments.
+The
+format is intended to be self explanatory.
+Here is a short sample taken from the start of an `rlogin' from
+host \fIrtsg\fP to host \fIcsam\fP:
+.RS
+.nf
+.sp .5
+\f(CWarp who-has csam tell rtsg
+arp reply csam is-at CSAM\fR
+.sp .5
+.fi
+.RE
+The first line says that rtsg sent an arp packet asking
+for the Ethernet address of internet host csam.
+Csam
+replies with its Ethernet address (in this example, Ethernet addresses
+are in caps and internet addresses in lower case).
+.LP
+This would look less redundant if we had done \fItcpdump \-n\fP:
+.RS
+.nf
+.sp .5
+\f(CWarp who-has 128.3.254.6 tell 128.3.254.68
+arp reply 128.3.254.6 is-at 02:07:01:00:01:c4\fP
+.fi
+.RE
+.LP
+If we had done \fItcpdump \-e\fP, the fact that the first packet is
+broadcast and the second is point-to-point would be visible:
+.RS
+.nf
+.sp .5
+\f(CWRTSG Broadcast 0806  64: arp who-has csam tell rtsg
+CSAM RTSG 0806  64: arp reply csam is-at CSAM\fR
+.sp .5
+.fi
+.RE
+For the first packet this says the Ethernet source address is RTSG, the
+destination is the Ethernet broadcast address, the type field
+contained hex 0806 (type ETHER_ARP) and the total length was 64 bytes.
+.HD
+TCP Packets
+.LP
+\fI(N.B.:The following description assumes familiarity with
+the TCP protocol described in RFC-793.
+If you are not familiar
+with the protocol, neither this description nor \fItcpdump\fP will
+be of much use to you.)\fP
+.LP
+The general format of a tcp protocol line is:
+.RS
+.nf
+.sp .5
+\fIsrc > dst: flags data-seqno ack window urgent options\fP
+.sp .5
+.fi
+.RE
+\fISrc\fP and \fIdst\fP are the source and destination IP
+addresses and ports.
+\fIFlags\fP are some combination of S (SYN),
+F (FIN), P (PUSH), R (RST), W (ECN CWR) or E (ECN-Echo), or a single
+`.' (no flags).
+\fIData-seqno\fP describes the portion of sequence space covered
+by the data in this packet (see example below).
+\fIAck\fP is sequence number of the next data expected the other
+direction on this connection.
+\fIWindow\fP is the number of bytes of receive buffer space available
+the other direction on this connection.
+\fIUrg\fP indicates there is `urgent' data in the packet.
+\fIOptions\fP are tcp options enclosed in angle brackets (e.g., ).
+.LP
+\fISrc, dst\fP and \fIflags\fP are always present.
+The other fields
+depend on the contents of the packet's tcp protocol header and
+are output only if appropriate.
+.LP
+Here is the opening portion of an rlogin from host \fIrtsg\fP to
+host \fIcsam\fP.
+.RS
+.nf
+.sp .5
+\s-2\f(CWrtsg.1023 > csam.login: S 768512:768512(0) win 4096 
+csam.login > rtsg.1023: S 947648:947648(0) ack 768513 win 4096 
+rtsg.1023 > csam.login: . ack 1 win 4096
+rtsg.1023 > csam.login: P 1:2(1) ack 1 win 4096
+csam.login > rtsg.1023: . ack 2 win 4096
+rtsg.1023 > csam.login: P 2:21(19) ack 1 win 4096
+csam.login > rtsg.1023: P 1:2(1) ack 21 win 4077
+csam.login > rtsg.1023: P 2:3(1) ack 21 win 4077 urg 1
+csam.login > rtsg.1023: P 3:4(1) ack 21 win 4077 urg 1\fR\s+2
+.sp .5
+.fi
+.RE
+The first line says that tcp port 1023 on rtsg sent a packet
+to port \fIlogin\fP
+on csam.
+The \fBS\fP indicates that the \fISYN\fP flag was set.
+The packet sequence number was 768512 and it contained no data.
+(The notation is `first:last(nbytes)' which means `sequence
+numbers \fIfirst\fP
+up to but not including \fIlast\fP which is \fInbytes\fP bytes of user data'.)
+There was no piggy-backed ack, the available receive window was 4096
+bytes and there was a max-segment-size option requesting an mss of
+1024 bytes.
+.LP
+Csam replies with a similar packet except it includes a piggy-backed
+ack for rtsg's SYN.
+Rtsg then acks csam's SYN.
+The `.' means no
+flags were set.
+The packet contained no data so there is no data sequence number.
+Note that the ack sequence
+number is a small integer (1).
+The first time \fItcpdump\fP sees a
+tcp `conversation', it prints the sequence number from the packet.
+On subsequent packets of the conversation, the difference between
+the current packet's sequence number and this initial sequence number
+is printed.
+This means that sequence numbers after the
+first can be interpreted
+as relative byte positions in the conversation's data stream (with the
+first data byte each direction being `1').
+`-S' will override this
+feature, causing the original sequence numbers to be output.
+.LP
+On the 6th line, rtsg sends csam 19 bytes of data (bytes 2 through 20
+in the rtsg \(-> csam side of the conversation).
+The PUSH flag is set in the packet.
+On the 7th line, csam says it's received data sent by rtsg up to
+but not including byte 21.
+Most of this data is apparently sitting in the
+socket buffer since csam's receive window has gotten 19 bytes smaller.
+Csam also sends one byte of data to rtsg in this packet.
+On the 8th and 9th lines,
+csam sends two bytes of urgent, pushed data to rtsg.
+.LP
+If the snapshot was small enough that \fItcpdump\fP didn't capture
+the full TCP header, it interprets as much of the header as it can
+and then reports ``[|\fItcp\fP]'' to indicate the remainder could not
+be interpreted.
+If the header contains a bogus option (one with a length
+that's either too small or beyond the end of the header), \fItcpdump\fP
+reports it as ``[\fIbad opt\fP]'' and does not interpret any further
+options (since it's impossible to tell where they start).
+If the header
+length indicates options are present but the IP datagram length is not
+long enough for the options to actually be there, \fItcpdump\fP reports
+it as ``[\fIbad hdr length\fP]''.
+.HD
+.B Capturing TCP packets with particular flag combinations (SYN-ACK, URG-ACK, etc.)
+.PP
+There are 8 bits in the control bits section of the TCP header:
+.IP
+.I CWR | ECE | URG | ACK | PSH | RST | SYN | FIN
+.PP
+Let's assume that we want to watch packets used in establishing
+a TCP connection.
+Recall that TCP uses a 3-way handshake protocol
+when it initializes a new connection; the connection sequence with
+regard to the TCP control bits is
+.PP
+.RS
+1) Caller sends SYN

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:10: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 C52ED1065670;
	Thu, 28 Oct 2010 19:10:15 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 98BCA8FC1E;
	Thu, 28 Oct 2010 19:10: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 o9SJAFdE025941;
	Thu, 28 Oct 2010 19:10:15 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJAFF6025940;
	Thu, 28 Oct 2010 19:10:15 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010281910.o9SJAFF6025940@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 28 Oct 2010 19:10:15 +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: r214482 - in head/contrib/tcpdump: . 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, 28 Oct 2010 19:10:15 -0000

Author: rpaulo
Date: Thu Oct 28 19:10:15 2010
New Revision: 214482
URL: http://svn.freebsd.org/changeset/base/214482

Log:
  Remove useless stuff.

Deleted:
  head/contrib/tcpdump/FREEBSD-Xlist
  head/contrib/tcpdump/FREEBSD-upgrade
  head/contrib/tcpdump/Readme.Win32
  head/contrib/tcpdump/win32/

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:10: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 C143C1065675;
	Thu, 28 Oct 2010 19:10:31 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ADA528FC2E;
	Thu, 28 Oct 2010 19:10: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 o9SJAV6s025993;
	Thu, 28 Oct 2010 19:10:31 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJAVLD025988;
	Thu, 28 Oct 2010 19:10:31 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281910.o9SJAVLD025988@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:10: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: r214483 - 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: Thu, 28 Oct 2010 19:10:31 -0000

Author: tuexen
Date: Thu Oct 28 19:10:31 2010
New Revision: 214483
URL: http://svn.freebsd.org/changeset/base/214483

Log:
  MFC r212799:
  * Implement initial version of send buffer splitting.
  * Make send/recv buffer splitting switchable via sysctl.
  * While there: Fix some comments.

Modified:
  stable/8/sys/netinet/sctp_constants.h
  stable/8/sys/netinet/sctp_output.c
  stable/8/sys/netinet/sctp_sysctl.c
  stable/8/sys/netinet/sctp_sysctl.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)

Modified: stable/8/sys/netinet/sctp_constants.h
==============================================================================
--- stable/8/sys/netinet/sctp_constants.h	Thu Oct 28 19:10:15 2010	(r214482)
+++ stable/8/sys/netinet/sctp_constants.h	Thu Oct 28 19:10:31 2010	(r214483)
@@ -948,6 +948,9 @@ __FBSDID("$FreeBSD$");
  */
 #define SCTP_TIME_WAIT 60
 
+#define SCTP_SEND_BUFFER_SPLITTING 0x00000001
+#define SCTP_RECV_BUFFER_SPLITTING 0x00000002
+
 /* The system retains a cache of free chunks such to
  * cut down on calls the memory allocation system. There
  * is a per association limit of free items and a overall

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 19:10:15 2010	(r214482)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 19:10:31 2010	(r214483)
@@ -7407,7 +7407,7 @@ sctp_med_chunk_output(struct sctp_inpcb 
 	/* temp arrays for unlinking */
 	struct sctp_tmit_chunk *data_list[SCTP_MAX_DATA_BUNDLING];
 	int no_fragmentflg, error;
-	unsigned int max_rwnd_per_dest;
+	unsigned int max_rwnd_per_dest, max_send_per_dest;
 	int one_chunk, hbflag, skip_data_for_this_net;
 	int asconf, cookie, no_out_cnt;
 	int bundle_at, ctl_cnt, no_data_chunks, eeor_mode;
@@ -7469,6 +7469,10 @@ sctp_med_chunk_output(struct sctp_inpcb 
 		}
 	}
 	max_rwnd_per_dest = ((asoc->peers_rwnd + asoc->total_flight) / asoc->numnets);
+	if (stcb->sctp_socket)
+		max_send_per_dest = SCTP_SB_LIMIT_SND(stcb->sctp_socket) / asoc->numnets;
+	else
+		max_send_per_dest = 0;
 	if ((no_data_chunks == 0) && (!TAILQ_EMPTY(&asoc->out_wheel))) {
 		TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
 			/*
@@ -8039,9 +8043,22 @@ again_one_more_time:
 			goto no_data_fill;
 		}
 		if ((asoc->sctp_cmt_on_off == 1) &&
+		    (SCTP_BASE_SYSCTL(sctp_buffer_splitting) & SCTP_RECV_BUFFER_SPLITTING) &&
 		    (net->flight_size > max_rwnd_per_dest)) {
 			goto no_data_fill;
 		}
+		/*
+		 * We need a specific accounting for the usage of the send
+		 * buffer. We also need to check the number of messages per
+		 * net. For now, this is better than nothing and it disabled
+		 * by default...
+		 */
+		if ((asoc->sctp_cmt_on_off == 1) &&
+		    (SCTP_BASE_SYSCTL(sctp_buffer_splitting) & SCTP_SEND_BUFFER_SPLITTING) &&
+		    (max_send_per_dest > 0) &&
+		    (net->flight_size > max_send_per_dest)) {
+			goto no_data_fill;
+		}
 		/*********************/
 		/* Data transmission */
 		/*********************/

Modified: stable/8/sys/netinet/sctp_sysctl.c
==============================================================================
--- stable/8/sys/netinet/sctp_sysctl.c	Thu Oct 28 19:10:15 2010	(r214482)
+++ stable/8/sys/netinet/sctp_sysctl.c	Thu Oct 28 19:10:31 2010	(r214483)
@@ -109,6 +109,7 @@ sctp_init_sysctls()
 	SCTP_BASE_SYSCTL(sctp_mobility_base) = SCTPCTL_MOBILITY_BASE_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff) = SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT;
+	SCTP_BASE_SYSCTL(sctp_buffer_splitting) = SCTPCTL_BUFFER_SPLITTING_DEFAULT;
 #if defined(SCTP_LOCAL_TRACE_BUF)
 	memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log));
 #endif
@@ -620,7 +621,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS)
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_default_cc_module), SCTPCTL_DEFAULT_CC_MODULE_MIN, SCTPCTL_DEFAULT_CC_MODULE_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX);
-
+		RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX);
@@ -1067,6 +1068,10 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vt
     &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU",
     SCTPCTL_TIME_WAIT_DESC);
 
+SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_INT | CTLFLAG_RW,
+    &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU",
+    SCTPCTL_BUFFER_SPLITTING_DESC);
+
 #ifdef SCTP_DEBUG
 SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_INT | CTLFLAG_RW,
     &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU",

Modified: stable/8/sys/netinet/sctp_sysctl.h
==============================================================================
--- stable/8/sys/netinet/sctp_sysctl.h	Thu Oct 28 19:10:15 2010	(r214482)
+++ stable/8/sys/netinet/sctp_sysctl.h	Thu Oct 28 19:10:31 2010	(r214483)
@@ -107,6 +107,7 @@ struct sctp_sysctl {
 	uint32_t sctp_udp_tunneling_port;
 	uint32_t sctp_enable_sack_immediately;
 	uint32_t sctp_vtag_time_wait;
+	uint32_t sctp_buffer_splitting;
 #if defined(SCTP_DEBUG)
 	uint32_t sctp_debug_on;
 #endif
@@ -478,19 +479,23 @@ struct sctp_sysctl {
 #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX	1
 #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT	SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN
 
-/* Enable sending of the SACK-IMMEDIATELY bit */
+/* Enable sending of the NAT-FRIENDLY message */
 #define SCTPCTL_NAT_FRIENDLY_INITS_DESC	"Enable sending of the nat-friendly SCTP option on INITs."
 #define SCTPCTL_NAT_FRIENDLY_INITS_MIN	0
 #define SCTPCTL_NAT_FRIENDLY_INITS_MAX	1
 #define SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT	SCTPCTL_NAT_FRIENDLY_INITS_MIN
 
-
-/* Vtag tiem wait bits */
-#define SCTPCTL_TIME_WAIT_DESC	"Vtag time wait time 0 disables."
+/* Vtag time wait in seconds */
+#define SCTPCTL_TIME_WAIT_DESC	"Vtag time wait time in seconds, 0 disables it."
 #define SCTPCTL_TIME_WAIT_MIN	0
 #define SCTPCTL_TIME_WAIT_MAX	0xffffffff
 #define SCTPCTL_TIME_WAIT_DEFAULT	SCTP_TIME_WAIT
 
+/* Enable Send/Receive buffer splitting */
+#define SCTPCTL_BUFFER_SPLITTING_DESC		"Enable send/receive buffer splitting."
+#define SCTPCTL_BUFFER_SPLITTING_MIN		0
+#define SCTPCTL_BUFFER_SPLITTING_MAX		0x3
+#define SCTPCTL_BUFFER_SPLITTING_DEFAULT	SCTPCTL_BUFFER_SPLITTING_MIN
 
 #if defined(SCTP_DEBUG)
 /* debug: Configure debug output */

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:12: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 B3B411065674;
	Thu, 28 Oct 2010 19:12:05 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A06498FC15;
	Thu, 28 Oct 2010 19:12: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 o9SJC5Id026129;
	Thu, 28 Oct 2010 19:12:05 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJC5LF026125;
	Thu, 28 Oct 2010 19:12:05 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281912.o9SJC5LF026125@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:12: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: r214484 - 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: Thu, 28 Oct 2010 19:12:05 -0000

Author: tuexen
Date: Thu Oct 28 19:12:05 2010
New Revision: 214484
URL: http://svn.freebsd.org/changeset/base/214484

Log:
  MFC r212800:
  Make the initial congestion window configurable via sysctl.

Modified:
  stable/8/sys/netinet/sctp_cc_functions.c
  stable/8/sys/netinet/sctp_sysctl.c
  stable/8/sys/netinet/sctp_sysctl.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)

Modified: stable/8/sys/netinet/sctp_cc_functions.c
==============================================================================
--- stable/8/sys/netinet/sctp_cc_functions.c	Thu Oct 28 19:10:31 2010	(r214483)
+++ stable/8/sys/netinet/sctp_cc_functions.c	Thu Oct 28 19:12:05 2010	(r214484)
@@ -44,18 +44,27 @@
 #include 
 #include 
 __FBSDID("$FreeBSD$");
+
 void
 sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net)
 {
+	struct sctp_association *assoc;
+	uint32_t cwnd_in_mtu;
+
+	assoc = &stcb->asoc;
 	/*
-	 * We take the max of the burst limit times a MTU or the
-	 * INITIAL_CWND. We then limit this to 4 MTU's of sending. cwnd must
-	 * be at least 2 MTU.
+	 * We take the minimum of the burst limit and the initial congestion
+	 * window. The initial congestion window is at least two times the
+	 * MTU.
 	 */
-	net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND));
-	net->ssthresh = stcb->asoc.peers_rwnd;
+	cwnd_in_mtu = SCTP_BASE_SYSCTL(sctp_initial_cwnd);
+	if ((assoc->max_burst > 0) && (cwnd_in_mtu > assoc->max_burst))
+		cwnd_in_mtu = assoc->max_burst;
+	net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu;
+	net->ssthresh = assoc->peers_rwnd;
 
-	if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) {
+	if (SCTP_BASE_SYSCTL(sctp_logging_level) &
+	    (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) {
 		sctp_log_cwnd(stcb, net, 0, SCTP_CWND_INITIALIZATION);
 	}
 }

Modified: stable/8/sys/netinet/sctp_sysctl.c
==============================================================================
--- stable/8/sys/netinet/sctp_sysctl.c	Thu Oct 28 19:10:31 2010	(r214483)
+++ stable/8/sys/netinet/sctp_sysctl.c	Thu Oct 28 19:12:05 2010	(r214484)
@@ -110,6 +110,7 @@ sctp_init_sysctls()
 	SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff) = SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_buffer_splitting) = SCTPCTL_BUFFER_SPLITTING_DEFAULT;
+	SCTP_BASE_SYSCTL(sctp_initial_cwnd) = SCTPCTL_INITIAL_CWND_DEFAULT;
 #if defined(SCTP_LOCAL_TRACE_BUF)
 	memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log));
 #endif
@@ -622,6 +623,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS)
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX);
+		RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX);
 		RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX);
@@ -1072,6 +1074,10 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, bu
     &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU",
     SCTPCTL_BUFFER_SPLITTING_DESC);
 
+SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_INT | CTLFLAG_RW,
+    &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU",
+    SCTPCTL_INITIAL_CWND_DESC);
+
 #ifdef SCTP_DEBUG
 SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_INT | CTLFLAG_RW,
     &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU",

Modified: stable/8/sys/netinet/sctp_sysctl.h
==============================================================================
--- stable/8/sys/netinet/sctp_sysctl.h	Thu Oct 28 19:10:31 2010	(r214483)
+++ stable/8/sys/netinet/sctp_sysctl.h	Thu Oct 28 19:12:05 2010	(r214484)
@@ -108,6 +108,7 @@ struct sctp_sysctl {
 	uint32_t sctp_enable_sack_immediately;
 	uint32_t sctp_vtag_time_wait;
 	uint32_t sctp_buffer_splitting;
+	uint32_t sctp_initial_cwnd;
 #if defined(SCTP_DEBUG)
 	uint32_t sctp_debug_on;
 #endif
@@ -497,6 +498,12 @@ struct sctp_sysctl {
 #define SCTPCTL_BUFFER_SPLITTING_MAX		0x3
 #define SCTPCTL_BUFFER_SPLITTING_DEFAULT	SCTPCTL_BUFFER_SPLITTING_MIN
 
+/* Initial congestion window in MTU */
+#define SCTPCTL_INITIAL_CWND_DESC	"Initial congestion window in MTU"
+#define SCTPCTL_INITIAL_CWND_MIN	2
+#define SCTPCTL_INITIAL_CWND_MAX	0xffffffff
+#define SCTPCTL_INITIAL_CWND_DEFAULT	3
+
 #if defined(SCTP_DEBUG)
 /* debug: Configure debug output */
 #define SCTPCTL_DEBUG_DESC	"Configure debug output"

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:13: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 35DF51065670;
	Thu, 28 Oct 2010 19:13:47 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 08C258FC12;
	Thu, 28 Oct 2010 19:13: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 o9SJDk9A026255;
	Thu, 28 Oct 2010 19:13:46 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJDkHc026251;
	Thu, 28 Oct 2010 19:13:46 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281913.o9SJDkHc026251@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:13: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: r214485 - 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: Thu, 28 Oct 2010 19:13:47 -0000

Author: tuexen
Date: Thu Oct 28 19:13:46 2010
New Revision: 214485
URL: http://svn.freebsd.org/changeset/base/214485

Log:
  MFC r212801:
  Fix a bug where the wrong PR-SCTP policy was considered.
  While there, use always the same code for the check of
  TTL expiration.

Modified:
  stable/8/sys/netinet/sctp_indata.c
  stable/8/sys/netinet/sctp_output.c
  stable/8/sys/netinet/sctp_timer.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)

Modified: stable/8/sys/netinet/sctp_indata.c
==============================================================================
--- stable/8/sys/netinet/sctp_indata.c	Thu Oct 28 19:12:05 2010	(r214484)
+++ stable/8/sys/netinet/sctp_indata.c	Thu Oct 28 19:13:46 2010	(r214485)
@@ -3300,13 +3300,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 		if (stcb->asoc.peer_supports_prsctp) {
 			if ((PR_SCTP_TTL_ENABLED(tp1->flags)) && tp1->sent < SCTP_DATAGRAM_ACKED) {
 				/* Is it expired? */
-				if (
-				/*
-				 * TODO sctp_constants.h needs alternative
-				 * time macros when _KERNEL is undefined.
-				 */
-				    (timevalcmp(&now, &tp1->rec.data.timetodrop, >))
-				    ) {
+				if (timevalcmp(&now, &tp1->rec.data.timetodrop, >)) {
 					/* Yes so drop it */
 					if (tp1->data != NULL) {
 						(void)sctp_release_pr_sctp_chunk(stcb, tp1,

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Thu Oct 28 19:12:05 2010	(r214484)
+++ stable/8/sys/netinet/sctp_output.c	Thu Oct 28 19:13:46 2010	(r214485)
@@ -5728,7 +5728,7 @@ sctp_prune_prsctp(struct sctp_tcb *stcb,
 		while (chk) {
 			nchk = TAILQ_NEXT(chk, sctp_next);
 			/* Here we must move to the sent queue and mark */
-			if (PR_SCTP_TTL_ENABLED(chk->flags)) {
+			if (PR_SCTP_BUF_ENABLED(chk->flags)) {
 				if (chk->rec.data.timetodrop.tv_sec >= (long)srcv->sinfo_timetolive) {
 					if (chk->data) {
 						/*

Modified: stable/8/sys/netinet/sctp_timer.c
==============================================================================
--- stable/8/sys/netinet/sctp_timer.c	Thu Oct 28 19:12:05 2010	(r214484)
+++ stable/8/sys/netinet/sctp_timer.c	Thu Oct 28 19:13:46 2010	(r214485)
@@ -772,9 +772,7 @@ start_again:
 			}
 			if (stcb->asoc.peer_supports_prsctp && PR_SCTP_TTL_ENABLED(chk->flags)) {
 				/* Is it expired? */
-				if ((now.tv_sec > chk->rec.data.timetodrop.tv_sec) ||
-				    ((chk->rec.data.timetodrop.tv_sec == now.tv_sec) &&
-				    (now.tv_usec > chk->rec.data.timetodrop.tv_usec))) {
+				if (timevalcmp(&now, &chk->rec.data.timetodrop, >)) {
 					/* Yes so drop it */
 					if (chk->data) {
 						(void)sctp_release_pr_sctp_chunk(stcb,

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:15: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 AFB4F1065673;
	Thu, 28 Oct 2010 19:15:30 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8257D8FC0C;
	Thu, 28 Oct 2010 19:15: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 o9SJFU7B026395;
	Thu, 28 Oct 2010 19:15:30 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJFUV2026392;
	Thu, 28 Oct 2010 19:15:30 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281915.o9SJFUV2026392@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:15:30 +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: r214486 - 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: Thu, 28 Oct 2010 19:15:30 -0000

Author: tuexen
Date: Thu Oct 28 19:15:30 2010
New Revision: 214486
URL: http://svn.freebsd.org/changeset/base/214486

Log:
  MFC r212850:
  Fix a locking issue which shows up when the code is used
  on Mac OS X.

Modified:
  stable/8/sys/netinet/sctp_auth.c
  stable/8/sys/netinet/sctp_pcb.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)

Modified: stable/8/sys/netinet/sctp_auth.c
==============================================================================
--- stable/8/sys/netinet/sctp_auth.c	Thu Oct 28 19:13:46 2010	(r214485)
+++ stable/8/sys/netinet/sctp_auth.c	Thu Oct 28 19:15:30 2010	(r214486)
@@ -614,7 +614,7 @@ sctp_auth_key_release(struct sctp_tcb *s
 		if ((skey->refcount <= 1) && (skey->deactivated)) {
 			/* notify ULP that key is no longer used */
 			sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb,
-			    key_id, 0, SCTP_SO_NOT_LOCKED);
+			    key_id, 0, SCTP_SO_LOCKED);
 			SCTPDBG(SCTP_DEBUG_AUTH2,
 			    "%s: stcb %p key %u no longer used, %d\n",
 			    __FUNCTION__, stcb, key_id, skey->refcount);

Modified: stable/8/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 19:13:46 2010	(r214485)
+++ stable/8/sys/netinet/sctp_pcb.c	Thu Oct 28 19:15:30 2010	(r214486)
@@ -4822,7 +4822,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, 
 					/* Still an open socket - report */
 					sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb,
 					    SCTP_NOTIFY_DATAGRAM_UNSENT,
-					    (void *)sp, 0);
+					    (void *)sp, SCTP_SO_LOCKED);
 				}
 				if (sp->data) {
 					sctp_m_freem(sp->data);
@@ -4894,7 +4894,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, 
 				if (so) {
 					/* Still a socket? */
 					sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb,
-					    SCTP_NOTIFY_DATAGRAM_UNSENT, chk, 0);
+					    SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_LOCKED);
 				}
 				if (chk->data) {
 					sctp_m_freem(chk->data);
@@ -4929,7 +4929,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, 
 				if (so) {
 					/* Still a socket? */
 					sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb,
-					    SCTP_NOTIFY_DATAGRAM_SENT, chk, 0);
+					    SCTP_NOTIFY_DATAGRAM_SENT, chk, SCTP_SO_LOCKED);
 				}
 				if (chk->data) {
 					sctp_m_freem(chk->data);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:17: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 A260D106566B;
	Thu, 28 Oct 2010 19:17:18 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FAB18FC22;
	Thu, 28 Oct 2010 19:17: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 o9SJHILQ026525;
	Thu, 28 Oct 2010 19:17:18 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJHIGg026523;
	Thu, 28 Oct 2010 19:17:18 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281917.o9SJHIGg026523@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:17: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: r214487 - 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: Thu, 28 Oct 2010 19:17:18 -0000

Author: tuexen
Date: Thu Oct 28 19:17:18 2010
New Revision: 214487
URL: http://svn.freebsd.org/changeset/base/214487

Log:
  MFC r212851:
  Allow the initial congestion window to be configure
  to one MTU. Improve the description.

Modified:
  stable/8/sys/netinet/sctp_sysctl.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)

Modified: stable/8/sys/netinet/sctp_sysctl.h
==============================================================================
--- stable/8/sys/netinet/sctp_sysctl.h	Thu Oct 28 19:15:30 2010	(r214486)
+++ stable/8/sys/netinet/sctp_sysctl.h	Thu Oct 28 19:17:18 2010	(r214487)
@@ -499,8 +499,8 @@ struct sctp_sysctl {
 #define SCTPCTL_BUFFER_SPLITTING_DEFAULT	SCTPCTL_BUFFER_SPLITTING_MIN
 
 /* Initial congestion window in MTU */
-#define SCTPCTL_INITIAL_CWND_DESC	"Initial congestion window in MTU"
-#define SCTPCTL_INITIAL_CWND_MIN	2
+#define SCTPCTL_INITIAL_CWND_DESC	"Initial congestion window in MTUs"
+#define SCTPCTL_INITIAL_CWND_MIN	1
 #define SCTPCTL_INITIAL_CWND_MAX	0xffffffff
 #define SCTPCTL_INITIAL_CWND_DEFAULT	3
 

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:18: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 28C2C106564A;
	Thu, 28 Oct 2010 19:18:55 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 15EE28FC15;
	Thu, 28 Oct 2010 19:18: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 o9SJIsfc026651;
	Thu, 28 Oct 2010 19:18:54 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SJIs5D026649;
	Thu, 28 Oct 2010 19:18:54 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201010281918.o9SJIs5D026649@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 28 Oct 2010 19:18: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: r214488 - 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: Thu, 28 Oct 2010 19:18:55 -0000

Author: tuexen
Date: Thu Oct 28 19:18:54 2010
New Revision: 214488
URL: http://svn.freebsd.org/changeset/base/214488

Log:
  MFC r212897:
  Fix a locking issue which resulted in aborted associations
  due to a corrupted nr-mapping array.

Modified:
  stable/8/sys/netinet/sctp_indata.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)

Modified: stable/8/sys/netinet/sctp_indata.c
==============================================================================
--- stable/8/sys/netinet/sctp_indata.c	Thu Oct 28 19:17:18 2010	(r214487)
+++ stable/8/sys/netinet/sctp_indata.c	Thu Oct 28 19:18:54 2010	(r214488)
@@ -1776,6 +1776,10 @@ sctp_process_a_data_chunk(struct sctp_tc
 		if (control == NULL) {
 			goto failed_express_del;
 		}
+		SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
+		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
+			asoc->highest_tsn_inside_nr_map = tsn;
+		}
 		sctp_add_to_readq(stcb->sctp_ep, stcb,
 		    control, &stcb->sctp_socket->so_rcv,
 		    1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
@@ -1791,10 +1795,6 @@ sctp_process_a_data_chunk(struct sctp_tc
 		}
 		control = NULL;
 
-		SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
-		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
-			asoc->highest_tsn_inside_nr_map = tsn;
-		}
 		goto finish_express_del;
 	}
 failed_express_del:

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 19:27: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 3E50C1065670;
	Thu, 28 Oct 2010 19:27:03 +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 E5E3E8FC08;
	Thu, 28 Oct 2010 19:27:02 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 6E20946B09;
	Thu, 28 Oct 2010 15:26:59 -0400 (EDT)
Date: Thu, 28 Oct 2010 20:26:59 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Alexander Best 
In-Reply-To: <20101028182219.GA36559@freebsd.org>
Message-ID: 
References: <201010271848.o9RImNSR019344@svn.freebsd.org>
	<20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
	
	<20101028182219.GA36559@freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: Doug Barton , d@delphij.net, svn-src-all@FreeBSD.org,
	Gary Jennejohn ,
	src-committers@FreeBSD.org, Bruce Evans ,
	svn-src-head@FreeBSD.org, Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 19:27:03 -0000


On Thu, 28 Oct 2010, Alexander Best wrote:

>> For example, you could imagine a pathconf() call that asks the file system 
>> if overwriting a file is likely to result in the data going away -- UFS 
>> could answer "yes" unless it's snapshotting the file system, and ZFS could 
>> simply answer "no".
>>
>> In FreeBSD 9, we're going to have two common file system configurations: 
>> ZFS and UFS+SUJ; the latter will do overwriting of files just fine on most 
>> current media.
>
> i agree. however from this discussion it's become quite obvious that 
> securely deleting any data on a certain media is a very complex topic. when 
> the -P option got implemented into rm, securely deleting files was quite an 
> easy and intuitive task. this has clearly changed. so the question arises, 
> if securely removing data (maybe also directory entries) shouldn't be 
> handled by a specially designed utility?
>
> the pathconf() idea looks very primising. should the return values ("yes" or 
> "no") simply be hardcoded for every fs? or should they be returned by a 
> routine which actually veryfies on the fly if overwriting files is possible?

Deleting data wasn't simple when rm -P was implemented -- in fact, if I 
recall, there was significant information available even then that overwrite 
patterns didn't fully remove file system data from magnetic media in such a 
way that a qualified attacker couldn't recover it.  Bad block relocation in 
software and hardware is also relevant, and wear-levelling has been used in 
certain storage devices for quite a while now as well.

Today the story has gotten even more complicated: file system snapshot 
features, copy-on-write file systems, block device-level snapshot features, 
widespread use of wear-levelling, full data journalling, etc.

But that doesn't mean that rm -P still isn't useful :-).

I see the point of the new pathconf() being to indicate whether trying to 
overwrite file data is fundamentally useless.  That information could be used 
in one of two ways: (1) to warn the user that the requested overwrite is 
unlikely to have helped and (2) to cause the removal to fail if it couldn't 
possibly have worked.  I find (1) more appealing but can see arguments for 
(2); possibly both should be supported in some or another form.

Since there's a whole spectrum of confidence possible in whether an overwrite 
succeeded, any mechanism like the one I've suggested is necessarily going to 
involve fairly arbitrary heuristics.  In a first generation implementation, I 
suggest that rm -P should generate a warning only in the following case:

- An attempt to overwrite a file on a file system actively performing
   copy-on-write that would affect the file, such as ZFS, or UFS when there's
   an active snapshot.

After some further cogitation, and if people remain interested, the following 
further case seems reasonable as well:

- An attempt to overwrite a file on a file system is mounted from a geom stack
   in which at least one component in the stack is performing copy-on-write
   that would affect the file.

The warning should read something along the lines of:

   rm: /foo/bar: file system may not support data overwrite (-P

Or similar.  However, rm should still perform the overwrite.

To be honest, I'm also fine with there just being a nice caveat in the rm(1) 
man page. :-)

Robert

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 20:18: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 5C7CC106564A;
	Thu, 28 Oct 2010 20:18:26 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 48FCE8FC22;
	Thu, 28 Oct 2010 20:18: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 o9SKIQ88029484;
	Thu, 28 Oct 2010 20:18:26 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SKIQHU029482;
	Thu, 28 Oct 2010 20:18:26 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201010282018.o9SKIQHU029482@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Thu, 28 Oct 2010 20:18: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: r214489 - head/usr.sbin/bsnmpd/modules/snmp_hostres
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 20:18:26 -0000

Author: uqs
Date: Thu Oct 28 20:18:26 2010
New Revision: 214489
URL: http://svn.freebsd.org/changeset/base/214489

Log:
  Fix CPU load reporting independent of scheduler used.
  
  - Sample CPU usage data from kern.cp_times, this makes for a far more
    accurate and scheduler independent algorithm.
  - Rip out the process list scraping that is no longer required.
  - Don't update CPU usage sampling on every request, but every 15s
    instead. This makes it impossible for an attacker to hide the CPU load
    by triggering 4 samplings in short succession when the system is idle.
  - After reaching the steady-state, the system will always report the
    average CPU load of the last 60 sampled seconds.
  - Untangling of call graph.
  
  PR:		kern/130222
  Tested by:	Julian Dunn 
  		Gustau Pérez 
  		Jürgen Weiß 
  MFC after:	2 weeks
  
  I'm unsure if some MIB standard states this must be the load average
  for, eg. 300s, it looks like net-snmp isn't even bothering to implement
  the CPU load reporting at all.

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c	Thu Oct 28 19:18:54 2010	(r214488)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c	Thu Oct 28 20:18:26 2010	(r214489)
@@ -56,19 +56,15 @@
 struct processor_entry {
 	int32_t		index;
 	const struct asn_oid *frwId;
-	int32_t		load;
+	int32_t		load;		/* average cpu usage */
+	int32_t		sample_cnt;	/* number of usage samples */
+	int32_t		cur_sample_idx;	/* current valid sample */
 	TAILQ_ENTRY(processor_entry) link;
 	u_char		cpu_no;		/* which cpu, counted from 0 */
-	pid_t		idle_pid;	/* PID of idle process for this CPU */
 
 	/* the samples from the last minute, as required by MIB */
 	double		samples[MAX_CPU_SAMPLES];
-
-	/* current sample to fill in next time, must be < MAX_CPU_SAMPLES */
-	uint32_t	cur_sample_idx;
-
-	/* number of useful samples */
-	uint32_t	sample_cnt;
+	long		states[MAX_CPU_SAMPLES][CPUSTATES];
 };
 TAILQ_HEAD(processor_tbl, processor_entry);
 
@@ -82,65 +78,78 @@ static int32_t detected_processor_count;
 /* sysctlbyname(hw.ncpu) */
 static int hw_ncpu;
 
-/* sysctlbyname(kern.{ccpu,fscale}) */
-static fixpt_t ccpu;
-static int fscale;
-
-/* tick of PDU where we have refreshed the processor table last */
-static uint64_t proctbl_tick;
+/* sysctlbyname(kern.cp_times) */
+static int cpmib[2];
+static size_t cplen;
 
 /* periodic timer used to get cpu load stats */
 static void *cpus_load_timer;
 
-/*
- * Average the samples. The entire algorithm seems to be wrong XXX.
+/**
+ * Returns the CPU usage of a given processor entry.
+ *
+ * It needs at least two cp_times "tick" samples to calculate a delta and
+ * thus, the usage over the sampling period.
  */
 static int
 get_avg_load(struct processor_entry *e)
 {
-	u_int i;
-	double sum = 0.0;
+	u_int i, oldest;
+	long delta = 0;
+	double usage = 0.0;
 
 	assert(e != NULL);
 
-	if (e->sample_cnt == 0)
+	/* Need two samples to perform delta calculation. */
+	if (e->sample_cnt <= 1)
 		return (0);
 
-	for (i = 0; i < e->sample_cnt; i++)
-		sum += e->samples[i];
-
-	return ((int)floor((double)sum/(double)e->sample_cnt));
-}
-
-/*
- * Stolen from /usr/src/bin/ps/print.c. The idle process should never
- * be swapped out :-)
- */
-static double
-processor_getpcpu(struct kinfo_proc *ki_p)
-{
-
-	if (ccpu == 0 || fscale == 0)
-		return (0.0);
-
-#define	fxtofl(fixpt) ((double)(fixpt) / fscale)
-	return (100.0 * fxtofl(ki_p->ki_pctcpu) /
-	    (1.0 - exp(ki_p->ki_swtime * log(fxtofl(ccpu)))));
+	/* Oldest usable index, we wrap around. */
+	if (e->sample_cnt == MAX_CPU_SAMPLES)
+		oldest = (e->cur_sample_idx + 1) % MAX_CPU_SAMPLES;
+	else
+		oldest = 0;
+
+	/* Sum delta for all states. */
+	for (i = 0; i < CPUSTATES; i++) {
+		delta += e->states[e->cur_sample_idx][i];
+		delta -= e->states[oldest][i];
+	}
+	if (delta == 0)
+		return 0;
+
+	/* Take idle time from the last element and convert to
+	 * percent usage by contrasting with total ticks delta. */
+	usage = (double)(e->states[e->cur_sample_idx][CPUSTATES-1] -
+	    e->states[oldest][CPUSTATES-1]) / delta;
+	usage = 100 - (usage * 100);
+	HRDBG("CPU no. %d, delta ticks %ld, pct usage %.2f", e->cpu_no,
+	    delta, usage);
+
+	return ((int)(usage));
 }
 
 /**
- * Save a new sample
+ * Save a new sample to proc entry and get the average usage.
+ *
+ * Samples are stored in a ringbuffer from 0..(MAX_CPU_SAMPLES-1)
  */
 static void
-save_sample(struct processor_entry *e, struct kinfo_proc *kp)
+save_sample(struct processor_entry *e, long *cp_times)
 {
+	int i;
 
-	e->samples[e->cur_sample_idx] = 100.0 - processor_getpcpu(kp);
-	e->load = get_avg_load(e);
 	e->cur_sample_idx = (e->cur_sample_idx + 1) % MAX_CPU_SAMPLES;
+	for (i = 0; cp_times != NULL && i < CPUSTATES; i++)
+		e->states[e->cur_sample_idx][i] = cp_times[i];
 
-	if (++e->sample_cnt > MAX_CPU_SAMPLES)
+	e->sample_cnt++;
+	if (e->sample_cnt > MAX_CPU_SAMPLES)
 		e->sample_cnt = MAX_CPU_SAMPLES;
+
+	HRDBG("sample count for CPU no. %d went to %d", e->cpu_no, e->sample_cnt);
+	e->load = get_avg_load(e);
+
 }
 
 /**
@@ -178,8 +187,9 @@ proc_create_entry(u_int cpu_no, struct d
 
 	entry->index = map->hrIndex;
 	entry->load = 0;
+	entry->sample_cnt = 0;
+	entry->cur_sample_idx = -1;
 	entry->cpu_no = (u_char)cpu_no;
-	entry->idle_pid = 0;
 	entry->frwId = &oid_zeroDotZero; /* unknown id FIXME */
 
 	INSERT_OBJECT_INT(entry, &processor_tbl);
@@ -191,64 +201,11 @@ proc_create_entry(u_int cpu_no, struct d
 }
 
 /**
- * Get the PIDs for the idle processes of the CPUs.
- */
-static void
-processor_get_pids(void)
-{
-	struct kinfo_proc *plist, *kp;
-	int i;
-	int nproc;
-	int cpu;
-	int nchars;
-	struct processor_entry *entry;
-
-	plist = kvm_getprocs(hr_kd, KERN_PROC_ALL, 0, &nproc);
-	if (plist == NULL || nproc < 0) {
-		syslog(LOG_ERR, "hrProcessor: kvm_getprocs() failed: %m");
-		return;
-	}
-
-	for (i = 0, kp = plist; i < nproc; i++, kp++) {
-		if (!IS_KERNPROC(kp))
-			continue;
-
-		if (strcmp(kp->ki_comm, "idle") == 0) {
-			/* single processor system */
-			cpu = 0;
-		} else if (sscanf(kp->ki_comm, "idle: cpu%d%n", &cpu, &nchars)
-		    == 1 && (u_int)nchars == strlen(kp->ki_comm)) {
-			/* MP system */
-		} else
-			/* not an idle process */
-			continue;
-
-		HRDBG("'%s' proc with pid %d is on CPU #%d (last on #%d)",
-		    kp->ki_comm, kp->ki_pid, kp->ki_oncpu, kp->ki_lastcpu);
-
-		TAILQ_FOREACH(entry, &processor_tbl, link)
-			if (entry->cpu_no == kp->ki_lastcpu)
-				break;
-
-		if (entry == NULL) {
-			/* create entry on non-ACPI systems */
-			if ((entry = proc_create_entry(cpu, NULL)) == NULL)
-				continue;
-
-			detected_processor_count++;
-		}
-
-		entry->idle_pid = kp->ki_pid;
-		HRDBG("CPU no. %d with SNMP index=%d has idle PID %d",
-		    entry->cpu_no, entry->index, entry->idle_pid);
-
-		save_sample(entry, kp);
-	}
-}
-
-/**
  * Scan the device map table for CPUs and create an entry into the
- * processor table for each CPU. Then fetch the idle PIDs for all CPUs.
+ * processor table for each CPU.
+ *
+ * Make sure that the number of processors announced by the kernel hw.ncpu
+ * is equal to the number of processors we have found in the device table.
  */
 static void
 create_proc_table(void)
@@ -256,6 +213,7 @@ create_proc_table(void)
 	struct device_map_entry *map;
 	struct processor_entry *entry;
 	int cpu_no;
+	size_t len;
 
 	detected_processor_count = 0;
 
@@ -265,7 +223,7 @@ create_proc_table(void)
 	 * If not, no entries will be present in the hrProcessor Table.
 	 *
 	 * For non-ACPI system the processors are not in the device table,
-	 * therefor insert them when getting the idle pids. XXX
+	 * therefore insert them after checking hw.ncpu.
 	 */
 	STAILQ_FOREACH(map, &device_map, link)
 		if (strncmp(map->name_key, "cpu", strlen("cpu")) == 0 &&
@@ -283,9 +241,34 @@ create_proc_table(void)
 			detected_processor_count++;
 		}
 
-	HRDBG("%d CPUs detected", detected_processor_count);
+	len = sizeof(hw_ncpu);
+	if (sysctlbyname("hw.ncpu", &hw_ncpu, &len, NULL, 0) == -1 ||
+	    len != sizeof(hw_ncpu)) {
+		syslog(LOG_ERR, "hrProcessorTable: sysctl(hw.ncpu) failed");
+		hw_ncpu = 0;
+	}
+
+	HRDBG("%d CPUs detected via device table; hw.ncpu is %d",
+	    detected_processor_count, hw_ncpu);
+
+	/* XXX Can happen on non-ACPI systems? Create entries by hand. */
+	for (; detected_processor_count < hw_ncpu; detected_processor_count++)
+		proc_create_entry(detected_processor_count, NULL);
+
+	len = 2;
+	if (sysctlnametomib("kern.cp_times", cpmib, &len)) {
+		syslog(LOG_ERR, "hrProcessorTable: sysctlnametomib(kern.cp_times) failed");
+		cpmib[0] = 0;
+		cpmib[1] = 0;
+		cplen = 0;
+	} else if (sysctl(cpmib, 2, NULL, &len, NULL, 0)) {
+		syslog(LOG_ERR, "hrProcessorTable: sysctl(kern.cp_times) length query failed");
+		cplen = 0;
+	} else {
+		cplen = len / sizeof(long);
+	}
+	HRDBG("%zu entries for kern.cp_times", cplen);
 
-	processor_get_pids();
 }
 
 /**
@@ -307,78 +290,6 @@ free_proc_table(void)
 }
 
 /**
- * Init the things for hrProcessorTable.
- * Scan the device table for processor entries.
- */
-void
-init_processor_tbl(void)
-{
-	size_t len;
-
-	/* get various parameters from the kernel */
-	len = sizeof(ccpu);
-	if (sysctlbyname("kern.ccpu", &ccpu, &len, NULL, 0) == -1) {
-		syslog(LOG_ERR, "hrProcessorTable: sysctl(kern.ccpu) failed");
-		ccpu = 0;
-	}
-
-	len = sizeof(fscale);
-	if (sysctlbyname("kern.fscale", &fscale, &len, NULL, 0) == -1) {
-		syslog(LOG_ERR, "hrProcessorTable: sysctl(kern.fscale) failed");
-		fscale = 0;
-	}
-
-	/* create the initial processor table */
-	create_proc_table();
-}
-
-/**
- * Finalization routine for hrProcessorTable.
- * It destroys the lists and frees any allocated heap memory.
- */
-void
-fini_processor_tbl(void)
-{
-
-	if (cpus_load_timer != NULL) {
-		timer_stop(cpus_load_timer);
-		cpus_load_timer = NULL;
-	}
-
-	free_proc_table();
-}
-
-/**
- * Make sure that the number of processors announced by the kernel hw.ncpu
- * is equal to the number of processors we have found in the device table.
- * If they differ rescan the device table.
- */
-static void
-processor_refill_tbl(void)
-{
-
-	HRDBG("hw_ncpu=%d detected_processor_count=%d", hw_ncpu,
-	    detected_processor_count);
-
-	if (hw_ncpu <= 0) {
-		size_t size = sizeof(hw_ncpu);
-
-		if (sysctlbyname("hw.ncpu", &hw_ncpu, &size, NULL, 0) == -1 ||
-		    size != sizeof(hw_ncpu)) {
-			syslog(LOG_ERR, "hrProcessorTable: "
-			    "sysctl(hw.ncpu) failed: %m");
-			hw_ncpu = 0;
-			return;
-		}
-	}
-
-	if (hw_ncpu != detected_processor_count) {
-		free_proc_table();
-		create_proc_table();
-	}
-}
-
-/**
  * Refresh all values in the processor table. We call this once for
  * every PDU that accesses the table.
  */
@@ -386,37 +297,23 @@ static void
 refresh_processor_tbl(void)
 {
 	struct processor_entry *entry;
-	int need_pids;
-	struct kinfo_proc *plist;
-	int nproc;
+	size_t size;
 
-	processor_refill_tbl();
+	long pcpu_cp_times[cplen];
+	memset(pcpu_cp_times, 0, sizeof(pcpu_cp_times));
 
-	need_pids = 0;
-	TAILQ_FOREACH(entry, &processor_tbl, link) {
-		if (entry->idle_pid <= 0) {
-			need_pids = 1;
-			continue;
-		}
+	size = cplen * sizeof(long);
+	if (sysctl(cpmib, 2, pcpu_cp_times, &size, NULL, 0) == -1 &&
+	    !(errno == ENOMEM && size >= cplen * sizeof(long))) {
+		syslog(LOG_ERR, "hrProcessorTable: sysctl(kern.cp_times) failed");
+		return;
+	}
 
+	TAILQ_FOREACH(entry, &processor_tbl, link) {
 		assert(hr_kd != NULL);
-
-		plist = kvm_getprocs(hr_kd, KERN_PROC_PID,
-		    entry->idle_pid, &nproc);
-		if (plist == NULL || nproc != 1) {
-			syslog(LOG_ERR, "%s: missing item with "
-			    "PID = %d for CPU #%d\n ", __func__,
-			    entry->idle_pid, entry->cpu_no);
-			need_pids = 1;
-			continue;
-		}
-		save_sample(entry, plist);
+		save_sample(entry, &pcpu_cp_times[entry->cpu_no * CPUSTATES]);
 	}
 
-	if (need_pids == 1)
-		processor_get_pids();
-
-	proctbl_tick = this_tick;
 }
 
 /**
@@ -451,6 +348,36 @@ start_processor_tbl(struct lmodule *mod)
 }
 
 /**
+ * Init the things for hrProcessorTable.
+ * Scan the device table for processor entries.
+ */
+void
+init_processor_tbl(void)
+{
+
+	/* create the initial processor table */
+	create_proc_table();
+	/* and get first samples */
+	refresh_processor_tbl();
+}
+
+/**
+ * Finalization routine for hrProcessorTable.
+ * It destroys the lists and frees any allocated heap memory.
+ */
+void
+fini_processor_tbl(void)
+{
+
+	if (cpus_load_timer != NULL) {
+		timer_stop(cpus_load_timer);
+		cpus_load_timer = NULL;
+	}
+
+	free_proc_table();
+}
+
+/**
  * Access routine for the processor table.
  */
 int
@@ -460,9 +387,6 @@ op_hrProcessorTable(struct snmp_context 
 {
 	struct processor_entry *entry;
 
-	if (this_tick != proctbl_tick)
-		refresh_processor_tbl();
-
 	switch (curr_op) {
 
 	case SNMP_OP_GETNEXT:

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 20:22: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 79D0E1065674;
	Thu, 28 Oct 2010 20:22:31 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by mx1.freebsd.org (Postfix) with ESMTP id E9D9A8FC18;
	Thu, 28 Oct 2010 20:22:30 +0000 (UTC)
Received: by qyk7 with SMTP id 7so5216348qyk.13
	for ; Thu, 28 Oct 2010 13:22:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=1dHHUczArvnQpcDNRnWj3ozEhhcX3ZkeEmvfJepUQwg=;
	b=aj5nLWFCd0A1r0aFyIh3pa2FjOY5WL3U9H4LLSjK9VhQ6Ze99RJVnTqEQdVq2/BnuO
	TZl0IiEwBPa4r0iIOD5F3U66+u9oGWMuajDnYKXNE6fkcFKcVzi9jQM+k1sjNJQk5VNw
	x6IL3aOTui4EDotE+pr1qKLWWdpoguKqrATgI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=h4FJIvnufdxkbovIbVwzOKAyyJXfJjHydAw1HZpwn0QUu/35UVbafj1B7He8tMzlY+
	XCgQGYRjYp+fJapAS0UoVbk9LU3E6Pt4QMEeyLPuPe3+Ib+rdMZRt2ojYpRKr5VpM1W1
	vld/3DwvqFLnmpIadJD1FTU/DeKoKjYL/orbM=
MIME-Version: 1.0
Received: by 10.229.225.199 with SMTP id it7mr7739395qcb.33.1288297350162;
	Thu, 28 Oct 2010 13:22:30 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.237.9 with HTTP; Thu, 28 Oct 2010 13:22:30 -0700 (PDT)
In-Reply-To: <201010281457.19804.jhb@freebsd.org>
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	
	<201010281411.40423.jhb@freebsd.org>
	<201010281457.19804.jhb@freebsd.org>
Date: Thu, 28 Oct 2010 22:22:30 +0200
X-Google-Sender-Auth: opzY_CSl9yq94DvUUIoGyY64z_U
Message-ID: 
From: Attilio Rao 
To: John Baldwin 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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, 28 Oct 2010 20:22:31 -0000

2010/10/28 John Baldwin :
> On Thursday, October 28, 2010 2:11:40 pm John Baldwin wrote:
>> On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
>> > + =C2=A0 =C2=A0 =C2=A0 vm_paddr_t *p;
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 caddr_t kmdp;
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint32_t smapsize;
>> > - =C2=A0 =C2=A0 =C2=A0 int error, rid;
>> > + =C2=A0 =C2=A0 =C2=A0 int error, i, rid;
>> >
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Retrieve the system memory map from the=
 loader. */
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_search_by_type("elf kerne=
l");
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (kmdp =3D=3D NULL)
>> > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_se=
arch_by_type("elf64 kernel");
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_se=
arch_by_type(ELF_KERN_STR);
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapbase =3D (struct bios_smap *)preload_s=
earch_info(kmdp,
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MODINFO_METADATA | MODINFOMD=
_SMAP);
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapsize =3D *((u_int32_t *)smapbase - 1);
>>
>> It would be nice if ELF_KERN_STR could be autogenerated as something lik=
e:
>>
>> "elf ## __ELF_WORD_SIZE ## kernel" instead of needing an #ifdef.
>
> This works in my testing:
>
> #include 
> #include 
>
> int
> main(void)
> {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0printf("%s\n", "elf" __XSTRING(__ELF_WORD_SIZE=
) " kernel");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
> }
>

I'm not entirely sure we might use this because in general it is an
'embedded' string for the other cases, but I don't have a strong
opinion about it, so I'm fine with auto-generation.

Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 20:25: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 80DA4106564A;
	Thu, 28 Oct 2010 20:25:20 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by mx1.freebsd.org (Postfix) with ESMTP id E2C208FC21;
	Thu, 28 Oct 2010 20:25:19 +0000 (UTC)
Received: by qwg8 with SMTP id 8so299397qwg.13
	for ; Thu, 28 Oct 2010 13:25:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=0hJxW8jomt850pShRSug/ive/uKNF4q68gkp3XV+xP0=;
	b=vOsA66hfybKgJeKtwpBBgVfj9rkxMj2W6VlR49+lC2RUzLwJuOm7blltyZ4Oz32H6M
	0DXz/k64tuXZCYmWtt/L8LzESrqI0KRNb31keqmlunHGwkApJWZqKnL4Hrsr14sjXt/Y
	n2h3bD9ArmdEvZFpivjE8SvZbUttGIEnmcWtk=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=vq/WK43/10FNSyAVu6nw9+PUuIy24X7TomBwYW1tXJz9HhlW/HPQuvpmprcsUR8/xN
	S6xpPwdwHnWQrSdJQab2NWVn9ovkgT4MLmPvfRs8zTNfi01FAzfmwpIkhuxwafyjPxvI
	pQHtyeNbajsIG0mcFrDDJicpuJ7UGQSP2kjAY=
MIME-Version: 1.0
Received: by 10.224.180.84 with SMTP id bt20mr4236443qab.293.1288297518505;
	Thu, 28 Oct 2010 13:25:18 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.237.9 with HTTP; Thu, 28 Oct 2010 13:25:18 -0700 (PDT)
In-Reply-To: <201010281411.40423.jhb@freebsd.org>
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010281257.05481.jhb@freebsd.org>
	
	<201010281411.40423.jhb@freebsd.org>
Date: Thu, 28 Oct 2010 22:25:18 +0200
X-Google-Sender-Auth: MxqZ-qECLbQuDhHnf3zQdtASOvA
Message-ID: 
From: Attilio Rao 
To: John Baldwin 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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, 28 Oct 2010 20:25:20 -0000

2010/10/28 John Baldwin :
> On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
>> 2010/10/28 John Baldwin :
>> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
>> >> Author: attilio
>> >> Date: Thu Oct 28 16:31:39 2010
>> >> New Revision: 214457
>> >> URL: http://svn.freebsd.org/changeset/base/214457
>> >>
>> >> Log:
>> >> =C2=A0 Merge nexus.c from amd64 and i386 to x86 subtree.
>> >>
>> >> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated
>> >> =C2=A0 Tested by: =C2=A0gianni
>> >>
>> >
>> > It would be better to merge these two routines. =C2=A0The loader now p=
asses the
>> > smap to i386 kernels as well, so ram_attach() should probably be chang=
ed to
>> > try the amd64 approach first and if that fails fall back to using the
>> > phys_avail[] array instead.
>>
>> What do you think about this patch?:
>> Index: nexus.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
>> --- nexus.c =C2=A0 =C2=A0 (revision 214457)
>> +++ nexus.c =C2=A0 =C2=A0 (working copy)
>> @@ -52,9 +52,7 @@
>> =C2=A0#include 
>> =C2=A0#include 
>> =C2=A0#include 
>> -#ifdef __amd64__
>> =C2=A0#include 
>> -#endif
>> =C2=A0#include 
>> =C2=A0#include 
>> =C2=A0#include 
>> @@ -67,12 +65,10 @@
>> =C2=A0#include 
>> =C2=A0#include 
>>
>> -#ifdef __amd64__
>> =C2=A0#include 
>> -#include 
>> -#endif
>> =C2=A0#include 
>> =C2=A0#include 
>> +#include 
>>
>> =C2=A0#ifdef DEV_APIC
>> =C2=A0#include "pcib_if.h"
>> @@ -89,11 +85,13 @@
>> =C2=A0#include 
>>
>> =C2=A0#ifdef __amd64__
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 AMD64_BUS_SPACE_IO
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0AMD64_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 =C2=A0AMD64_BUS_SPACE_IO
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0 AMD64_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0"elf64 kernel"
>> =C2=A0#else
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 I386_BUS_SPACE_IO
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0I386_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 =C2=A0I386_BUS_SPACE_IO
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0 I386_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0"elf32 kernel"
>> =C2=A0#endif
>
> I would not do this. =C2=A0What I meant is that amd64 and i386 should be
> changed to both use X86_BUS_SPACE_* and {AMD64,I386}_BUS_SPACE_* should b=
e
> retired. =C2=A0This would involve changing the bus space code itself slig=
htly,
> but it could perhaps be shared as a result. =C2=A0Alternatively as bde@ n=
otes
> we could just drop the MD prefix entirely and have BUS_SPACE_* instead.
>
> However, I wouldn't make any changes to just nexus.c for the BUS_SPACE_*
> stuff.

Ok, as long as you and bde seem to prefer it, I'd just drop the X86_*
prefix for the moment and working on the overhaul later, as time
permits.

Thanks,
Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 20:28: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 D9A441065670;
	Thu, 28 Oct 2010 20:28:13 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 403538FC20;
	Thu, 28 Oct 2010 20:28:12 +0000 (UTC)
Received: by qwg8 with SMTP id 8so301832qwg.13
	for ; Thu, 28 Oct 2010 13:28:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=aB0md5GdOD4Wvi92m/KZ41c66stnlBM6MK7RMI83plI=;
	b=q+7ZaPgyhxYbFr/bCZ8nT7aTSDZGJ8Na8wxKrUa5fmlr9YUIQEXGsIka+gqu2WJf5T
	eLkmvpFhq5wNNlSfnt66i1vDlM1XXPlL5dt/MHrr966u7m9bO1Z5dQGO5a/mzd9H3WGW
	urB5JoOtWsjD8R5S36pnGOOZt7uMlmvvqERRI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=HpDLfNwriUFEzBNlmNdD9cfdykxorbJcHR/IJf2YIS3DA17MTf0dSeV/C83lVqFj+I
	ppZsPLMFIQz4SSyMnaUTZhNiknDSNdNg9+YF+lnFMx7ZBXHf8P2L/pDFrSaJdgjjxkKw
	9cQMeQ5QZC2E564XdGKwE/CzosQcZsCt1rjKk=
MIME-Version: 1.0
Received: by 10.229.184.68 with SMTP id cj4mr10725871qcb.48.1288297692198;
	Thu, 28 Oct 2010 13:28:12 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.237.9 with HTTP; Thu, 28 Oct 2010 13:28:12 -0700 (PDT)
In-Reply-To: <201010281411.40423.jhb@freebsd.org>
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010281257.05481.jhb@freebsd.org>
	
	<201010281411.40423.jhb@freebsd.org>
Date: Thu, 28 Oct 2010 22:28:12 +0200
X-Google-Sender-Auth: SXHMdAtITRrUCaoPVZw-iLX7vMU
Message-ID: 
From: Attilio Rao 
To: John Baldwin 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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, 28 Oct 2010 20:28:14 -0000

2010/10/28 John Baldwin :
> On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
>> 2010/10/28 John Baldwin :
>> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
>> >> Author: attilio
>> >> Date: Thu Oct 28 16:31:39 2010
>> >> New Revision: 214457
>> >> URL: http://svn.freebsd.org/changeset/base/214457
>> >>
>> >> Log:
>> >> =C2=A0 Merge nexus.c from amd64 and i386 to x86 subtree.
>> >>
>> >> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated
>> >> =C2=A0 Tested by: =C2=A0gianni
>> >>
>> >
>> > It would be better to merge these two routines. =C2=A0The loader now p=
asses the
>> > smap to i386 kernels as well, so ram_attach() should probably be chang=
ed to
>> > try the amd64 approach first and if that fails fall back to using the
>> > phys_avail[] array instead.
>>
>> What do you think about this patch?:
>> Index: nexus.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
>> --- nexus.c =C2=A0 =C2=A0 (revision 214457)
>> +++ nexus.c =C2=A0 =C2=A0 (working copy)
>> @@ -52,9 +52,7 @@
>> =C2=A0#include 
>> =C2=A0#include 
>> =C2=A0#include 
>> -#ifdef __amd64__
>> =C2=A0#include 
>> -#endif
>> =C2=A0#include 
>> =C2=A0#include 
>> =C2=A0#include 
>> @@ -67,12 +65,10 @@
>> =C2=A0#include 
>> =C2=A0#include 
>>
>> -#ifdef __amd64__
>> =C2=A0#include 
>> -#include 
>> -#endif
>> =C2=A0#include 
>> =C2=A0#include 
>> +#include 
>>
>> =C2=A0#ifdef DEV_APIC
>> =C2=A0#include "pcib_if.h"
>> @@ -89,11 +85,13 @@
>> =C2=A0#include 
>>
>> =C2=A0#ifdef __amd64__
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 AMD64_BUS_SPACE_IO
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0AMD64_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 =C2=A0AMD64_BUS_SPACE_IO
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0 AMD64_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0"elf64 kernel"
>> =C2=A0#else
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 I386_BUS_SPACE_IO
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0I386_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 =C2=A0I386_BUS_SPACE_IO
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0 I386_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0"elf32 kernel"
>> =C2=A0#endif
>> @@ -701,16 +699,11 @@
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 panic("ram_attach: resource %d failed to attach", rid);
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rid++;
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>> - =C2=A0 =C2=A0 =C2=A0 return (0);
>> -}
>> -#else
>> -static int
>> -ram_attach(device_t dev)
>> -{
>> - =C2=A0 =C2=A0 =C2=A0 struct resource *res;
>> - =C2=A0 =C2=A0 =C2=A0 vm_paddr_t *p;
>> - =C2=A0 =C2=A0 =C2=A0 int error, i, rid;
>>
>> + =C2=A0 =C2=A0 =C2=A0 /* If at least one smap attached, return. */
>> + =C2=A0 =C2=A0 =C2=A0 if (rid !=3D 0)
>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);
>> +
>
> Perhaps this instead:
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0/* If we found an SMAP, return. */
> =C2=A0 =C2=A0 =C2=A0 =C2=A0if (smapbase !=3D NULL)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);

No, I don't think this check is right, smapbase will always be !=3D NULL
(otherwise the code panics).

Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 20:51: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 945FA1065670;
	Thu, 28 Oct 2010 20:51:57 +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 505D78FC20;
	Thu, 28 Oct 2010 20:51:57 +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 CAAF746B03;
	Thu, 28 Oct 2010 16:51:56 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8CA5A8A01D;
	Thu, 28 Oct 2010 16:51:55 -0400 (EDT)
From: John Baldwin 
To: Attilio Rao 
Date: Thu, 28 Oct 2010 16:38:13 -0400
User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; )
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010281411.40423.jhb@freebsd.org>
	
In-Reply-To: 
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201010281638.14043.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Thu, 28 Oct 2010 16:51:55 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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, 28 Oct 2010 20:51:57 -0000

On Thursday, October 28, 2010 4:28:12 pm Attilio Rao wrote:
> 2010/10/28 John Baldwin :
> > On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
> >> 2010/10/28 John Baldwin :
> >> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
> >> >> Author: attilio
> >> >> Date: Thu Oct 28 16:31:39 2010
> >> >> New Revision: 214457
> >> >> URL: http://svn.freebsd.org/changeset/base/214457
> >> >>
> >> >> Log:
> >> >>   Merge nexus.c from amd64 and i386 to x86 subtree.
> >> >>
> >> >>   Sponsored by:       Sandvine Incorporated
> >> >>   Tested by:  gianni
> >> >>
> >> >
> >> > It would be better to merge these two routines.  The loader now passes 
the
> >> > smap to i386 kernels as well, so ram_attach() should probably be 
changed to
> >> > try the amd64 approach first and if that fails fall back to using the
> >> > phys_avail[] array instead.
> >>
> >> What do you think about this patch?:
> >> Index: nexus.c
> >> ===================================================================
> >> --- nexus.c     (revision 214457)
> >> +++ nexus.c     (working copy)
> >> @@ -52,9 +52,7 @@
> >>  #include 
> >>  #include 
> >>  #include 
> >> -#ifdef __amd64__
> >>  #include 
> >> -#endif
> >>  #include 
> >>  #include 
> >>  #include 
> >> @@ -67,12 +65,10 @@
> >>  #include 
> >>  #include 
> >>
> >> -#ifdef __amd64__
> >>  #include 
> >> -#include 
> >> -#endif
> >>  #include 
> >>  #include 
> >> +#include 
> >>
> >>  #ifdef DEV_APIC
> >>  #include "pcib_if.h"
> >> @@ -89,11 +85,13 @@
> >>  #include 
> >>
> >>  #ifdef __amd64__
> >> -#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
> >> -#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
> >> +#define        X86_BUS_SPACE_IO        AMD64_BUS_SPACE_IO
> >> +#define        X86_BUS_SPACE_MEM       AMD64_BUS_SPACE_MEM
> >> +#define        ELF_KERN_STR            "elf64 kernel"
> >>  #else
> >> -#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
> >> -#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
> >> +#define        X86_BUS_SPACE_IO        I386_BUS_SPACE_IO
> >> +#define        X86_BUS_SPACE_MEM       I386_BUS_SPACE_MEM
> >> +#define        ELF_KERN_STR            "elf32 kernel"
> >>  #endif
> >> @@ -701,16 +699,11 @@
> >>                         panic("ram_attach: resource %d failed to attach", 
rid);
> >>                 rid++;
> >>         }
> >> -       return (0);
> >> -}
> >> -#else
> >> -static int
> >> -ram_attach(device_t dev)
> >> -{
> >> -       struct resource *res;
> >> -       vm_paddr_t *p;
> >> -       int error, i, rid;
> >>
> >> +       /* If at least one smap attached, return. */
> >> +       if (rid != 0)
> >> +               return (0);
> >> +
> >
> > Perhaps this instead:
> >
> >        /* If we found an SMAP, return. */
> >        if (smapbase != NULL)
> >                return (0);
> 
> No, I don't think this check is right, smapbase will always be != NULL
> (otherwise the code panics).

Oh, that needs to be fixed then.  It can be NULL on i386 with an old loader 
(or on a really old machine without an SMAP).  The amd64 nexus code could 
assume it would never be NULL, but i386 cannot.

It should probably more closely match what i386 does during the memory probe 
which is:

	kmdp = search("elf kernel");
	if (kmdp == NULL)
		kmdp = search("elfXX kernel");
	if (kmdp != NULL)
		smapbase = preload_search(...);
	else
		smapbase = NULL;
	if (smapbase != NULL) {
		for (smap = ...) {
		}

		return (0);
	}

	/* fall through to old i386 code using phys_avail[] */

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 21:51: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 E4C3E106566B;
	Thu, 28 Oct 2010 21:51:14 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2F0B8FC0A;
	Thu, 28 Oct 2010 21:51: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 o9SLpECf034118;
	Thu, 28 Oct 2010 21:51:14 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SLpE7l034115;
	Thu, 28 Oct 2010 21:51:14 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201010282151.o9SLpE7l034115@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Thu, 28 Oct 2010 21:51: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: r214490 - in head: bin/sh
	tools/regression/bin/sh/expansion
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 21:51:15 -0000

Author: jilles
Date: Thu Oct 28 21:51:14 2010
New Revision: 214490
URL: http://svn.freebsd.org/changeset/base/214490

Log:
  sh: Make double-quotes quote a '}' inside ${v#...} and ${v%...}.
  
  Exp-run done by:	pav (with some other sh(1) changes)
  PR:			bin/57554

Added:
  head/tools/regression/bin/sh/expansion/trim5.0   (contents, props changed)
Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Thu Oct 28 20:18:26 2010	(r214489)
+++ head/bin/sh/parser.c	Thu Oct 28 21:51:14 2010	(r214490)
@@ -1234,7 +1234,8 @@ readtoken1(int firstc, char const *initi
 			case CENDVAR:	/* '}' */
 				if (level > 0 &&
 				    (state[level].category == TSTATE_VAR_OLD ||
-				    state[level].category == TSTATE_VAR_NEW)) {
+				    (state[level].category == TSTATE_VAR_NEW &&
+				     state[level].syntax == BASESYNTAX))) {
 					if (state[level].category == TSTATE_VAR_OLD)
 						state[level - 1].syntax = state[level].syntax;
 					else

Added: head/tools/regression/bin/sh/expansion/trim5.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/trim5.0	Thu Oct 28 21:51:14 2010	(r214490)
@@ -0,0 +1,28 @@
+# $FreeBSD$
+
+e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}'
+h='##'
+failures=''
+ok=''
+
+testcase() {
+	code="$1"
+	expected="$2"
+	oIFS="$IFS"
+	eval "$code"
+	IFS='|'
+	result="$#|$*"
+	IFS="$oIFS"
+	if [ "x$result" = "x$expected" ]; then
+		ok=x$ok
+	else
+		failures=x$failures
+		echo "For $code, expected $expected actual $result"
+	fi
+}
+
+testcase 'set -- "${b%'\'}\''}"'		'1|{{(#)}'
+testcase 'set -- ${b%"}"}'			'1|{{(#)}'
+testcase 'set -- "${b%"}"}"'			'1|{{(#)}'
+
+test "x$failures" = x

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 22:28: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 BED011065673;
	Thu, 28 Oct 2010 22:28:45 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AE4518FC18;
	Thu, 28 Oct 2010 22:28: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 o9SMSjrd035787;
	Thu, 28 Oct 2010 22:28:45 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SMSj19035785;
	Thu, 28 Oct 2010 22:28:45 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201010282228.o9SMSj19035785@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Thu, 28 Oct 2010 22:28: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: r214491 - head/usr.sbin/rtadvd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 22:28:45 -0000

Author: uqs
Date: Thu Oct 28 22:28:45 2010
New Revision: 214491
URL: http://svn.freebsd.org/changeset/base/214491

Log:
  Fix another "string" typo.
  
  MFC after:	3 days

Modified:
  head/usr.sbin/rtadvd/rtadvd.conf.5

Modified: head/usr.sbin/rtadvd/rtadvd.conf.5
==============================================================================
--- head/usr.sbin/rtadvd/rtadvd.conf.5	Thu Oct 28 21:51:14 2010	(r214490)
+++ head/usr.sbin/rtadvd/rtadvd.conf.5	Thu Oct 28 22:28:45 2010	(r214491)
@@ -201,7 +201,7 @@ The default value is 64.
 (str or num) A 8-bit flags field in prefix information option.
 This field can be specified either as a case-sensitive string or as an
 integer.
-A sting consists of characters each of which corresponds to a
+A string consists of characters each of which corresponds to a
 particular flag bit(s).
 An integer should be the logical OR of all enabled bits.
 Bit 7

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 22:34: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 C4A541065672;
	Thu, 28 Oct 2010 22:34:49 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 990858FC1A;
	Thu, 28 Oct 2010 22:34: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 o9SMYnqF036407;
	Thu, 28 Oct 2010 22:34:49 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SMYn6f036403;
	Thu, 28 Oct 2010 22:34:49 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201010282234.o9SMYn6f036403@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Thu, 28 Oct 2010 22:34: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: r214492 - in head: bin/sh
	tools/regression/bin/sh/expansion
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 22:34:49 -0000

Author: jilles
Date: Thu Oct 28 22:34:49 2010
New Revision: 214492
URL: http://svn.freebsd.org/changeset/base/214492

Log:
  sh: Only accept a '}' inside ${v+-=?...} if double-quote state matches.
  If double-quote state does not match, treat the '}' literally.
  
  This ensures double-quote state remains the same before and after a
  ${v+-=?...} which helps with expand.c.
  
  It makes things like
    ${foo+"\${bar}"}
  which I have seen in the wild work as expected.
  
  Exp-run done by:	pav (with some other sh(1) changes)

Added:
  head/tools/regression/bin/sh/expansion/plus-minus5.0   (contents, props changed)
Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Thu Oct 28 22:28:45 2010	(r214491)
+++ head/bin/sh/parser.c	Thu Oct 28 22:34:49 2010	(r214492)
@@ -1233,12 +1233,12 @@ readtoken1(int firstc, char const *initi
 				break;
 			case CENDVAR:	/* '}' */
 				if (level > 0 &&
-				    (state[level].category == TSTATE_VAR_OLD ||
+				    ((state[level].category == TSTATE_VAR_OLD &&
+				      state[level].syntax ==
+				      state[level - 1].syntax) ||
 				    (state[level].category == TSTATE_VAR_NEW &&
 				     state[level].syntax == BASESYNTAX))) {
-					if (state[level].category == TSTATE_VAR_OLD)
-						state[level - 1].syntax = state[level].syntax;
-					else
+					if (state[level].category == TSTATE_VAR_NEW)
 						newvarnest--;
 					level--;
 					USTPUTC(CTLENDVAR, out);

Added: head/tools/regression/bin/sh/expansion/plus-minus5.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/plus-minus5.0	Thu Oct 28 22:34:49 2010	(r214492)
@@ -0,0 +1,31 @@
+# $FreeBSD$
+
+e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}'
+h='##'
+failures=''
+ok=''
+
+testcase() {
+	code="$1"
+	expected="$2"
+	oIFS="$IFS"
+	eval "$code"
+	IFS='|'
+	result="$#|$*"
+	IFS="$oIFS"
+	if [ "x$result" = "x$expected" ]; then
+		ok=x$ok
+	else
+		failures=x$failures
+		echo "For $code, expected $expected actual $result"
+	fi
+}
+
+testcase 'set -- ${e:-"{x}"}'			'1|{x}'
+testcase 'set -- "${e:-"{x}"}"'			'1|{x}'
+testcase 'set -- ${h+"{x}"}'			'1|{x}'
+testcase 'set -- "${h+"{x}"}"'			'1|{x}'
+testcase 'set -- ${h:-"{x}"}'			'1|##'
+testcase 'set -- "${h:-"{x}"}"'			'1|##'
+
+test "x$failures" = x

From owner-svn-src-all@FreeBSD.ORG  Thu Oct 28 23:46: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 D85721065675;
	Thu, 28 Oct 2010 23:46:05 +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 C6F938FC0A;
	Thu, 28 Oct 2010 23:46: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 o9SNk5cC042725;
	Thu, 28 Oct 2010 23:46:05 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9SNk5Fg042721;
	Thu, 28 Oct 2010 23:46:05 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201010282346.o9SNk5Fg042721@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 28 Oct 2010 23:46: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: r214493 - in head/sys/boot/ofw: common libofw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Oct 2010 23:46:06 -0000

Author: nwhitehorn
Date: Thu Oct 28 23:46:05 2010
New Revision: 214493
URL: http://svn.freebsd.org/changeset/base/214493

Log:
  Fix some memory management issues discovered when trying to boot the PPC
  OF loader on systems where address cells and size cells are both 2 (the
  Mambo simulator) and fix an error where cons_probe() was called before
  init_heap() but used malloc() to set environment variables.
  
  MFC after:	1 month

Modified:
  head/sys/boot/ofw/common/main.c
  head/sys/boot/ofw/libofw/ofw_memory.c
  head/sys/boot/ofw/libofw/openfirm.c

Modified: head/sys/boot/ofw/common/main.c
==============================================================================
--- head/sys/boot/ofw/common/main.c	Thu Oct 28 22:34:49 2010	(r214492)
+++ head/sys/boot/ofw/common/main.c	Thu Oct 28 23:46:05 2010	(r214493)
@@ -41,7 +41,7 @@ extern char bootprog_rev[];
 extern char bootprog_date[];
 extern char bootprog_maker[];
 
-u_int32_t	acells;
+u_int32_t	acells, scells;
 
 static char bootargs[128];
 
@@ -64,25 +64,20 @@ uint64_t
 memsize(void)
 {
 	phandle_t	memoryp;
-	struct ofw_reg	reg[4];
-	struct ofw_reg2	reg2[8];
-	int		i;
-	u_int64_t	sz, memsz;
+	cell_t		reg[24];
+	int		i, sz;
+	u_int64_t	memsz;
 
+	memsz = 0;
 	memoryp = OF_instance_to_package(memory);
 
-	if (acells == 1) {
-		sz = OF_getprop(memoryp, "reg", ®, sizeof(reg));
-		sz /= sizeof(struct ofw_reg);
-
-		for (i = 0, memsz = 0; i < sz; i++)
-			memsz += reg[i].size;
-	} else if (acells == 2) {
-		sz = OF_getprop(memoryp, "reg", ®2, sizeof(reg2));
-		sz /= sizeof(struct ofw_reg2);
+	sz = OF_getprop(memoryp, "reg", ®, sizeof(reg));
+	sz /= sizeof(reg[0]);
 
-		for (i = 0, memsz = 0; i < sz; i++)
-			memsz += reg2[i].size;
+	for (i = 0; i < sz; i += (acells + scells)) {
+		if (scells > 1)
+			memsz += (uint64_t)reg[i + acells] << 32;
+		memsz += reg[i + acells + scells - 1];
 	}
 
 	return (memsz);
@@ -105,13 +100,9 @@ main(int (*openfirm)(void *))
 
 	root = OF_finddevice("/");
 
-	acells = 1;
+	scells = acells = 1;
 	OF_getprop(root, "#address-cells", &acells, sizeof(acells));
-
-	/*
-         * Set up console.
-         */
-	cons_probe();
+	OF_getprop(root, "#size-cells", &scells, sizeof(scells));
 
 	/*
 	 * Initialise the heap as early as possible.  Once this is done,
@@ -121,6 +112,11 @@ main(int (*openfirm)(void *))
 	init_heap();
 
 	/*
+         * Set up console.
+         */
+	cons_probe();
+
+	/*
 	 * March through the device switch probing for things.
 	 */
 	for (i = 0; devsw[i] != NULL; i++)

Modified: head/sys/boot/ofw/libofw/ofw_memory.c
==============================================================================
--- head/sys/boot/ofw/libofw/ofw_memory.c	Thu Oct 28 22:34:49 2010	(r214492)
+++ head/sys/boot/ofw/libofw/ofw_memory.c	Thu Oct 28 23:46:05 2010	(r214493)
@@ -118,13 +118,19 @@ ofw_memmap(int acells)
 void *
 ofw_alloc_heap(unsigned int size)
 {
-	phandle_t	memoryp;
-	struct		ofw_reg available;
+	phandle_t	memoryp, root;
+	cell_t		available[4];
+	cell_t		acells;
+
+	root = OF_finddevice("/");
+	acells = 1;
+	OF_getprop(root, "#address-cells", &acells, sizeof(acells));
 
 	memoryp = OF_instance_to_package(memory);
-	OF_getprop(memoryp, "available", &available, sizeof(available));
+	OF_getprop(memoryp, "available", available, sizeof(available));
 
-	heap_base = OF_claim((void *)available.base, size, sizeof(register_t));
+	heap_base = OF_claim((void *)available[acells-1], size,
+	    sizeof(register_t));
 
 	if (heap_base != (void *)-1) {
 		heap_size = size;

Modified: head/sys/boot/ofw/libofw/openfirm.c
==============================================================================
--- head/sys/boot/ofw/libofw/openfirm.c	Thu Oct 28 22:34:49 2010	(r214492)
+++ head/sys/boot/ofw/libofw/openfirm.c	Thu Oct 28 23:46:05 2010	(r214493)
@@ -80,8 +80,13 @@ OF_init(int (*openfirm)(void *))
 
 	if ((chosen = OF_finddevice("/chosen")) == -1)
 		OF_exit();
-	if (OF_getprop(chosen, "memory", &memory, sizeof(memory)) == -1)
-		OF_exit();
+	if (OF_getprop(chosen, "memory", &memory, sizeof(memory)) == -1) {
+		memory = OF_open("/memory");
+		if (memory == -1)
+			memory = OF_open("/memory@0");
+		if (memory == -1)
+			OF_exit();
+	}
 	if (OF_getprop(chosen, "mmu", &mmu, sizeof(mmu)) == -1)
 		OF_exit();
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 00:25: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 8D90D106566B;
	Fri, 29 Oct 2010 00:25:40 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 055E48FC16;
	Fri, 29 Oct 2010 00:25:39 +0000 (UTC)
Received: by qyk2 with SMTP id 2so1489143qyk.13
	for ; Thu, 28 Oct 2010 17:25:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=whewNNwn2HnYAYuK/0O1Pire8NYbPUCfa5vxLPZEdjc=;
	b=N5g4IxbY/mSGU0HrQSlnC+bGy2ugi1hEsc/59/p74Soyp7h4v87pdzz9wjlmAUf1Q7
	+AQi5pJoYmIzS9m3SQQeg5bePcEoP9CPuea3Lke8r43dIY/S29zFFNngoKsH4ne8ygKd
	DYm6NNCh8nd1/skEZbptNfsAOSh/qSW3t/ZF4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=kyDqZXvXd5EQtwFLkbZUS8C5rzxAeIR59ulQV9LFCK+uEXYTGj3qWOvqAEddC/VjKA
	gX12MAUsEuUvvMHApBn00AtAtz9mJkqLG9ZmuSTiDoc4w3YLu83C5OU2ZRpFkyGUoKPM
	SZd1+RzLFZVTYC+krid+we2kU5SlTxJr7qxiM=
MIME-Version: 1.0
Received: by 10.229.240.213 with SMTP id lb21mr10981155qcb.185.1288311938949; 
	Thu, 28 Oct 2010 17:25:38 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.237.9 with HTTP; Thu, 28 Oct 2010 17:25:38 -0700 (PDT)
In-Reply-To: <201010281638.14043.jhb@freebsd.org>
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010281411.40423.jhb@freebsd.org>
	
	<201010281638.14043.jhb@freebsd.org>
Date: Fri, 29 Oct 2010 02:25:38 +0200
X-Google-Sender-Auth: oG3tpCBB9PL1eAhfyPujVlIzJQU
Message-ID: 
From: Attilio Rao 
To: John Baldwin 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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: Fri, 29 Oct 2010 00:25:40 -0000

2010/10/28 John Baldwin :
> On Thursday, October 28, 2010 4:28:12 pm Attilio Rao wrote:
>> 2010/10/28 John Baldwin :
>> > On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
>> >> 2010/10/28 John Baldwin :
>> >> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
>> >> >> Author: attilio
>> >> >> Date: Thu Oct 28 16:31:39 2010
>> >> >> New Revision: 214457
>> >> >> URL: http://svn.freebsd.org/changeset/base/214457
>> >> >>
>> >> >> Log:
>> >> >> =C2=A0 Merge nexus.c from amd64 and i386 to x86 subtree.
>> >> >>
>> >> >> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated
>> >> >> =C2=A0 Tested by: =C2=A0gianni
>> >> >>
>> >> >
>> >> > It would be better to merge these two routines. =C2=A0The loader no=
w passes
> the
>> >> > smap to i386 kernels as well, so ram_attach() should probably be
> changed to
>> >> > try the amd64 approach first and if that fails fall back to using t=
he
>> >> > phys_avail[] array instead.
>> >>
>> >> What do you think about this patch?:
>> >> Index: nexus.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
>> >> --- nexus.c =C2=A0 =C2=A0 (revision 214457)
>> >> +++ nexus.c =C2=A0 =C2=A0 (working copy)
>> >> @@ -52,9 +52,7 @@
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> -#ifdef __amd64__
>> >> =C2=A0#include 
>> >> -#endif
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> @@ -67,12 +65,10 @@
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >>
>> >> -#ifdef __amd64__
>> >> =C2=A0#include 
>> >> -#include 
>> >> -#endif
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> +#include 
>> >>
>> >> =C2=A0#ifdef DEV_APIC
>> >> =C2=A0#include "pcib_if.h"
>> >> @@ -89,11 +85,13 @@
>> >> =C2=A0#include 
>> >>
>> >> =C2=A0#ifdef __amd64__
>> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =
=C2=A0 AMD64_BUS_SPACE_IO
>> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =
=C2=A0AMD64_BUS_SPACE_MEM
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0 =
=C2=A0 =C2=A0AMD64_BUS_SPACE_IO
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=A0 =
=C2=A0 AMD64_BUS_SPACE_MEM
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0"elf64 kernel"
>> >> =C2=A0#else
>> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =
=C2=A0 I386_BUS_SPACE_IO
>> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =
=C2=A0I386_BUS_SPACE_MEM
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0 =
=C2=A0 =C2=A0I386_BUS_SPACE_IO
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=A0 =
=C2=A0 I386_BUS_SPACE_MEM
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0"elf32 kernel"
>> >> =C2=A0#endif
>> >> @@ -701,16 +699,11 @@
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 panic("ram_attach: resource %d failed to attach",
> rid);
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rid++;
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>> >> - =C2=A0 =C2=A0 =C2=A0 return (0);
>> >> -}
>> >> -#else
>> >> -static int
>> >> -ram_attach(device_t dev)
>> >> -{
>> >> - =C2=A0 =C2=A0 =C2=A0 struct resource *res;
>> >> - =C2=A0 =C2=A0 =C2=A0 vm_paddr_t *p;
>> >> - =C2=A0 =C2=A0 =C2=A0 int error, i, rid;
>> >>
>> >> + =C2=A0 =C2=A0 =C2=A0 /* If at least one smap attached, return. */
>> >> + =C2=A0 =C2=A0 =C2=A0 if (rid !=3D 0)
>> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);
>> >> +
>> >
>> > Perhaps this instead:
>> >
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* If we found an SMAP, return. */
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (smapbase !=3D NULL)
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
>>
>> No, I don't think this check is right, smapbase will always be !=3D NULL
>> (otherwise the code panics).
>
> Oh, that needs to be fixed then. =C2=A0It can be NULL on i386 with an old=
 loader
> (or on a really old machine without an SMAP). =C2=A0The amd64 nexus code =
could
> assume it would never be NULL, but i386 cannot.
>
> It should probably more closely match what i386 does during the memory pr=
obe
> which is:
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0kmdp =3D search("elf kernel");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0if (kmdp =3D=3D NULL)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0kmdp =3D search("e=
lfXX kernel");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0if (kmdp !=3D NULL)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0smapbase =3D prelo=
ad_search(...);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0else
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0smapbase =3D NULL;
> =C2=A0 =C2=A0 =C2=A0 =C2=A0if (smapbase !=3D NULL) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (smap =3D ...)=
 {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0/* fall through to old i386 code using phys_av=
ail[] */

This further patch should address your concerns about nexus.c:
Index: nexus.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
--- nexus.c     (revision 214457)
+++ nexus.c     (working copy)
@@ -52,9 +52,7 @@
 #include 
 #include 
 #include 
-#ifdef __amd64__
 #include 
-#endif
 #include 
 #include 
 #include 
@@ -67,12 +65,10 @@
 #include 
 #include 

-#ifdef __amd64__
 #include 
-#include 
-#endif
 #include 
 #include 
+#include 

 #ifdef DEV_APIC
 #include "pcib_if.h"
@@ -89,13 +85,15 @@
 #include 

 #ifdef __amd64__
-#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
-#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
+#define        BUS_SPACE_IO    AMD64_BUS_SPACE_IO
+#define        BUS_SPACE_MEM   AMD64_BUS_SPACE_MEM
 #else
-#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
-#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
+#define        BUS_SPACE_IO    I386_BUS_SPACE_IO
+#define        BUS_SPACE_MEM   I386_BUS_SPACE_MEM
 #endif

+#define        ELF_KERN_STR    ("elf"__XSTRING(__ELF_WORD_SIZE)" kernel")
+
 static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");

 #define DEVTONX(dev)   ((struct nexus_device *)device_get_ivars(dev))
@@ -435,7 +433,7 @@
 #else
                rman_set_bushandle(r, rman_get_start(r));
 #endif
-               rman_set_bustag(r, RMAN_BUS_SPACE_IO);
+               rman_set_bustag(r, BUS_SPACE_IO);
                break;
        case SYS_RES_MEMORY:
 #ifdef PC98
@@ -446,7 +444,7 @@
 #endif
                vaddr =3D pmap_mapdev(rman_get_start(r), rman_get_size(r));
                rman_set_virtual(r, vaddr);
-               rman_set_bustag(r, RMAN_BUS_SPACE_MEM);
+               rman_set_bustag(r, BUS_SPACE_MEM);
 #ifdef PC98
                /* PC-98: the type of bus_space_handle_t is the structure. =
*/
                bh->bsh_base =3D (bus_addr_t) vaddr;
@@ -668,48 +666,45 @@
        return (0);
 }

-#ifdef __amd64__
 static int
 ram_attach(device_t dev)
 {
        struct bios_smap *smapbase, *smap, *smapend;
        struct resource *res;
+       vm_paddr_t *p;
        caddr_t kmdp;
        uint32_t smapsize;
-       int error, rid;
+       int error, i, rid;

        /* Retrieve the system memory map from the loader. */
        kmdp =3D preload_search_by_type("elf kernel");
        if (kmdp =3D=3D NULL)
-               kmdp =3D preload_search_by_type("elf64 kernel");
-       smapbase =3D (struct bios_smap *)preload_search_info(kmdp,
-           MODINFO_METADATA | MODINFOMD_SMAP);
-       smapsize =3D *((u_int32_t *)smapbase - 1);
-       smapend =3D (struct bios_smap *)((uintptr_t)smapbase + smapsize);
+               kmdp =3D preload_search_by_type(ELF_KERN_STR);
+       if (kmdp !=3D NULL) {
+               smapbase =3D (struct bios_smap *)preload_search_info(kmdp,
+                   MODINFO_METADATA | MODINFOMD_SMAP);
+               smapsize =3D *((u_int32_t *)smapbase - 1);
+               smapend =3D (struct bios_smap *)((uintptr_t)smapbase + smap=
size);

-       rid =3D 0;
-       for (smap =3D smapbase; smap < smapend; smap++) {
-               if (smap->type !=3D SMAP_TYPE_MEMORY || smap->length =3D=3D=
 0)
-                       continue;
-               error =3D bus_set_resource(dev, SYS_RES_MEMORY, rid, smap->=
base,
-                   smap->length);
-               if (error)
-                       panic("ram_attach: resource %d failed set with %d",=
 rid,
-                           error);
-               res =3D bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0=
);
-               if (res =3D=3D NULL)
-                       panic("ram_attach: resource %d failed to attach", r=
id);
-               rid++;
+               rid =3D 0;
+               for (smap =3D smapbase; smap < smapend; smap++) {
+                       if (smap->type !=3D SMAP_TYPE_MEMORY ||
+                           smap->length =3D=3D 0)
+                               continue;
+                       error =3D bus_set_resource(dev, SYS_RES_MEMORY, rid=
,
+                           smap->base, smap->length);
+                       if (error)
+                       panic("ram_attach: resource %d failed set with %d",
+                                   rid, error);
+                       res =3D bus_alloc_resource_any(dev, SYS_RES_MEMORY,=
 &rid,
+                           0);
+                       if (res =3D=3D NULL)
+                       panic("ram_attach: resource %d failed to attach",
+                                   rid);
+                       rid++;
+               }
+               return (0);
        }
-       return (0);
-}
-#else
-static int
-ram_attach(device_t dev)
-{
-       struct resource *res;
-       vm_paddr_t *p;
-       int error, i, rid;

        /*
         * We use the dump_avail[] array rather than phys_avail[] for
@@ -743,7 +738,6 @@
        }
        return (0);
 }
-#endif

 static device_method_t ram_methods[] =3D {
        /* Device interface */

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 00:36: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 C0EB71065672;
	Fri, 29 Oct 2010 00:36:44 +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 AFE648FC1A;
	Fri, 29 Oct 2010 00:36: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 o9T0aikf047102;
	Fri, 29 Oct 2010 00:36:44 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9T0aidm047100;
	Fri, 29 Oct 2010 00:36:44 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201010290036.o9T0aidm047100@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 29 Oct 2010 00:36: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: r214494 - head/sys/boot/ofw/libofw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 00:36:44 -0000

Author: nwhitehorn
Date: Fri Oct 29 00:36:44 2010
New Revision: 214494
URL: http://svn.freebsd.org/changeset/base/214494

Log:
  Fix netboot on some Apple machines on which calling dma-free on the
  network device can hang the machine. This causes the loss of 64 KB of
  accessible memory on netbooted machines.

Modified:
  head/sys/boot/ofw/libofw/ofw_net.c

Modified: head/sys/boot/ofw/libofw/ofw_net.c
==============================================================================
--- head/sys/boot/ofw/libofw/ofw_net.c	Thu Oct 28 23:46:05 2010	(r214493)
+++ head/sys/boot/ofw/libofw/ofw_net.c	Fri Oct 29 00:36:44 2010	(r214494)
@@ -230,7 +230,10 @@ punt:
 static void
 ofwn_end(struct netif *nif)
 {
+#ifdef BROKEN
+	/* dma-free freezes at least some Apple ethernet controllers */
 	OF_call_method("dma-free", netinstance, 2, 0, dmabuf, MAXPHYS);
+#endif
 	OF_close(netinstance);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 00:37: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 15AB51065693;
	Fri, 29 Oct 2010 00:37:36 +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 04D048FC0C;
	Fri, 29 Oct 2010 00:37: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 o9T0bZdt047199;
	Fri, 29 Oct 2010 00:37:35 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9T0bZei047197;
	Fri, 29 Oct 2010 00:37:35 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201010290037.o9T0bZei047197@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 29 Oct 2010 00:37: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: r214495 - head/sys/boot/ofw/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, 29 Oct 2010 00:37:36 -0000

Author: nwhitehorn
Date: Fri Oct 29 00:37:35 2010
New Revision: 214495
URL: http://svn.freebsd.org/changeset/base/214495

Log:
  Fix the printf() in init_heap so that it can run before the console is up.
  
  Pointed out by:	marius

Modified:
  head/sys/boot/ofw/common/main.c

Modified: head/sys/boot/ofw/common/main.c
==============================================================================
--- head/sys/boot/ofw/common/main.c	Fri Oct 29 00:36:44 2010	(r214494)
+++ head/sys/boot/ofw/common/main.c	Fri Oct 29 00:37:35 2010	(r214495)
@@ -47,13 +47,17 @@ static char bootargs[128];
 
 #define	HEAP_SIZE	0x80000
 
+#define OF_puts(fd, text) OF_write(fd, text, strlen(text))
+
 void
 init_heap(void)
 {
 	void	*base;
+	ihandle_t stdout;
 
 	if ((base = ofw_alloc_heap(HEAP_SIZE)) == (void *)0xffffffff) {
-		printf("Heap memory claim failed!\n");
+		OF_getprop(chosen, "stdout", &stdout, sizeof(stdout));
+		OF_puts(stdout, "Heap memory claim failed!\n");
 		OF_enter();
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 05:04: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 F06721065672;
	Fri, 29 Oct 2010 05:04:51 +0000 (UTC)
	(envelope-from davidxu@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id B9CB78FC18;
	Fri, 29 Oct 2010 05:04:51 +0000 (UTC)
Received: from xyf.my.dom (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9T54n2P000958;
	Fri, 29 Oct 2010 05:04:49 GMT (envelope-from davidxu@freebsd.org)
Message-ID: <4CCAC673.7070307@freebsd.org>
Date: Fri, 29 Oct 2010 13:04:51 +0000
From: David Xu 
User-Agent: Thunderbird 2.0.0.24 (X11/20100630)
MIME-Version: 1.0
To: Garrett Cooper 
References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>		<4CC803A8.3040602@freebsd.org>	<20101027082122.GD1848@garage.freebsd.pl>	<4CC85552.2020100@freebsd.org>	<20101027133307.GQ2392@deviant.kiev.zoral.com.ua>		<4CC851CC.80509@freebsd.org>		<4CC9483C.7050507@freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: src-committers@freebsd.org, Pawel Jakub Dawidek ,
	svn-src-all@freebsd.org, Andriy Gapon ,
	svn-src-head@freebsd.org, Kostik Belousov 
Subject: Re: svn commit: r214409 - 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, 29 Oct 2010 05:04:52 -0000

Garrett Cooper wrote:
> On Thu, Oct 28, 2010 at 2:54 AM, David Xu  wrote:
>> Garrett Cooper wrote:
>>> On Wed, Oct 27, 2010 at 9:22 AM, Andriy Gapon  wrote:
>>>> [patch attachment was lost]
>>> Ugh... Mailman hates me I guess :(...
>>>
>>>> on 27/10/2010 19:07 Garrett Cooper said the following:
>>>>>    How about this patch? I implemented this as a readonly tunable and
>>>> I don't think that it's correct to call it a tunable or use
>>>> CTLFLAG_RDTUN.
>>>> As I understand it is a read-only sysctl.
>>> Converted to CTLFLAG_RD.
>>>
>>>>> sysconf tunable, because (AFAIK) the value that is being tested
>>>>> shouldn't change during runtime after the system has been booted up,
>>>>> and figuring that the value wasn't going to change it was better to
>>>>> lose 4/8 bytes on the kernel stack instead of having to recompute the
>>>>> value every time in a function call, with the associated lost heap /
>>>>> stack memory in the process, as the assumption is that this libcall
>>>>> was going to be called frequently by some programs.
>> The patch looks fine to me. ;-)
> 
> If no one opposes the change, could you please commit the patch for me David?
> Thanks!
> -Garrett
> 
The SC_XXX constants are in rather odd order!

 > #define _SC_XOPEN_XCU_VERSION   117 /* user */
 > #endif
 >
 > #if __BSD_VISIBLE
 > #define _SC_NPROCESSORS_CONF    57
 > #define _SC_NPROCESSORS_ONLN    58
 > #endif

Does someone just want to save some typing for __BSD_VISIBLE ?
It is wrong if it this true.

Regards,
David Xu


From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 07: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 CE6AE1065694;
	Fri, 29 Oct 2010 07:04:45 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BBD5D8FC16;
	Fri, 29 Oct 2010 07: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 o9T74jph066902;
	Fri, 29 Oct 2010 07:04:45 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9T74j5r066900;
	Fri, 29 Oct 2010 07:04:45 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201010290704.o9T74j5r066900@svn.freebsd.org>
From: David Xu 
Date: Fri, 29 Oct 2010 07:04: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: r214500 - head/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: Fri, 29 Oct 2010 07:04:45 -0000

Author: davidxu
Date: Fri Oct 29 07:04:45 2010
New Revision: 214500
URL: http://svn.freebsd.org/changeset/base/214500

Log:
  Remove local variable 'first', instead check signal number in memory,
  because the variable can be in register, second checking the variable
  may still return true, however this is unexpected.

Modified:
  head/lib/libthr/thread/thr_sig.c

Modified: head/lib/libthr/thread/thr_sig.c
==============================================================================
--- head/lib/libthr/thread/thr_sig.c	Fri Oct 29 02:12:36 2010	(r214499)
+++ head/lib/libthr/thread/thr_sig.c	Fri Oct 29 07:04:45 2010	(r214500)
@@ -317,14 +317,11 @@ check_deferred_signal(struct pthread *cu
 	ucontext_t uc;
 	struct sigaction act;
 	siginfo_t info;
-	volatile int first;
 
 	if (__predict_true(curthread->deferred_siginfo.si_signo == 0))
 		return;
-	first = 1;
 	getcontext(&uc);
-	if (first) {
-		first = 0;
+	if (curthread->deferred_siginfo.si_signo == 0) {
 		act = curthread->deferred_sigact;
 		uc.uc_sigmask = curthread->deferred_sigmask;
 		memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t));

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 08:01: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 CFF29106564A;
	Fri, 29 Oct 2010 08:01:22 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 89BFC8FC15;
	Fri, 29 Oct 2010 08:01: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 o9T81MnK075666;
	Fri, 29 Oct 2010 08:01:22 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9T81MdV075661;
	Fri, 29 Oct 2010 08:01:22 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010290801.o9T81MdV075661@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 08:01:22 +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: r214501 - in vendor/wpa/dist: hostapd patches src
	src/ap src/common src/crypto src/drivers src/eap_common
	src/eap_peer src/eap_server src/eapol_auth src/eapol_supp
	src/hlr_auc_gw src/l2...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 08:01:22 -0000

Author: rpaulo
Date: Fri Oct 29 08:01:21 2010
New Revision: 214501
URL: http://svn.freebsd.org/changeset/base/214501

Log:
  Import wpa_supplicant / hostapd 0.7.3.
  
  Changes:
  
  2010-09-07 - v0.7.3
  	* fixed fallback from failed PMKSA caching into full EAP authentication
  	  [Bug 355]
  	* fixed issue with early D-Bus signals during initialization
  	* fixed X.509 name handling in internal TLS
  	* fixed WPS ER to use corrent Enrollee MAC Address in Credential
  	* fixed scanning routines ot improve AP selection for WPS
  	* added WPS workaround for open networks
  	* fixed WPS Diffie-Hellman derivation to use correct public key length
  	* fixed wpa_supplicant AP mode operations to ignore Supplicant and
  	  scan result events
  	* improved SME operations with nl80211
  	* fixed WPS ER event_id handling in some cases
  	* fixed some issues with bgscan simple to avoid unnecessary scans
  	* fixed issue with l2_packet_ndis overlapped writes corrupting stack
  	  [Bug 328]
  	* updated WinPcap to the latest stable version 4.1.2 in Windows
  	  installer
  
  2010-04-18 - v0.7.2
  	* nl80211: fixed number of issues with roaming
  	* avoid unnecessary roaming if multiple APs with similar signal
  	  strength are present in scan results
  	* add TLS client events and server probing to ease design of
  	  automatic detection of EAP parameters
  	* add option for server certificate matching (SHA256 hash of the
  	  certificate) instead of trusted CA certificate configuration
  	* bsd: Cleaned up driver wrapper and added various low-level
  	  configuration options
  	* wpa_gui-qt4: do not show too frequent WPS AP available events as
  	  tray messages
  	* TNC: fixed issues with fragmentation
  	* EAP-TNC: add Flags field into fragment acknowledgement (needed to
  	  interoperate with other implementations; may potentially breaks
  	  compatibility with older wpa_supplicant/hostapd versions)
  	* wpa_cli: added option for using a separate process to receive event
  	  messages to reduce latency in showing these
  	  (CFLAGS += -DCONFIG_WPA_CLI_FORK=y in .config to enable this)
  	* maximum BSS table size can now be configured (bss_max_count)
  	* BSSes to be included in the BSS table can be filtered based on
  	  configured SSIDs to save memory (filter_ssids)
  	* fix number of issues with IEEE 802.11r/FT; this version is not
  	  backwards compatible with old versions
  	* nl80211: add support for IEEE 802.11r/FT protocol (both over-the-air
  	  and over-the-DS)
  	* add freq_list network configuration parameter to allow the AP
  	  selection to filter out entries based on the operating channel
  	* add signal strength change events for bgscan; this allows more
  	  dynamic changes to background scanning interval based on changes in
  	  the signal strength with the current AP; this improves roaming within
  	  ESS quite a bit, e.g., with bgscan="simple:30:-45:300" in the network
  	  configuration block to request background scans less frequently when
  	  signal strength remains good and to automatically trigger background
  	  scans whenever signal strength drops noticeably
  	  (this is currently only available with nl80211)
  	* add BSSID and reason code (if available) to disconnect event messages
  	* wpa_gui-qt4: more complete support for translating the GUI with
  	  linguist and add German translation
  	* fix DH padding with internal crypto code (mainly, for WPS)
  	* do not trigger initial scan automatically anymore if there are no
  	  enabled networks
  
  2010-01-16 - v0.7.1
  	* cleaned up driver wrapper API (struct wpa_driver_ops); the new API
  	  is not fully backwards compatible, so out-of-tree driver wrappers
  	  will need modifications
  	* cleaned up various module interfaces
  	* merge hostapd and wpa_supplicant developers' documentation into a
  	  single document
  	* nl80211: use explicit deauthentication to clear cfg80211 state to
  	  avoid issues when roaming between APs
  	* dbus: major design changes in the new D-Bus API
  	  (fi.w1.wpa_supplicant1)
  	* nl80211: added support for IBSS networks
  	* added internal debugging mechanism with backtrace support and memory
  	  allocation/freeing validation, etc. tests (CONFIG_WPA_TRACE=y)
  	* added WPS ER unsubscription command to more cleanly unregister from
  	  receiving UPnP events when ER is terminated
  	* cleaned up AP mode operations to avoid need for virtual driver_ops
  	  wrapper
  	* added BSS table to maintain more complete scan result information
  	  over multiple scans (that may include only partial results)
  	* wpa_gui-qt4: update Peers dialog information more dynamically while
  	  the dialog is kept open
  	* fixed PKCS#12 use with OpenSSL 1.0.0
  	* driver_wext: Added cfg80211-specific optimization to avoid some
  	  unnecessary scans and to speed up association
  
  2009-11-21 - v0.7.0
  	* increased wpa_cli ping interval to 5 seconds and made this
  	  configurable with a new command line options (-G)
  	* fixed scan buffer processing with WEXT to handle up to 65535
  	  byte result buffer (previously, limited to 32768 bytes)
  	* allow multiple driver wrappers to be specified on command line
  	  (e.g., -Dnl80211,wext); the first one that is able to initialize the
  	  interface will be used
  	* added support for multiple SSIDs per scan request to optimize
  	  scan_ssid=1 operations in ap_scan=1 mode (i.e., search for hidden
  	  SSIDs); this requires driver support and can currently be used only
  	  with nl80211
  	* added support for WPS USBA out-of-band mechanism with USB Flash
  	  Drives (UFD) (CONFIG_WPS_UFD=y)
  	* driver_ndis: add PAE group address to the multicast address list to
  	  fix wired IEEE 802.1X authentication
  	* fixed IEEE 802.11r key derivation function to match with the standard
  	  (note: this breaks interoperability with previous version) [Bug 303]
  	* added better support for drivers that allow separate authentication
  	  and association commands (e.g., mac80211-based Linux drivers with
  	  nl80211; SME in wpa_supplicant); this allows over-the-air FT protocol
  	  to be used (IEEE 802.11r)
  	* fixed SHA-256 based key derivation function to match with the
  	  standard when using CCMP (for IEEE 802.11r and IEEE 802.11w)
  	  (note: this breaks interoperability with previous version) [Bug 307]
  	* use shared driver wrapper files with hostapd
  	* added AP mode functionality (CONFIG_AP=y) with mode=2 in the network
  	  block; this can be used for open and WPA2-Personal networks
  	  (optionally, with WPS); this links in parts of hostapd functionality
  	  into wpa_supplicant
  	* wpa_gui-qt4: added new Peers dialog to show information about peers
  	  (other devices, including APs and stations, etc. in the neighborhood)
  	* added support for WPS External Registrar functionality (configure APs
  	  and enroll new devices); can be used with wpa_gui-qt4 Peers dialog
  	  and wpa_cli commands wps_er_start, wps_er_stop, wps_er_pin,
  	  wps_er_pbc, wps_er_learn
  	  (this can also be used with a new 'none' driver wrapper if no
  	  wireless device or IEEE 802.1X on wired is needed)
  	* driver_nl80211: multiple updates to provide support for new Linux
  	  nl80211/mac80211 functionality
  	* updated management frame protection to use IEEE Std 802.11w-2009
  	* fixed number of small WPS issues and added workarounds to
  	  interoperate with common deployed broken implementations
  	* added support for NFC out-of-band mechanism with WPS
  	* driver_ndis: fixed wired IEEE 802.1X authentication with PAE group
  	  address frames
  	* added preliminary support for IEEE 802.11r RIC processing
  	* added support for specifying subset of enabled frequencies to scan
  	  (scan_freq option in the network configuration block); this can speed
  	  up scanning process considerably if it is known that only a small
  	  subset of channels is actually used in the network (this is currently
  	  supported only with -Dnl80211)
  	* added a workaround for race condition between receiving the
  	  association event and the following EAPOL-Key
  	* added background scan and roaming infrastructure to allow
  	  network-specific optimizations to be used to improve roaming within
  	  an ESS (same SSID)
  	* added new DBus interface (fi.w1.wpa_supplicant1)

Added:
  vendor/wpa/dist/patches/
  vendor/wpa/dist/patches/openssl-0.9.8-tls-extensions.patch
  vendor/wpa/dist/patches/openssl-0.9.8d-tls-extensions.patch
  vendor/wpa/dist/patches/openssl-0.9.8e-tls-extensions.patch
  vendor/wpa/dist/patches/openssl-0.9.8g-tls-extensions.patch
  vendor/wpa/dist/patches/openssl-0.9.8h-tls-extensions.patch
  vendor/wpa/dist/patches/openssl-0.9.8i-tls-extensions.patch
  vendor/wpa/dist/patches/openssl-0.9.9-session-ticket.patch
  vendor/wpa/dist/src/ap/
  vendor/wpa/dist/src/ap/Makefile   (contents, props changed)
  vendor/wpa/dist/src/ap/accounting.c   (contents, props changed)
  vendor/wpa/dist/src/ap/accounting.h   (contents, props changed)
  vendor/wpa/dist/src/ap/ap_config.c   (contents, props changed)
  vendor/wpa/dist/src/ap/ap_config.h   (contents, props changed)
  vendor/wpa/dist/src/ap/ap_drv_ops.c   (contents, props changed)
  vendor/wpa/dist/src/ap/ap_drv_ops.h   (contents, props changed)
  vendor/wpa/dist/src/ap/ap_list.c   (contents, props changed)
  vendor/wpa/dist/src/ap/ap_list.h   (contents, props changed)
  vendor/wpa/dist/src/ap/ap_mlme.c   (contents, props changed)
  vendor/wpa/dist/src/ap/ap_mlme.h   (contents, props changed)
  vendor/wpa/dist/src/ap/authsrv.c   (contents, props changed)
  vendor/wpa/dist/src/ap/authsrv.h   (contents, props changed)
  vendor/wpa/dist/src/ap/beacon.c   (contents, props changed)
  vendor/wpa/dist/src/ap/beacon.h   (contents, props changed)
  vendor/wpa/dist/src/ap/ctrl_iface_ap.c   (contents, props changed)
  vendor/wpa/dist/src/ap/ctrl_iface_ap.h   (contents, props changed)
  vendor/wpa/dist/src/ap/drv_callbacks.c   (contents, props changed)
  vendor/wpa/dist/src/ap/hostapd.c   (contents, props changed)
  vendor/wpa/dist/src/ap/hostapd.h   (contents, props changed)
  vendor/wpa/dist/src/ap/hw_features.c   (contents, props changed)
  vendor/wpa/dist/src/ap/hw_features.h   (contents, props changed)
  vendor/wpa/dist/src/ap/iapp.c   (contents, props changed)
  vendor/wpa/dist/src/ap/iapp.h   (contents, props changed)
  vendor/wpa/dist/src/ap/ieee802_11.c   (contents, props changed)
  vendor/wpa/dist/src/ap/ieee802_11.h   (contents, props changed)
  vendor/wpa/dist/src/ap/ieee802_11_auth.c   (contents, props changed)
  vendor/wpa/dist/src/ap/ieee802_11_auth.h   (contents, props changed)
  vendor/wpa/dist/src/ap/ieee802_11_ht.c   (contents, props changed)
  vendor/wpa/dist/src/ap/ieee802_1x.c   (contents, props changed)
  vendor/wpa/dist/src/ap/ieee802_1x.h   (contents, props changed)
  vendor/wpa/dist/src/ap/peerkey_auth.c   (contents, props changed)
  vendor/wpa/dist/src/ap/pmksa_cache_auth.c   (contents, props changed)
  vendor/wpa/dist/src/ap/pmksa_cache_auth.h   (contents, props changed)
  vendor/wpa/dist/src/ap/preauth_auth.c   (contents, props changed)
  vendor/wpa/dist/src/ap/preauth_auth.h   (contents, props changed)
  vendor/wpa/dist/src/ap/sta_info.c   (contents, props changed)
  vendor/wpa/dist/src/ap/sta_info.h   (contents, props changed)
  vendor/wpa/dist/src/ap/tkip_countermeasures.c   (contents, props changed)
  vendor/wpa/dist/src/ap/tkip_countermeasures.h   (contents, props changed)
  vendor/wpa/dist/src/ap/utils.c   (contents, props changed)
  vendor/wpa/dist/src/ap/vlan_init.c   (contents, props changed)
  vendor/wpa/dist/src/ap/vlan_init.h   (contents, props changed)
  vendor/wpa/dist/src/ap/wmm.c   (contents, props changed)
  vendor/wpa/dist/src/ap/wmm.h   (contents, props changed)
  vendor/wpa/dist/src/ap/wpa_auth.c   (contents, props changed)
  vendor/wpa/dist/src/ap/wpa_auth.h   (contents, props changed)
  vendor/wpa/dist/src/ap/wpa_auth_ft.c   (contents, props changed)
  vendor/wpa/dist/src/ap/wpa_auth_glue.c   (contents, props changed)
  vendor/wpa/dist/src/ap/wpa_auth_glue.h   (contents, props changed)
  vendor/wpa/dist/src/ap/wpa_auth_i.h   (contents, props changed)
  vendor/wpa/dist/src/ap/wpa_auth_ie.c   (contents, props changed)
  vendor/wpa/dist/src/ap/wpa_auth_ie.h   (contents, props changed)
  vendor/wpa/dist/src/ap/wps_hostapd.c   (contents, props changed)
  vendor/wpa/dist/src/ap/wps_hostapd.h   (contents, props changed)
  vendor/wpa/dist/src/crypto/.gitignore
  vendor/wpa/dist/src/crypto/aes-cbc.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes-ctr.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes-eax.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes-encblock.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes-internal-dec.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes-internal-enc.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes-internal.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes-omac1.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes-unwrap.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes-wrap.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/aes_i.h   (contents, props changed)
  vendor/wpa/dist/src/crypto/crypto_internal-cipher.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/crypto_internal-modexp.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/crypto_internal-rsa.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/crypto_nss.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/des-internal.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/des_i.h   (contents, props changed)
  vendor/wpa/dist/src/crypto/dh_group5.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/dh_group5.h   (contents, props changed)
  vendor/wpa/dist/src/crypto/fips_prf_cryptoapi.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/fips_prf_gnutls.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/fips_prf_internal.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/fips_prf_nss.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/fips_prf_openssl.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/md4-internal.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/md5-internal.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/md5-non-fips.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/md5_i.h   (contents, props changed)
  vendor/wpa/dist/src/crypto/milenage.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/milenage.h   (contents, props changed)
  vendor/wpa/dist/src/crypto/sha1-internal.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/sha1-pbkdf2.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/sha1-tlsprf.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/sha1-tprf.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/sha1_i.h   (contents, props changed)
  vendor/wpa/dist/src/crypto/sha256-internal.c   (contents, props changed)
  vendor/wpa/dist/src/crypto/tls_nss.c   (contents, props changed)
  vendor/wpa/dist/src/drivers/.gitignore
  vendor/wpa/dist/src/drivers/driver_atheros.c   (contents, props changed)
  vendor/wpa/dist/src/drivers/driver_none.c   (contents, props changed)
  vendor/wpa/dist/src/drivers/drivers.mak
  vendor/wpa/dist/src/drivers/linux_ioctl.c   (contents, props changed)
  vendor/wpa/dist/src/drivers/linux_ioctl.h   (contents, props changed)
  vendor/wpa/dist/src/drivers/netlink.c   (contents, props changed)
  vendor/wpa/dist/src/drivers/netlink.h   (contents, props changed)
  vendor/wpa/dist/src/drivers/nl80211_copy.h   (contents, props changed)
  vendor/wpa/dist/src/drivers/wireless_copy.h   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_aka.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_fast.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_gpsk.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_gtc.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_identity.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_ikev2.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_md5.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_methods.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_mschapv2.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_pax.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_peap.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_psk.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_sake.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_sim.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_tls.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_tls_common.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_tnc.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_ttls.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_vendor_test.c   (contents, props changed)
  vendor/wpa/dist/src/eap_server/eap_server_wsc.c   (contents, props changed)
  vendor/wpa/dist/src/eapol_auth/
  vendor/wpa/dist/src/eapol_auth/Makefile   (contents, props changed)
  vendor/wpa/dist/src/eapol_auth/eapol_auth_dump.c   (contents, props changed)
  vendor/wpa/dist/src/eapol_auth/eapol_auth_sm.c   (contents, props changed)
  vendor/wpa/dist/src/eapol_auth/eapol_auth_sm.h   (contents, props changed)
  vendor/wpa/dist/src/eapol_auth/eapol_auth_sm_i.h   (contents, props changed)
  vendor/wpa/dist/src/lib.rules
  vendor/wpa/dist/src/radius/.gitignore
  vendor/wpa/dist/src/tls/.gitignore
  vendor/wpa/dist/src/tls/pkcs1.c   (contents, props changed)
  vendor/wpa/dist/src/tls/pkcs1.h   (contents, props changed)
  vendor/wpa/dist/src/tls/pkcs5.c   (contents, props changed)
  vendor/wpa/dist/src/tls/pkcs5.h   (contents, props changed)
  vendor/wpa/dist/src/tls/pkcs8.c   (contents, props changed)
  vendor/wpa/dist/src/tls/pkcs8.h   (contents, props changed)
  vendor/wpa/dist/src/utils/.gitignore
  vendor/wpa/dist/src/utils/list.h   (contents, props changed)
  vendor/wpa/dist/src/utils/radiotap.c   (contents, props changed)
  vendor/wpa/dist/src/utils/radiotap.h   (contents, props changed)
  vendor/wpa/dist/src/utils/radiotap_iter.h   (contents, props changed)
  vendor/wpa/dist/src/utils/trace.c   (contents, props changed)
  vendor/wpa/dist/src/utils/trace.h   (contents, props changed)
  vendor/wpa/dist/src/wps/http.h   (contents, props changed)
  vendor/wpa/dist/src/wps/http_client.c   (contents, props changed)
  vendor/wpa/dist/src/wps/http_client.h   (contents, props changed)
  vendor/wpa/dist/src/wps/http_server.c   (contents, props changed)
  vendor/wpa/dist/src/wps/http_server.h   (contents, props changed)
  vendor/wpa/dist/src/wps/ndef.c   (contents, props changed)
  vendor/wpa/dist/src/wps/upnp_xml.c   (contents, props changed)
  vendor/wpa/dist/src/wps/upnp_xml.h   (contents, props changed)
  vendor/wpa/dist/src/wps/wps_er.c   (contents, props changed)
  vendor/wpa/dist/src/wps/wps_er.h   (contents, props changed)
  vendor/wpa/dist/src/wps/wps_er_ssdp.c   (contents, props changed)
  vendor/wpa/dist/src/wps/wps_nfc.c   (contents, props changed)
  vendor/wpa/dist/src/wps/wps_nfc_pn531.c   (contents, props changed)
  vendor/wpa/dist/src/wps/wps_ufd.c   (contents, props changed)
  vendor/wpa/dist/src/wps/wps_upnp_ap.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/.gitignore
  vendor/wpa/dist/wpa_supplicant/ap.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/ap.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/bgscan.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/bgscan.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/bgscan_simple.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/bss.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/bss.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/
  vendor/wpa/dist/wpa_supplicant/dbus/.gitignore
  vendor/wpa/dist/wpa_supplicant/dbus/Makefile   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus-wpa_supplicant.conf   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_common.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_common.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_common_i.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_dict_helpers.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_dict_helpers.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_new.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_new.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers_wps.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_helpers.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_helpers.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_introspect.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_old.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_old.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_old_handlers.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_old_handlers.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/dbus_old_handlers_wps.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
  vendor/wpa/dist/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
  vendor/wpa/dist/wpa_supplicant/doc/docbook/.gitignore
  vendor/wpa/dist/wpa_supplicant/driver_i.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/eap_register.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/examples/60_wpa_supplicant   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/examples/wpas-dbus-new-getall.py   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/examples/wpas-dbus-new-signals.py   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/examples/wpas-dbus-new-wps.py   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/examples/wpas-dbus-new.py   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/ibss_rsn.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/ibss_rsn.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/notify.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/notify.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/scan.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/sme.c   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/sme.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/.gitignore
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/icons/ap.svg
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/icons/laptop.svg
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/lang/
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/lang/.gitignore
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/lang/wpa_gui_de.ts
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/peers.cpp   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/peers.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/peers.ui
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/stringquery.cpp   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/stringquery.h   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/wpa_gui/.gitignore
  vendor/wpa/dist/wpa_supplicant/xcode/
  vendor/wpa/dist/wpa_supplicant/xcode/wpa_supplicant.xcodeproj/
  vendor/wpa/dist/wpa_supplicant/xcode/wpa_supplicant.xcodeproj/project.pbxproj
Deleted:
  vendor/wpa/dist/hostapd/
  vendor/wpa/dist/src/common/nl80211_copy.h
  vendor/wpa/dist/src/common/wireless_copy.h
  vendor/wpa/dist/src/crypto/aes.c
  vendor/wpa/dist/src/crypto/aes_wrap.c
  vendor/wpa/dist/src/crypto/des.c
  vendor/wpa/dist/src/crypto/md4.c
  vendor/wpa/dist/src/crypto/rc4.h
  vendor/wpa/dist/src/drivers/driver_prism54.c
  vendor/wpa/dist/src/drivers/driver_ps3.c
  vendor/wpa/dist/src/drivers/radiotap.c
  vendor/wpa/dist/src/drivers/radiotap.h
  vendor/wpa/dist/src/drivers/radiotap_iter.h
  vendor/wpa/dist/src/drivers/scan_helpers.c
  vendor/wpa/dist/src/eap_server/eap.c
  vendor/wpa/dist/src/eap_server/eap_aka.c
  vendor/wpa/dist/src/eap_server/eap_fast.c
  vendor/wpa/dist/src/eap_server/eap_gpsk.c
  vendor/wpa/dist/src/eap_server/eap_gtc.c
  vendor/wpa/dist/src/eap_server/eap_identity.c
  vendor/wpa/dist/src/eap_server/eap_ikev2.c
  vendor/wpa/dist/src/eap_server/eap_md5.c
  vendor/wpa/dist/src/eap_server/eap_methods.c
  vendor/wpa/dist/src/eap_server/eap_mschapv2.c
  vendor/wpa/dist/src/eap_server/eap_pax.c
  vendor/wpa/dist/src/eap_server/eap_peap.c
  vendor/wpa/dist/src/eap_server/eap_psk.c
  vendor/wpa/dist/src/eap_server/eap_sake.c
  vendor/wpa/dist/src/eap_server/eap_sim.c
  vendor/wpa/dist/src/eap_server/eap_tls.c
  vendor/wpa/dist/src/eap_server/eap_tls_common.c
  vendor/wpa/dist/src/eap_server/eap_tnc.c
  vendor/wpa/dist/src/eap_server/eap_ttls.c
  vendor/wpa/dist/src/eap_server/eap_vendor_test.c
  vendor/wpa/dist/src/eap_server/eap_wsc.c
  vendor/wpa/dist/src/hlr_auc_gw/Makefile
  vendor/wpa/dist/src/hlr_auc_gw/hlr_auc_gw.c
  vendor/wpa/dist/src/hlr_auc_gw/hlr_auc_gw.milenage_db
  vendor/wpa/dist/src/hlr_auc_gw/milenage.c
  vendor/wpa/dist/src/hlr_auc_gw/milenage.h
  vendor/wpa/dist/src/tls/asn1_test.c
  vendor/wpa/dist/wpa_supplicant/ctrl_iface_dbus.c
  vendor/wpa/dist/wpa_supplicant/ctrl_iface_dbus.h
  vendor/wpa/dist/wpa_supplicant/ctrl_iface_dbus_handlers.c
  vendor/wpa/dist/wpa_supplicant/ctrl_iface_dbus_handlers.h
  vendor/wpa/dist/wpa_supplicant/dbus-wpa_supplicant.conf
  vendor/wpa/dist/wpa_supplicant/dbus-wpa_supplicant.service
  vendor/wpa/dist/wpa_supplicant/dbus_dict_helpers.c
  vendor/wpa/dist/wpa_supplicant/dbus_dict_helpers.h
  vendor/wpa/dist/wpa_supplicant/doc/code_structure.doxygen
  vendor/wpa/dist/wpa_supplicant/doc/ctrl_iface.doxygen
  vendor/wpa/dist/wpa_supplicant/doc/doxygen.fast
  vendor/wpa/dist/wpa_supplicant/doc/doxygen.full
  vendor/wpa/dist/wpa_supplicant/doc/driver_wrapper.doxygen
  vendor/wpa/dist/wpa_supplicant/doc/eap.doxygen
  vendor/wpa/dist/wpa_supplicant/doc/kerneldoc2doxygen.pl
  vendor/wpa/dist/wpa_supplicant/doc/mainpage.doxygen
  vendor/wpa/dist/wpa_supplicant/doc/porting.doxygen
  vendor/wpa/dist/wpa_supplicant/doc/testing_tools.doxygen
  vendor/wpa/dist/wpa_supplicant/doc/wpa_supplicant.fig
  vendor/wpa/dist/wpa_supplicant/tests/test_aes.c
  vendor/wpa/dist/wpa_supplicant/tests/test_md4.c
  vendor/wpa/dist/wpa_supplicant/tests/test_md5.c
  vendor/wpa/dist/wpa_supplicant/tests/test_ms_funcs.c
  vendor/wpa/dist/wpa_supplicant/tests/test_sha1.c
  vendor/wpa/dist/wpa_supplicant/tests/test_sha256.c
  vendor/wpa/dist/wpa_supplicant/tests/test_x509v3.c
  vendor/wpa/dist/wpa_supplicant/tests/test_x509v3_nist.sh
  vendor/wpa/dist/wpa_supplicant/tests/test_x509v3_nist2.sh
Modified:
  vendor/wpa/dist/src/Makefile
  vendor/wpa/dist/src/common/Makefile
  vendor/wpa/dist/src/common/defs.h
  vendor/wpa/dist/src/common/ieee802_11_common.c
  vendor/wpa/dist/src/common/ieee802_11_common.h
  vendor/wpa/dist/src/common/ieee802_11_defs.h
  vendor/wpa/dist/src/common/privsep_commands.h
  vendor/wpa/dist/src/common/version.h
  vendor/wpa/dist/src/common/wpa_common.c
  vendor/wpa/dist/src/common/wpa_common.h
  vendor/wpa/dist/src/common/wpa_ctrl.h
  vendor/wpa/dist/src/crypto/Makefile
  vendor/wpa/dist/src/crypto/aes.h
  vendor/wpa/dist/src/crypto/crypto.h
  vendor/wpa/dist/src/crypto/crypto_cryptoapi.c
  vendor/wpa/dist/src/crypto/crypto_gnutls.c
  vendor/wpa/dist/src/crypto/crypto_internal.c
  vendor/wpa/dist/src/crypto/crypto_libtomcrypt.c
  vendor/wpa/dist/src/crypto/crypto_none.c
  vendor/wpa/dist/src/crypto/crypto_openssl.c
  vendor/wpa/dist/src/crypto/dh_groups.c
  vendor/wpa/dist/src/crypto/md5.c
  vendor/wpa/dist/src/crypto/md5.h
  vendor/wpa/dist/src/crypto/ms_funcs.c
  vendor/wpa/dist/src/crypto/ms_funcs.h
  vendor/wpa/dist/src/crypto/rc4.c
  vendor/wpa/dist/src/crypto/sha1.c
  vendor/wpa/dist/src/crypto/sha1.h
  vendor/wpa/dist/src/crypto/sha256.c
  vendor/wpa/dist/src/crypto/tls.h
  vendor/wpa/dist/src/crypto/tls_gnutls.c
  vendor/wpa/dist/src/crypto/tls_internal.c
  vendor/wpa/dist/src/crypto/tls_none.c
  vendor/wpa/dist/src/crypto/tls_openssl.c
  vendor/wpa/dist/src/crypto/tls_schannel.c
  vendor/wpa/dist/src/drivers/Makefile
  vendor/wpa/dist/src/drivers/driver.h
  vendor/wpa/dist/src/drivers/driver_atmel.c
  vendor/wpa/dist/src/drivers/driver_broadcom.c
  vendor/wpa/dist/src/drivers/driver_bsd.c
  vendor/wpa/dist/src/drivers/driver_hostap.c
  vendor/wpa/dist/src/drivers/driver_hostap.h
  vendor/wpa/dist/src/drivers/driver_iphone.m
  vendor/wpa/dist/src/drivers/driver_ipw.c
  vendor/wpa/dist/src/drivers/driver_madwifi.c
  vendor/wpa/dist/src/drivers/driver_ndis.c
  vendor/wpa/dist/src/drivers/driver_ndis.h
  vendor/wpa/dist/src/drivers/driver_ndiswrapper.c
  vendor/wpa/dist/src/drivers/driver_nl80211.c
  vendor/wpa/dist/src/drivers/driver_osx.m
  vendor/wpa/dist/src/drivers/driver_privsep.c
  vendor/wpa/dist/src/drivers/driver_ralink.c
  vendor/wpa/dist/src/drivers/driver_ralink.h
  vendor/wpa/dist/src/drivers/driver_roboswitch.c
  vendor/wpa/dist/src/drivers/driver_test.c
  vendor/wpa/dist/src/drivers/driver_wext.c
  vendor/wpa/dist/src/drivers/driver_wext.h
  vendor/wpa/dist/src/drivers/driver_wired.c
  vendor/wpa/dist/src/drivers/drivers.c
  vendor/wpa/dist/src/drivers/priv_netlink.h
  vendor/wpa/dist/src/eap_common/Makefile
  vendor/wpa/dist/src/eap_common/chap.c
  vendor/wpa/dist/src/eap_common/chap.h
  vendor/wpa/dist/src/eap_common/eap_fast_common.c
  vendor/wpa/dist/src/eap_common/eap_gpsk_common.c
  vendor/wpa/dist/src/eap_common/eap_pax_common.c
  vendor/wpa/dist/src/eap_common/eap_peap_common.c
  vendor/wpa/dist/src/eap_common/eap_psk_common.c
  vendor/wpa/dist/src/eap_common/eap_sake_common.c
  vendor/wpa/dist/src/eap_common/eap_sim_common.c
  vendor/wpa/dist/src/eap_common/eap_sim_common.h
  vendor/wpa/dist/src/eap_common/ikev2_common.c
  vendor/wpa/dist/src/eap_peer/Makefile
  vendor/wpa/dist/src/eap_peer/eap.c
  vendor/wpa/dist/src/eap_peer/eap.h
  vendor/wpa/dist/src/eap_peer/eap_aka.c
  vendor/wpa/dist/src/eap_peer/eap_config.h
  vendor/wpa/dist/src/eap_peer/eap_fast.c
  vendor/wpa/dist/src/eap_peer/eap_fast_pac.c
  vendor/wpa/dist/src/eap_peer/eap_leap.c
  vendor/wpa/dist/src/eap_peer/eap_md5.c
  vendor/wpa/dist/src/eap_peer/eap_methods.c
  vendor/wpa/dist/src/eap_peer/eap_methods.h
  vendor/wpa/dist/src/eap_peer/eap_mschapv2.c
  vendor/wpa/dist/src/eap_peer/eap_pax.c
  vendor/wpa/dist/src/eap_peer/eap_peap.c
  vendor/wpa/dist/src/eap_peer/eap_psk.c
  vendor/wpa/dist/src/eap_peer/eap_sim.c
  vendor/wpa/dist/src/eap_peer/eap_tls.c
  vendor/wpa/dist/src/eap_peer/eap_tls_common.c
  vendor/wpa/dist/src/eap_peer/eap_tls_common.h
  vendor/wpa/dist/src/eap_peer/eap_tnc.c
  vendor/wpa/dist/src/eap_peer/eap_ttls.c
  vendor/wpa/dist/src/eap_peer/eap_wsc.c
  vendor/wpa/dist/src/eap_peer/ikev2.c
  vendor/wpa/dist/src/eap_peer/mschapv2.c
  vendor/wpa/dist/src/eap_peer/mschapv2.h
  vendor/wpa/dist/src/eap_server/Makefile
  vendor/wpa/dist/src/eap_server/eap.h
  vendor/wpa/dist/src/eap_server/eap_i.h
  vendor/wpa/dist/src/eap_server/eap_methods.h
  vendor/wpa/dist/src/eap_server/eap_sim_db.c
  vendor/wpa/dist/src/eap_server/eap_sim_db.h
  vendor/wpa/dist/src/eap_server/eap_tls_common.h
  vendor/wpa/dist/src/eap_server/ikev2.c
  vendor/wpa/dist/src/eap_server/tncs.c
  vendor/wpa/dist/src/eapol_supp/Makefile
  vendor/wpa/dist/src/eapol_supp/eapol_supp_sm.c
  vendor/wpa/dist/src/eapol_supp/eapol_supp_sm.h
  vendor/wpa/dist/src/l2_packet/Makefile
  vendor/wpa/dist/src/l2_packet/l2_packet_freebsd.c
  vendor/wpa/dist/src/l2_packet/l2_packet_ndis.c
  vendor/wpa/dist/src/l2_packet/l2_packet_privsep.c
  vendor/wpa/dist/src/radius/Makefile
  vendor/wpa/dist/src/radius/radius.c
  vendor/wpa/dist/src/radius/radius.h
  vendor/wpa/dist/src/radius/radius_client.c
  vendor/wpa/dist/src/radius/radius_client.h
  vendor/wpa/dist/src/radius/radius_server.c
  vendor/wpa/dist/src/radius/radius_server.h
  vendor/wpa/dist/src/rsn_supp/Makefile
  vendor/wpa/dist/src/rsn_supp/peerkey.c
  vendor/wpa/dist/src/rsn_supp/pmksa_cache.c
  vendor/wpa/dist/src/rsn_supp/pmksa_cache.h
  vendor/wpa/dist/src/rsn_supp/preauth.c
  vendor/wpa/dist/src/rsn_supp/preauth.h
  vendor/wpa/dist/src/rsn_supp/wpa.c
  vendor/wpa/dist/src/rsn_supp/wpa.h
  vendor/wpa/dist/src/rsn_supp/wpa_ft.c
  vendor/wpa/dist/src/rsn_supp/wpa_i.h
  vendor/wpa/dist/src/rsn_supp/wpa_ie.c
  vendor/wpa/dist/src/rsn_supp/wpa_ie.h
  vendor/wpa/dist/src/tls/Makefile
  vendor/wpa/dist/src/tls/asn1.c
  vendor/wpa/dist/src/tls/asn1.h
  vendor/wpa/dist/src/tls/rsa.c
  vendor/wpa/dist/src/tls/tlsv1_client.c
  vendor/wpa/dist/src/tls/tlsv1_client_read.c
  vendor/wpa/dist/src/tls/tlsv1_client_write.c
  vendor/wpa/dist/src/tls/tlsv1_common.h
  vendor/wpa/dist/src/tls/tlsv1_cred.c
  vendor/wpa/dist/src/tls/tlsv1_record.c
  vendor/wpa/dist/src/tls/tlsv1_record.h
  vendor/wpa/dist/src/tls/tlsv1_server.c
  vendor/wpa/dist/src/tls/tlsv1_server_read.c
  vendor/wpa/dist/src/tls/tlsv1_server_write.c
  vendor/wpa/dist/src/tls/x509v3.c
  vendor/wpa/dist/src/tls/x509v3.h
  vendor/wpa/dist/src/utils/Makefile
  vendor/wpa/dist/src/utils/base64.c
  vendor/wpa/dist/src/utils/build_config.h
  vendor/wpa/dist/src/utils/common.c
  vendor/wpa/dist/src/utils/common.h
  vendor/wpa/dist/src/utils/eloop.c
  vendor/wpa/dist/src/utils/eloop.h
  vendor/wpa/dist/src/utils/eloop_none.c
  vendor/wpa/dist/src/utils/eloop_win.c
  vendor/wpa/dist/src/utils/ip_addr.h
  vendor/wpa/dist/src/utils/os.h
  vendor/wpa/dist/src/utils/os_internal.c
  vendor/wpa/dist/src/utils/os_unix.c
  vendor/wpa/dist/src/utils/uuid.c
  vendor/wpa/dist/src/utils/uuid.h
  vendor/wpa/dist/src/utils/wpa_debug.c
  vendor/wpa/dist/src/utils/wpa_debug.h
  vendor/wpa/dist/src/utils/wpabuf.c
  vendor/wpa/dist/src/utils/wpabuf.h
  vendor/wpa/dist/src/wps/Makefile
  vendor/wpa/dist/src/wps/httpread.c
  vendor/wpa/dist/src/wps/httpread.h
  vendor/wpa/dist/src/wps/wps.c
  vendor/wpa/dist/src/wps/wps.h
  vendor/wpa/dist/src/wps/wps_attr_build.c
  vendor/wpa/dist/src/wps/wps_attr_parse.c
  vendor/wpa/dist/src/wps/wps_attr_process.c
  vendor/wpa/dist/src/wps/wps_common.c
  vendor/wpa/dist/src/wps/wps_defs.h
  vendor/wpa/dist/src/wps/wps_dev_attr.c
  vendor/wpa/dist/src/wps/wps_enrollee.c
  vendor/wpa/dist/src/wps/wps_i.h
  vendor/wpa/dist/src/wps/wps_registrar.c
  vendor/wpa/dist/src/wps/wps_upnp.c
  vendor/wpa/dist/src/wps/wps_upnp.h
  vendor/wpa/dist/src/wps/wps_upnp_event.c
  vendor/wpa/dist/src/wps/wps_upnp_i.h
  vendor/wpa/dist/src/wps/wps_upnp_ssdp.c
  vendor/wpa/dist/src/wps/wps_upnp_web.c
  vendor/wpa/dist/wpa_supplicant/ChangeLog
  vendor/wpa/dist/wpa_supplicant/Makefile
  vendor/wpa/dist/wpa_supplicant/README
  vendor/wpa/dist/wpa_supplicant/README-WPS
  vendor/wpa/dist/wpa_supplicant/config.c
  vendor/wpa/dist/wpa_supplicant/config.h
  vendor/wpa/dist/wpa_supplicant/config_file.c
  vendor/wpa/dist/wpa_supplicant/config_ssid.h
  vendor/wpa/dist/wpa_supplicant/config_winreg.c
  vendor/wpa/dist/wpa_supplicant/ctrl_iface.c
  vendor/wpa/dist/wpa_supplicant/ctrl_iface_named_pipe.c
  vendor/wpa/dist/wpa_supplicant/ctrl_iface_udp.c
  vendor/wpa/dist/wpa_supplicant/ctrl_iface_unix.c
  vendor/wpa/dist/wpa_supplicant/defconfig
  vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_background.8
  vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_cli.8
  vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_gui.8
  vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_passphrase.8
  vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_priv.8
  vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_supplicant.8
  vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5
  vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_supplicant.sgml
  vendor/wpa/dist/wpa_supplicant/eapol_test.c
  vendor/wpa/dist/wpa_supplicant/events.c
  vendor/wpa/dist/wpa_supplicant/main.c
  vendor/wpa/dist/wpa_supplicant/mlme.c
  vendor/wpa/dist/wpa_supplicant/mlme.h
  vendor/wpa/dist/wpa_supplicant/nmake.mak
  vendor/wpa/dist/wpa_supplicant/preauth_test.c
  vendor/wpa/dist/wpa_supplicant/scan.c
  vendor/wpa/dist/wpa_supplicant/symbian/wpa_supplicant.mmp
  vendor/wpa/dist/wpa_supplicant/tests/test_eap_sim_common.c
  vendor/wpa/dist/wpa_supplicant/tests/test_wpa.c
  vendor/wpa/dist/wpa_supplicant/todo.txt
  vendor/wpa/dist/wpa_supplicant/vs2005/eapol_test/eapol_test.vcproj
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_cli/wpa_cli.vcproj
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_passphrase/wpa_passphrase.vcproj
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj
  vendor/wpa/dist/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj
  vendor/wpa/dist/wpa_supplicant/wpa_cli.c
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/addinterface.cpp
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/eventhistory.cpp
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/icons.qrc
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/icons/Makefile
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/icons/README
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/icons_png.qrc
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/main.cpp
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/networkconfig.ui
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/userdatarequest.cpp
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/wpa_gui.pro
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/wpagui.h
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/wpagui.ui
  vendor/wpa/dist/wpa_supplicant/wpa_gui/scanresults.ui
  vendor/wpa/dist/wpa_supplicant/wpa_gui/userdatarequest.ui
  vendor/wpa/dist/wpa_supplicant/wpa_gui/wpa_gui.pro
  vendor/wpa/dist/wpa_supplicant/wpa_gui/wpagui.ui
  vendor/wpa/dist/wpa_supplicant/wpa_passphrase.c
  vendor/wpa/dist/wpa_supplicant/wpa_priv.c
  vendor/wpa/dist/wpa_supplicant/wpa_supplicant.c
  vendor/wpa/dist/wpa_supplicant/wpa_supplicant.conf
  vendor/wpa/dist/wpa_supplicant/wpa_supplicant.nsi
  vendor/wpa/dist/wpa_supplicant/wpa_supplicant_i.h
  vendor/wpa/dist/wpa_supplicant/wpas_glue.c
  vendor/wpa/dist/wpa_supplicant/wps_supplicant.c
  vendor/wpa/dist/wpa_supplicant/wps_supplicant.h

Added: vendor/wpa/dist/patches/openssl-0.9.8-tls-extensions.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/wpa/dist/patches/openssl-0.9.8-tls-extensions.patch	Fri Oct 29 08:01:21 2010	(r214501)
@@ -0,0 +1,429 @@
+This patch is adding support for TLS hello extensions and externally
+generated pre-shared key material to OpenSSL 0.9.8. This is
+based on the patch from Alexey Kobozev 
+(sent to openssl-dev mailing list on Tue, 07 Jun 2005 15:40:58 +0300).
+
+
+
+diff -uprN openssl-0.9.8.orig/include/openssl/ssl.h openssl-0.9.8/include/openssl/ssl.h
+--- openssl-0.9.8.orig/include/openssl/ssl.h	2005-06-10 12:51:16.000000000 -0700
++++ openssl-0.9.8/include/openssl/ssl.h	2005-07-19 20:02:15.000000000 -0700
+@@ -340,6 +340,7 @@ extern "C" {
+  * 'struct ssl_st *' function parameters used to prototype callbacks
+  * in SSL_CTX. */
+ typedef struct ssl_st *ssl_crock_st;
++typedef struct tls_extension_st TLS_EXTENSION;
+ 
+ /* used to hold info on the particular ciphers used */
+ typedef struct ssl_cipher_st
+@@ -361,6 +362,8 @@ DECLARE_STACK_OF(SSL_CIPHER)
+ typedef struct ssl_st SSL;
+ typedef struct ssl_ctx_st SSL_CTX;
+ 
++typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg);
++
+ /* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
+ typedef struct ssl_method_st
+ 	{
+@@ -968,6 +971,15 @@ struct ssl_st
+ 	int first_packet;
+ 	int client_version;	/* what was passed, used for
+ 				 * SSLv3/TLS rollback check */
++
++	/* TLS externsions */
++	TLS_EXTENSION *tls_extension;
++	int (*tls_extension_cb)(SSL *s, TLS_EXTENSION *tls_ext, void *arg);
++	void *tls_extension_cb_arg;
++
++	/* TLS pre-shared secret session resumption */
++	tls_session_secret_cb_fn tls_session_secret_cb;
++	void *tls_session_secret_cb_arg;
+ 	};
+ 
+ #ifdef __cplusplus
+@@ -1533,6 +1545,13 @@ void *SSL_COMP_get_compression_methods(v
+ int SSL_COMP_add_compression_method(int id,void *cm);
+ #endif
+ 
++/* TLS extensions functions */
++int SSL_set_hello_extension(SSL *s, int ext_type, void *ext_data, int ext_len);
++int SSL_set_hello_extension_cb(SSL *s, int (*cb)(SSL *, TLS_EXTENSION *, void *), void *arg);
++
++/* Pre-shared secret session resumption functions */
++int SSL_set_session_secret_cb(SSL *s, tls_session_secret_cb_fn tls_session_secret_cb, void *arg);
++
+ /* BEGIN ERROR CODES */
+ /* The following lines are auto generated by the script mkerr.pl. Any changes
+  * made after this point may be overwritten when the script is next run.
+@@ -1714,6 +1733,7 @@ void ERR_load_SSL_strings(void);
+ #define SSL_F_TLS1_ENC					 210
+ #define SSL_F_TLS1_SETUP_KEY_BLOCK			 211
+ #define SSL_F_WRITE_PENDING				 212
++#define SSL_F_SSL_SET_HELLO_EXTENSION	 213
+ 
+ /* Reason codes. */
+ #define SSL_R_APP_DATA_IN_HANDSHAKE			 100
+diff -uprN openssl-0.9.8.orig/include/openssl/tls1.h openssl-0.9.8/include/openssl/tls1.h
+--- openssl-0.9.8.orig/include/openssl/tls1.h	2003-07-22 05:34:21.000000000 -0700
++++ openssl-0.9.8/include/openssl/tls1.h	2005-07-19 20:02:15.000000000 -0700
+@@ -282,6 +282,14 @@ extern "C" {
+ #define TLS_MD_MASTER_SECRET_CONST    "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74"  /*master secret*/
+ #endif
+ 
++/* TLS extension struct */
++struct tls_extension_st
++{
++	unsigned short type;
++	unsigned short length;
++	void *data;
++};
++
+ #ifdef  __cplusplus
+ }
+ #endif
+diff -uprN openssl-0.9.8.orig/ssl/Makefile openssl-0.9.8/ssl/Makefile
+--- openssl-0.9.8.orig/ssl/Makefile	2005-05-30 16:20:30.000000000 -0700
++++ openssl-0.9.8/ssl/Makefile	2005-07-19 20:02:15.000000000 -0700
+@@ -24,7 +24,7 @@ LIBSRC=	\
+ 	s2_meth.c   s2_srvr.c s2_clnt.c  s2_lib.c  s2_enc.c s2_pkt.c \
+ 	s3_meth.c   s3_srvr.c s3_clnt.c  s3_lib.c  s3_enc.c s3_pkt.c s3_both.c \
+ 	s23_meth.c s23_srvr.c s23_clnt.c s23_lib.c          s23_pkt.c \
+-	t1_meth.c   t1_srvr.c t1_clnt.c  t1_lib.c  t1_enc.c \
++	t1_meth.c   t1_srvr.c t1_clnt.c  t1_lib.c  t1_enc.c                    t1_ext.c \
+ 	d1_meth.c   d1_srvr.c d1_clnt.c  d1_lib.c  d1_pkt.c \
+ 	d1_both.c d1_enc.c \
+ 	ssl_lib.c ssl_err2.c ssl_cert.c ssl_sess.c \
+@@ -35,7 +35,7 @@ LIBOBJ= \
+ 	s2_meth.o  s2_srvr.o  s2_clnt.o  s2_lib.o  s2_enc.o s2_pkt.o \
+ 	s3_meth.o  s3_srvr.o  s3_clnt.o  s3_lib.o  s3_enc.o s3_pkt.o s3_both.o \
+ 	s23_meth.o s23_srvr.o s23_clnt.o s23_lib.o          s23_pkt.o \
+-	t1_meth.o   t1_srvr.o t1_clnt.o  t1_lib.o  t1_enc.o \
++	t1_meth.o   t1_srvr.o t1_clnt.o  t1_lib.o  t1_enc.o                    t1_ext.o \
+ 	d1_meth.o   d1_srvr.o d1_clnt.o  d1_lib.o  d1_pkt.o \
+ 	d1_both.o d1_enc.o \
+ 	ssl_lib.o ssl_err2.o ssl_cert.o ssl_sess.o \
+@@ -968,3 +968,4 @@ t1_srvr.o: ../include/openssl/ssl23.h ..
+ t1_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
+ t1_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h
+ t1_srvr.o: ../include/openssl/x509_vfy.h ssl_locl.h t1_srvr.c
++t1_ext.o: t1_ext.c ssl_locl.h
+diff -uprN openssl-0.9.8.orig/ssl/s3_clnt.c openssl-0.9.8/ssl/s3_clnt.c
+--- openssl-0.9.8.orig/ssl/s3_clnt.c	2005-05-16 03:11:03.000000000 -0700
++++ openssl-0.9.8/ssl/s3_clnt.c	2005-07-19 20:02:15.000000000 -0700
+@@ -606,6 +606,20 @@ int ssl3_client_hello(SSL *s)
+ 			}
+ 		*(p++)=0; /* Add the NULL method */
+ 		
++		/* send client hello extensions if any */
++		if (s->version >= TLS1_VERSION && s->tls_extension)
++		{
++			// set the total extensions length
++			s2n(s->tls_extension->length + 4, p);
++
++			// put the extensions with type and length
++			s2n(s->tls_extension->type, p);
++			s2n(s->tls_extension->length, p);
++			
++			memcpy(p, s->tls_extension->data, s->tls_extension->length);
++			p+=s->tls_extension->length;
++		}
++
+ 		l=(p-d);
+ 		d=buf;
+ 		*(d++)=SSL3_MT_CLIENT_HELLO;
+@@ -628,7 +642,7 @@ int ssl3_get_server_hello(SSL *s)
+ 	STACK_OF(SSL_CIPHER) *sk;
+ 	SSL_CIPHER *c;
+ 	unsigned char *p,*d;
+-	int i,al,ok;
++	int i,al,ok,pre_shared;
+ 	unsigned int j;
+ 	long n;
+ 	SSL_COMP *comp;
+@@ -693,7 +707,24 @@ int ssl3_get_server_hello(SSL *s)
+ 		goto f_err;
+ 		}
+ 
+-	if (j != 0 && j == s->session->session_id_length
++	/* check if we want to resume the session based on external pre-shared secret */
++	pre_shared = 0;
++	if (s->version >= TLS1_VERSION && s->tls_session_secret_cb)
++	{
++		SSL_CIPHER *pref_cipher=NULL;
++		s->session->master_key_length=sizeof(s->session->master_key);
++		if (s->tls_session_secret_cb(s, s->session->master_key, &s->session->master_key_length,
++			NULL, &pref_cipher, s->tls_session_secret_cb_arg))
++		{
++			s->hit=1;
++			s->session->cipher=pref_cipher ? pref_cipher : ssl_get_cipher_by_char(s,p+j);
++			s->session->session_id_length = j;
++			memcpy(s->session->session_id, p, j);
++			pre_shared = 1;
++		}
++	}
++
++	if ((pre_shared || j != 0) && j == s->session->session_id_length
+ 	    && memcmp(p,s->session->session_id,j) == 0)
+ 	    {
+ 	    if(s->sid_ctx_length != s->session->sid_ctx_length
+diff -uprN openssl-0.9.8.orig/ssl/s3_srvr.c openssl-0.9.8/ssl/s3_srvr.c
+--- openssl-0.9.8.orig/ssl/s3_srvr.c	2005-05-22 17:32:55.000000000 -0700
++++ openssl-0.9.8/ssl/s3_srvr.c	2005-07-19 20:02:15.000000000 -0700
+@@ -955,6 +955,75 @@ int ssl3_get_client_hello(SSL *s)
+ 		}
+ #endif
+ 
++	/* Check for TLS client hello extension here */
++	if (p < (d+n) && s->version >= TLS1_VERSION)
++	{
++		if (s->tls_extension_cb)
++		{
++			TLS_EXTENSION tls_ext;
++			unsigned short ext_total_len;
++			
++			n2s(p, ext_total_len);
++			n2s(p, tls_ext.type);
++			n2s(p, tls_ext.length);
++
++			// sanity check in TLS extension len
++			if (tls_ext.length > (d+n) - p)
++			{
++				// just cut the lenth to packet border
++				tls_ext.length = (d+n) - p;
++			}
++
++			tls_ext.data = p;
++
++			// returns an alert code or 0
++			al = s->tls_extension_cb(s, &tls_ext, s->tls_extension_cb_arg);
++			if (al != 0)
++			{
++				SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_PEER_ERROR);
++				goto f_err;
++			}
++		}
++	}
++
++	/* Check if we want to use external pre-shared secret for this handshake */
++	/* for not reused session only */
++	if (!s->hit && s->version >= TLS1_VERSION && s->tls_session_secret_cb)
++	{
++		SSL_CIPHER *pref_cipher=NULL;
++
++		s->session->master_key_length=sizeof(s->session->master_key);
++		if(s->tls_session_secret_cb(s, s->session->master_key, &s->session->master_key_length, 
++			ciphers, &pref_cipher, s->tls_session_secret_cb_arg))
++		{
++			s->hit=1;
++			s->session->ciphers=ciphers;
++			s->session->verify_result=X509_V_OK;
++			
++			ciphers=NULL;
++			
++			/* check if some cipher was preferred by call back */
++			pref_cipher=pref_cipher ? pref_cipher : ssl3_choose_cipher(s, s->session->ciphers, SSL_get_ciphers(s));
++			if (pref_cipher == NULL)
++				{
++				al=SSL_AD_HANDSHAKE_FAILURE;
++				SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_NO_SHARED_CIPHER);
++				goto f_err;
++				}
++
++			s->session->cipher=pref_cipher;
++
++			if (s->cipher_list)
++				sk_SSL_CIPHER_free(s->cipher_list);
++
++			if (s->cipher_list_by_id)
++				sk_SSL_CIPHER_free(s->cipher_list_by_id);
++
++			s->cipher_list = sk_SSL_CIPHER_dup(s->session->ciphers);
++			s->cipher_list_by_id = sk_SSL_CIPHER_dup(s->session->ciphers);
++		}
++	}
++
+ 	/* Given s->session->ciphers and SSL_get_ciphers, we must
+ 	 * pick a cipher */
+ 
+diff -uprN openssl-0.9.8.orig/ssl/ssl_err.c openssl-0.9.8/ssl/ssl_err.c
+--- openssl-0.9.8.orig/ssl/ssl_err.c	2005-06-10 12:51:16.000000000 -0700
++++ openssl-0.9.8/ssl/ssl_err.c	2005-07-19 20:02:15.000000000 -0700
+@@ -242,6 +242,7 @@ static ERR_STRING_DATA SSL_str_functs[]=
+ {ERR_FUNC(SSL_F_TLS1_ENC),	"TLS1_ENC"},
+ {ERR_FUNC(SSL_F_TLS1_SETUP_KEY_BLOCK),	"TLS1_SETUP_KEY_BLOCK"},
+ {ERR_FUNC(SSL_F_WRITE_PENDING),	"WRITE_PENDING"},
++{ERR_FUNC(SSL_F_SSL_SET_HELLO_EXTENSION), "SSL_set_hello_extension"},
+ {0,NULL}
+ 	};
+ 
+diff -uprN openssl-0.9.8.orig/ssl/ssl.h openssl-0.9.8/ssl/ssl.h
+--- openssl-0.9.8.orig/ssl/ssl.h	2005-06-10 12:51:16.000000000 -0700
++++ openssl-0.9.8/ssl/ssl.h	2005-07-19 20:02:15.000000000 -0700
+@@ -340,6 +340,7 @@ extern "C" {
+  * 'struct ssl_st *' function parameters used to prototype callbacks
+  * in SSL_CTX. */
+ typedef struct ssl_st *ssl_crock_st;
++typedef struct tls_extension_st TLS_EXTENSION;
+ 
+ /* used to hold info on the particular ciphers used */
+ typedef struct ssl_cipher_st
+@@ -361,6 +362,8 @@ DECLARE_STACK_OF(SSL_CIPHER)
+ typedef struct ssl_st SSL;
+ typedef struct ssl_ctx_st SSL_CTX;
+ 
++typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg);
++
+ /* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
+ typedef struct ssl_method_st
+ 	{
+@@ -968,6 +971,15 @@ struct ssl_st
+ 	int first_packet;
+ 	int client_version;	/* what was passed, used for
+ 				 * SSLv3/TLS rollback check */
++
++	/* TLS externsions */
++	TLS_EXTENSION *tls_extension;
++	int (*tls_extension_cb)(SSL *s, TLS_EXTENSION *tls_ext, void *arg);
++	void *tls_extension_cb_arg;
++
++	/* TLS pre-shared secret session resumption */
++	tls_session_secret_cb_fn tls_session_secret_cb;
++	void *tls_session_secret_cb_arg;
+ 	};
+ 
+ #ifdef __cplusplus
+@@ -1533,6 +1545,13 @@ void *SSL_COMP_get_compression_methods(v
+ int SSL_COMP_add_compression_method(int id,void *cm);
+ #endif
+ 
++/* TLS extensions functions */
++int SSL_set_hello_extension(SSL *s, int ext_type, void *ext_data, int ext_len);
++int SSL_set_hello_extension_cb(SSL *s, int (*cb)(SSL *, TLS_EXTENSION *, void *), void *arg);
++
++/* Pre-shared secret session resumption functions */
++int SSL_set_session_secret_cb(SSL *s, tls_session_secret_cb_fn tls_session_secret_cb, void *arg);
++
+ /* BEGIN ERROR CODES */
+ /* The following lines are auto generated by the script mkerr.pl. Any changes
+  * made after this point may be overwritten when the script is next run.
+@@ -1714,6 +1733,7 @@ void ERR_load_SSL_strings(void);
+ #define SSL_F_TLS1_ENC					 210
+ #define SSL_F_TLS1_SETUP_KEY_BLOCK			 211
+ #define SSL_F_WRITE_PENDING				 212
++#define SSL_F_SSL_SET_HELLO_EXTENSION	 213
+ 
+ /* Reason codes. */
+ #define SSL_R_APP_DATA_IN_HANDSHAKE			 100
+diff -uprN openssl-0.9.8.orig/ssl/ssl_sess.c openssl-0.9.8/ssl/ssl_sess.c
+--- openssl-0.9.8.orig/ssl/ssl_sess.c	2005-04-29 13:10:06.000000000 -0700
++++ openssl-0.9.8/ssl/ssl_sess.c	2005-07-19 20:02:15.000000000 -0700
+@@ -656,6 +656,15 @@ long SSL_CTX_get_timeout(const SSL_CTX *
+ 	return(s->session_timeout);
+ 	}
+ 
++int SSL_set_session_secret_cb(SSL *s, int (*tls_session_secret_cb)(SSL *s, void *secret, int *secret_len, 
++	STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg), void *arg)
++{
++	if (s == NULL) return(0);
++	s->tls_session_secret_cb = tls_session_secret_cb;
++	s->tls_session_secret_cb_arg = arg;
++	return(1);
++}
++
+ typedef struct timeout_param_st
+ 	{
+ 	SSL_CTX *ctx;
+diff -uprN openssl-0.9.8.orig/ssl/t1_ext.c openssl-0.9.8/ssl/t1_ext.c
+--- openssl-0.9.8.orig/ssl/t1_ext.c	1969-12-31 16:00:00.000000000 -0800
++++ openssl-0.9.8/ssl/t1_ext.c	2005-07-19 20:03:29.000000000 -0700
+@@ -0,0 +1,48 @@
++
++#include 
++#include "ssl_locl.h"
++
++
++int SSL_set_hello_extension(SSL *s, int ext_type, void *ext_data, int ext_len)
++{
++	if(s->version >= TLS1_VERSION)
++	{
++		if(s->tls_extension)
++		{
++			OPENSSL_free(s->tls_extension);
++			s->tls_extension = NULL;
++		}
++
++		if(ext_data)
++		{
++			s->tls_extension = OPENSSL_malloc(sizeof(TLS_EXTENSION) + ext_len);
++			if(!s->tls_extension)
++			{
++				SSLerr(SSL_F_SSL_SET_HELLO_EXTENSION, ERR_R_MALLOC_FAILURE);
++				return 0;
++			}
++
++			s->tls_extension->type = ext_type;
++			s->tls_extension->length = ext_len;
++			s->tls_extension->data = s->tls_extension + 1;
++			memcpy(s->tls_extension->data, ext_data, ext_len);
++		}
++
++		return 1;
++	}
++
++	return 0;
++}
++
++int SSL_set_hello_extension_cb(SSL *s, int (*cb)(SSL *, TLS_EXTENSION *, void *), void *arg)
++{
++	if(s->version >= TLS1_VERSION)
++	{
++		s->tls_extension_cb = cb;
++		s->tls_extension_cb_arg = arg;
++
++		return 1;
++	}
++
++	return 0;
++}
+diff -uprN openssl-0.9.8.orig/ssl/t1_lib.c openssl-0.9.8/ssl/t1_lib.c
+--- openssl-0.9.8.orig/ssl/t1_lib.c	2005-04-26 09:02:40.000000000 -0700
++++ openssl-0.9.8/ssl/t1_lib.c	2005-07-19 20:02:15.000000000 -0700
+@@ -131,6 +131,10 @@ int tls1_new(SSL *s)
+ 
+ void tls1_free(SSL *s)
+ 	{
++	if(s->tls_extension)
++	{
++		OPENSSL_free(s->tls_extension);
++	}
+ 	ssl3_free(s);
+ 	}
+ 
+diff -uprN openssl-0.9.8.orig/ssl/tls1.h openssl-0.9.8/ssl/tls1.h
+--- openssl-0.9.8.orig/ssl/tls1.h	2003-07-22 05:34:21.000000000 -0700
++++ openssl-0.9.8/ssl/tls1.h	2005-07-19 20:02:15.000000000 -0700
+@@ -282,6 +282,14 @@ extern "C" {
+ #define TLS_MD_MASTER_SECRET_CONST    "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74"  /*master secret*/
+ #endif
+ 
++/* TLS extension struct */
++struct tls_extension_st
++{
++	unsigned short type;
++	unsigned short length;
++	void *data;
++};
++
+ #ifdef  __cplusplus
+ }
+ #endif
+diff -uprN openssl-0.9.8.orig/util/ssleay.num openssl-0.9.8/util/ssleay.num
+--- openssl-0.9.8.orig/util/ssleay.num	2005-05-08 17:22:02.000000000 -0700
++++ openssl-0.9.8/util/ssleay.num	2005-07-19 20:02:15.000000000 -0700
+@@ -226,3 +226,6 @@ DTLSv1_server_method                    
+ SSL_COMP_get_compression_methods        276	EXIST:!VMS:FUNCTION:COMP
+ SSL_COMP_get_compress_methods           276	EXIST:VMS:FUNCTION:COMP
+ SSL_SESSION_get_id                      277	EXIST::FUNCTION:
++SSL_set_hello_extension			278	EXIST::FUNCTION:
++SSL_set_hello_extension_cb		279	EXIST::FUNCTION:
++SSL_set_session_secret_cb		280	EXIST::FUNCTION:

Added: vendor/wpa/dist/patches/openssl-0.9.8d-tls-extensions.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/wpa/dist/patches/openssl-0.9.8d-tls-extensions.patch	Fri Oct 29 08:01:21 2010	(r214501)
@@ -0,0 +1,429 @@
+This patch is adding support for TLS hello extensions and externally
+generated pre-shared key material to OpenSSL 0.9.8d. This is
+based on the patch from Alexey Kobozev 
+(sent to openssl-dev mailing list on Tue, 07 Jun 2005 15:40:58 +0300).
+
+
+
+diff -uprN openssl-0.9.8d.orig/include/openssl/ssl.h openssl-0.9.8d/include/openssl/ssl.h
+--- openssl-0.9.8d.orig/include/openssl/ssl.h	2006-06-14 06:52:49.000000000 -0700
++++ openssl-0.9.8d/include/openssl/ssl.h	2006-12-10 08:20:02.000000000 -0800
+@@ -345,6 +345,7 @@ extern "C" {
+  * 'struct ssl_st *' function parameters used to prototype callbacks
+  * in SSL_CTX. */
+ typedef struct ssl_st *ssl_crock_st;
++typedef struct tls_extension_st TLS_EXTENSION;
+ 
+ /* used to hold info on the particular ciphers used */
+ typedef struct ssl_cipher_st
+@@ -366,6 +367,8 @@ DECLARE_STACK_OF(SSL_CIPHER)
+ typedef struct ssl_st SSL;
+ typedef struct ssl_ctx_st SSL_CTX;
+ 
++typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg);
++
+ /* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
+ typedef struct ssl_method_st
+ 	{
+@@ -973,6 +976,15 @@ struct ssl_st
+ 	int first_packet;
+ 	int client_version;	/* what was passed, used for
+ 				 * SSLv3/TLS rollback check */
++
++	/* TLS externsions */
++	TLS_EXTENSION *tls_extension;
++	int (*tls_extension_cb)(SSL *s, TLS_EXTENSION *tls_ext, void *arg);
++	void *tls_extension_cb_arg;
++
++	/* TLS pre-shared secret session resumption */
++	tls_session_secret_cb_fn tls_session_secret_cb;
++	void *tls_session_secret_cb_arg;
+ 	};
+ 
+ #ifdef __cplusplus
+@@ -1538,6 +1550,13 @@ void *SSL_COMP_get_compression_methods(v
+ int SSL_COMP_add_compression_method(int id,void *cm);
+ #endif
+ 
++/* TLS extensions functions */
++int SSL_set_hello_extension(SSL *s, int ext_type, void *ext_data, int ext_len);
++int SSL_set_hello_extension_cb(SSL *s, int (*cb)(SSL *, TLS_EXTENSION *, void *), void *arg);
++
++/* Pre-shared secret session resumption functions */
++int SSL_set_session_secret_cb(SSL *s, tls_session_secret_cb_fn tls_session_secret_cb, void *arg);
++
+ /* BEGIN ERROR CODES */
+ /* The following lines are auto generated by the script mkerr.pl. Any changes
+  * made after this point may be overwritten when the script is next run.
+@@ -1719,6 +1738,7 @@ void ERR_load_SSL_strings(void);
+ #define SSL_F_TLS1_ENC					 210
+ #define SSL_F_TLS1_SETUP_KEY_BLOCK			 211
+ #define SSL_F_WRITE_PENDING				 212
++#define SSL_F_SSL_SET_HELLO_EXTENSION	 213
+ 
+ /* Reason codes. */
+ #define SSL_R_APP_DATA_IN_HANDSHAKE			 100
+diff -uprN openssl-0.9.8d.orig/include/openssl/tls1.h openssl-0.9.8d/include/openssl/tls1.h
+--- openssl-0.9.8d.orig/include/openssl/tls1.h	2006-06-14 10:52:01.000000000 -0700
++++ openssl-0.9.8d/include/openssl/tls1.h	2006-12-10 08:20:02.000000000 -0800
+@@ -296,6 +296,14 @@ extern "C" {
+ #define TLS_MD_MASTER_SECRET_CONST    "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74"  /*master secret*/
+ #endif
+ 
++/* TLS extension struct */
++struct tls_extension_st
++{
++	unsigned short type;
++	unsigned short length;
++	void *data;
++};
++
+ #ifdef  __cplusplus
+ }
+ #endif
+diff -uprN openssl-0.9.8d.orig/ssl/Makefile openssl-0.9.8d/ssl/Makefile
+--- openssl-0.9.8d.orig/ssl/Makefile	2006-02-03 17:49:35.000000000 -0800
++++ openssl-0.9.8d/ssl/Makefile	2006-12-10 08:20:02.000000000 -0800
+@@ -24,7 +24,7 @@ LIBSRC=	\
+ 	s2_meth.c   s2_srvr.c s2_clnt.c  s2_lib.c  s2_enc.c s2_pkt.c \
+ 	s3_meth.c   s3_srvr.c s3_clnt.c  s3_lib.c  s3_enc.c s3_pkt.c s3_both.c \
+ 	s23_meth.c s23_srvr.c s23_clnt.c s23_lib.c          s23_pkt.c \
+-	t1_meth.c   t1_srvr.c t1_clnt.c  t1_lib.c  t1_enc.c \
++	t1_meth.c   t1_srvr.c t1_clnt.c  t1_lib.c  t1_enc.c                    t1_ext.c \
+ 	d1_meth.c   d1_srvr.c d1_clnt.c  d1_lib.c  d1_pkt.c \
+ 	d1_both.c d1_enc.c \
+ 	ssl_lib.c ssl_err2.c ssl_cert.c ssl_sess.c \
+@@ -35,7 +35,7 @@ LIBOBJ= \
+ 	s2_meth.o  s2_srvr.o  s2_clnt.o  s2_lib.o  s2_enc.o s2_pkt.o \
+ 	s3_meth.o  s3_srvr.o  s3_clnt.o  s3_lib.o  s3_enc.o s3_pkt.o s3_both.o \
+ 	s23_meth.o s23_srvr.o s23_clnt.o s23_lib.o          s23_pkt.o \
+-	t1_meth.o   t1_srvr.o t1_clnt.o  t1_lib.o  t1_enc.o \
++	t1_meth.o   t1_srvr.o t1_clnt.o  t1_lib.o  t1_enc.o                    t1_ext.o \
+ 	d1_meth.o   d1_srvr.o d1_clnt.o  d1_lib.o  d1_pkt.o \
+ 	d1_both.o d1_enc.o \
+ 	ssl_lib.o ssl_err2.o ssl_cert.o ssl_sess.o \
+@@ -968,3 +968,4 @@ t1_srvr.o: ../include/openssl/ssl23.h ..
+ t1_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
+ t1_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h
+ t1_srvr.o: ../include/openssl/x509_vfy.h ssl_locl.h t1_srvr.c
++t1_ext.o: t1_ext.c ssl_locl.h
+diff -uprN openssl-0.9.8d.orig/ssl/s3_clnt.c openssl-0.9.8d/ssl/s3_clnt.c
+--- openssl-0.9.8d.orig/ssl/s3_clnt.c	2005-12-12 23:41:46.000000000 -0800
++++ openssl-0.9.8d/ssl/s3_clnt.c	2006-12-10 08:20:02.000000000 -0800
+@@ -601,6 +601,20 @@ int ssl3_client_hello(SSL *s)
+ #endif
+ 		*(p++)=0; /* Add the NULL method */
+ 		
++		/* send client hello extensions if any */
++		if (s->version >= TLS1_VERSION && s->tls_extension)
++		{
++			// set the total extensions length
++			s2n(s->tls_extension->length + 4, p);
++
++			// put the extensions with type and length
++			s2n(s->tls_extension->type, p);
++			s2n(s->tls_extension->length, p);
++			
++			memcpy(p, s->tls_extension->data, s->tls_extension->length);
++			p+=s->tls_extension->length;
++		}
++
+ 		l=(p-d);
+ 		d=buf;
+ 		*(d++)=SSL3_MT_CLIENT_HELLO;
+@@ -623,7 +637,7 @@ int ssl3_get_server_hello(SSL *s)
+ 	STACK_OF(SSL_CIPHER) *sk;
+ 	SSL_CIPHER *c;
+ 	unsigned char *p,*d;
+-	int i,al,ok;
++	int i,al,ok,pre_shared;
+ 	unsigned int j;
+ 	long n;
+ #ifndef OPENSSL_NO_COMP
+@@ -690,7 +704,24 @@ int ssl3_get_server_hello(SSL *s)
+ 		goto f_err;
+ 		}
+ 
+-	if (j != 0 && j == s->session->session_id_length
++	/* check if we want to resume the session based on external pre-shared secret */
++	pre_shared = 0;
++	if (s->version >= TLS1_VERSION && s->tls_session_secret_cb)
++	{
++		SSL_CIPHER *pref_cipher=NULL;
++		s->session->master_key_length=sizeof(s->session->master_key);
++		if (s->tls_session_secret_cb(s, s->session->master_key, &s->session->master_key_length,
++			NULL, &pref_cipher, s->tls_session_secret_cb_arg))
++		{
++			s->hit=1;
++			s->session->cipher=pref_cipher ? pref_cipher : ssl_get_cipher_by_char(s,p+j);
++			s->session->session_id_length = j;
++			memcpy(s->session->session_id, p, j);
++			pre_shared = 1;
++		}
++	}
++
++	if ((pre_shared || j != 0) && j == s->session->session_id_length
+ 	    && memcmp(p,s->session->session_id,j) == 0)
+ 	    {
+ 	    if(s->sid_ctx_length != s->session->sid_ctx_length
+diff -uprN openssl-0.9.8d.orig/ssl/s3_srvr.c openssl-0.9.8d/ssl/s3_srvr.c
+--- openssl-0.9.8d.orig/ssl/s3_srvr.c	2006-09-28 04:29:03.000000000 -0700
++++ openssl-0.9.8d/ssl/s3_srvr.c	2006-12-10 08:20:02.000000000 -0800
+@@ -943,6 +943,75 @@ int ssl3_get_client_hello(SSL *s)
+ 		}
+ #endif
+ 
++	/* Check for TLS client hello extension here */
++	if (p < (d+n) && s->version >= TLS1_VERSION)
++	{
++		if (s->tls_extension_cb)
++		{
++			TLS_EXTENSION tls_ext;
++			unsigned short ext_total_len;
++			
++			n2s(p, ext_total_len);
++			n2s(p, tls_ext.type);
++			n2s(p, tls_ext.length);
++
++			// sanity check in TLS extension len
++			if (tls_ext.length > (d+n) - p)
++			{
++				// just cut the lenth to packet border
++				tls_ext.length = (d+n) - p;
++			}
++
++			tls_ext.data = p;
++
++			// returns an alert code or 0
++			al = s->tls_extension_cb(s, &tls_ext, s->tls_extension_cb_arg);
++			if (al != 0)
++			{
++				SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_PEER_ERROR);
++				goto f_err;
++			}
++		}
++	}
++
++	/* Check if we want to use external pre-shared secret for this handshake */
++	/* for not reused session only */
++	if (!s->hit && s->version >= TLS1_VERSION && s->tls_session_secret_cb)
++	{
++		SSL_CIPHER *pref_cipher=NULL;
++
++		s->session->master_key_length=sizeof(s->session->master_key);
++		if(s->tls_session_secret_cb(s, s->session->master_key, &s->session->master_key_length, 
++			ciphers, &pref_cipher, s->tls_session_secret_cb_arg))
++		{
++			s->hit=1;
++			s->session->ciphers=ciphers;
++			s->session->verify_result=X509_V_OK;
++			
++			ciphers=NULL;
++			
++			/* check if some cipher was preferred by call back */
++			pref_cipher=pref_cipher ? pref_cipher : ssl3_choose_cipher(s, s->session->ciphers, SSL_get_ciphers(s));
++			if (pref_cipher == NULL)
++				{
++				al=SSL_AD_HANDSHAKE_FAILURE;
++				SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_NO_SHARED_CIPHER);
++				goto f_err;
++				}
++
++			s->session->cipher=pref_cipher;
++
++			if (s->cipher_list)
++				sk_SSL_CIPHER_free(s->cipher_list);
++
++			if (s->cipher_list_by_id)
++				sk_SSL_CIPHER_free(s->cipher_list_by_id);
++
++			s->cipher_list = sk_SSL_CIPHER_dup(s->session->ciphers);
++			s->cipher_list_by_id = sk_SSL_CIPHER_dup(s->session->ciphers);
++		}
++	}
++
+ 	/* Given s->session->ciphers and SSL_get_ciphers, we must
+ 	 * pick a cipher */
+ 
+diff -uprN openssl-0.9.8d.orig/ssl/ssl.h openssl-0.9.8d/ssl/ssl.h
+--- openssl-0.9.8d.orig/ssl/ssl.h	2006-06-14 06:52:49.000000000 -0700
++++ openssl-0.9.8d/ssl/ssl.h	2006-12-10 08:20:02.000000000 -0800
+@@ -345,6 +345,7 @@ extern "C" {
+  * 'struct ssl_st *' function parameters used to prototype callbacks
+  * in SSL_CTX. */
+ typedef struct ssl_st *ssl_crock_st;
++typedef struct tls_extension_st TLS_EXTENSION;
+ 
+ /* used to hold info on the particular ciphers used */
+ typedef struct ssl_cipher_st
+@@ -366,6 +367,8 @@ DECLARE_STACK_OF(SSL_CIPHER)
+ typedef struct ssl_st SSL;
+ typedef struct ssl_ctx_st SSL_CTX;
+ 
++typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg);
++
+ /* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
+ typedef struct ssl_method_st
+ 	{
+@@ -973,6 +976,15 @@ struct ssl_st
+ 	int first_packet;
+ 	int client_version;	/* what was passed, used for
+ 				 * SSLv3/TLS rollback check */
++
++	/* TLS externsions */
++	TLS_EXTENSION *tls_extension;
++	int (*tls_extension_cb)(SSL *s, TLS_EXTENSION *tls_ext, void *arg);
++	void *tls_extension_cb_arg;
++
++	/* TLS pre-shared secret session resumption */
++	tls_session_secret_cb_fn tls_session_secret_cb;
++	void *tls_session_secret_cb_arg;
+ 	};
+ 
+ #ifdef __cplusplus
+@@ -1538,6 +1550,13 @@ void *SSL_COMP_get_compression_methods(v
+ int SSL_COMP_add_compression_method(int id,void *cm);
+ #endif
+ 
++/* TLS extensions functions */
++int SSL_set_hello_extension(SSL *s, int ext_type, void *ext_data, int ext_len);
++int SSL_set_hello_extension_cb(SSL *s, int (*cb)(SSL *, TLS_EXTENSION *, void *), void *arg);
++
++/* Pre-shared secret session resumption functions */
++int SSL_set_session_secret_cb(SSL *s, tls_session_secret_cb_fn tls_session_secret_cb, void *arg);
++
+ /* BEGIN ERROR CODES */
+ /* The following lines are auto generated by the script mkerr.pl. Any changes
+  * made after this point may be overwritten when the script is next run.
+@@ -1719,6 +1738,7 @@ void ERR_load_SSL_strings(void);
+ #define SSL_F_TLS1_ENC					 210
+ #define SSL_F_TLS1_SETUP_KEY_BLOCK			 211
+ #define SSL_F_WRITE_PENDING				 212
++#define SSL_F_SSL_SET_HELLO_EXTENSION	 213
+ 
+ /* Reason codes. */
+ #define SSL_R_APP_DATA_IN_HANDSHAKE			 100
+diff -uprN openssl-0.9.8d.orig/ssl/ssl_err.c openssl-0.9.8d/ssl/ssl_err.c
+--- openssl-0.9.8d.orig/ssl/ssl_err.c	2006-01-08 13:52:46.000000000 -0800
++++ openssl-0.9.8d/ssl/ssl_err.c	2006-12-10 08:20:02.000000000 -0800
+@@ -242,6 +242,7 @@ static ERR_STRING_DATA SSL_str_functs[]=
+ {ERR_FUNC(SSL_F_TLS1_ENC),	"TLS1_ENC"},
+ {ERR_FUNC(SSL_F_TLS1_SETUP_KEY_BLOCK),	"TLS1_SETUP_KEY_BLOCK"},
+ {ERR_FUNC(SSL_F_WRITE_PENDING),	"WRITE_PENDING"},
++{ERR_FUNC(SSL_F_SSL_SET_HELLO_EXTENSION), "SSL_set_hello_extension"},
+ {0,NULL}
+ 	};
+ 
+diff -uprN openssl-0.9.8d.orig/ssl/ssl_sess.c openssl-0.9.8d/ssl/ssl_sess.c
+--- openssl-0.9.8d.orig/ssl/ssl_sess.c	2005-12-30 15:51:57.000000000 -0800
++++ openssl-0.9.8d/ssl/ssl_sess.c	2006-12-10 08:20:02.000000000 -0800
+@@ -656,6 +656,15 @@ long SSL_CTX_get_timeout(const SSL_CTX *
+ 	return(s->session_timeout);
+ 	}
+ 
++int SSL_set_session_secret_cb(SSL *s, int (*tls_session_secret_cb)(SSL *s, void *secret, int *secret_len, 
++	STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg), void *arg)
++{
++	if (s == NULL) return(0);
++	s->tls_session_secret_cb = tls_session_secret_cb;
++	s->tls_session_secret_cb_arg = arg;
++	return(1);
++}
++
+ typedef struct timeout_param_st
+ 	{
+ 	SSL_CTX *ctx;
+diff -uprN openssl-0.9.8d.orig/ssl/t1_ext.c openssl-0.9.8d/ssl/t1_ext.c
+--- openssl-0.9.8d.orig/ssl/t1_ext.c	1969-12-31 16:00:00.000000000 -0800
++++ openssl-0.9.8d/ssl/t1_ext.c	2006-12-10 08:20:02.000000000 -0800
+@@ -0,0 +1,48 @@
++
++#include 
++#include "ssl_locl.h"
++
++
++int SSL_set_hello_extension(SSL *s, int ext_type, void *ext_data, int ext_len)
++{
++	if(s->version >= TLS1_VERSION)
++	{
++		if(s->tls_extension)
++		{
++			OPENSSL_free(s->tls_extension);
++			s->tls_extension = NULL;
++		}
++
++		if(ext_data)
++		{
++			s->tls_extension = OPENSSL_malloc(sizeof(TLS_EXTENSION) + ext_len);
++			if(!s->tls_extension)
++			{
++				SSLerr(SSL_F_SSL_SET_HELLO_EXTENSION, ERR_R_MALLOC_FAILURE);
++				return 0;
++			}
++
++			s->tls_extension->type = ext_type;
++			s->tls_extension->length = ext_len;
++			s->tls_extension->data = s->tls_extension + 1;
++			memcpy(s->tls_extension->data, ext_data, ext_len);
++		}
++
++		return 1;
++	}
++
++	return 0;
++}
++
++int SSL_set_hello_extension_cb(SSL *s, int (*cb)(SSL *, TLS_EXTENSION *, void *), void *arg)
++{
++	if(s->version >= TLS1_VERSION)
++	{
++		s->tls_extension_cb = cb;
++		s->tls_extension_cb_arg = arg;
++
++		return 1;
++	}
++
++	return 0;
++}
+diff -uprN openssl-0.9.8d.orig/ssl/t1_lib.c openssl-0.9.8d/ssl/t1_lib.c
+--- openssl-0.9.8d.orig/ssl/t1_lib.c	2005-08-05 16:52:07.000000000 -0700
++++ openssl-0.9.8d/ssl/t1_lib.c	2006-12-10 08:20:02.000000000 -0800
+@@ -97,6 +97,10 @@ int tls1_new(SSL *s)
+ 
+ void tls1_free(SSL *s)
+ 	{
++	if(s->tls_extension)
++	{
++		OPENSSL_free(s->tls_extension);
++	}
+ 	ssl3_free(s);
+ 	}
+ 
+diff -uprN openssl-0.9.8d.orig/ssl/tls1.h openssl-0.9.8d/ssl/tls1.h
+--- openssl-0.9.8d.orig/ssl/tls1.h	2006-06-14 10:52:01.000000000 -0700
++++ openssl-0.9.8d/ssl/tls1.h	2006-12-10 08:20:02.000000000 -0800
+@@ -296,6 +296,14 @@ extern "C" {
+ #define TLS_MD_MASTER_SECRET_CONST    "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74"  /*master secret*/
+ #endif
+ 
++/* TLS extension struct */
++struct tls_extension_st
++{
++	unsigned short type;
++	unsigned short length;
++	void *data;
++};
++
+ #ifdef  __cplusplus
+ }
+ #endif
+diff -uprN openssl-0.9.8d.orig/util/ssleay.num openssl-0.9.8d/util/ssleay.num
+--- openssl-0.9.8d.orig/util/ssleay.num	2005-05-08 17:22:02.000000000 -0700
++++ openssl-0.9.8d/util/ssleay.num	2006-12-10 08:20:02.000000000 -0800
+@@ -226,3 +226,6 @@ DTLSv1_server_method                    
+ SSL_COMP_get_compression_methods        276	EXIST:!VMS:FUNCTION:COMP
+ SSL_COMP_get_compress_methods           276	EXIST:VMS:FUNCTION:COMP
+ SSL_SESSION_get_id                      277	EXIST::FUNCTION:
++SSL_set_hello_extension			278	EXIST::FUNCTION:
++SSL_set_hello_extension_cb		279	EXIST::FUNCTION:
++SSL_set_session_secret_cb		280	EXIST::FUNCTION:

Added: vendor/wpa/dist/patches/openssl-0.9.8e-tls-extensions.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/wpa/dist/patches/openssl-0.9.8e-tls-extensions.patch	Fri Oct 29 08:01:21 2010	(r214501)
@@ -0,0 +1,353 @@
+This patch is adding support for TLS hello extensions and externally
+generated pre-shared key material to OpenSSL 0.9.8e. This is
+based on the patch from Alexey Kobozev 
+(sent to openssl-dev mailing list on Tue, 07 Jun 2005 15:40:58 +0300).
+
+
+
+diff -uprN openssl-0.9.8e.orig/ssl/Makefile openssl-0.9.8e/ssl/Makefile
+--- openssl-0.9.8e.orig/ssl/Makefile	2006-02-03 17:49:35.000000000 -0800
++++ openssl-0.9.8e/ssl/Makefile	2007-03-22 20:23:19.000000000 -0700
+@@ -24,7 +24,7 @@ LIBSRC=	\
+ 	s2_meth.c   s2_srvr.c s2_clnt.c  s2_lib.c  s2_enc.c s2_pkt.c \
+ 	s3_meth.c   s3_srvr.c s3_clnt.c  s3_lib.c  s3_enc.c s3_pkt.c s3_both.c \
+ 	s23_meth.c s23_srvr.c s23_clnt.c s23_lib.c          s23_pkt.c \
+-	t1_meth.c   t1_srvr.c t1_clnt.c  t1_lib.c  t1_enc.c \
++	t1_meth.c   t1_srvr.c t1_clnt.c  t1_lib.c  t1_enc.c                    t1_ext.c \
+ 	d1_meth.c   d1_srvr.c d1_clnt.c  d1_lib.c  d1_pkt.c \
+ 	d1_both.c d1_enc.c \
+ 	ssl_lib.c ssl_err2.c ssl_cert.c ssl_sess.c \
+@@ -35,7 +35,7 @@ LIBOBJ= \
+ 	s2_meth.o  s2_srvr.o  s2_clnt.o  s2_lib.o  s2_enc.o s2_pkt.o \
+ 	s3_meth.o  s3_srvr.o  s3_clnt.o  s3_lib.o  s3_enc.o s3_pkt.o s3_both.o \
+ 	s23_meth.o s23_srvr.o s23_clnt.o s23_lib.o          s23_pkt.o \
+-	t1_meth.o   t1_srvr.o t1_clnt.o  t1_lib.o  t1_enc.o \
++	t1_meth.o   t1_srvr.o t1_clnt.o  t1_lib.o  t1_enc.o                    t1_ext.o \
+ 	d1_meth.o   d1_srvr.o d1_clnt.o  d1_lib.o  d1_pkt.o \
+ 	d1_both.o d1_enc.o \
+ 	ssl_lib.o ssl_err2.o ssl_cert.o ssl_sess.o \
+@@ -968,3 +968,4 @@ t1_srvr.o: ../include/openssl/ssl23.h ..
+ t1_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
+ t1_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h
+ t1_srvr.o: ../include/openssl/x509_vfy.h ssl_locl.h t1_srvr.c
++t1_ext.o: t1_ext.c ssl_locl.h
+diff -uprN openssl-0.9.8e.orig/ssl/s3_clnt.c openssl-0.9.8e/ssl/s3_clnt.c
+--- openssl-0.9.8e.orig/ssl/s3_clnt.c	2006-09-28 05:23:15.000000000 -0700
++++ openssl-0.9.8e/ssl/s3_clnt.c	2007-03-22 20:23:19.000000000 -0700
+@@ -601,6 +601,20 @@ int ssl3_client_hello(SSL *s)
+ #endif
+ 		*(p++)=0; /* Add the NULL method */
+ 		
++		/* send client hello extensions if any */
++		if (s->version >= TLS1_VERSION && s->tls_extension)
++		{
++			// set the total extensions length
++			s2n(s->tls_extension->length + 4, p);
++
++			// put the extensions with type and length
++			s2n(s->tls_extension->type, p);
++			s2n(s->tls_extension->length, p);
++			
++			memcpy(p, s->tls_extension->data, s->tls_extension->length);
++			p+=s->tls_extension->length;
++		}
++
+ 		l=(p-d);
+ 		d=buf;
+ 		*(d++)=SSL3_MT_CLIENT_HELLO;
+@@ -623,7 +637,7 @@ int ssl3_get_server_hello(SSL *s)
+ 	STACK_OF(SSL_CIPHER) *sk;
+ 	SSL_CIPHER *c;
+ 	unsigned char *p,*d;
+-	int i,al,ok;
++	int i,al,ok,pre_shared;
+ 	unsigned int j;
+ 	long n;
+ #ifndef OPENSSL_NO_COMP
+@@ -690,7 +704,24 @@ int ssl3_get_server_hello(SSL *s)
+ 		goto f_err;
+ 		}
+ 
+-	if (j != 0 && j == s->session->session_id_length
++	/* check if we want to resume the session based on external pre-shared secret */
++	pre_shared = 0;
++	if (s->version >= TLS1_VERSION && s->tls_session_secret_cb)
++	{
++		SSL_CIPHER *pref_cipher=NULL;
++		s->session->master_key_length=sizeof(s->session->master_key);
++		if (s->tls_session_secret_cb(s, s->session->master_key, &s->session->master_key_length,
++			NULL, &pref_cipher, s->tls_session_secret_cb_arg))
++		{
++			s->hit=1;
++			s->session->cipher=pref_cipher ? pref_cipher : ssl_get_cipher_by_char(s,p+j);
++			s->session->session_id_length = j;
++			memcpy(s->session->session_id, p, j);
++			pre_shared = 1;
++		}
++	}
++
++	if ((pre_shared || j != 0) && j == s->session->session_id_length
+ 	    && memcmp(p,s->session->session_id,j) == 0)
+ 	    {
+ 	    if(s->sid_ctx_length != s->session->sid_ctx_length
+diff -uprN openssl-0.9.8e.orig/ssl/s3_srvr.c openssl-0.9.8e/ssl/s3_srvr.c
+--- openssl-0.9.8e.orig/ssl/s3_srvr.c	2007-02-07 12:36:40.000000000 -0800
++++ openssl-0.9.8e/ssl/s3_srvr.c	2007-03-22 20:23:19.000000000 -0700
+@@ -945,6 +945,75 @@ int ssl3_get_client_hello(SSL *s)
+ 		}
+ #endif
+ 
++	/* Check for TLS client hello extension here */
++	if (p < (d+n) && s->version >= TLS1_VERSION)
++	{
++		if (s->tls_extension_cb)
++		{
++			TLS_EXTENSION tls_ext;
++			unsigned short ext_total_len;
++			
++			n2s(p, ext_total_len);
++			n2s(p, tls_ext.type);
++			n2s(p, tls_ext.length);
++
++			// sanity check in TLS extension len
++			if (tls_ext.length > (d+n) - p)
++			{
++				// just cut the lenth to packet border
++				tls_ext.length = (d+n) - p;
++			}
++
++			tls_ext.data = p;
++
++			// returns an alert code or 0
++			al = s->tls_extension_cb(s, &tls_ext, s->tls_extension_cb_arg);
++			if (al != 0)
++			{
++				SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_PEER_ERROR);
++				goto f_err;
++			}
++		}
++	}
++
++	/* Check if we want to use external pre-shared secret for this handshake */
++	/* for not reused session only */
++	if (!s->hit && s->version >= TLS1_VERSION && s->tls_session_secret_cb)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 08: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 74BFA106566B;
	Fri, 29 Oct 2010 08:02:13 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1363C8FC14;
	Fri, 29 Oct 2010 08: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 o9T82CVX075845;
	Fri, 29 Oct 2010 08:02:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9T82Cqx075844;
	Fri, 29 Oct 2010 08:02:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010290802.o9T82Cqx075844@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 08:02:12 +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: r214502 - vendor/wpa/0.7.3
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 08:02:13 -0000

Author: rpaulo
Date: Fri Oct 29 08:02:12 2010
New Revision: 214502
URL: http://svn.freebsd.org/changeset/base/214502

Log:
  Tag wpa_supplicant / hostapd 0.7.3.

Added:
  vendor/wpa/0.7.3/
     - copied from r214501, vendor/wpa/dist/

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 08:08: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 88296106564A;
	Fri, 29 Oct 2010 08:08:10 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from mail16.syd.optusnet.com.au (mail16.syd.optusnet.com.au
	[211.29.132.197])
	by mx1.freebsd.org (Postfix) with ESMTP id EE4278FC27;
	Fri, 29 Oct 2010 08:08:09 +0000 (UTC)
Received: from server.vk2pj.dyndns.org
	(c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103])
	by mail16.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o9T886eG007109
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 29 Oct 2010 19:08:07 +1100
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id o9T885o5034786;
	Fri, 29 Oct 2010 19:08:05 +1100 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id o9T88578034785;
	Fri, 29 Oct 2010 19:08:05 +1100 (EST) (envelope-from peter)
Date: Fri, 29 Oct 2010 19:08:05 +1100
From: Peter Jeremy 
To: Ulrich Spoerlein 
Message-ID: <20101029080805.GA33527@server.vk2pj.dyndns.org>
References: <201010282018.o9SKIQHU029482@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7"
Content-Disposition: inline
In-Reply-To: <201010282018.o9SKIQHU029482@svn.freebsd.org>
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
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: r214489 - head/usr.sbin/bsnmpd/modules/snmp_hostres
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 08:08:10 -0000


--1yeeQ81UyVL57Vl7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2010-Oct-28 20:18:26 +0000, Ulrich Spoerlein  wrote:
>  Fix CPU load reporting independent of scheduler used.

That's good.

>  I'm unsure if some MIB standard states this must be the load average
>  for, eg. 300s, it looks like net-snmp isn't even bothering to implement
>  the CPU load reporting at all.

I'd be very surprised if there was because (eg) HP Tru64 uses different
load average times.

--=20
Peter Jeremy

--1yeeQ81UyVL57Vl7
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (FreeBSD)

iEYEARECAAYFAkzKgOUACgkQ/opHv/APuIfCwwCgorRt+536y6buG12TFqf0JXc5
xn8An3r53Y+xX7A03ilv83vlfiX/7GHR
=Xli2
-----END PGP SIGNATURE-----

--1yeeQ81UyVL57Vl7--

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 09:21: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 26B5B1065673;
	Fri, 29 Oct 2010 09:21:41 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 125F48FC13;
	Fri, 29 Oct 2010 09:21: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 o9T9Le1O087769;
	Fri, 29 Oct 2010 09:21:40 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9T9LegQ087764;
	Fri, 29 Oct 2010 09:21:40 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010290921.o9T9LegQ087764@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 09:21:40 +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: r214503 - in vendor/wpa/dist/hostapd: . logwatch
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 09:21:41 -0000

Author: rpaulo
Date: Fri Oct 29 09:21:40 2010
New Revision: 214503
URL: http://svn.freebsd.org/changeset/base/214503

Log:
  Import hostapd 0.7.3.
  
  Changes:
  
  2010-09-07 - v0.7.3
  	* fixed re-association after WPS not initializing WPA state machine in
  	  some cases
  	* fixed WPS IE update on reconfiguration
  	* fixed WPS code not to proxy Probe Request frames for foreign SSIDs
  	* added WPS workaround for open networks and some known interop issues
  	* fixed WPS Diffie-Hellman derivation to use correct public key length
  	* fixed FT RRB messages on big endian CPUs
  	* changed WPS protection for brute force AP PIN attacks to disable AP
  	  PIN only temporarily (but with increasing time) to avoid usability
  	  issues on Label-only devices
  	* added wps_ap_pin command for more secure handling of AP PIN
  	  operations (e.g., to generate a random AP PIN and only use it for
  	  short amount of time)
  	* fixed HT STBC negotiation
  
  2010-04-18 - v0.7.2
  	* fix WPS internal Registrar use when an external Registrar is also
  	  active
  	* bsd: Cleaned up driver wrapper and added various low-level
  	  configuration options
  	* TNC: fixed issues with fragmentation
  	* EAP-TNC: add Flags field into fragment acknowledgement (needed to
  	  interoperate with other implementations; may potentially breaks
  	  compatibility with older wpa_supplicant/hostapd versions)
  	* cleaned up driver wrapper API for multi-BSS operations
  	* nl80211: fix multi-BSS and VLAN operations
  	* fix number of issues with IEEE 802.11r/FT; this version is not
  	  backwards compatible with old versions
  	* add SA Query Request processing in AP mode (IEEE 802.11w)
  	* fix IGTK PN in group rekeying (IEEE 802.11w)
  	* fix WPS PBC session overlap detection to use correct attribute
  	* hostapd_notif_Assoc() can now be called with all IEs to simplify
  	  driver wrappers
  	* work around interoperability issue with some WPS External Registrar
  	  implementations
  	* nl80211: fix WPS IE update
  	* hostapd_cli: add support for action script operations (run a script
  	  on hostapd events)
  	* fix DH padding with internal crypto code (mainly, for WPS)
  	* fix WPS association with both WPS IE and WPA/RSN IE present with
  	  driver wrappers that use hostapd MLME (e.g., nl80211)
  
  2010-01-16 - v0.7.1
  	* cleaned up driver wrapper API (struct wpa_driver_ops); the new API
  	  is not fully backwards compatible, so out-of-tree driver wrappers
  	  will need modifications
  	* cleaned up various module interfaces
  	* merge hostapd and wpa_supplicant developers' documentation into a
  	  single document
  	* fixed HT Capabilities IE with nl80211 drivers
  	* moved generic AP functionality code into src/ap
  	* WPS: handle Selected Registrar as union of info from all Registrars
  	* remove obsolte Prism54.org driver wrapper
  	* added internal debugging mechanism with backtrace support and memory
  	  allocation/freeing validation, etc. tests (CONFIG_WPA_TRACE=y)
  	* EAP-FAST server: piggyback Phase 2 start with the end of Phase 1
  	* WPS: add support for dynamically selecting whether to provision the
  	  PSK as an ASCII passphrase or PSK
  	* added support for WDS (4-address frame) mode with per-station virtual
  	  interfaces (wds_sta=1 in config file; only supported with
  	  driver=nl80211 for now)
  	* fixed WPS Probe Request processing to handle missing required
  	  attribute
  	* fixed PKCS#12 use with OpenSSL 1.0.0
  	* detect bridge interface automatically so that bridge parameter in
  	  hostapd.conf becomes optional (though, it may now be used to
  	  automatically add then WLAN interface into a bridge with
  	  driver=nl80211)
  
  2009-11-21 - v0.7.0
  	* increased hostapd_cli ping interval to 5 seconds and made this
  	  configurable with a new command line options (-G)
  	* driver_nl80211: use Linux socket filter to improve performance
  	* added support for external Registrars with WPS (UPnP transport)
  	* 802.11n: scan for overlapping BSSes before starting 20/40 MHz channel
  	* driver_nl80211: fixed STA accounting data collection (TX/RX bytes
  	  reported correctly; TX/RX packets not yet available from kernel)
  	* added support for WPS USBA out-of-band mechanism with USB Flash
  	  Drives (UFD) (CONFIG_WPS_UFD=y)
  	* fixed EAPOL/EAP reauthentication when using an external RADIUS
  	  authentication server
  	* fixed TNC with EAP-TTLS
  	* fixed IEEE 802.11r key derivation function to match with the standard
  	  (note: this breaks interoperability with previous version) [Bug 303]
  	* fixed SHA-256 based key derivation function to match with the
  	  standard when using CCMP (for IEEE 802.11r and IEEE 802.11w)
  	  (note: this breaks interoperability with previous version) [Bug 307]
  	* added number of code size optimizations to remove unnecessary
  	  functionality from the program binary based on build configuration
  	  (part of this automatic; part configurable with CONFIG_NO_* build
  	  options)
  	* use shared driver wrapper files with wpa_supplicant
  	* driver_nl80211: multiple updates to provide support for new Linux
  	  nl80211/mac80211 functionality
  	* updated management frame protection to use IEEE Std 802.11w-2009
  	* fixed number of small WPS issues and added workarounds to
  	  interoperate with common deployed broken implementations
  	* added some IEEE 802.11n co-existance rules to disable 40 MHz channels
  	  or modify primary/secondary channels if needed based on neighboring
  	  networks
  	* added support for NFC out-of-band mechanism with WPS
  	* added preliminary support for IEEE 802.11r RIC processing

Added:
  vendor/wpa/dist/hostapd/
  vendor/wpa/dist/hostapd/.gitignore
  vendor/wpa/dist/hostapd/ChangeLog
  vendor/wpa/dist/hostapd/Makefile   (contents, props changed)
  vendor/wpa/dist/hostapd/README
  vendor/wpa/dist/hostapd/README-WPS
  vendor/wpa/dist/hostapd/config_file.c   (contents, props changed)
  vendor/wpa/dist/hostapd/config_file.h   (contents, props changed)
  vendor/wpa/dist/hostapd/ctrl_iface.c   (contents, props changed)
  vendor/wpa/dist/hostapd/ctrl_iface.h   (contents, props changed)
  vendor/wpa/dist/hostapd/defconfig
  vendor/wpa/dist/hostapd/dump_state.c   (contents, props changed)
  vendor/wpa/dist/hostapd/dump_state.h   (contents, props changed)
  vendor/wpa/dist/hostapd/eap_register.c   (contents, props changed)
  vendor/wpa/dist/hostapd/eap_register.h   (contents, props changed)
  vendor/wpa/dist/hostapd/eap_testing.txt   (contents, props changed)
  vendor/wpa/dist/hostapd/hlr_auc_gw.c   (contents, props changed)
  vendor/wpa/dist/hostapd/hlr_auc_gw.milenage_db
  vendor/wpa/dist/hostapd/hostapd.8   (contents, props changed)
  vendor/wpa/dist/hostapd/hostapd.accept
  vendor/wpa/dist/hostapd/hostapd.conf   (contents, props changed)
  vendor/wpa/dist/hostapd/hostapd.deny
  vendor/wpa/dist/hostapd/hostapd.eap_user
  vendor/wpa/dist/hostapd/hostapd.radius_clients
  vendor/wpa/dist/hostapd/hostapd.sim_db
  vendor/wpa/dist/hostapd/hostapd.vlan
  vendor/wpa/dist/hostapd/hostapd.wpa_psk
  vendor/wpa/dist/hostapd/hostapd_cli.1   (contents, props changed)
  vendor/wpa/dist/hostapd/hostapd_cli.c   (contents, props changed)
  vendor/wpa/dist/hostapd/logwatch/
  vendor/wpa/dist/hostapd/logwatch/README
  vendor/wpa/dist/hostapd/logwatch/hostapd   (contents, props changed)
  vendor/wpa/dist/hostapd/logwatch/hostapd.conf   (contents, props changed)
  vendor/wpa/dist/hostapd/main.c   (contents, props changed)
  vendor/wpa/dist/hostapd/nt_password_hash.c   (contents, props changed)
  vendor/wpa/dist/hostapd/wired.conf   (contents, props changed)

Added: vendor/wpa/dist/hostapd/.gitignore
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/wpa/dist/hostapd/.gitignore	Fri Oct 29 09:21:40 2010	(r214503)
@@ -0,0 +1,7 @@
+*.d
+.config
+driver_conf.c
+hostapd
+hostapd_cli
+hlr_auc_gw
+nt_password_hash

Added: vendor/wpa/dist/hostapd/ChangeLog
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/wpa/dist/hostapd/ChangeLog	Fri Oct 29 09:21:40 2010	(r214503)
@@ -0,0 +1,663 @@
+ChangeLog for hostapd
+
+2010-09-07 - v0.7.3
+	* fixed re-association after WPS not initializing WPA state machine in
+	  some cases
+	* fixed WPS IE update on reconfiguration
+	* fixed WPS code not to proxy Probe Request frames for foreign SSIDs
+	* added WPS workaround for open networks and some known interop issues
+	* fixed WPS Diffie-Hellman derivation to use correct public key length
+	* fixed FT RRB messages on big endian CPUs
+	* changed WPS protection for brute force AP PIN attacks to disable AP
+	  PIN only temporarily (but with increasing time) to avoid usability
+	  issues on Label-only devices
+	* added wps_ap_pin command for more secure handling of AP PIN
+	  operations (e.g., to generate a random AP PIN and only use it for
+	  short amount of time)
+	* fixed HT STBC negotiation
+
+2010-04-18 - v0.7.2
+	* fix WPS internal Registrar use when an external Registrar is also
+	  active
+	* bsd: Cleaned up driver wrapper and added various low-level
+	  configuration options
+	* TNC: fixed issues with fragmentation
+	* EAP-TNC: add Flags field into fragment acknowledgement (needed to
+	  interoperate with other implementations; may potentially breaks
+	  compatibility with older wpa_supplicant/hostapd versions)
+	* cleaned up driver wrapper API for multi-BSS operations
+	* nl80211: fix multi-BSS and VLAN operations
+	* fix number of issues with IEEE 802.11r/FT; this version is not
+	  backwards compatible with old versions
+	* add SA Query Request processing in AP mode (IEEE 802.11w)
+	* fix IGTK PN in group rekeying (IEEE 802.11w)
+	* fix WPS PBC session overlap detection to use correct attribute
+	* hostapd_notif_Assoc() can now be called with all IEs to simplify
+	  driver wrappers
+	* work around interoperability issue with some WPS External Registrar
+	  implementations
+	* nl80211: fix WPS IE update
+	* hostapd_cli: add support for action script operations (run a script
+	  on hostapd events)
+	* fix DH padding with internal crypto code (mainly, for WPS)
+	* fix WPS association with both WPS IE and WPA/RSN IE present with
+	  driver wrappers that use hostapd MLME (e.g., nl80211)
+
+2010-01-16 - v0.7.1
+	* cleaned up driver wrapper API (struct wpa_driver_ops); the new API
+	  is not fully backwards compatible, so out-of-tree driver wrappers
+	  will need modifications
+	* cleaned up various module interfaces
+	* merge hostapd and wpa_supplicant developers' documentation into a
+	  single document
+	* fixed HT Capabilities IE with nl80211 drivers
+	* moved generic AP functionality code into src/ap
+	* WPS: handle Selected Registrar as union of info from all Registrars
+	* remove obsolte Prism54.org driver wrapper
+	* added internal debugging mechanism with backtrace support and memory
+	  allocation/freeing validation, etc. tests (CONFIG_WPA_TRACE=y)
+	* EAP-FAST server: piggyback Phase 2 start with the end of Phase 1
+	* WPS: add support for dynamically selecting whether to provision the
+	  PSK as an ASCII passphrase or PSK
+	* added support for WDS (4-address frame) mode with per-station virtual
+	  interfaces (wds_sta=1 in config file; only supported with
+	  driver=nl80211 for now)
+	* fixed WPS Probe Request processing to handle missing required
+	  attribute
+	* fixed PKCS#12 use with OpenSSL 1.0.0
+	* detect bridge interface automatically so that bridge parameter in
+	  hostapd.conf becomes optional (though, it may now be used to
+	  automatically add then WLAN interface into a bridge with
+	  driver=nl80211)
+
+2009-11-21 - v0.7.0
+	* increased hostapd_cli ping interval to 5 seconds and made this
+	  configurable with a new command line options (-G)
+	* driver_nl80211: use Linux socket filter to improve performance
+	* added support for external Registrars with WPS (UPnP transport)
+	* 802.11n: scan for overlapping BSSes before starting 20/40 MHz channel
+	* driver_nl80211: fixed STA accounting data collection (TX/RX bytes
+	  reported correctly; TX/RX packets not yet available from kernel)
+	* added support for WPS USBA out-of-band mechanism with USB Flash
+	  Drives (UFD) (CONFIG_WPS_UFD=y)
+	* fixed EAPOL/EAP reauthentication when using an external RADIUS
+	  authentication server
+	* fixed TNC with EAP-TTLS
+	* fixed IEEE 802.11r key derivation function to match with the standard
+	  (note: this breaks interoperability with previous version) [Bug 303]
+	* fixed SHA-256 based key derivation function to match with the
+	  standard when using CCMP (for IEEE 802.11r and IEEE 802.11w)
+	  (note: this breaks interoperability with previous version) [Bug 307]
+	* added number of code size optimizations to remove unnecessary
+	  functionality from the program binary based on build configuration
+	  (part of this automatic; part configurable with CONFIG_NO_* build
+	  options)
+	* use shared driver wrapper files with wpa_supplicant
+	* driver_nl80211: multiple updates to provide support for new Linux
+	  nl80211/mac80211 functionality
+	* updated management frame protection to use IEEE Std 802.11w-2009
+	* fixed number of small WPS issues and added workarounds to
+	  interoperate with common deployed broken implementations
+	* added some IEEE 802.11n co-existance rules to disable 40 MHz channels
+	  or modify primary/secondary channels if needed based on neighboring
+	  networks
+	* added support for NFC out-of-band mechanism with WPS
+	* added preliminary support for IEEE 802.11r RIC processing
+
+2009-01-06 - v0.6.7
+	* added support for Wi-Fi Protected Setup (WPS)
+	  (hostapd can now be configured to act as an integrated WPS Registrar
+	  and provision credentials for WPS Enrollees using PIN and PBC
+	  methods; external wireless Registrar can configure the AP, but
+	  external WLAN Manager Registrars are not supported); WPS support can
+	  be enabled by adding CONFIG_WPS=y into .config and setting the
+	  runtime configuration variables in hostapd.conf (see WPS section in
+	  the example configuration file); new hostapd_cli commands wps_pin and
+	  wps_pbc are used to configure WPS negotiation; see README-WPS for
+	  more details
+	* added IEEE 802.11n HT capability configuration (ht_capab)
+	* added support for generating Country IE based on nl80211 regulatory
+	  information (added if ieee80211d=1 in configuration)
+	* fixed WEP authentication (both Open System and Shared Key) with
+	  mac80211
+	* added support for EAP-AKA' (draft-arkko-eap-aka-kdf)
+	* added support for using driver_test over UDP socket
+	* changed EAP-GPSK to use the IANA assigned EAP method type 51
+	* updated management frame protection to use IEEE 802.11w/D7.0
+	* fixed retransmission of EAP requests if no response is received
+
+2008-11-23 - v0.6.6
+	* added a new configuration option, wpa_ptk_rekey, that can be used to
+	  enforce frequent PTK rekeying, e.g., to mitigate some attacks against
+	  TKIP deficiencies
+	* updated OpenSSL code for EAP-FAST to use an updated version of the
+	  session ticket overriding API that was included into the upstream
+	  OpenSSL 0.9.9 tree on 2008-11-15 (no additional OpenSSL patch is
+	  needed with that version anymore)
+	* changed channel flags configuration to read the information from
+	  the driver (e.g., via driver_nl80211 when using mac80211) instead of
+	  using hostapd as the source of the regulatory information (i.e.,
+	  information from CRDA is now used with mac80211); this allows 5 GHz
+	  channels to be used with hostapd (if allowed in the current
+	  regulatory domain)
+	* fixed EAP-TLS message processing for the last TLS message if it is
+	  large enough to require fragmentation (e.g., if a large Session
+	  Ticket data is included)
+	* fixed listen interval configuration for nl80211 drivers
+
+2008-11-01 - v0.6.5
+	* added support for SHA-256 as X.509 certificate digest when using the
+	  internal X.509/TLSv1 implementation
+	* fixed EAP-FAST PAC-Opaque padding (0.6.4 broke this for some peer
+	  identity lengths)
+	* fixed internal TLSv1 implementation for abbreviated handshake (used
+	  by EAP-FAST server)
+	* added support for setting VLAN ID for STAs based on local MAC ACL
+	  (accept_mac_file) as an alternative for RADIUS server-based
+	  configuration
+	* updated management frame protection to use IEEE 802.11w/D6.0
+	  (adds a new association ping to protect against unauthenticated
+	  authenticate or (re)associate request frames dropping association)
+	* added support for using SHA256-based stronger key derivation for WPA2
+	  (IEEE 802.11w)
+	* added new "driver wrapper" for RADIUS-only configuration
+	  (driver=none in hostapd.conf; CONFIG_DRIVER_NONE=y in .config)
+	* fixed WPA/RSN IE validation to verify that the proto (WPA vs. WPA2)
+	  is enabled in configuration
+	* changed EAP-FAST configuration to use separate fields for A-ID and
+	  A-ID-Info (eap_fast_a_id_info) to allow A-ID to be set to a fixed
+	  16-octet len binary value for better interoperability with some peer
+	  implementations; eap_fast_a_id is now configured as a hex string
+	* driver_nl80211: Updated to match the current Linux mac80211 AP mode
+	  configuration (wireless-testing.git and Linux kernel releases
+	  starting from 2.6.29)
+
+2008-08-10 - v0.6.4
+	* added peer identity into EAP-FAST PAC-Opaque and skip Phase 2
+	  Identity Request if identity is already known
+	* added support for EAP Sequences in EAP-FAST Phase 2
+	* added support for EAP-TNC (Trusted Network Connect)
+	  (this version implements the EAP-TNC method and EAP-TTLS/EAP-FAST
+	  changes needed to run two methods in sequence (IF-T) and the IF-IMV
+	  and IF-TNCCS interfaces from TNCS)
+	* added support for optional cryptobinding with PEAPv0
+	* added fragmentation support for EAP-TNC
+	* added support for fragmenting EAP-TTLS/PEAP/FAST Phase 2 (tunneled)
+	  data
+	* added support for opportunistic key caching (OKC)
+
+2008-02-22 - v0.6.3
+	* fixed Reassociation Response callback processing when using internal
+	  MLME (driver_{hostap,nl80211,test}.c)
+	* updated FT support to use the latest draft, IEEE 802.11r/D9.0
+	* copy optional Proxy-State attributes into RADIUS response when acting
+	  as a RADIUS authentication server
+	* fixed EAPOL state machine to handle a case in which no response is
+	  received from the RADIUS authentication server; previous version
+	  could have triggered a crash in some cases after a timeout
+	* fixed EAP-SIM/AKA realm processing to allow decorated usernames to
+	  be used
+	* added a workaround for EAP-SIM/AKA peers that include incorrect null
+	  termination in the username
+	* fixed EAP-SIM/AKA protected result indication to include AT_COUNTER
+	  attribute in notification messages only when using fast
+	  reauthentication
+	* fixed EAP-SIM Start response processing for fast reauthentication
+	  case
+	* added support for pending EAP processing in EAP-{PEAP,TTLS,FAST}
+	  phase 2 to allow EAP-SIM and EAP-AKA to be used as the Phase 2 method
+
+2008-01-01 - v0.6.2
+	* fixed EAP-SIM and EAP-AKA message parser to validate attribute
+	  lengths properly to avoid potential crash caused by invalid messages
+	* added data structure for storing allocated buffers (struct wpabuf);
+	  this does not affect hostapd usage, but many of the APIs changed
+	  and various interfaces (e.g., EAP) is not compatible with old
+	  versions
+	* added support for protecting EAP-AKA/Identity messages with
+	  AT_CHECKCODE (optional feature in RFC 4187)
+	* added support for protected result indication with AT_RESULT_IND for
+	  EAP-SIM and EAP-AKA (eap_sim_aka_result_ind=1)
+	* added support for configuring EAP-TTLS phase 2 non-EAP methods in
+	  EAP server configuration; previously all four were enabled for every
+	  phase 2 user, now all four are disabled by default and need to be
+	  enabled with new method names TTLS-PAP, TTLS-CHAP, TTLS-MSCHAP,
+	  TTLS-MSCHAPV2
+	* removed old debug printing mechanism and the related 'debug'
+	  parameter in the configuration file; debug verbosity is now set with
+	  -d (or -dd) command line arguments
+	* added support for EAP-IKEv2 (draft-tschofenig-eap-ikev2-15.txt);
+	  only shared key/password authentication is supported in this version
+
+2007-11-24 - v0.6.1
+	* added experimental, integrated TLSv1 server implementation with the
+	  needed X.509/ASN.1/RSA/bignum processing (this can be enabled by
+	  setting CONFIG_TLS=internal and CONFIG_INTERNAL_LIBTOMMATH=y in
+	  .config); this can be useful, e.g., if the target system does not
+	  have a suitable TLS library and a minimal code size is required
+	* added support for EAP-FAST server method to the integrated EAP
+	  server
+	* updated EAP Generalized Pre-Shared Key (EAP-GPSK) to use the latest
+	  draft (draft-ietf-emu-eap-gpsk-07.txt)
+	* added a new configuration parameter, rsn_pairwise, to allow different
+	  pairwise cipher suites to be enabled for WPA and RSN/WPA2
+	  (note: if wpa_pairwise differs from rsn_pairwise, the driver will
+	  either need to support this or will have to use the WPA/RSN IEs from
+	  hostapd; currently, the included madwifi and bsd driver interfaces do
+	  not have support for this)
+	* updated FT support to use the latest draft, IEEE 802.11r/D8.0
+
+2007-05-28 - v0.6.0
+	* added experimental IEEE 802.11r/D6.0 support
+	* updated EAP-SAKE to RFC 4763 and the IANA-allocated EAP type 48
+	* updated EAP-PSK to use the IANA-allocated EAP type 47
+	* fixed EAP-PSK bit ordering of the Flags field
+	* fixed configuration reloading (SIGHUP) to re-initialize WPA PSKs
+	  by reading wpa_psk_file [Bug 181]
+	* fixed EAP-TTLS AVP parser processing for too short AVP lengths
+	* fixed IPv6 connection to RADIUS accounting server
+	* updated EAP Generalized Pre-Shared Key (EAP-GPSK) to use the latest
+	  draft (draft-ietf-emu-eap-gpsk-04.txt)
+	* hlr_auc_gw: read GSM triplet file into memory and rotate through the
+	  entries instead of only using the same three triplets every time
+	  (this does not work properly with tests using multiple clients, but
+	  provides bit better triplet data for testing a single client; anyway,
+	  if a better quality triplets are needed, GSM-Milenage should be used
+	  instead of hardcoded triplet file)
+	* fixed EAP-MSCHAPv2 server to use a space between S and M parameters
+	  in Success Request [Bug 203]
+	* added support for sending EAP-AKA Notifications in error cases
+	* updated to use IEEE 802.11w/D2.0 for management frame protection
+	  (still experimental)
+	* RADIUS server: added support for processing duplicate messages
+	  (retransmissions from RADIUS client) by replying with the previous
+	  reply
+
+2006-11-24 - v0.5.6
+	* added support for configuring and controlling multiple BSSes per
+	  radio interface (bss= in hostapd.conf); this is only
+	  available with Devicescape and test driver interfaces
+	* fixed PMKSA cache update in the end of successful RSN
+	  pre-authentication
+	* added support for dynamic VLAN configuration (i.e., selecting VLAN-ID
+	  for each STA based on RADIUS Access-Accept attributes); this requires
+	  VLAN support from the kernel driver/802.11 stack and this is
+	  currently only available with Devicescape and test driver interfaces
+	* driver_madwifi: fixed configuration of unencrypted modes (plaintext
+	  and IEEE 802.1X without WEP)
+	* removed STAKey handshake since PeerKey handshake has replaced it in
+	  IEEE 802.11ma and there are no known deployments of STAKey
+	* updated EAP Generalized Pre-Shared Key (EAP-GPSK) to use the latest
+	  draft (draft-ietf-emu-eap-gpsk-01.txt)
+	* added preliminary implementation of IEEE 802.11w/D1.0 (management
+	  frame protection)
+	  (Note: this requires driver support to work properly.)
+	  (Note2: IEEE 802.11w is an unapproved draft and subject to change.)
+	* hlr_auc_gw: added support for GSM-Milenage (for EAP-SIM)
+	* hlr_auc_gw: added support for reading per-IMSI Milenage keys and
+	  parameters from a text file to make it possible to implement proper
+	  GSM/UMTS authentication server for multiple SIM/USIM cards using
+	  EAP-SIM/EAP-AKA
+	* fixed session timeout processing with drivers that do not use
+	  ieee802_11.c (e.g., madwifi)
+
+2006-08-27 - v0.5.5
+	* added 'hostapd_cli new_sta ' command for adding a new STA into
+	  hostapd (e.g., to initialize wired network authentication based on an
+	  external signal)
+	* fixed hostapd to add PMKID KDE into 4-Way Handshake Message 1 when
+	  using WPA2 even if PMKSA caching is not used
+	* added -P argument for hostapd to write the current process
+	  id into a file
+	* added support for RADIUS Authentication Server MIB (RFC 2619)
+
+2006-06-20 - v0.5.4
+	* fixed nt_password_hash build [Bug 144]
+	* added PeerKey handshake implementation for IEEE 802.11e
+	  direct link setup (DLS) to replace STAKey handshake
+	* added support for EAP Generalized Pre-Shared Key (EAP-GPSK,
+	  draft-clancy-emu-eap-shared-secret-00.txt)
+	* fixed a segmentation fault when RSN pre-authentication was completed
+	  successfully [Bug 152]
+
+2006-04-27 - v0.5.3
+	* do not build nt_password_hash and hlr_auc_gw by default to avoid
+	  requiring a TLS library for a successful build; these programs can be
+	  build with 'make nt_password_hash' and 'make hlr_auc_gw'
+	* added a new configuration option, eapol_version, that can be used to
+	  set EAPOL version to 1 (default is 2) to work around broken client
+	  implementations that drop EAPOL frames which use version number 2
+	  [Bug 89]
+	* added support for EAP-SAKE (no EAP method number allocated yet, so
+	  this is using the same experimental type 255 as EAP-PSK)
+	* fixed EAP-MSCHAPv2 message length validation
+
+2006-03-19 - v0.5.2
+	* fixed stdarg use in hostapd_logger(): if both stdout and syslog
+	  logging was enabled, hostapd could trigger a segmentation fault in
+	  vsyslog on some CPU -- C library combinations
+	* moved HLR/AuC gateway implementation for EAP-SIM/AKA into an external
+	  program to make it easier to use for implementing real SS7 gateway;
+	  eap_sim_db is not anymore used as a file name for GSM authentication
+	  triplets; instead, it is path to UNIX domain socket that will be used
+	  to communicate with the external gateway program (e.g., hlr_auc_gw)
+	* added example HLR/AuC gateway implementation, hlr_auc_gw, that uses
+	  local information (GSM authentication triplets from a text file and
+	  hardcoded AKA authentication data); this can be used to test EAP-SIM
+	  and EAP-AKA
+	* added Milenage algorithm (example 3GPP AKA algorithm) to hlr_auc_gw
+	  to make it possible to test EAP-AKA with real USIM cards (this is
+	  disabled by default; define AKA_USE_MILENAGE when building hlr_auc_gw
+	  to enable this)
+	* driver_madwifi: added support for getting station RSN IE from
+	  madwifi-ng svn r1453 and newer; this fixes RSN that was apparently
+	  broken with earlier change (r1357) in the driver
+	* changed EAP method registration to use a dynamic list of methods
+	  instead of a static list generated at build time
+	* fixed WPA message 3/4 not to encrypt Key Data field (WPA IE)
+	  [Bug 125]
+	* added ap_max_inactivity configuration parameter
+
+2006-01-29 - v0.5.1
+	* driver_test: added better support for multiple APs and STAs by using
+	  a directory with sockets that include MAC address for each device in
+	  the name (test_socket=DIR:/tmp/test)
+	* added support for EAP expanded type (vendor specific EAP methods)
+
+2005-12-18 - v0.5.0 (beginning of 0.5.x development releases)
+	* added experimental STAKey handshake implementation for IEEE 802.11e
+	  direct link setup (DLS); note: this is disabled by default in both
+	  build and runtime configuration (can be enabled with CONFIG_STAKEY=y
+	  and stakey=1)
+	* added support for EAP methods to use callbacks to external programs
+	  by buffering a pending request and processing it after the EAP method
+	  is ready to continue
+	* improved EAP-SIM database interface to allow external request to GSM
+	  HLR/AuC without blocking hostapd process
+	* added support for using EAP-SIM pseudonyms and fast re-authentication
+	* added support for EAP-AKA in the integrated EAP authenticator
+	* added support for matching EAP identity prefixes (e.g., "1"*) in EAP
+	  user database to allow EAP-SIM/AKA selection without extra roundtrip
+	  for EAP-Nak negotiation
+	* added support for storing EAP user password as NtPasswordHash instead
+	  of plaintext password when using MSCHAP or MSCHAPv2 for
+	  authentication (hash:<16-octet hex value>); added nt_password_hash
+	  tool for hashing password to generate NtPasswordHash
+
+2005-11-20 - v0.4.7 (beginning of 0.4.x stable releases)
+	* driver_wired: fixed EAPOL sending to optionally use PAE group address
+	  as the destination instead of supplicant MAC address; this is
+	  disabled by default, but should be enabled with use_pae_group_addr=1
+	  in configuration file if the wired interface is used by only one
+	  device at the time (common switch configuration)
+	* driver_madwifi: configure driver to use TKIP countermeasures in order
+	  to get correct behavior (IEEE 802.11 association failing; previously,
+	  association succeeded, but hostpad forced disassociation immediately)
+	* driver_madwifi: added support for madwifi-ng
+
+2005-10-27 - v0.4.6
+	* added support for replacing user identity from EAP with RADIUS
+	  User-Name attribute from Access-Accept message, if that is included,
+	  for the RADIUS accounting messages (e.g., for EAP-PEAP/TTLS to get
+	  tunneled identity into accounting messages when the RADIUS server
+	  does not support better way of doing this with Class attribute)
+	* driver_madwifi: fixed EAPOL packet receive for configuration where
+	  ath# is part of a bridge interface
+	* added a configuration file and log analyzer script for logwatch
+	* fixed EAPOL state machine step function to process all state
+	  transitions before processing new events; this resolves a race
+	  condition in which EAPOL-Start message could trigger hostapd to send
+	  two EAP-Response/Identity frames to the authentication server
+
+2005-09-25 - v0.4.5
+	* added client CA list to the TLS certificate request in order to make
+	  it easier for the client to select which certificate to use
+	* added experimental support for EAP-PSK
+	* added support for WE-19 (hostap, madwifi)
+
+2005-08-21 - v0.4.4
+	* fixed build without CONFIG_RSN_PREAUTH
+	* fixed FreeBSD build
+
+2005-06-26 - v0.4.3
+	* fixed PMKSA caching to copy User-Name and Class attributes so that
+	  RADIUS accounting gets correct information
+	* start RADIUS accounting only after successful completion of WPA
+	  4-Way Handshake if WPA-PSK is used
+	* fixed PMKSA caching for the case where STA (re)associates without
+	  first disassociating
+
+2005-06-12 - v0.4.2
+	* EAP-PAX is now registered as EAP type 46
+	* fixed EAP-PAX MAC calculation
+	* fixed EAP-PAX CK and ICK key derivation
+	* renamed eap_authenticator configuration variable to eap_server to
+	  better match with RFC 3748 (EAP) terminology
+	* driver_test: added support for testing hostapd with wpa_supplicant
+	  by using test driver interface without any kernel drivers or network
+	  cards
+
+2005-05-22 - v0.4.1
+	* fixed RADIUS server initialization when only auth or acct server
+	  is configured and the other one is left empty
+	* driver_madwifi: added support for RADIUS accounting
+	* driver_madwifi: added preliminary support for compiling against 'BSD'
+	  branch of madwifi CVS tree
+	* driver_madwifi: fixed pairwise key removal to allow WPA reauth
+	  without disassociation
+	* added support for reading additional certificates from PKCS#12 files
+	  and adding them to the certificate chain
+	* fixed RADIUS Class attribute processing to only use Access-Accept
+	  packets to update Class; previously, other RADIUS authentication
+	  packets could have cleared Class attribute
+	* added support for more than one Class attribute in RADIUS packets
+	* added support for verifying certificate revocation list (CRL) when
+	  using integrated EAP authenticator for EAP-TLS; new hostapd.conf
+	  options 'check_crl'; CRL must be included in the ca_cert file for now
+
+2005-04-25 - v0.4.0 (beginning of 0.4.x development releases)
+	* added support for including network information into
+	  EAP-Request/Identity message (ASCII-0 (nul) in eap_message)
+	  (e.g., to implement draft-adrange-eap-network-discovery-07.txt)
+	* fixed a bug which caused some RSN pre-authentication cases to use
+	  freed memory and potentially crash hostapd
+	* fixed private key loading for cases where passphrase is not set
+	* added support for sending TLS alerts and aborting authentication
+	  when receiving a TLS alert
+	* fixed WPA2 to add PMKSA cache entry when using integrated EAP
+	  authenticator
+	* fixed PMKSA caching (EAP authentication was not skipped correctly
+	  with the new state machine changes from IEEE 802.1X draft)
+	* added support for RADIUS over IPv6; own_ip_addr, auth_server_addr,
+	  and acct_server_addr can now be IPv6 addresses (CONFIG_IPV6=y needs
+	  to be added to .config to include IPv6 support); for RADIUS server,
+	  radius_server_ipv6=1 needs to be set in hostapd.conf and addresses
+	  in RADIUS clients file can then use IPv6 format
+	* added experimental support for EAP-PAX
+	* replaced hostapd control interface library (hostapd_ctrl.[ch]) with
+	  the same implementation that wpa_supplicant is using (wpa_ctrl.[ch])
+
+2005-02-12 - v0.3.7 (beginning of 0.3.x stable releases)
+
+2005-01-23 - v0.3.5
+	* added support for configuring a forced PEAP version based on the
+	  Phase 1 identity
+	* fixed PEAPv1 to use tunneled EAP-Success/Failure instead of EAP-TLV
+	  to terminate authentication
+	* fixed EAP identifier duplicate processing with the new IEEE 802.1X
+	  draft
+	* clear accounting data in the driver when starting a new accounting
+	  session
+	* driver_madwifi: filter wireless events based on ifindex to allow more
+	  than one network interface to be used
+	* fixed WPA message 2/4 processing not to cancel timeout for TimeoutEvt
+	  setting if the packet does not pass MIC verification (e.g., due to
+	  incorrect PSK); previously, message 1/4 was not tried again if an
+	  invalid message 2/4 was received
+	* fixed reconfiguration of RADIUS client retransmission timer when
+	  adding a new message to the pending list; previously, timer was not
+	  updated at this point and if there was a pending message with long
+	  time for the next retry, the new message needed to wait that long for
+	  its first retry, too
+
+2005-01-09 - v0.3.4
+	* added support for configuring multiple allowed EAP types for Phase 2
+	  authentication (EAP-PEAP, EAP-TTLS)
+	* fixed EAPOL-Start processing to trigger WPA reauthentication
+	  (previously, only EAPOL authentication was done)
+
+2005-01-02 - v0.3.3
+	* added support for EAP-PEAP in the integrated EAP authenticator
+	* added support for EAP-GTC in the integrated EAP authenticator
+	* added support for configuring list of EAP methods for Phase 1 so that
+	  the integrated EAP authenticator can, e.g., use the wildcard entry
+	  for EAP-TLS and EAP-PEAP
+	* added support for EAP-TTLS in the integrated EAP authenticator
+	* added support for EAP-SIM in the integrated EAP authenticator
+	* added support for using hostapd as a RADIUS authentication server
+	  with the integrated EAP authenticator taking care of EAP
+	  authentication (new hostapd.conf options: radius_server_clients and
+	  radius_server_auth_port); this is not included in default build; use
+	  CONFIG_RADIUS_SERVER=y in .config to include
+
+2004-12-19 - v0.3.2
+	* removed 'daemonize' configuration file option since it has not really
+	  been used at all for more than year
+	* driver_madwifi: fixed group key setup and added get_ssid method
+	* added support for EAP-MSCHAPv2 in the integrated EAP authenticator
+
+2004-12-12 - v0.3.1
+	* added support for integrated EAP-TLS authentication (new hostapd.conf
+	  variables: ca_cert, server_cert, private_key, private_key_passwd);
+	  this enabled dynamic keying (WPA2/WPA/IEEE 802.1X/WEP) without
+	  external RADIUS server
+	* added support for reading PKCS#12 (PFX) files (as a replacement for
+	  PEM/DER) to get certificate and private key (CONFIG_PKCS12)
+
+2004-12-05 - v0.3.0 (beginning of 0.3.x development releases)
+	* added support for Acct-{Input,Output}-Gigawords
+	* added support for Event-Timestamp (in RADIUS Accounting-Requests)
+	* added support for RADIUS Authentication Client MIB (RFC2618)
+	* added support for RADIUS Accounting Client MIB (RFC2620)
+	* made EAP re-authentication period configurable (eap_reauth_period)
+	* fixed EAPOL reauthentication to trigger WPA/WPA2 reauthentication
+	* fixed EAPOL state machine to stop if STA is removed during
+	  eapol_sm_step(); this fixes at least one segfault triggering bug with
+	  IEEE 802.11i pre-authentication
+	* added support for multiple WPA pre-shared keys (e.g., one for each
+	  client MAC address or keys shared by a group of clients);
+	  new hostapd.conf field wpa_psk_file for setting path to a text file
+	  containing PSKs, see hostapd.wpa_psk for an example
+	* added support for multiple driver interfaces to allow hostapd to be
+	  used with other drivers
+	* added wired authenticator driver interface (driver=wired in
+	  hostapd.conf, see wired.conf for example configuration)
+	* added madwifi driver interface (driver=madwifi in hostapd.conf, see
+	  madwifi.conf for example configuration; Note: include files from
+	  madwifi project is needed for building and a configuration file,
+	  .config, needs to be created in hostapd directory with
+	  CONFIG_DRIVER_MADWIFI=y to include this driver interface in hostapd
+	  build)
+	* fixed an alignment issue that could cause SHA-1 to fail on some
+	  platforms (e.g., Intel ixp425 with a compiler that does not 32-bit
+	  align variables)
+	* fixed RADIUS reconnection after an error in sending interim
+	  accounting packets
+	* added hostapd control interface for external programs and an example
+	  CLI, hostapd_cli (like wpa_cli for wpa_supplicant)
+	* started adding dot11, dot1x, radius MIBs ('hostapd_cli mib',
+	  'hostapd_cli sta ')
+	* finished update from IEEE 802.1X-2001 to IEEE 802.1X-REV (now d11)
+	* added support for strict GTK rekeying (wpa_strict_rekey in
+	  hostapd.conf)
+	* updated IAPP to use UDP port 3517 and multicast address 224.0.1.178
+	  (instead of broadcast) for IAPP ADD-notify (moved from draft 3 to
+	  IEEE 802.11F-2003)
+	* added Prism54 driver interface (driver=prism54 in hostapd.conf;
+	  note: .config needs to be created in hostapd directory with
+	  CONFIG_DRIVER_PRISM54=y to include this driver interface in hostapd
+	  build)
+	* dual-licensed hostapd (GPLv2 and BSD licenses)
+	* fixed RADIUS accounting to generate a new session id for cases where
+	  a station reassociates without first being complete deauthenticated
+	* fixed STA disassociation handler to mark next timeout state to
+	  deauthenticate the station, i.e., skip long wait for inactivity poll
+	  and extra disassociation, if the STA disassociates without
+	  deauthenticating
+	* added integrated EAP authenticator that can be used instead of
+	  external RADIUS authentication server; currently, only EAP-MD5 is
+	  supported, so this cannot yet be used for key distribution; the EAP
+	  method interface is generic, though, so adding new EAP methods should
+	  be straightforward; new hostapd.conf variables: 'eap_authenticator'
+	  and 'eap_user_file'; this obsoletes "minimal authentication server"
+	  ('minimal_eap' in hostapd.conf) which is now removed
+	* added support for FreeBSD and driver interface for the BSD net80211
+	  layer (driver=bsd in hostapd.conf and CONFIG_DRIVER_BSD=y in
+	  .config); please note that some of the required kernel mods have not
+	  yet been committed
+
+2004-07-17 - v0.2.4 (beginning of 0.2.x stable releases)
+	* fixed some accounting cases where Accounting-Start was sent when
+	  IEEE 802.1X port was being deauthorized
+
+2004-06-20 - v0.2.3
+	* modified RADIUS client to re-connect the socket in case of certain
+	  error codes that are generated when a network interface state is
+	  changes (e.g., when IP address changes or the interface is set UP)
+	* fixed couple of cases where EAPOL state for a station was freed
+	  twice causing a segfault for hostapd
+	* fixed couple of bugs in processing WPA deauthentication (freed data
+	  was used)
+
+2004-05-31 - v0.2.2
+	* fixed WPA/WPA2 group rekeying to use key index correctly (GN/GM)
+	* fixed group rekeying to send zero TSC in EAPOL-Key messages to fix
+	  cases where STAs dropped multicast frames as replay attacks
+	* added support for copying RADIUS Attribute 'Class' from
+	  authentication messages into accounting messages
+	* send canned EAP failure if RADIUS server sends Access-Reject without
+	  EAP message (previously, Supplicant was not notified in this case)
+	* fixed mixed WPA-PSK and WPA-EAP mode to work with WPA-PSK (i.e., do
+	  not start EAPOL state machines if the STA selected to use WPA-PSK)
+
+2004-05-06 - v0.2.1
+	* added WPA and IEEE 802.11i/RSN (WPA2) Authenticator functionality
+	  - based on IEEE 802.11i/D10.0 but modified to interoperate with WPA
+	    (i.e., IEEE 802.11i/D3.0)
+	  - supports WPA-only, RSN-only, and mixed WPA/RSN mode
+	  - both WPA-PSK and WPA-RADIUS/EAP are supported
+	  - PMKSA caching and pre-authentication
+	  - new hostapd.conf variables: wpa, wpa_psk, wpa_passphrase,
+	    wpa_key_mgmt, wpa_pairwise, wpa_group_rekey, wpa_gmk_rekey,
+	    rsn_preauth, rsn_preauth_interfaces
+	* fixed interim accounting to remove any pending accounting messages
+	  to the STA before sending a new one
+
+2004-02-15 - v0.2.0
+	* added support for Acct-Interim-Interval:
+	  - draft-ietf-radius-acct-interim-01.txt
+	  - use Acct-Interim-Interval attribute from Access-Accept if local
+	    'radius_acct_interim_interval' is not set
+	  - allow different update intervals for each STA
+	* fixed event loop to call signal handlers only after returning from
+	  the real signal handler
+	* reset sta->timeout_next after successful association to make sure
+	  that the previously registered inactivity timer will not remove the
+	  STA immediately (e.g., if STA deauthenticates and re-associates
+	  before the timer is triggered).
+	* added new hostapd.conf variable, nas_identifier, that can be used to
+	  add an optional RADIUS Attribute, NAS-Identifier, into authentication
+	  and accounting messages
+	* added support for Accounting-On and Accounting-Off messages
+	* fixed accounting session handling to send Accounting-Start only once
+	  per session and not to send Accounting-Stop if the session was not
+	  initialized properly
+	* fixed Accounting-Stop statistics in cases where the message was
+	  previously sent after the kernel entry for the STA (and/or IEEE
+	  802.1X data) was removed
+
+
+Note:
+
+Older changes up to and including v0.1.0 are included in the ChangeLog
+of the Host AP driver.

Added: vendor/wpa/dist/hostapd/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/wpa/dist/hostapd/Makefile	Fri Oct 29 09:21:40 2010	(r214503)
@@ -0,0 +1,791 @@
+ifndef CC
+CC=gcc
+endif
+
+ifndef CFLAGS
+CFLAGS = -MMD -O2 -Wall -g
+endif
+
+CFLAGS += -I../src
+CFLAGS += -I../src/utils
+
+# Uncomment following line and set the path to your kernel tree include
+# directory if your C library does not include all header files.
+# CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
+
+-include .config
+
+ifndef CONFIG_OS
+ifdef CONFIG_NATIVE_WINDOWS
+CONFIG_OS=win32
+else
+CONFIG_OS=unix
+endif
+endif
+
+ifeq ($(CONFIG_OS), internal)
+CFLAGS += -DOS_NO_C_LIB_DEFINES
+endif
+
+ifdef CONFIG_NATIVE_WINDOWS
+CFLAGS += -DCONFIG_NATIVE_WINDOWS
+LIBS += -lws2_32
+endif
+
+OBJS += main.o
+OBJS += config_file.o
+
+OBJS += ../src/ap/hostapd.o
+OBJS += ../src/ap/wpa_auth_glue.o
+OBJS += ../src/ap/drv_callbacks.o
+OBJS += ../src/ap/ap_drv_ops.o
+OBJS += ../src/ap/utils.o
+OBJS += ../src/ap/authsrv.o
+OBJS += ../src/ap/ieee802_1x.o
+OBJS += ../src/ap/ap_config.o
+OBJS += ../src/ap/ieee802_11_auth.o
+OBJS += ../src/ap/sta_info.o
+OBJS += ../src/ap/wpa_auth.o
+OBJS += ../src/ap/tkip_countermeasures.o
+OBJS += ../src/ap/ap_mlme.o
+OBJS += ../src/ap/wpa_auth_ie.o
+OBJS += ../src/ap/preauth_auth.o
+OBJS += ../src/ap/pmksa_cache_auth.o
+
+NEED_RC4=y
+NEED_AES=y
+NEED_MD5=y
+NEED_SHA1=y
+
+OBJS += ../src/drivers/drivers.o
+CFLAGS += -DHOSTAPD
+
+ifdef CONFIG_WPA_TRACE
+CFLAGS += -DWPA_TRACE
+OBJS += ../src/utils/trace.o
+LDFLAGS += -rdynamic
+CFLAGS += -funwind-tables
+ifdef CONFIG_WPA_TRACE_BFD
+CFLAGS += -DWPA_TRACE_BFD
+LIBS += -lbfd
+LIBS_c += -lbfd
+endif
+endif
+
+OBJS += ../src/utils/eloop.o
+OBJS += ../src/utils/common.o
+OBJS += ../src/utils/wpa_debug.o
+OBJS += ../src/utils/wpabuf.o
+OBJS += ../src/utils/os_$(CONFIG_OS).o
+OBJS += ../src/utils/ip_addr.o
+
+OBJS += ../src/common/ieee802_11_common.o
+OBJS += ../src/common/wpa_common.o
+
+OBJS += ../src/eapol_auth/eapol_auth_sm.o
+
+
+ifndef CONFIG_NO_DUMP_STATE
+# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
+# a file (undefine it, if you want to save in binary size)
+CFLAGS += -DHOSTAPD_DUMP_STATE
+OBJS += dump_state.o
+OBJS += ../src/eapol_auth/eapol_auth_dump.o
+endif
+
+ifdef CONFIG_NO_RADIUS
+CFLAGS += -DCONFIG_NO_RADIUS
+CONFIG_NO_ACCOUNTING=y
+else
+OBJS += ../src/radius/radius.o
+OBJS += ../src/radius/radius_client.o
+endif
+
+ifdef CONFIG_NO_ACCOUNTING
+CFLAGS += -DCONFIG_NO_ACCOUNTING
+else
+OBJS += ../src/ap/accounting.o
+endif
+
+ifdef CONFIG_NO_VLAN
+CFLAGS += -DCONFIG_NO_VLAN
+else
+OBJS += ../src/ap/vlan_init.o
+endif
+
+ifdef CONFIG_NO_CTRL_IFACE
+CFLAGS += -DCONFIG_NO_CTRL_IFACE
+else
+OBJS += ctrl_iface.o
+OBJS += ../src/ap/ctrl_iface_ap.o
+endif
+
+OBJS += ../src/crypto/md5.o
+
+CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
+
+ifdef CONFIG_IAPP
+CFLAGS += -DCONFIG_IAPP
+OBJS += ../src/ap/iapp.o
+endif
+
+ifdef CONFIG_RSN_PREAUTH
+CFLAGS += -DCONFIG_RSN_PREAUTH
+CONFIG_L2_PACKET=y
+endif
+
+ifdef CONFIG_PEERKEY
+CFLAGS += -DCONFIG_PEERKEY
+OBJS += ../src/ap/peerkey_auth.o
+endif
+
+ifdef CONFIG_IEEE80211W
+CFLAGS += -DCONFIG_IEEE80211W
+NEED_SHA256=y
+NEED_AES_OMAC1=y
+endif
+
+ifdef CONFIG_IEEE80211R
+CFLAGS += -DCONFIG_IEEE80211R
+OBJS += ../src/ap/wpa_auth_ft.o
+NEED_SHA256=y
+NEED_AES_OMAC1=y
+NEED_AES_UNWRAP=y
+endif
+
+ifdef CONFIG_IEEE80211N
+CFLAGS += -DCONFIG_IEEE80211N
+endif
+
+include ../src/drivers/drivers.mak
+OBJS += $(DRV_AP_OBJS)
+CFLAGS += $(DRV_AP_CFLAGS)
+LDFLAGS += $(DRV_AP_LDFLAGS)
+LIBS += $(DRV_AP_LIBS)
+
+ifdef CONFIG_L2_PACKET
+ifdef CONFIG_DNET_PCAP
+ifdef CONFIG_L2_FREEBSD
+LIBS += -lpcap
+OBJS += ../src/l2_packet/l2_packet_freebsd.o
+else
+LIBS += -ldnet -lpcap
+OBJS += ../src/l2_packet/l2_packet_pcap.o
+endif
+else
+OBJS += ../src/l2_packet/l2_packet_linux.o
+endif
+else
+OBJS += ../src/l2_packet/l2_packet_none.o
+endif
+
+
+ifdef CONFIG_EAP_MD5
+CFLAGS += -DEAP_SERVER_MD5
+OBJS += ../src/eap_server/eap_server_md5.o
+CHAP=y
+endif
+
+ifdef CONFIG_EAP_TLS
+CFLAGS += -DEAP_SERVER_TLS
+OBJS += ../src/eap_server/eap_server_tls.o
+TLS_FUNCS=y
+endif
+
+ifdef CONFIG_EAP_PEAP
+CFLAGS += -DEAP_SERVER_PEAP
+OBJS += ../src/eap_server/eap_server_peap.o
+OBJS += ../src/eap_common/eap_peap_common.o
+TLS_FUNCS=y
+CONFIG_EAP_MSCHAPV2=y
+endif
+
+ifdef CONFIG_EAP_TTLS
+CFLAGS += -DEAP_SERVER_TTLS
+OBJS += ../src/eap_server/eap_server_ttls.o
+TLS_FUNCS=y
+CHAP=y
+endif
+
+ifdef CONFIG_EAP_MSCHAPV2
+CFLAGS += -DEAP_SERVER_MSCHAPV2
+OBJS += ../src/eap_server/eap_server_mschapv2.o
+MS_FUNCS=y
+endif
+
+ifdef CONFIG_EAP_GTC
+CFLAGS += -DEAP_SERVER_GTC
+OBJS += ../src/eap_server/eap_server_gtc.o
+endif
+
+ifdef CONFIG_EAP_SIM
+CFLAGS += -DEAP_SERVER_SIM
+OBJS += ../src/eap_server/eap_server_sim.o
+CONFIG_EAP_SIM_COMMON=y
+NEED_AES_CBC=y
+endif
+
+ifdef CONFIG_EAP_AKA
+CFLAGS += -DEAP_SERVER_AKA
+OBJS += ../src/eap_server/eap_server_aka.o
+CONFIG_EAP_SIM_COMMON=y
+NEED_SHA256=y
+NEED_AES_CBC=y
+endif
+
+ifdef CONFIG_EAP_AKA_PRIME
+CFLAGS += -DEAP_SERVER_AKA_PRIME
+endif
+
+ifdef CONFIG_EAP_SIM_COMMON
+OBJS += ../src/eap_common/eap_sim_common.o
+# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
+# replaced with another file implementating the interface specified in
+# eap_sim_db.h.
+OBJS += ../src/eap_server/eap_sim_db.o
+NEED_FIPS186_2_PRF=y
+endif
+
+ifdef CONFIG_EAP_PAX
+CFLAGS += -DEAP_SERVER_PAX
+OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o
+endif
+
+ifdef CONFIG_EAP_PSK
+CFLAGS += -DEAP_SERVER_PSK
+OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o
+NEED_AES_OMAC1=y
+NEED_AES_ENCBLOCK=y
+NEED_AES_EAX=y
+endif
+
+ifdef CONFIG_EAP_SAKE
+CFLAGS += -DEAP_SERVER_SAKE
+OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o
+endif
+
+ifdef CONFIG_EAP_GPSK
+CFLAGS += -DEAP_SERVER_GPSK
+OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o
+ifdef CONFIG_EAP_GPSK_SHA256
+CFLAGS += -DEAP_SERVER_GPSK_SHA256
+endif
+NEED_SHA256=y
+NEED_AES_OMAC1=y
+endif
+
+ifdef CONFIG_EAP_VENDOR_TEST
+CFLAGS += -DEAP_SERVER_VENDOR_TEST
+OBJS += ../src/eap_server/eap_server_vendor_test.o
+endif
+
+ifdef CONFIG_EAP_FAST
+CFLAGS += -DEAP_SERVER_FAST
+OBJS += ../src/eap_server/eap_server_fast.o
+OBJS += ../src/eap_common/eap_fast_common.o
+TLS_FUNCS=y
+NEED_T_PRF=y
+NEED_AES_UNWRAP=y
+endif
+
+ifdef CONFIG_WPS
+CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
+OBJS += ../src/utils/uuid.o
+OBJS += ../src/ap/wps_hostapd.o
+OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o
+OBJS += ../src/wps/wps.o
+OBJS += ../src/wps/wps_common.o
+OBJS += ../src/wps/wps_attr_parse.o
+OBJS += ../src/wps/wps_attr_build.o
+OBJS += ../src/wps/wps_attr_process.o
+OBJS += ../src/wps/wps_dev_attr.o
+OBJS += ../src/wps/wps_enrollee.o
+OBJS += ../src/wps/wps_registrar.o
+NEED_DH_GROUPS=y
+NEED_SHA256=y
+NEED_BASE64=y
+NEED_AES_CBC=y
+NEED_MODEXP=y
+CONFIG_EAP=y
+
+ifdef CONFIG_WPS_UFD
+CFLAGS += -DCONFIG_WPS_UFD
+OBJS += ../src/wps/wps_ufd.o
+NEED_WPS_OOB=y
+endif
+
+ifdef CONFIG_WPS_NFC
+CFLAGS += -DCONFIG_WPS_NFC
+OBJS += ../src/wps/ndef.o
+OBJS += ../src/wps/wps_nfc.o
+NEED_WPS_OOB=y

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 09:22: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 851E9106564A;
	Fri, 29 Oct 2010 09:22:07 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5982E8FC1C;
	Fri, 29 Oct 2010 09:22: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 o9T9M70X087884;
	Fri, 29 Oct 2010 09:22:07 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9T9M7xC087883;
	Fri, 29 Oct 2010 09:22:07 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010290922.o9T9M7xC087883@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 09:22:07 +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: r214504 - vendor/wpa/0.7.3
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 09:22:07 -0000

Author: rpaulo
Date: Fri Oct 29 09:22:07 2010
New Revision: 214504
URL: http://svn.freebsd.org/changeset/base/214504

Log:
  Remove bogus 0.7.3 tag.

Deleted:
  vendor/wpa/0.7.3/

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 09:23: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 BE00D1065670;
	Fri, 29 Oct 2010 09:23:26 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 926618FC12;
	Fri, 29 Oct 2010 09:23: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 o9T9NQPJ088134;
	Fri, 29 Oct 2010 09:23:26 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9T9NQUO088133;
	Fri, 29 Oct 2010 09:23:26 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010290923.o9T9NQUO088133@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 09:23:26 +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: r214505 - vendor/wpa/0.7.3
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 09:23:26 -0000

Author: rpaulo
Date: Fri Oct 29 09:23:26 2010
New Revision: 214505
URL: http://svn.freebsd.org/changeset/base/214505

Log:
  Re-tag wpa_supplicant / hostapd 0.7.3.

Added:
  vendor/wpa/0.7.3/
     - copied from r214504, vendor/wpa/dist/

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 09:35: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 530671065670;
	Fri, 29 Oct 2010 09:35:37 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 419858FC1F;
	Fri, 29 Oct 2010 09:35: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 o9T9ZbXJ089954;
	Fri, 29 Oct 2010 09:35:37 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9T9ZbXH089952;
	Fri, 29 Oct 2010 09:35:37 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201010290935.o9T9ZbXH089952@svn.freebsd.org>
From: David Xu 
Date: Fri, 29 Oct 2010 09:35: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: r214506 - head/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: Fri, 29 Oct 2010 09:35:37 -0000

Author: davidxu
Date: Fri Oct 29 09:35:36 2010
New Revision: 214506
URL: http://svn.freebsd.org/changeset/base/214506

Log:
  Return previous sigaction correctly.
  
  Submitted by:	avg

Modified:
  head/lib/libthr/thread/thr_sig.c

Modified: head/lib/libthr/thread/thr_sig.c
==============================================================================
--- head/lib/libthr/thread/thr_sig.c	Fri Oct 29 09:23:26 2010	(r214505)
+++ head/lib/libthr/thread/thr_sig.c	Fri Oct 29 09:35:36 2010	(r214506)
@@ -547,7 +547,10 @@ _sigaction(int sig, const struct sigacti
 
 	if (oldact.sa_handler != SIG_DFL &&
 	    oldact.sa_handler != SIG_IGN) {
-		oldact = _thr_sigact[sig-1].sigact;
+		if (act != NULL)
+			oldact = oldact2;
+		else if (oact != NULL)
+			oldact = _thr_sigact[sig-1].sigact;
 	}
 
 	_thr_rwl_unlock(&_thr_sigact[sig-1].lock);

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 10:57: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 9A998106564A;
	Fri, 29 Oct 2010 10:57:18 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8913F8FC16;
	Fri, 29 Oct 2010 10:57: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 o9TAvI1b011020;
	Fri, 29 Oct 2010 10:57:18 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TAvIHK011017;
	Fri, 29 Oct 2010 10:57:18 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201010291057.o9TAvIHK011017@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Fri, 29 Oct 2010 10:57: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: r214508 - 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, 29 Oct 2010 10:57:18 -0000

Author: glebius
Date: Fri Oct 29 10:57:18 2010
New Revision: 214508
URL: http://svn.freebsd.org/changeset/base/214508

Log:
  Revert a small part of the r198301, that is entirely unrelated to the
  r198301 itself. It also broke the logic of not sending more than one
  ARP request per second, that consequently lead to a potential problem
  of flooding network with broadcast packets.
  
  MFC after:	1 week

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Fri Oct 29 09:50:28 2010	(r214507)
+++ head/sys/netinet/if_ether.c	Fri Oct 29 10:57:18 2010	(r214508)
@@ -381,7 +381,7 @@ retry:
 		int canceled;
 
 		LLE_ADDREF(la);
-		la->la_expire = time_second + V_arpt_down;
+		la->la_expire = time_second;
 		canceled = callout_reset(&la->la_timer, hz * V_arpt_down,
 		    arptimer, la);
 		if (canceled)

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 11:13: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 CAFF7106564A;
	Fri, 29 Oct 2010 11:13:42 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B93048FC13;
	Fri, 29 Oct 2010 11:13: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 o9TBDgDm014835;
	Fri, 29 Oct 2010 11:13:42 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TBDgZZ014833;
	Fri, 29 Oct 2010 11:13:42 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201010291113.o9TBDgZZ014833@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Fri, 29 Oct 2010 11:13: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: r214509 - 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, 29 Oct 2010 11:13:42 -0000

Author: glebius
Date: Fri Oct 29 11:13:42 2010
New Revision: 214509
URL: http://svn.freebsd.org/changeset/base/214509

Log:
  Remove meaningless XXXXX, that is a remain of comment, removed in r186200.

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Fri Oct 29 10:57:18 2010	(r214508)
+++ head/sys/netinet/if_ether.c	Fri Oct 29 11:13:42 2010	(r214509)
@@ -291,8 +291,6 @@ arpresolve(struct ifnet *ifp, struct rte
 			return (0);
 		}
 	}
-	/* XXXXX
-	 */
 retry:
 	IF_AFDATA_RLOCK(ifp);	
 	la = lla_lookup(LLTABLE(ifp), flags, dst);

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 10:41: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 CC2BE106564A;
	Fri, 29 Oct 2010 10:41:17 +0000 (UTC)
	(envelope-from alexander@leidinger.net)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D4138FC08;
	Fri, 29 Oct 2010 10:41:16 +0000 (UTC)
Received: from outgoing.leidinger.net (p57B3A5FE.dip.t-dialin.net
	[87.179.165.254])
	by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id C8E2C84400D;
	Fri, 29 Oct 2010 12:41:12 +0200 (CEST)
Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102])
	by outgoing.leidinger.net (Postfix) with ESMTP id AE8C92403;
	Fri, 29 Oct 2010 12:41:04 +0200 (CEST)
Received: (from www@localhost)
	by webmail.leidinger.net (8.14.4/8.13.8/Submit) id o9TAeI50090426;
	Fri, 29 Oct 2010 12:40:18 +0200 (CEST)
	(envelope-from Alexander@Leidinger.net)
Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by
	webmail.leidinger.net (Horde Framework) with HTTP; Fri, 29 Oct 2010
	12:40:18 +0200
Message-ID: <20101029124018.584213anttm848lc@webmail.leidinger.net>
Date: Fri, 29 Oct 2010 12:40:18 +0200
From: Alexander Leidinger 
To: Garrett Cooper 
References: <20101027212601.GA78062@freebsd.org>
	<4CC899C3.7040107@FreeBSD.org> <20101027214822.GA82697@freebsd.org>
	<4CC8A89D.5070909@delphij.net> <20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
	
	<20101028182219.GA36559@freebsd.org>
	
	
	<20101028204849.GE46314@acme.spoerlein.net>
	
In-Reply-To: 
MIME-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4)
X-EBL-MailScanner-Information: Please contact the ISP for more information
X-EBL-MailScanner-ID: C8E2C84400D.A9C7F
X-EBL-MailScanner: Found to be clean
X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN,
	SpamAssassin (not cached, score=1.351, required 6,
	autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08)
X-EBL-MailScanner-SpamScore: s
X-EBL-MailScanner-From: alexander@leidinger.net
X-EBL-MailScanner-Watermark: 1288953674.03558@07xK7Cb12xpE8YCyOOTOWw
X-EBL-Spam-Status: No
X-Mailman-Approved-At: Fri, 29 Oct 2010 11:22:01 +0000
Cc: Doug Barton , d@delphij.net,
	Ulrich =?utf-8?b?U3DDtnJsZWlu?= ,
	Gary Jennejohn ,
	src-committers@FreeBSD.org, Robert Watson ,
	Bruce Evans , svn-src-head@FreeBSD.org,
	Alexander Best , svn-src-all@FreeBSD.org,
	Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 10:41:18 -0000

Quoting Garrett Cooper  (from Thu, 28 Oct 2010  
14:11:14 -0700):

> Unfortunately it's implied superficially by the 3 pass tort; but as
> most people who understand magnetic disks know, unless you completely
> obliterate a disk, wipe over it with random data enough times,
> whatever, the content is still on the disk and retrievable via various
> methods...

Can you please elaborate?

I've read somewhere that someone (some kind of computer magazine) made  
a test of this (yes, to much somewhere and someone, sorry). They took  
a full harddisk with random data (random as in pictures, music, ...)  
and overwrote it once with zeros and gave it to one (or several) data  
rescue companies. The result was that for a price which makes still  
sense to pay for a business (like a bank), only a fraction of data (as  
in non-zero bytes) was recoverable, and that none of the original  
files, and no useful sequence of data, was recovered.

For myself I kept the info that I've did not read it at an untrusty  
place and that for any normal person (even with some malicious intent  
to remove traces of the existence of something) overwritting a  
harddisk one time completely is enough.

Bye,
Alexander.

-- 
Christ died for our sins, so let's not disappoint Him.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 11:00: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 E8E041065673;
	Fri, 29 Oct 2010 11:00:25 +0000 (UTC)
	(envelope-from bruce@cran.org.uk)
Received: from muon.cran.org.uk (muon.cran.org.uk
	[IPv6:2a01:348:0:15:5d59:5c40:0:1])
	by mx1.freebsd.org (Postfix) with ESMTP id 767268FC17;
	Fri, 29 Oct 2010 11:00:25 +0000 (UTC)
Received: from muon.cran.org.uk (localhost [127.0.0.1])
	by muon.cran.org.uk (Postfix) with ESMTP id BCDFFE7746;
	Fri, 29 Oct 2010 12:00:24 +0100 (BST)
Received: from unknown (client-81-107-142-135.midd.adsl.virginmedia.com
	[81.107.142.135])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by muon.cran.org.uk (Postfix) with ESMTPSA;
	Fri, 29 Oct 2010 12:00:23 +0100 (BST)
Date: Fri, 29 Oct 2010 12:00:17 +0100
From: Bruce Cran 
To: Garrett Cooper 
Message-ID: <20101029120017.00003c98@unknown>
In-Reply-To: 
References: <20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
	
	<20101028182219.GA36559@freebsd.org>
	
	
	<20101028204849.GE46314@acme.spoerlein.net>
	
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.6; i586-pc-mingw32msvc)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Mailman-Approved-At: Fri, 29 Oct 2010 11:22:32 +0000
Cc: Doug Barton , d@delphij.net,
	Ulrich =?ISO-8859-1?Q?Sp=F6rlein?= ,
	Gary Jennejohn ,
	src-committers@freebsd.org, Robert Watson ,
	Bruce Evans , svn-src-head@freebsd.org,
	Alexander Best , svn-src-all@freebsd.org,
	Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 11:00:26 -0000

On Thu, 28 Oct 2010 14:11:14 -0700
Garrett Cooper  wrote:

> Unfortunately it's implied superficially by the 3 pass tort; but as
> most people who understand magnetic disks know, unless you completely
> obliterate a disk, wipe over it with random data enough times,
> whatever, the content is still on the disk and retrievable via various
> methods... I agree that this advice should be placed near the flag
> itself so that people completely understand the implications of the
> feature.

I believe the only method 10-15 years ago would have been a scanning
electron microscope, but that probably isn't possible with today's
disks. Simply writing zeros once is enough to obliterate all the data
(except for any remapped sectors).

-- 
Bruce Cran

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 11:10: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 5D151106566C;
	Fri, 29 Oct 2010 11:10:19 +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 26EDF8FC13;
	Fri, 29 Oct 2010 11:10:19 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 9C41B46B0C;
	Fri, 29 Oct 2010 07:10:18 -0400 (EDT)
Date: Fri, 29 Oct 2010 12:10:18 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Bruce Cran 
In-Reply-To: <20101029120017.00003c98@unknown>
Message-ID: 
References: <20101027212601.GA78062@freebsd.org> <4CC899C3.7040107@FreeBSD.org>
	<20101027214822.GA82697@freebsd.org> <4CC8A89D.5070909@delphij.net>
	<20101028152418.A916@besplex.bde.org>
	<20101028095538.24147119@ernst.jennejohn.org>
	
	<20101028182219.GA36559@freebsd.org>
	
	
	<20101028204849.GE46314@acme.spoerlein.net>
	
	<20101029120017.00003c98@unknown>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Mailman-Approved-At: Fri, 29 Oct 2010 11:22:43 +0000
Cc: Doug Barton , d@delphij.net,
	=?ISO-8859-15?Q?Ulrich_Sp=F6rlein?= ,
	Garrett Cooper , src-committers@freebsd.org,
	Bruce Evans , svn-src-head@freebsd.org,
	Alexander Best ,
	Gary Jennejohn ,
	svn-src-all@freebsd.org, Dag-Erling Smorgrav 
Subject: Re: svn commit: r214431 - head/bin/rm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 11:10:19 -0000

On Fri, 29 Oct 2010, Bruce Cran wrote:

> On Thu, 28 Oct 2010 14:11:14 -0700 Garrett Cooper  
> wrote:
>
>> Unfortunately it's implied superficially by the 3 pass tort; but as most 
>> people who understand magnetic disks know, unless you completely obliterate 
>> a disk, wipe over it with random data enough times, whatever, the content 
>> is still on the disk and retrievable via various methods... I agree that 
>> this advice should be placed near the flag itself so that people completely 
>> understand the implications of the feature.
>
> I believe the only method 10-15 years ago would have been a scanning 
> electron microscope, but that probably isn't possible with today's disks. 
> Simply writing zeros once is enough to obliterate all the data (except for 
> any remapped sectors).

Especially given modern magnetic disk densities.  However, the problem with 
flash memory is quite interesting -- because of device wear-leveling.  People 
who really care about forensic extraction of flash disks bypass the normal 
interface in order to (a) follow best practices on not powering on devices and 
(b) bypass the wear-levelling abstraction, revealing the underlying disk 
blocks and wear-levelling meta-data.  As a result, they often have access to 
large numbers of believed-deleted and even believed-overwritten blocks 
(although how much depends on the algorithm, fill ratio, usage patterns, etc).

Robert

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 13:31: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 3A01E1065670;
	Fri, 29 Oct 2010 13:31:11 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D5948FC16;
	Fri, 29 Oct 2010 13:31: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 o9TDVA9S027026;
	Fri, 29 Oct 2010 13:31:10 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TDVAtm027022;
	Fri, 29 Oct 2010 13:31:10 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201010291331.o9TDVAtm027022@svn.freebsd.org>
From: David Xu 
Date: Fri, 29 Oct 2010 13:31: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: r214510 - in head: include lib/libc/gen 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, 29 Oct 2010 13:31:11 -0000

Author: davidxu
Date: Fri Oct 29 13:31:10 2010
New Revision: 214510
URL: http://svn.freebsd.org/changeset/base/214510

Log:
  Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset,
  also add sysconf() key _SC_CPUSET_SIZE to get sysctl value.
  
  Submitted by: gcooper

Modified:
  head/include/unistd.h
  head/lib/libc/gen/sysconf.c
  head/sys/kern/sched_ule.c

Modified: head/include/unistd.h
==============================================================================
--- head/include/unistd.h	Fri Oct 29 11:13:42 2010	(r214509)
+++ head/include/unistd.h	Fri Oct 29 13:31:10 2010	(r214510)
@@ -288,6 +288,7 @@ typedef	__useconds_t	useconds_t;
 #if __BSD_VISIBLE
 #define	_SC_NPROCESSORS_CONF	57
 #define	_SC_NPROCESSORS_ONLN	58
+#define	_SC_CPUSET_SIZE		122
 #endif
 
 /* Extensions found in Solaris and Linux. */

Modified: head/lib/libc/gen/sysconf.c
==============================================================================
--- head/lib/libc/gen/sysconf.c	Fri Oct 29 11:13:42 2010	(r214509)
+++ head/lib/libc/gen/sysconf.c	Fri Oct 29 13:31:10 2010	(r214510)
@@ -597,6 +597,15 @@ yesno:
 		return (lvalue);
 #endif
 
+#ifdef _SC_CPUSET_SIZE
+	case _SC_CPUSET_SIZE:
+		len = sizeof(lvalue);
+		if (sysctlbyname("kern.sched.cpusetsize", &lvalue, &len, NULL,
+		    0) == -1)
+			return (-1);
+		return (lvalue);
+#endif
+
 	default:
 		errno = EINVAL;
 		return (-1);

Modified: head/sys/kern/sched_ule.c
==============================================================================
--- head/sys/kern/sched_ule.c	Fri Oct 29 11:13:42 2010	(r214509)
+++ head/sys/kern/sched_ule.c	Fri Oct 29 13:31:10 2010	(r214510)
@@ -2712,6 +2712,8 @@ sysctl_kern_sched_topology_spec(SYSCTL_H
 	sbuf_delete(topo);
 	return (err);
 }
+
+static size_t _kern_cpuset_size = sizeof(cpuset_t);
 #endif
 
 SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW, 0, "Scheduler");
@@ -2748,6 +2750,15 @@ SYSCTL_INT(_kern_sched, OID_AUTO, steal_
 SYSCTL_PROC(_kern_sched, OID_AUTO, topology_spec, CTLTYPE_STRING |
     CTLFLAG_RD, NULL, 0, sysctl_kern_sched_topology_spec, "A", 
     "XML dump of detected CPU topology");
+
+/* 
+ * Return the size of cpuset_t at the kernel level
+ *
+ * XXX (gcooper): replace ULONG with SIZE once CTLTYPE_SIZE is implemented.
+ */
+SYSCTL_ULONG(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
+    &_kern_cpuset_size, 0, "Kernel-level cpuset_t struct size");
+
 #endif
 
 /* ps compat.  All cpu percentages from ULE are weighted. */

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 13:34: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 E51631065698;
	Fri, 29 Oct 2010 13:34:57 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D338A8FC2B;
	Fri, 29 Oct 2010 13:34: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 o9TDYvsN027313;
	Fri, 29 Oct 2010 13:34:57 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TDYvG0027311;
	Fri, 29 Oct 2010 13:34:57 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201010291334.o9TDYvG0027311@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 29 Oct 2010 13:34: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: r214511 - head/sys/fs/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: Fri, 29 Oct 2010 13:34:58 -0000

Author: rmacklem
Date: Fri Oct 29 13:34:57 2010
New Revision: 214511
URL: http://svn.freebsd.org/changeset/base/214511

Log:
  Add a call for nfsrpc_close() to ncl_reclaim() in the experimental
  NFSv4 client, since the call in ncl_inactive() might be missed
  because VOP_INACTIVE() is not guaranteed to be called before
  VOP_RECLAIM().
  
  MFC after:	1 week

Modified:
  head/sys/fs/nfsclient/nfs_clnode.c

Modified: head/sys/fs/nfsclient/nfs_clnode.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clnode.c	Fri Oct 29 13:31:10 2010	(r214510)
+++ head/sys/fs/nfsclient/nfs_clnode.c	Fri Oct 29 13:34:57 2010	(r214511)
@@ -236,6 +236,15 @@ ncl_reclaim(struct vop_reclaim_args *ap)
 	if (prtactive && vrefcnt(vp) != 0)
 		vprint("ncl_reclaim: pushing active", vp);
 
+	if (NFS_ISV4(vp) && vp->v_type == VREG)
+		/*
+		 * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4
+		 * Close operations are delayed until ncl_inactive().
+		 * However, since VOP_INACTIVE() is not guaranteed to be
+		 * called, we need to do it again here.
+		 */
+		(void) nfsrpc_close(vp, 1, ap->a_td);
+
 	/*
 	 * If the NLM is running, give it a chance to abort pending
 	 * locks.

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 13:42: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 68D88106564A;
	Fri, 29 Oct 2010 13:42:19 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 55D2E8FC12;
	Fri, 29 Oct 2010 13:42: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 o9TDgJIJ027787;
	Fri, 29 Oct 2010 13:42:19 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TDgJnZ027780;
	Fri, 29 Oct 2010 13:42:19 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201010291342.o9TDgJnZ027780@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 29 Oct 2010 13:42: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: r214512 - in head: bin/sh
	tools/regression/bin/sh/expansion
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 13:42:19 -0000

Author: jilles
Date: Fri Oct 29 13:42:18 2010
New Revision: 214512
URL: http://svn.freebsd.org/changeset/base/214512

Log:
  sh: Do IFS splitting on word in ${v+word} and ${v-word}.
  
  The code is inspired by NetBSD sh somewhat, but different because we
  preserve the old Almquist/Bourne/Korn ability to have an unquoted part in a
  quoted ${v+word}. For example, "${v-"*"}" expands to $v as a single field if
  v is set, but generates filenames otherwise.
  
  Note that this is the only place where we split text literally from the
  script (the similar ${v=word} assigns to v and then expands $v). The parser
  must now add additional markers to allow the expansion code to know whether
  arbitrary characters in substitutions are quoted.
  
  Example:
    for i in ${$+a b c}; do echo $i; done
  
  Exp-run done by:	pav (with some other sh(1) changes)

Added:
  head/tools/regression/bin/sh/expansion/plus-minus6.0   (contents, props changed)
Modified:
  head/bin/sh/expand.c
  head/bin/sh/expand.h
  head/bin/sh/mksyntax.c
  head/bin/sh/parser.c
  head/bin/sh/parser.h

Modified: head/bin/sh/expand.c
==============================================================================
--- head/bin/sh/expand.c	Fri Oct 29 13:34:57 2010	(r214511)
+++ head/bin/sh/expand.c	Fri Oct 29 13:42:18 2010	(r214512)
@@ -216,7 +216,12 @@ argstr(char *p, int flag)
 	char c;
 	int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR);	/* do CTLESC */
 	int firsteq = 1;
+	int split_lit;
+	int lit_quoted;
 
+	split_lit = flag & EXP_SPLIT_LIT;
+	lit_quoted = flag & EXP_LIT_QUOTED;
+	flag &= ~(EXP_SPLIT_LIT | EXP_LIT_QUOTED);
 	if (*p == '~' && (flag & (EXP_TILDE | EXP_VARTILDE)))
 		p = exptilde(p, flag);
 	for (;;) {
@@ -225,17 +230,25 @@ argstr(char *p, int flag)
 		case CTLENDVAR:
 			goto breakloop;
 		case CTLQUOTEMARK:
+			lit_quoted = 1;
 			/* "$@" syntax adherence hack */
 			if (p[0] == CTLVAR && p[2] == '@' && p[3] == '=')
 				break;
 			if ((flag & EXP_FULL) != 0)
 				STPUTC(c, expdest);
 			break;
+		case CTLQUOTEEND:
+			lit_quoted = 0;
+			break;
 		case CTLESC:
 			if (quotes)
 				STPUTC(c, expdest);
 			c = *p++;
 			STPUTC(c, expdest);
+			if (split_lit && !lit_quoted)
+				recordregion(expdest - stackblock() -
+				    (quotes ? 2 : 1),
+				    expdest - stackblock(), 0);
 			break;
 		case CTLVAR:
 			p = evalvar(p, flag);
@@ -255,18 +268,21 @@ argstr(char *p, int flag)
 			 * assignments (after the first '=' and after ':'s).
 			 */
 			STPUTC(c, expdest);
-			if (flag & EXP_VARTILDE && *p == '~') {
-				if (c == '=') {
-					if (firsteq)
-						firsteq = 0;
-					else
-						break;
-				}
+			if (split_lit && !lit_quoted)
+				recordregion(expdest - stackblock() - 1,
+				    expdest - stackblock(), 0);
+			if (flag & EXP_VARTILDE && *p == '~' &&
+			    (c != '=' || firsteq)) {
+				if (c == '=')
+					firsteq = 0;
 				p = exptilde(p, flag);
 			}
 			break;
 		default:
 			STPUTC(c, expdest);
+			if (split_lit && !lit_quoted)
+				recordregion(expdest - stackblock() - 1,
+				    expdest - stackblock(), 0);
 		}
 	}
 breakloop:;
@@ -742,7 +758,8 @@ record:
 	case VSPLUS:
 	case VSMINUS:
 		if (!set) {
-			argstr(p, flag);
+			argstr(p, flag | (flag & EXP_FULL ? EXP_SPLIT_LIT : 0) |
+			    (varflags & VSQUOTE ? EXP_LIT_QUOTED : 0));
 			break;
 		}
 		if (easy)
@@ -1495,13 +1512,13 @@ rmescapes(char *str)
 	char *p, *q;
 
 	p = str;
-	while (*p != CTLESC && *p != CTLQUOTEMARK) {
+	while (*p != CTLESC && *p != CTLQUOTEMARK && *p != CTLQUOTEEND) {
 		if (*p++ == '\0')
 			return;
 	}
 	q = p;
 	while (*p) {
-		if (*p == CTLQUOTEMARK) {
+		if (*p == CTLQUOTEMARK || *p == CTLQUOTEEND) {
 			p++;
 			continue;
 		}

Modified: head/bin/sh/expand.h
==============================================================================
--- head/bin/sh/expand.h	Fri Oct 29 13:34:57 2010	(r214511)
+++ head/bin/sh/expand.h	Fri Oct 29 13:42:18 2010	(r214512)
@@ -52,6 +52,8 @@ struct arglist {
 #define	EXP_VARTILDE	0x4	/* expand tildes in an assignment */
 #define	EXP_REDIR	0x8	/* file glob for a redirection (1 match only) */
 #define EXP_CASE	0x10	/* keeps quotes around for CASE pattern */
+#define EXP_SPLIT_LIT	0x20	/* IFS split literal text ${v+-a b c} */
+#define EXP_LIT_QUOTED	0x40	/* for EXP_SPLIT_LIT, start off quoted */
 
 
 union node;

Modified: head/bin/sh/mksyntax.c
==============================================================================
--- head/bin/sh/mksyntax.c	Fri Oct 29 13:34:57 2010	(r214511)
+++ head/bin/sh/mksyntax.c	Fri Oct 29 13:42:18 2010	(r214512)
@@ -285,6 +285,7 @@ init(void)
 	syntax[base + CTLARI] = "CCTL";
 	syntax[base + CTLENDARI] = "CCTL";
 	syntax[base + CTLQUOTEMARK] = "CCTL";
+	syntax[base + CTLQUOTEEND] = "CCTL";
 }
 
 

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Fri Oct 29 13:34:57 2010	(r214511)
+++ head/bin/sh/parser.c	Fri Oct 29 13:42:18 2010	(r214512)
@@ -1161,7 +1161,7 @@ readtoken1(int firstc, char const *initi
 	loop: {	/* for each line, until end of word */
 		CHECKEND();	/* set c to PEOF if at end of here document */
 		for (;;) {	/* until end of line or end of word */
-			CHECKSTRSPACE(3, out);	/* permit 3 calls to USTPUTC */
+			CHECKSTRSPACE(4, out);	/* permit 4 calls to USTPUTC */
 
 			synentry = state[level].syntax[c];
 
@@ -1203,12 +1203,18 @@ readtoken1(int firstc, char const *initi
 						newvarnest == 0)) &&
 					    (c != '}' || state[level].category != TSTATE_VAR_OLD))
 						USTPUTC('\\', out);
+					if ((eofmark == NULL ||
+					    newvarnest > 0) &&
+					    state[level].syntax == BASESYNTAX)
+						USTPUTC(CTLQUOTEMARK, out);
 					if (SQSYNTAX[c] == CCTL)
 						USTPUTC(CTLESC, out);
-					else if (eofmark == NULL ||
-					    newvarnest > 0)
-						USTPUTC(CTLQUOTEMARK, out);
 					USTPUTC(c, out);
+					if ((eofmark == NULL ||
+					    newvarnest > 0) &&
+					    state[level].syntax == BASESYNTAX &&
+					    state[level].category == TSTATE_VAR_OLD)
+						USTPUTC(CTLQUOTEEND, out);
 					quotef++;
 				}
 				break;
@@ -1224,6 +1230,8 @@ readtoken1(int firstc, char const *initi
 				if (eofmark != NULL && newvarnest == 0)
 					USTPUTC(c, out);
 				else {
+					if (state[level].category == TSTATE_VAR_OLD)
+						USTPUTC(CTLQUOTEEND, out);
 					state[level].syntax = BASESYNTAX;
 					quotef++;
 				}

Modified: head/bin/sh/parser.h
==============================================================================
--- head/bin/sh/parser.h	Fri Oct 29 13:34:57 2010	(r214511)
+++ head/bin/sh/parser.h	Fri Oct 29 13:42:18 2010	(r214512)
@@ -43,6 +43,7 @@
 #define	CTLARI	'\206'
 #define	CTLENDARI '\207'
 #define	CTLQUOTEMARK '\210'
+#define	CTLQUOTEEND '\211' /* only for ${v+-...} */
 
 /* variable substitution byte (follows CTLVAR) */
 #define VSTYPE		0x0f	/* type of variable substitution */

Added: head/tools/regression/bin/sh/expansion/plus-minus6.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/plus-minus6.0	Fri Oct 29 13:42:18 2010	(r214512)
@@ -0,0 +1,34 @@
+# $FreeBSD$
+
+failures=0
+unset LC_ALL
+export LC_CTYPE=en_US.ISO8859-1
+nl='
+'
+i=1
+set -f
+while [ "$i" -le 255 ]; do
+	# A different byte still in the range 1..255.
+	i2=$((i^2+(i==2)))
+	# Add a character to work around command substitution's removal of
+	# final newlines, then remove it again.
+	c=$(printf \\"$(printf %o@ "$i")")
+	c=${c%@}
+	c2=$(printf \\"$(printf %o@ "$i2")")
+	c2=${c2%@}
+	case $c in
+		[\'$nl'$}();&|\"`']) c=M
+	esac
+	case $c2 in
+		[\'$nl'$}();&|\"`']) c2=N
+	esac
+	IFS=$c
+	command eval "set -- \${\$+$c2$c$c2$c$c2}"
+	if [ "$#" -ne 3 ] || [ "$1" != "$c2" ] || [ "$2" != "$c2" ] ||
+	    [ "$3" != "$c2" ]; then
+		echo "Bad results for separator $i (word $i2)" >&2
+		: $((failures += 1))
+	fi
+	i=$((i+1))
+done
+exit $((failures > 0))

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 13:45: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 35BA710657BC;
	Fri, 29 Oct 2010 13:45:15 +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 73CE18FC08;
	Fri, 29 Oct 2010 13:45:03 +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 19DDA46B52;
	Fri, 29 Oct 2010 09:45:03 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id A7BE68A01D;
	Fri, 29 Oct 2010 09:45:00 -0400 (EDT)
From: John Baldwin 
To: Attilio Rao 
Date: Fri, 29 Oct 2010 09:44:53 -0400
User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; )
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010281638.14043.jhb@freebsd.org>
	
In-Reply-To: 
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201010290944.53628.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Fri, 29 Oct 2010 09:45:01 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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: Fri, 29 Oct 2010 13:45:16 -0000

On Thursday, October 28, 2010 8:25:38 pm Attilio Rao wrote:
> 2010/10/28 John Baldwin :
> > On Thursday, October 28, 2010 4:28:12 pm Attilio Rao wrote:
> >> 2010/10/28 John Baldwin :
> >> > On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
> >> >> 2010/10/28 John Baldwin :
> >> >> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
> >> >> >> Author: attilio
> >> >> >> Date: Thu Oct 28 16:31:39 2010
> >> >> >> New Revision: 214457
> >> >> >> URL: http://svn.freebsd.org/changeset/base/214457
> >> >> >>
> >> >> >> Log:
> >> >> >>   Merge nexus.c from amd64 and i386 to x86 subtree.
> >> >> >>
> >> >> >>   Sponsored by:       Sandvine Incorporated
> >> >> >>   Tested by:  gianni
> >> >> >>
> >> >> >
> >> >> > It would be better to merge these two routines.  The loader now passes
> > the
> >> >> > smap to i386 kernels as well, so ram_attach() should probably be
> > changed to
> >> >> > try the amd64 approach first and if that fails fall back to using the
> >> >> > phys_avail[] array instead.
> >> >>
> >> >> What do you think about this patch?:
> >> >> Index: nexus.c
> >> >> ===================================================================
> >> >> --- nexus.c     (revision 214457)
> >> >> +++ nexus.c     (working copy)
> >> >> @@ -52,9 +52,7 @@
> >> >>  #include 
> >> >>  #include 
> >> >>  #include 
> >> >> -#ifdef __amd64__
> >> >>  #include 
> >> >> -#endif
> >> >>  #include 
> >> >>  #include 
> >> >>  #include 
> >> >> @@ -67,12 +65,10 @@
> >> >>  #include 
> >> >>  #include 
> >> >>
> >> >> -#ifdef __amd64__
> >> >>  #include 
> >> >> -#include 
> >> >> -#endif
> >> >>  #include 
> >> >>  #include 
> >> >> +#include 
> >> >>
> >> >>  #ifdef DEV_APIC
> >> >>  #include "pcib_if.h"
> >> >> @@ -89,11 +85,13 @@
> >> >>  #include 
> >> >>
> >> >>  #ifdef __amd64__
> >> >> -#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
> >> >> -#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
> >> >> +#define        X86_BUS_SPACE_IO        AMD64_BUS_SPACE_IO
> >> >> +#define        X86_BUS_SPACE_MEM       AMD64_BUS_SPACE_MEM
> >> >> +#define        ELF_KERN_STR            "elf64 kernel"
> >> >>  #else
> >> >> -#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
> >> >> -#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
> >> >> +#define        X86_BUS_SPACE_IO        I386_BUS_SPACE_IO
> >> >> +#define        X86_BUS_SPACE_MEM       I386_BUS_SPACE_MEM
> >> >> +#define        ELF_KERN_STR            "elf32 kernel"
> >> >>  #endif
> >> >> @@ -701,16 +699,11 @@
> >> >>                         panic("ram_attach: resource %d failed to attach",
> > rid);
> >> >>                 rid++;
> >> >>         }
> >> >> -       return (0);
> >> >> -}
> >> >> -#else
> >> >> -static int
> >> >> -ram_attach(device_t dev)
> >> >> -{
> >> >> -       struct resource *res;
> >> >> -       vm_paddr_t *p;
> >> >> -       int error, i, rid;
> >> >>
> >> >> +       /* If at least one smap attached, return. */
> >> >> +       if (rid != 0)
> >> >> +               return (0);
> >> >> +
> >> >
> >> > Perhaps this instead:
> >> >
> >> >        /* If we found an SMAP, return. */
> >> >        if (smapbase != NULL)
> >> >                return (0);
> >>
> >> No, I don't think this check is right, smapbase will always be != NULL
> >> (otherwise the code panics).
> >
> > Oh, that needs to be fixed then.  It can be NULL on i386 with an old loader
> > (or on a really old machine without an SMAP).  The amd64 nexus code could
> > assume it would never be NULL, but i386 cannot.
> >
> > It should probably more closely match what i386 does during the memory probe
> > which is:
> >
> >        kmdp = search("elf kernel");
> >        if (kmdp == NULL)
> >                kmdp = search("elfXX kernel");
> >        if (kmdp != NULL)
> >                smapbase = preload_search(...);
> >        else
> >                smapbase = NULL;
> >        if (smapbase != NULL) {
> >                for (smap = ...) {
> >                }
> >
> >                return (0);
> >        }
> >
> >        /* fall through to old i386 code using phys_avail[] */
> 
> This further patch should address your concerns about nexus.c:
> Index: nexus.c
> ===================================================================
> --- nexus.c     (revision 214457)
> +++ nexus.c     (working copy)
> @@ -52,9 +52,7 @@
>  #include 
>  #include 
>  #include 
> -#ifdef __amd64__
>  #include 
> -#endif
>  #include 
>  #include 
>  #include 
> @@ -67,12 +65,10 @@
>  #include 
>  #include 
> 
> -#ifdef __amd64__
>  #include 
> -#include 
> -#endif
>  #include 
>  #include 
> +#include 
> 
>  #ifdef DEV_APIC
>  #include "pcib_if.h"
> @@ -89,13 +85,15 @@
>  #include 
> 
>  #ifdef __amd64__
> -#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
> -#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
> +#define        BUS_SPACE_IO    AMD64_BUS_SPACE_IO
> +#define        BUS_SPACE_MEM   AMD64_BUS_SPACE_MEM
>  #else
> -#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
> -#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
> +#define        BUS_SPACE_IO    I386_BUS_SPACE_IO
> +#define        BUS_SPACE_MEM   I386_BUS_SPACE_MEM
>  #endif
> 
> +#define        ELF_KERN_STR    ("elf"__XSTRING(__ELF_WORD_SIZE)" kernel")
> +
>  static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
> 
>  #define DEVTONX(dev)   ((struct nexus_device *)device_get_ivars(dev))
> @@ -435,7 +433,7 @@
>  #else
>                 rman_set_bushandle(r, rman_get_start(r));
>  #endif
> -               rman_set_bustag(r, RMAN_BUS_SPACE_IO);
> +               rman_set_bustag(r, BUS_SPACE_IO);
>                 break;
>         case SYS_RES_MEMORY:
>  #ifdef PC98
> @@ -446,7 +444,7 @@
>  #endif
>                 vaddr = pmap_mapdev(rman_get_start(r), rman_get_size(r));
>                 rman_set_virtual(r, vaddr);
> -               rman_set_bustag(r, RMAN_BUS_SPACE_MEM);
> +               rman_set_bustag(r, BUS_SPACE_MEM);
>  #ifdef PC98
>                 /* PC-98: the type of bus_space_handle_t is the structure. */
>                 bh->bsh_base = (bus_addr_t) vaddr;
> @@ -668,48 +666,45 @@
>         return (0);
>  }
> 
> -#ifdef __amd64__
>  static int
>  ram_attach(device_t dev)
>  {
>         struct bios_smap *smapbase, *smap, *smapend;
>         struct resource *res;
> +       vm_paddr_t *p;
>         caddr_t kmdp;
>         uint32_t smapsize;
> -       int error, rid;
> +       int error, i, rid;
> 
>         /* Retrieve the system memory map from the loader. */
>         kmdp = preload_search_by_type("elf kernel");
>         if (kmdp == NULL)
> -               kmdp = preload_search_by_type("elf64 kernel");
> -       smapbase = (struct bios_smap *)preload_search_info(kmdp,
> -           MODINFO_METADATA | MODINFOMD_SMAP);
> -       smapsize = *((u_int32_t *)smapbase - 1);
> -       smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
> +               kmdp = preload_search_by_type(ELF_KERN_STR);
> +       if (kmdp != NULL) {
> +               smapbase = (struct bios_smap *)preload_search_info(kmdp,
> +                   MODINFO_METADATA | MODINFOMD_SMAP);
> +               smapsize = *((u_int32_t *)smapbase - 1);
> +               smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);

I think this doesn't check for the case that smapbase is NULL.  I would
expect kmdp to always be non-NULL in practice (it just means we have a
kernel).  However, the preload_search_info() can fail when booting on an old
machine without an SMAP or an old loader that doesn't pass the SMAP to i386.

Hence the i386 approach of:

	if (kmdp! = NULL)
		smapbase = preload_search_info();
	else
		smapbase = NULL;
	if (smapbase != NULL) {
		...
	}

You could do this as:

	if (kmdp != NULL) {
		smapbase = preload_search_info();
		if (smapbase != NULL) {
			smapsize = ...;
			...
		}
	}

It just causes the code to indent further.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 13:46: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 D20961065698;
	Fri, 29 Oct 2010 13:46:21 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BFC668FC16;
	Fri, 29 Oct 2010 13:46: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 o9TDkLIc028097;
	Fri, 29 Oct 2010 13:46:21 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TDkLrM028095;
	Fri, 29 Oct 2010 13:46:21 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201010291346.o9TDkLrM028095@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 29 Oct 2010 13:46: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: r214513 - head/sys/fs/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: Fri, 29 Oct 2010 13:46:22 -0000

Author: rmacklem
Date: Fri Oct 29 13:46:21 2010
New Revision: 214513
URL: http://svn.freebsd.org/changeset/base/214513

Log:
  Modify nfs_open() in the experimental NFS client to be compatible
  with the regular NFS client. Also, fix a couple of mutex lock issues.
  
  MFC after:	1 week

Modified:
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Fri Oct 29 13:42:18 2010	(r214512)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Fri Oct 29 13:46:21 2010	(r214513)
@@ -494,24 +494,46 @@ nfs_open(struct vop_open_args *ap)
 	 * Now, if this Open will be doing reading, re-validate/flush the
 	 * cache, so that Close/Open coherency is maintained.
 	 */
-	if ((fmode & FREAD) != 0 &&
-	    (!NFS_ISV4(vp) || nfscl_mustflush(vp) != 0)) {
+	mtx_lock(&np->n_mtx);
+	if (np->n_flag & NMODIFIED) {
+		mtx_unlock(&np->n_mtx);
+		error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1);
+		if (error == EINTR || error == EIO) {
+			if (NFS_ISV4(vp))
+				(void) nfsrpc_close(vp, 0, ap->a_td);
+			return (error);
+		}
 		mtx_lock(&np->n_mtx);
-		if (np->n_flag & NMODIFIED) {
-			mtx_unlock(&np->n_mtx);			
-			error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1);
-			if (error == EINTR || error == EIO) {
-				if (NFS_ISV4(vp))
-					(void) nfsrpc_close(vp, 0, ap->a_td);
-				return (error);
-			}
-			mtx_lock(&np->n_mtx);
-			np->n_attrstamp = 0;
+		np->n_attrstamp = 0;
+		if (vp->v_type == VDIR)
+			np->n_direofoffset = 0;
+		mtx_unlock(&np->n_mtx);
+		error = VOP_GETATTR(vp, &vattr, ap->a_cred);
+		if (error) {
+			if (NFS_ISV4(vp))
+				(void) nfsrpc_close(vp, 0, ap->a_td);
+			return (error);
+		}
+		mtx_lock(&np->n_mtx);
+		np->n_mtime = vattr.va_mtime;
+		if (NFS_ISV4(vp))
+			np->n_change = vattr.va_filerev;
+	} else {
+		mtx_unlock(&np->n_mtx);
+		error = VOP_GETATTR(vp, &vattr, ap->a_cred);
+		if (error) {
+			if (NFS_ISV4(vp))
+				(void) nfsrpc_close(vp, 0, ap->a_td);
+			return (error);
+		}
+		mtx_lock(&np->n_mtx);
+		if ((NFS_ISV4(vp) && np->n_change != vattr.va_filerev) ||
+		    NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) {
 			if (vp->v_type == VDIR)
 				np->n_direofoffset = 0;
 			mtx_unlock(&np->n_mtx);
-			error = VOP_GETATTR(vp, &vattr, ap->a_cred);
-			if (error) {
+			error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1);
+			if (error == EINTR || error == EIO) {
 				if (NFS_ISV4(vp))
 					(void) nfsrpc_close(vp, 0, ap->a_td);
 				return (error);
@@ -520,42 +542,16 @@ nfs_open(struct vop_open_args *ap)
 			np->n_mtime = vattr.va_mtime;
 			if (NFS_ISV4(vp))
 				np->n_change = vattr.va_filerev;
-			mtx_unlock(&np->n_mtx);
-		} else {
-			mtx_unlock(&np->n_mtx);						
-			error = VOP_GETATTR(vp, &vattr, ap->a_cred);
-			if (error) {
-				if (NFS_ISV4(vp))
-					(void) nfsrpc_close(vp, 0, ap->a_td);
-				return (error);
-			}
-			mtx_lock(&np->n_mtx);
-			if ((NFS_ISV4(vp) && np->n_change != vattr.va_filerev) ||
-			    NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) {
-				if (vp->v_type == VDIR)
-					np->n_direofoffset = 0;
-				mtx_unlock(&np->n_mtx);
-				error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1);
-				if (error == EINTR || error == EIO) {
-					if (NFS_ISV4(vp))
-						(void) nfsrpc_close(vp, 0,
-						    ap->a_td);
-					return (error);
-				}
-				mtx_lock(&np->n_mtx);
-				np->n_mtime = vattr.va_mtime;
-				if (NFS_ISV4(vp))
-					np->n_change = vattr.va_filerev;
-			}
-			mtx_unlock(&np->n_mtx);
 		}
 	}
 
 	/*
 	 * If the object has >= 1 O_DIRECT active opens, we disable caching.
 	 */
-	if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) {
+	if (newnfs_directio_enable && (fmode & O_DIRECT) &&
+	    (vp->v_type == VREG)) {
 		if (np->n_directio_opens == 0) {
+			mtx_unlock(&np->n_mtx);
 			error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1);
 			if (error) {
 				if (NFS_ISV4(vp))
@@ -564,12 +560,10 @@ nfs_open(struct vop_open_args *ap)
 			}
 			mtx_lock(&np->n_mtx);
 			np->n_flag |= NNONCACHE;
-		} else {
-			mtx_lock(&np->n_mtx);
 		}
 		np->n_directio_opens++;
-		mtx_unlock(&np->n_mtx);
 	}
+	mtx_unlock(&np->n_mtx);
 	vnode_create_vobject(vp, vattr.va_size, ap->a_td);
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 14:17: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 D42291065672;
	Fri, 29 Oct 2010 14:17:24 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 42E2B8FC12;
	Fri, 29 Oct 2010 14:17:23 +0000 (UTC)
Received: by qyk2 with SMTP id 2so2110490qyk.13
	for ; Fri, 29 Oct 2010 07:17:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=KdEu707QFwEZVYQJHFIjZ0jvM6iiLVY9Qub9ZjCi7lw=;
	b=UNWrHjafRAdV5F6+y7Fy9A0XlBTGgdXfgyd4Vf0+FRpUbrAI/ihXpCSkmQtU/TTnfV
	Vo3ZxViEbqRCqbA++dM1b84TpKcmU5GSBMtgpjgffG/Kr1EzMoyK1FWxlsw5QpRfd9cr
	ocsMKN1DdgTfnRyPalnTYohEa34eT59RxfMeE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=B9ZF1HYUwjIaCwcj5YYE313s8lZ3capCnOTQh286VHwoD6o7CUXAsdrQ/TCNz6yhyK
	GdIPkwan2uXFm4r6xkMDKZrm2vprQG+2FYQRwoqrQ9evDYKqU5ECY0a11GG366wt2NCm
	dM5QROebiy5qLnV0LF9xwb+TeC0YYIpKc+DJQ=
MIME-Version: 1.0
Received: by 10.229.240.213 with SMTP id lb21mr11753797qcb.185.1288361843381; 
	Fri, 29 Oct 2010 07:17:23 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.237.9 with HTTP; Fri, 29 Oct 2010 07:17:23 -0700 (PDT)
In-Reply-To: <201010290944.53628.jhb@freebsd.org>
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010281638.14043.jhb@freebsd.org>
	
	<201010290944.53628.jhb@freebsd.org>
Date: Fri, 29 Oct 2010 16:17:23 +0200
X-Google-Sender-Auth: _fNL_4Q-S5v50NB8uHPlnX_6f7U
Message-ID: 
From: Attilio Rao 
To: John Baldwin 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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: Fri, 29 Oct 2010 14:17:24 -0000

2010/10/29 John Baldwin :
> On Thursday, October 28, 2010 8:25:38 pm Attilio Rao wrote:
>> 2010/10/28 John Baldwin :
>> > On Thursday, October 28, 2010 4:28:12 pm Attilio Rao wrote:
>> >> 2010/10/28 John Baldwin :
>> >> > On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
>> >> >> 2010/10/28 John Baldwin :
>> >> >> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
>> >> >> >> Author: attilio
>> >> >> >> Date: Thu Oct 28 16:31:39 2010
>> >> >> >> New Revision: 214457
>> >> >> >> URL: http://svn.freebsd.org/changeset/base/214457
>> >> >> >>
>> >> >> >> Log:
>> >> >> >> =C2=A0 Merge nexus.c from amd64 and i386 to x86 subtree.
>> >> >> >>
>> >> >> >> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated
>> >> >> >> =C2=A0 Tested by: =C2=A0gianni
>> >> >> >>
>> >> >> >
>> >> >> > It would be better to merge these two routines. =C2=A0The loader=
 now passes
>> > the
>> >> >> > smap to i386 kernels as well, so ram_attach() should probably be
>> > changed to
>> >> >> > try the amd64 approach first and if that fails fall back to usin=
g the
>> >> >> > phys_avail[] array instead.
>> >> >>
>> >> >> What do you think about this patch?:
>> >> >> Index: nexus.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
>> >> >> --- nexus.c =C2=A0 =C2=A0 (revision 214457)
>> >> >> +++ nexus.c =C2=A0 =C2=A0 (working copy)
>> >> >> @@ -52,9 +52,7 @@
>> >> >> =C2=A0#include 
>> >> >> =C2=A0#include 
>> >> >> =C2=A0#include 
>> >> >> -#ifdef __amd64__
>> >> >> =C2=A0#include 
>> >> >> -#endif
>> >> >> =C2=A0#include 
>> >> >> =C2=A0#include 
>> >> >> =C2=A0#include 
>> >> >> @@ -67,12 +65,10 @@
>> >> >> =C2=A0#include 
>> >> >> =C2=A0#include 
>> >> >>
>> >> >> -#ifdef __amd64__
>> >> >> =C2=A0#include 
>> >> >> -#include 
>> >> >> -#endif
>> >> >> =C2=A0#include 
>> >> >> =C2=A0#include 
>> >> >> +#include 
>> >> >>
>> >> >> =C2=A0#ifdef DEV_APIC
>> >> >> =C2=A0#include "pcib_if.h"
>> >> >> @@ -89,11 +85,13 @@
>> >> >> =C2=A0#include 
>> >> >>
>> >> >> =C2=A0#ifdef __amd64__
>> >> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=
=A0 =C2=A0 AMD64_BUS_SPACE_IO
>> >> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=
=A0 =C2=A0AMD64_BUS_SPACE_MEM
>> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0=
 =C2=A0 =C2=A0AMD64_BUS_SPACE_IO
>> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=
=A0 =C2=A0 AMD64_BUS_SPACE_MEM
>> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0"elf64 kernel"
>> >> >> =C2=A0#else
>> >> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=
=A0 =C2=A0 I386_BUS_SPACE_IO
>> >> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=
=A0 =C2=A0I386_BUS_SPACE_MEM
>> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0=
 =C2=A0 =C2=A0I386_BUS_SPACE_IO
>> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=
=A0 =C2=A0 I386_BUS_SPACE_MEM
>> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0"elf32 kernel"
>> >> >> =C2=A0#endif
>> >> >> @@ -701,16 +699,11 @@
>> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 panic("ram_attach: resource %d failed to attach",
>> > rid);
>> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rid++;
>> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>> >> >> - =C2=A0 =C2=A0 =C2=A0 return (0);
>> >> >> -}
>> >> >> -#else
>> >> >> -static int
>> >> >> -ram_attach(device_t dev)
>> >> >> -{
>> >> >> - =C2=A0 =C2=A0 =C2=A0 struct resource *res;
>> >> >> - =C2=A0 =C2=A0 =C2=A0 vm_paddr_t *p;
>> >> >> - =C2=A0 =C2=A0 =C2=A0 int error, i, rid;
>> >> >>
>> >> >> + =C2=A0 =C2=A0 =C2=A0 /* If at least one smap attached, return. *=
/
>> >> >> + =C2=A0 =C2=A0 =C2=A0 if (rid !=3D 0)
>> >> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);
>> >> >> +
>> >> >
>> >> > Perhaps this instead:
>> >> >
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* If we found an SMAP, return. */
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (smapbase !=3D NULL)
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
>> >>
>> >> No, I don't think this check is right, smapbase will always be !=3D N=
ULL
>> >> (otherwise the code panics).
>> >
>> > Oh, that needs to be fixed then. =C2=A0It can be NULL on i386 with an =
old loader
>> > (or on a really old machine without an SMAP). =C2=A0The amd64 nexus co=
de could
>> > assume it would never be NULL, but i386 cannot.
>> >
>> > It should probably more closely match what i386 does during the memory=
 probe
>> > which is:
>> >
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0kmdp =3D search("elf kernel");
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (kmdp =3D=3D NULL)
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0kmdp =3D search=
("elfXX kernel");
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (kmdp !=3D NULL)
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0smapbase =3D pr=
eload_search(...);
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0else
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0smapbase =3D NU=
LL;
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (smapbase !=3D NULL) {
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (smap =3D .=
..) {
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>> >
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>> >
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* fall through to old i386 code using phys=
_avail[] */
>>
>> This further patch should address your concerns about nexus.c:
>> Index: nexus.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
>> --- nexus.c =C2=A0 =C2=A0 (revision 214457)
>> +++ nexus.c =C2=A0 =C2=A0 (working copy)
>> @@ -52,9 +52,7 @@
>> =C2=A0#include 
>> =C2=A0#include 
>> =C2=A0#include 
>> -#ifdef __amd64__
>> =C2=A0#include 
>> -#endif
>> =C2=A0#include 
>> =C2=A0#include 
>> =C2=A0#include 
>> @@ -67,12 +65,10 @@
>> =C2=A0#include 
>> =C2=A0#include 
>>
>> -#ifdef __amd64__
>> =C2=A0#include 
>> -#include 
>> -#endif
>> =C2=A0#include 
>> =C2=A0#include 
>> +#include 
>>
>> =C2=A0#ifdef DEV_APIC
>> =C2=A0#include "pcib_if.h"
>> @@ -89,13 +85,15 @@
>> =C2=A0#include 
>>
>> =C2=A0#ifdef __amd64__
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 AMD64_BUS_SPACE_IO
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0AMD64_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0BUS_SPACE_IO =C2=A0 =C2=A0AMD64_BUS_=
SPACE_IO
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0BUS_SPACE_MEM =C2=A0 AMD64_BUS_SPACE=
_MEM
>> =C2=A0#else
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 I386_BUS_SPACE_IO
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0I386_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0BUS_SPACE_IO =C2=A0 =C2=A0I386_BUS_S=
PACE_IO
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0BUS_SPACE_MEM =C2=A0 I386_BUS_SPACE_=
MEM
>> =C2=A0#endif
>>
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0("elf"__XS=
TRING(__ELF_WORD_SIZE)" kernel")
>> +
>> =C2=A0static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
>>
>> =C2=A0#define DEVTONX(dev) =C2=A0 ((struct nexus_device *)device_get_iva=
rs(dev))
>> @@ -435,7 +433,7 @@
>> =C2=A0#else
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bushand=
le(r, rman_get_start(r));
>> =C2=A0#endif
>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bustag(r, RM=
AN_BUS_SPACE_IO);
>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bustag(r, BU=
S_SPACE_IO);
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 case SYS_RES_MEMORY:
>> =C2=A0#ifdef PC98
>> @@ -446,7 +444,7 @@
>> =C2=A0#endif
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 vaddr =3D pmap_m=
apdev(rman_get_start(r), rman_get_size(r));
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_virtual=
(r, vaddr);
>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bustag(r, RM=
AN_BUS_SPACE_MEM);
>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bustag(r, BU=
S_SPACE_MEM);
>> =C2=A0#ifdef PC98
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* PC-98: the ty=
pe of bus_space_handle_t is the structure. */
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bh->bsh_base =3D=
 (bus_addr_t) vaddr;
>> @@ -668,48 +666,45 @@
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);
>> =C2=A0}
>>
>> -#ifdef __amd64__
>> =C2=A0static int
>> =C2=A0ram_attach(device_t dev)
>> =C2=A0{
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct bios_smap *smapbase, *smap, *smapend;
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct resource *res;
>> + =C2=A0 =C2=A0 =C2=A0 vm_paddr_t *p;
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 caddr_t kmdp;
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint32_t smapsize;
>> - =C2=A0 =C2=A0 =C2=A0 int error, rid;
>> + =C2=A0 =C2=A0 =C2=A0 int error, i, rid;
>>
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Retrieve the system memory map from the l=
oader. */
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_search_by_type("elf kernel"=
);
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (kmdp =3D=3D NULL)
>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_sear=
ch_by_type("elf64 kernel");
>> - =C2=A0 =C2=A0 =C2=A0 smapbase =3D (struct bios_smap *)preload_search_i=
nfo(kmdp,
>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MODINFO_METADATA | MODINFOMD_SMAP);
>> - =C2=A0 =C2=A0 =C2=A0 smapsize =3D *((u_int32_t *)smapbase - 1);
>> - =C2=A0 =C2=A0 =C2=A0 smapend =3D (struct bios_smap *)((uintptr_t)smapb=
ase + smapsize);
>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_sear=
ch_by_type(ELF_KERN_STR);
>> + =C2=A0 =C2=A0 =C2=A0 if (kmdp !=3D NULL) {
>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapbase =3D (struct =
bios_smap *)preload_search_info(kmdp,
>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MODINFO=
_METADATA | MODINFOMD_SMAP);
>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapsize =3D *((u_int=
32_t *)smapbase - 1);
>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapend =3D (struct b=
ios_smap *)((uintptr_t)smapbase + smapsize);
>
> I think this doesn't check for the case that smapbase is NULL. =C2=A0I wo=
uld
> expect kmdp to always be non-NULL in practice (it just means we have a
> kernel). =C2=A0However, the preload_search_info() can fail when booting o=
n an old
> machine without an SMAP or an old loader that doesn't pass the SMAP to i3=
86.

I don't understand where is the problem.
smap is only used when it is consistent in that patch, otherwise it is
not used and fallsthrough the physavail[] approach.
It doesn't need to be set to NULL or checked.

I guess that you want to patch the file and see how it looks like,
will be easier to review than inline .diff, in this case.

Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 14:26: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 4E9C1106564A;
	Fri, 29 Oct 2010 14:26:37 +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 19B908FC23;
	Fri, 29 Oct 2010 14:26:37 +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 B76A446B2E;
	Fri, 29 Oct 2010 10:26:36 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6F5498A009;
	Fri, 29 Oct 2010 10:26:35 -0400 (EDT)
From: John Baldwin 
To: Attilio Rao 
Date: Fri, 29 Oct 2010 10:26:19 -0400
User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; )
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010290944.53628.jhb@freebsd.org>
	
In-Reply-To: 
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201010291026.20252.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Fri, 29 Oct 2010 10:26:35 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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: Fri, 29 Oct 2010 14:26:37 -0000

On Friday, October 29, 2010 10:17:23 am Attilio Rao wrote:
> 2010/10/29 John Baldwin :
> > On Thursday, October 28, 2010 8:25:38 pm Attilio Rao wrote:
> >> 2010/10/28 John Baldwin :
> >> > On Thursday, October 28, 2010 4:28:12 pm Attilio Rao wrote:
> >> >> 2010/10/28 John Baldwin :
> >> >> > On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
> >> >> >> 2010/10/28 John Baldwin :
> >> >> >> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
> >> >> >> >> Author: attilio
> >> >> >> >> Date: Thu Oct 28 16:31:39 2010
> >> >> >> >> New Revision: 214457
> >> >> >> >> URL: http://svn.freebsd.org/changeset/base/214457
> >> >> >> >>
> >> >> >> >> Log:
> >> >> >> >>   Merge nexus.c from amd64 and i386 to x86 subtree.
> >> >> >> >>
> >> >> >> >>   Sponsored by:       Sandvine Incorporated
> >> >> >> >>   Tested by:  gianni
> >> >> >> >>
> >> >> >> >
> >> >> >> > It would be better to merge these two routines.  The loader now passes
> >> > the
> >> >> >> > smap to i386 kernels as well, so ram_attach() should probably be
> >> > changed to
> >> >> >> > try the amd64 approach first and if that fails fall back to using the
> >> >> >> > phys_avail[] array instead.
> >> >> >>
> >> >> >> What do you think about this patch?:
> >> >> >> Index: nexus.c
> >> >> >> ===================================================================
> >> >> >> --- nexus.c     (revision 214457)
> >> >> >> +++ nexus.c     (working copy)
> >> >> >> @@ -52,9 +52,7 @@
> >> >> >>  #include 
> >> >> >>  #include 
> >> >> >>  #include 
> >> >> >> -#ifdef __amd64__
> >> >> >>  #include 
> >> >> >> -#endif
> >> >> >>  #include 
> >> >> >>  #include 
> >> >> >>  #include 
> >> >> >> @@ -67,12 +65,10 @@
> >> >> >>  #include 
> >> >> >>  #include 
> >> >> >>
> >> >> >> -#ifdef __amd64__
> >> >> >>  #include 
> >> >> >> -#include 
> >> >> >> -#endif
> >> >> >>  #include 
> >> >> >>  #include 
> >> >> >> +#include 
> >> >> >>
> >> >> >>  #ifdef DEV_APIC
> >> >> >>  #include "pcib_if.h"
> >> >> >> @@ -89,11 +85,13 @@
> >> >> >>  #include 
> >> >> >>
> >> >> >>  #ifdef __amd64__
> >> >> >> -#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
> >> >> >> -#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
> >> >> >> +#define        X86_BUS_SPACE_IO        AMD64_BUS_SPACE_IO
> >> >> >> +#define        X86_BUS_SPACE_MEM       AMD64_BUS_SPACE_MEM
> >> >> >> +#define        ELF_KERN_STR            "elf64 kernel"
> >> >> >>  #else
> >> >> >> -#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
> >> >> >> -#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
> >> >> >> +#define        X86_BUS_SPACE_IO        I386_BUS_SPACE_IO
> >> >> >> +#define        X86_BUS_SPACE_MEM       I386_BUS_SPACE_MEM
> >> >> >> +#define        ELF_KERN_STR            "elf32 kernel"
> >> >> >>  #endif
> >> >> >> @@ -701,16 +699,11 @@
> >> >> >>                         panic("ram_attach: resource %d failed to attach",
> >> > rid);
> >> >> >>                 rid++;
> >> >> >>         }
> >> >> >> -       return (0);
> >> >> >> -}
> >> >> >> -#else
> >> >> >> -static int
> >> >> >> -ram_attach(device_t dev)
> >> >> >> -{
> >> >> >> -       struct resource *res;
> >> >> >> -       vm_paddr_t *p;
> >> >> >> -       int error, i, rid;
> >> >> >>
> >> >> >> +       /* If at least one smap attached, return. */
> >> >> >> +       if (rid != 0)
> >> >> >> +               return (0);
> >> >> >> +
> >> >> >
> >> >> > Perhaps this instead:
> >> >> >
> >> >> >        /* If we found an SMAP, return. */
> >> >> >        if (smapbase != NULL)
> >> >> >                return (0);
> >> >>
> >> >> No, I don't think this check is right, smapbase will always be != NULL
> >> >> (otherwise the code panics).
> >> >
> >> > Oh, that needs to be fixed then.  It can be NULL on i386 with an old loader
> >> > (or on a really old machine without an SMAP).  The amd64 nexus code could
> >> > assume it would never be NULL, but i386 cannot.
> >> >
> >> > It should probably more closely match what i386 does during the memory probe
> >> > which is:
> >> >
> >> >        kmdp = search("elf kernel");
> >> >        if (kmdp == NULL)
> >> >                kmdp = search("elfXX kernel");
> >> >        if (kmdp != NULL)
> >> >                smapbase = preload_search(...);
> >> >        else
> >> >                smapbase = NULL;
> >> >        if (smapbase != NULL) {
> >> >                for (smap = ...) {
> >> >                }
> >> >
> >> >                return (0);
> >> >        }
> >> >
> >> >        /* fall through to old i386 code using phys_avail[] */
> >>
> >> This further patch should address your concerns about nexus.c:
> >> Index: nexus.c
> >> ===================================================================
> >> --- nexus.c     (revision 214457)
> >> +++ nexus.c     (working copy)
> >> @@ -52,9 +52,7 @@
> >>  #include 
> >>  #include 
> >>  #include 
> >> -#ifdef __amd64__
> >>  #include 
> >> -#endif
> >>  #include 
> >>  #include 
> >>  #include 
> >> @@ -67,12 +65,10 @@
> >>  #include 
> >>  #include 
> >>
> >> -#ifdef __amd64__
> >>  #include 
> >> -#include 
> >> -#endif
> >>  #include 
> >>  #include 
> >> +#include 
> >>
> >>  #ifdef DEV_APIC
> >>  #include "pcib_if.h"
> >> @@ -89,13 +85,15 @@
> >>  #include 
> >>
> >>  #ifdef __amd64__
> >> -#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
> >> -#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
> >> +#define        BUS_SPACE_IO    AMD64_BUS_SPACE_IO
> >> +#define        BUS_SPACE_MEM   AMD64_BUS_SPACE_MEM
> >>  #else
> >> -#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
> >> -#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
> >> +#define        BUS_SPACE_IO    I386_BUS_SPACE_IO
> >> +#define        BUS_SPACE_MEM   I386_BUS_SPACE_MEM
> >>  #endif
> >>
> >> +#define        ELF_KERN_STR    ("elf"__XSTRING(__ELF_WORD_SIZE)" kernel")
> >> +
> >>  static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
> >>
> >>  #define DEVTONX(dev)   ((struct nexus_device *)device_get_ivars(dev))
> >> @@ -435,7 +433,7 @@
> >>  #else
> >>                 rman_set_bushandle(r, rman_get_start(r));
> >>  #endif
> >> -               rman_set_bustag(r, RMAN_BUS_SPACE_IO);
> >> +               rman_set_bustag(r, BUS_SPACE_IO);
> >>                 break;
> >>         case SYS_RES_MEMORY:
> >>  #ifdef PC98
> >> @@ -446,7 +444,7 @@
> >>  #endif
> >>                 vaddr = pmap_mapdev(rman_get_start(r), rman_get_size(r));
> >>                 rman_set_virtual(r, vaddr);
> >> -               rman_set_bustag(r, RMAN_BUS_SPACE_MEM);
> >> +               rman_set_bustag(r, BUS_SPACE_MEM);
> >>  #ifdef PC98
> >>                 /* PC-98: the type of bus_space_handle_t is the structure. */
> >>                 bh->bsh_base = (bus_addr_t) vaddr;
> >> @@ -668,48 +666,45 @@
> >>         return (0);
> >>  }
> >>
> >> -#ifdef __amd64__
> >>  static int
> >>  ram_attach(device_t dev)
> >>  {
> >>         struct bios_smap *smapbase, *smap, *smapend;
> >>         struct resource *res;
> >> +       vm_paddr_t *p;
> >>         caddr_t kmdp;
> >>         uint32_t smapsize;
> >> -       int error, rid;
> >> +       int error, i, rid;
> >>
> >>         /* Retrieve the system memory map from the loader. */
> >>         kmdp = preload_search_by_type("elf kernel");
> >>         if (kmdp == NULL)
> >> -               kmdp = preload_search_by_type("elf64 kernel");
> >> -       smapbase = (struct bios_smap *)preload_search_info(kmdp,
> >> -           MODINFO_METADATA | MODINFOMD_SMAP);
> >> -       smapsize = *((u_int32_t *)smapbase - 1);
> >> -       smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
> >> +               kmdp = preload_search_by_type(ELF_KERN_STR);
> >> +       if (kmdp != NULL) {
> >> +               smapbase = (struct bios_smap *)preload_search_info(kmdp,
> >> +                   MODINFO_METADATA | MODINFOMD_SMAP);
> >> +               smapsize = *((u_int32_t *)smapbase - 1);
> >> +               smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
> >
> > I think this doesn't check for the case that smapbase is NULL.  I would
> > expect kmdp to always be non-NULL in practice (it just means we have a
> > kernel).  However, the preload_search_info() can fail when booting on an old
> > machine without an SMAP or an old loader that doesn't pass the SMAP to i386.
> 
> I don't understand where is the problem.
> smap is only used when it is consistent in that patch, otherwise it is
> not used and fallsthrough the physavail[] approach.
> It doesn't need to be set to NULL or checked.
> 
> I guess that you want to patch the file and see how it looks like,
> will be easier to review than inline .diff, in this case.

The preload_search_info() can fail and return NULL (old machine with no SMAP
or an older /boot/loader on i386).  Then when you do this:

	smapsize = *((u_int32_t *)smapbase - 1);

the kernel will panic.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 14:33: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 0BF1D106566C;
	Fri, 29 Oct 2010 14:33:07 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by mx1.freebsd.org (Postfix) with ESMTP id 6E5E28FC1C;
	Fri, 29 Oct 2010 14:33:06 +0000 (UTC)
Received: by qyk7 with SMTP id 7so6047932qyk.13
	for ; Fri, 29 Oct 2010 07:33:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=NysACTbN7FO+M4EyS0O/TPolq4ii6KadP0mgCfD+ChE=;
	b=buvDcUQeeJC7D+t1h1bet/H/vF8E2PEk3OtbHAEZ3KCRO0C22OBwKjxflQ2/Ni8/2N
	rxd36ag9A0t19oYPHIzKHhPJwMU5IIfXGDmEUR6GxdrgTY84a2e+sKwl/ABfjBXgE2Qi
	cWRGA0OTdRTK7veQnsBejm1uhasXP3x7kXjTA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=lX9V+DcxIT8s19Cdbs7DZCRgV9+qxKr7+nJhjxqonudkVEyCPgDxfx/SyhJMWlqk3o
	LsWeRTPVSrLwMQqkrA5npw434YCYyEwv02/Kg5lUXfCEDG9Q296Trtmmpfaa4tZzMsoi
	eQXJJulY3x/V26czAxYvzV8sNXF0JNk6UQ5TU=
MIME-Version: 1.0
Received: by 10.229.97.68 with SMTP id k4mr11898523qcn.261.1288362785353; Fri,
	29 Oct 2010 07:33:05 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.237.9 with HTTP; Fri, 29 Oct 2010 07:33:05 -0700 (PDT)
In-Reply-To: <201010291026.20252.jhb@freebsd.org>
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010290944.53628.jhb@freebsd.org>
	
	<201010291026.20252.jhb@freebsd.org>
Date: Fri, 29 Oct 2010 16:33:05 +0200
X-Google-Sender-Auth: VR4uMcgmy1x2_28q_oeCQktzVdg
Message-ID: 
From: Attilio Rao 
To: John Baldwin 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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: Fri, 29 Oct 2010 14:33:07 -0000

2010/10/29 John Baldwin :
> On Friday, October 29, 2010 10:17:23 am Attilio Rao wrote:
>> 2010/10/29 John Baldwin :
>> > On Thursday, October 28, 2010 8:25:38 pm Attilio Rao wrote:
>> >> 2010/10/28 John Baldwin :
>> >> > On Thursday, October 28, 2010 4:28:12 pm Attilio Rao wrote:
>> >> >> 2010/10/28 John Baldwin :
>> >> >> > On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
>> >> >> >> 2010/10/28 John Baldwin :
>> >> >> >> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
>> >> >> >> >> Author: attilio
>> >> >> >> >> Date: Thu Oct 28 16:31:39 2010
>> >> >> >> >> New Revision: 214457
>> >> >> >> >> URL: http://svn.freebsd.org/changeset/base/214457
>> >> >> >> >>
>> >> >> >> >> Log:
>> >> >> >> >> =C2=A0 Merge nexus.c from amd64 and i386 to x86 subtree.
>> >> >> >> >>
>> >> >> >> >> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorpora=
ted
>> >> >> >> >> =C2=A0 Tested by: =C2=A0gianni
>> >> >> >> >>
>> >> >> >> >
>> >> >> >> > It would be better to merge these two routines. =C2=A0The loa=
der now passes
>> >> > the
>> >> >> >> > smap to i386 kernels as well, so ram_attach() should probably=
 be
>> >> > changed to
>> >> >> >> > try the amd64 approach first and if that fails fall back to u=
sing the
>> >> >> >> > phys_avail[] array instead.
>> >> >> >>
>> >> >> >> What do you think about this patch?:
>> >> >> >> Index: nexus.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
>> >> >> >> --- nexus.c =C2=A0 =C2=A0 (revision 214457)
>> >> >> >> +++ nexus.c =C2=A0 =C2=A0 (working copy)
>> >> >> >> @@ -52,9 +52,7 @@
>> >> >> >> =C2=A0#include 
>> >> >> >> =C2=A0#include 
>> >> >> >> =C2=A0#include 
>> >> >> >> -#ifdef __amd64__
>> >> >> >> =C2=A0#include 
>> >> >> >> -#endif
>> >> >> >> =C2=A0#include 
>> >> >> >> =C2=A0#include 
>> >> >> >> =C2=A0#include 
>> >> >> >> @@ -67,12 +65,10 @@
>> >> >> >> =C2=A0#include 
>> >> >> >> =C2=A0#include 
>> >> >> >>
>> >> >> >> -#ifdef __amd64__
>> >> >> >> =C2=A0#include 
>> >> >> >> -#include 
>> >> >> >> -#endif
>> >> >> >> =C2=A0#include 
>> >> >> >> =C2=A0#include 
>> >> >> >> +#include 
>> >> >> >>
>> >> >> >> =C2=A0#ifdef DEV_APIC
>> >> >> >> =C2=A0#include "pcib_if.h"
>> >> >> >> @@ -89,11 +85,13 @@
>> >> >> >> =C2=A0#include 
>> >> >> >>
>> >> >> >> =C2=A0#ifdef __amd64__
>> >> >> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =
=C2=A0 =C2=A0 AMD64_BUS_SPACE_IO
>> >> >> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =
=C2=A0 =C2=A0AMD64_BUS_SPACE_MEM
>> >> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=
=A0 =C2=A0 =C2=A0AMD64_BUS_SPACE_IO
>> >> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =
=C2=A0 =C2=A0 AMD64_BUS_SPACE_MEM
>> >> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0"elf64 kernel"
>> >> >> >> =C2=A0#else
>> >> >> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =
=C2=A0 =C2=A0 I386_BUS_SPACE_IO
>> >> >> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =
=C2=A0 =C2=A0I386_BUS_SPACE_MEM
>> >> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=
=A0 =C2=A0 =C2=A0I386_BUS_SPACE_IO
>> >> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =
=C2=A0 =C2=A0 I386_BUS_SPACE_MEM
>> >> >> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0"elf32 kernel"
>> >> >> >> =C2=A0#endif
>> >> >> >> @@ -701,16 +699,11 @@
>> >> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 panic("ram_attach: resource %d failed to attach",
>> >> > rid);
>> >> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rid++;
>> >> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>> >> >> >> - =C2=A0 =C2=A0 =C2=A0 return (0);
>> >> >> >> -}
>> >> >> >> -#else
>> >> >> >> -static int
>> >> >> >> -ram_attach(device_t dev)
>> >> >> >> -{
>> >> >> >> - =C2=A0 =C2=A0 =C2=A0 struct resource *res;
>> >> >> >> - =C2=A0 =C2=A0 =C2=A0 vm_paddr_t *p;
>> >> >> >> - =C2=A0 =C2=A0 =C2=A0 int error, i, rid;
>> >> >> >>
>> >> >> >> + =C2=A0 =C2=A0 =C2=A0 /* If at least one smap attached, return=
. */
>> >> >> >> + =C2=A0 =C2=A0 =C2=A0 if (rid !=3D 0)
>> >> >> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);
>> >> >> >> +
>> >> >> >
>> >> >> > Perhaps this instead:
>> >> >> >
>> >> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* If we found an SMAP, return. */
>> >> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (smapbase !=3D NULL)
>> >> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0=
);
>> >> >>
>> >> >> No, I don't think this check is right, smapbase will always be !=
=3D NULL
>> >> >> (otherwise the code panics).
>> >> >
>> >> > Oh, that needs to be fixed then. =C2=A0It can be NULL on i386 with =
an old loader
>> >> > (or on a really old machine without an SMAP). =C2=A0The amd64 nexus=
 code could
>> >> > assume it would never be NULL, but i386 cannot.
>> >> >
>> >> > It should probably more closely match what i386 does during the mem=
ory probe
>> >> > which is:
>> >> >
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0kmdp =3D search("elf kernel");
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (kmdp =3D=3D NULL)
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0kmdp =3D sea=
rch("elfXX kernel");
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (kmdp !=3D NULL)
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0smapbase =3D=
 preload_search(...);
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0else
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0smapbase =3D=
 NULL;
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (smapbase !=3D NULL) {
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (smap =
=3D ...) {
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>> >> >
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>> >> >
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* fall through to old i386 code using p=
hys_avail[] */
>> >>
>> >> This further patch should address your concerns about nexus.c:
>> >> Index: nexus.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
>> >> --- nexus.c =C2=A0 =C2=A0 (revision 214457)
>> >> +++ nexus.c =C2=A0 =C2=A0 (working copy)
>> >> @@ -52,9 +52,7 @@
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> -#ifdef __amd64__
>> >> =C2=A0#include 
>> >> -#endif
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> @@ -67,12 +65,10 @@
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >>
>> >> -#ifdef __amd64__
>> >> =C2=A0#include 
>> >> -#include 
>> >> -#endif
>> >> =C2=A0#include 
>> >> =C2=A0#include 
>> >> +#include 
>> >>
>> >> =C2=A0#ifdef DEV_APIC
>> >> =C2=A0#include "pcib_if.h"
>> >> @@ -89,13 +85,15 @@
>> >> =C2=A0#include 
>> >>
>> >> =C2=A0#ifdef __amd64__
>> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =
=C2=A0 AMD64_BUS_SPACE_IO
>> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =
=C2=A0AMD64_BUS_SPACE_MEM
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0BUS_SPACE_IO =C2=A0 =C2=A0AMD64_B=
US_SPACE_IO
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0BUS_SPACE_MEM =C2=A0 AMD64_BUS_SP=
ACE_MEM
>> >> =C2=A0#else
>> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =
=C2=A0 I386_BUS_SPACE_IO
>> >> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =
=C2=A0I386_BUS_SPACE_MEM
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0BUS_SPACE_IO =C2=A0 =C2=A0I386_BU=
S_SPACE_IO
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0BUS_SPACE_MEM =C2=A0 I386_BUS_SPA=
CE_MEM
>> >> =C2=A0#endif
>> >>
>> >> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0("elf"_=
_XSTRING(__ELF_WORD_SIZE)" kernel")
>> >> +
>> >> =C2=A0static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
>> >>
>> >> =C2=A0#define DEVTONX(dev) =C2=A0 ((struct nexus_device *)device_get_=
ivars(dev))
>> >> @@ -435,7 +433,7 @@
>> >> =C2=A0#else
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bush=
andle(r, rman_get_start(r));
>> >> =C2=A0#endif
>> >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bustag(r,=
 RMAN_BUS_SPACE_IO);
>> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bustag(r,=
 BUS_SPACE_IO);
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 case SYS_RES_MEMORY:
>> >> =C2=A0#ifdef PC98
>> >> @@ -446,7 +444,7 @@
>> >> =C2=A0#endif
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 vaddr =3D pma=
p_mapdev(rman_get_start(r), rman_get_size(r));
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_virt=
ual(r, vaddr);
>> >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bustag(r,=
 RMAN_BUS_SPACE_MEM);
>> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rman_set_bustag(r,=
 BUS_SPACE_MEM);
>> >> =C2=A0#ifdef PC98
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* PC-98: the=
 type of bus_space_handle_t is the structure. */
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bh->bsh_base =
=3D (bus_addr_t) vaddr;
>> >> @@ -668,48 +666,45 @@
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);
>> >> =C2=A0}
>> >>
>> >> -#ifdef __amd64__
>> >> =C2=A0static int
>> >> =C2=A0ram_attach(device_t dev)
>> >> =C2=A0{
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct bios_smap *smapbase, *smap, *smape=
nd;
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct resource *res;
>> >> + =C2=A0 =C2=A0 =C2=A0 vm_paddr_t *p;
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 caddr_t kmdp;
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint32_t smapsize;
>> >> - =C2=A0 =C2=A0 =C2=A0 int error, rid;
>> >> + =C2=A0 =C2=A0 =C2=A0 int error, i, rid;
>> >>
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Retrieve the system memory map from th=
e loader. */
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_search_by_type("elf kern=
el");
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (kmdp =3D=3D NULL)
>> >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_s=
earch_by_type("elf64 kernel");
>> >> - =C2=A0 =C2=A0 =C2=A0 smapbase =3D (struct bios_smap *)preload_searc=
h_info(kmdp,
>> >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MODINFO_METADATA | MODINFOMD_SMA=
P);
>> >> - =C2=A0 =C2=A0 =C2=A0 smapsize =3D *((u_int32_t *)smapbase - 1);
>> >> - =C2=A0 =C2=A0 =C2=A0 smapend =3D (struct bios_smap *)((uintptr_t)sm=
apbase + smapsize);
>> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_s=
earch_by_type(ELF_KERN_STR);
>> >> + =C2=A0 =C2=A0 =C2=A0 if (kmdp !=3D NULL) {
>> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapbase =3D (stru=
ct bios_smap *)preload_search_info(kmdp,
>> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MODI=
NFO_METADATA | MODINFOMD_SMAP);
>> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapsize =3D *((u_=
int32_t *)smapbase - 1);
>> >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapend =3D (struc=
t bios_smap *)((uintptr_t)smapbase + smapsize);
>> >
>> > I think this doesn't check for the case that smapbase is NULL. =C2=A0I=
 would
>> > expect kmdp to always be non-NULL in practice (it just means we have a
>> > kernel). =C2=A0However, the preload_search_info() can fail when bootin=
g on an old
>> > machine without an SMAP or an old loader that doesn't pass the SMAP to=
 i386.
>>
>> I don't understand where is the problem.
>> smap is only used when it is consistent in that patch, otherwise it is
>> not used and fallsthrough the physavail[] approach.
>> It doesn't need to be set to NULL or checked.
>>
>> I guess that you want to patch the file and see how it looks like,
>> will be easier to review than inline .diff, in this case.
>
> The preload_search_info() can fail and return NULL (old machine with no S=
MAP
> or an older /boot/loader on i386). =C2=A0Then when you do this:
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0smapsize =3D *((u_int32_t *)smapbase - 1);
>
> the kernel will panic.

Ah, I thought that it could be failing only with a NULL kmdp.
That patch should fix it then:
Index: nexus.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
--- nexus.c     (revision 214457)
+++ nexus.c     (working copy)
@@ -52,9 +52,7 @@
 #include 
 #include 
 #include 
-#ifdef __amd64__
 #include 
-#endif
 #include 
 #include 
 #include 
@@ -67,12 +65,10 @@
 #include 
 #include 

-#ifdef __amd64__
 #include 
-#include 
-#endif
 #include 
 #include 
+#include 

 #ifdef DEV_APIC
 #include "pcib_if.h"
@@ -89,13 +85,15 @@
 #include 

 #ifdef __amd64__
-#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
-#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
+#define        BUS_SPACE_IO    AMD64_BUS_SPACE_IO
+#define        BUS_SPACE_MEM   AMD64_BUS_SPACE_MEM
 #else
-#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
-#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
+#define        BUS_SPACE_IO    I386_BUS_SPACE_IO
+#define        BUS_SPACE_MEM   I386_BUS_SPACE_MEM
 #endif

+#define        ELF_KERN_STR    ("elf"__XSTRING(__ELF_WORD_SIZE)" kernel")
+
 static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");

 #define DEVTONX(dev)   ((struct nexus_device *)device_get_ivars(dev))
@@ -435,7 +433,7 @@
 #else
                rman_set_bushandle(r, rman_get_start(r));
 #endif
-               rman_set_bustag(r, RMAN_BUS_SPACE_IO);
+               rman_set_bustag(r, BUS_SPACE_IO);
                break;
        case SYS_RES_MEMORY:
 #ifdef PC98
@@ -446,7 +444,7 @@
 #endif
                vaddr =3D pmap_mapdev(rman_get_start(r), rman_get_size(r));
                rman_set_virtual(r, vaddr);
-               rman_set_bustag(r, RMAN_BUS_SPACE_MEM);
+               rman_set_bustag(r, BUS_SPACE_MEM);
 #ifdef PC98
                /* PC-98: the type of bus_space_handle_t is the structure. =
*/
                bh->bsh_base =3D (bus_addr_t) vaddr;
@@ -668,48 +666,48 @@
        return (0);
 }

-#ifdef __amd64__
 static int
 ram_attach(device_t dev)
 {
        struct bios_smap *smapbase, *smap, *smapend;
        struct resource *res;
+       vm_paddr_t *p;
        caddr_t kmdp;
        uint32_t smapsize;
-       int error, rid;
+       int error, i, rid;

        /* Retrieve the system memory map from the loader. */
        kmdp =3D preload_search_by_type("elf kernel");
        if (kmdp =3D=3D NULL)
-               kmdp =3D preload_search_by_type("elf64 kernel");
-       smapbase =3D (struct bios_smap *)preload_search_info(kmdp,
-           MODINFO_METADATA | MODINFOMD_SMAP);
-       smapsize =3D *((u_int32_t *)smapbase - 1);
-       smapend =3D (struct bios_smap *)((uintptr_t)smapbase + smapsize);
+               kmdp =3D preload_search_by_type(ELF_KERN_STR);
+       if (kmdp !=3D NULL)
+               smapbase =3D (struct bios_smap *)preload_search_info(kmdp,
+                   MODINFO_METADATA | MODINFOMD_SMAP);
+       else
+               smapbase =3D NULL;
+       if (smapbase !=3D NULL) {
+               smapsize =3D *((u_int32_t *)smapbase - 1);
+               smapend =3D (struct bios_smap *)((uintptr_t)smapbase + smap=
size);

-       rid =3D 0;
-       for (smap =3D smapbase; smap < smapend; smap++) {
-               if (smap->type !=3D SMAP_TYPE_MEMORY || smap->length =3D=3D=
 0)
-                       continue;
-               error =3D bus_set_resource(dev, SYS_RES_MEMORY, rid, smap->=
base,
-                   smap->length);
-               if (error)
-                       panic("ram_attach: resource %d failed set with %d",=
 rid,
-                           error);
-               res =3D bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0=
);
-               if (res =3D=3D NULL)
-                       panic("ram_attach: resource %d failed to attach", r=
id);
-               rid++;
+               rid =3D 0;
+               for (smap =3D smapbase; smap < smapend; smap++) {
+                       if (smap->type !=3D SMAP_TYPE_MEMORY ||
+                           smap->length =3D=3D 0)
+                               continue;
+                       error =3D bus_set_resource(dev, SYS_RES_MEMORY, rid=
,
+                           smap->base, smap->length);
+                       if (error)
+                       panic("ram_attach: resource %d failed set with %d",
+                                   rid, error);
+                       res =3D bus_alloc_resource_any(dev, SYS_RES_MEMORY,=
 &rid,
+                           0);
+                       if (res =3D=3D NULL)
+                       panic("ram_attach: resource %d failed to attach",
+                                   rid);
+                       rid++;
+               }
+               return (0);
        }
-       return (0);
-}
-#else
-static int
-ram_attach(device_t dev)
-{
-       struct resource *res;
-       vm_paddr_t *p;
-       int error, i, rid;

        /*
         * We use the dump_avail[] array rather than phys_avail[] for
@@ -743,7 +741,6 @@
        }
        return (0);
 }
-#endif

 static device_method_t ram_methods[] =3D {
        /* Device interface */

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 15:03: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 CF7E3106566B;
	Fri, 29 Oct 2010 15:03:29 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BDA668FC17;
	Fri, 29 Oct 2010 15:03: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 o9TF3T1Y034168;
	Fri, 29 Oct 2010 15:03:29 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TF3T7I034166;
	Fri, 29 Oct 2010 15:03:29 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201010291503.o9TF3T7I034166@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Fri, 29 Oct 2010 15:03: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: r214514 - head/lib/libc/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, 29 Oct 2010 15:03:29 -0000

Author: jh
Date: Fri Oct 29 15:03:29 2010
New Revision: 214514
URL: http://svn.freebsd.org/changeset/base/214514

Log:
  - Note that non-superusers are not allowed to set the SF_ARCHIVED
    flag. [1]
  - Note that also fchflags(2) will return EPERM for attempts to set or
    unset the SF_SNAPSHOT flag.
  
  Submitted by:	Garrett Cooper [1]
  MFC after:	1 week

Modified:
  head/lib/libc/sys/chflags.2

Modified: head/lib/libc/sys/chflags.2
==============================================================================
--- head/lib/libc/sys/chflags.2	Fri Oct 29 13:46:21 2010	(r214513)
+++ head/lib/libc/sys/chflags.2	Fri Oct 29 15:03:29 2010	(r214514)
@@ -28,7 +28,7 @@
 .\"	@(#)chflags.2	8.3 (Berkeley) 5/2/95
 .\" $FreeBSD$
 .\"
-.Dd May 16, 2006
+.Dd Oct 29, 2010
 .Dt CHFLAGS 2
 .Os
 .Sh NAME
@@ -155,7 +155,7 @@ is set and the user is either not the su
 securelevel is greater than 0.
 .It Bq Er EPERM
 A non-super-user tries to set one of
-.Dv SF_IMMUTABLE , SF_APPEND ,
+.Dv SF_ARCHIVED , SF_IMMUTABLE , SF_APPEND ,
 or
 .Dv SF_NOUNLINK .
 .It Bq Er EPERM
@@ -200,9 +200,13 @@ is set and the user is either not the su
 securelevel is greater than 0.
 .It Bq Er EPERM
 A non-super-user tries to set one of
-.Dv SF_IMMUTABLE , SF_APPEND ,
+.Dv SF_ARCHIVED , SF_IMMUTABLE , SF_APPEND ,
 or
 .Dv SF_NOUNLINK .
+.It Bq Er EPERM
+User tries to set or remove the
+.Dv SF_SNAPSHOT
+flag.
 .It Bq Er EROFS
 The file resides on a read-only file system.
 .It Bq Er EIO

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 17:06: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 C89EF1065675;
	Fri, 29 Oct 2010 17:06:01 +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 852BE8FC19;
	Fri, 29 Oct 2010 17:06:01 +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 0879D46B37;
	Fri, 29 Oct 2010 13:06:01 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id BD5EB8A009;
	Fri, 29 Oct 2010 13:05:59 -0400 (EDT)
From: John Baldwin 
To: Attilio Rao 
Date: Fri, 29 Oct 2010 13:02:08 -0400
User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; )
References: <201010281631.o9SGVdtZ014923@svn.freebsd.org>
	<201010291026.20252.jhb@freebsd.org>
	
In-Reply-To: 
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201010291302.08687.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Fri, 29 Oct 2010 13:05:59 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214457 - 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: Fri, 29 Oct 2010 17:06:01 -0000

On Friday, October 29, 2010 10:33:05 am Attilio Rao wrote:
> 2010/10/29 John Baldwin :
> > On Friday, October 29, 2010 10:17:23 am Attilio Rao wrote:
> >> 2010/10/29 John Baldwin :
> >> > On Thursday, October 28, 2010 8:25:38 pm Attilio Rao wrote:
> >> >> 2010/10/28 John Baldwin :
> >> >> > On Thursday, October 28, 2010 4:28:12 pm Attilio Rao wrote:
> >> >> >> 2010/10/28 John Baldwin :
> >> >> >> > On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
> >> >> >> >> 2010/10/28 John Baldwin :
> >> >> >> >> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
> >> >> >> >> >> Author: attilio
> >> >> >> >> >> Date: Thu Oct 28 16:31:39 2010
> >> >> >> >> >> New Revision: 214457
> >> >> >> >> >> URL: http://svn.freebsd.org/changeset/base/214457
> >> >> >> >> >>
> >> >> >> >> >> Log:
> >> >> >> >> >>   Merge nexus.c from amd64 and i386 to x86 subtree.
> >> >> >> >> >>
> >> >> >> >> >>   Sponsored by:       Sandvine Incorporated
> >> >> >> >> >>   Tested by:  gianni
> >> >> >> >> >>
> >> >> >> >> >
> >> >> >> >> > It would be better to merge these two routines.  The loader now passes
> >> >> > the
> >> >> >> >> > smap to i386 kernels as well, so ram_attach() should probably be
> >> >> > changed to
> >> >> >> >> > try the amd64 approach first and if that fails fall back to using the
> >> >> >> >> > phys_avail[] array instead.
> >> >> >> >>
> >> >> >> >> What do you think about this patch?:
> >> >> >> >> Index: nexus.c
> >> >> >> >> ===================================================================
> >> >> >> >> --- nexus.c     (revision 214457)
> >> >> >> >> +++ nexus.c     (working copy)
> >> >> >> >> @@ -52,9 +52,7 @@
> >> >> >> >>  #include 
> >> >> >> >>  #include 
> >> >> >> >>  #include 
> >> >> >> >> -#ifdef __amd64__
> >> >> >> >>  #include 
> >> >> >> >> -#endif
> >> >> >> >>  #include 
> >> >> >> >>  #include 
> >> >> >> >>  #include 
> >> >> >> >> @@ -67,12 +65,10 @@
> >> >> >> >>  #include 
> >> >> >> >>  #include 
> >> >> >> >>
> >> >> >> >> -#ifdef __amd64__
> >> >> >> >>  #include 
> >> >> >> >> -#include 
> >> >> >> >> -#endif
> >> >> >> >>  #include 
> >> >> >> >>  #include 
> >> >> >> >> +#include 
> >> >> >> >>
> >> >> >> >>  #ifdef DEV_APIC
> >> >> >> >>  #include "pcib_if.h"
> >> >> >> >> @@ -89,11 +85,13 @@
> >> >> >> >>  #include 
> >> >> >> >>
> >> >> >> >>  #ifdef __amd64__
> >> >> >> >> -#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
> >> >> >> >> -#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
> >> >> >> >> +#define        X86_BUS_SPACE_IO        AMD64_BUS_SPACE_IO
> >> >> >> >> +#define        X86_BUS_SPACE_MEM       AMD64_BUS_SPACE_MEM
> >> >> >> >> +#define        ELF_KERN_STR            "elf64 kernel"
> >> >> >> >>  #else
> >> >> >> >> -#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
> >> >> >> >> -#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
> >> >> >> >> +#define        X86_BUS_SPACE_IO        I386_BUS_SPACE_IO
> >> >> >> >> +#define        X86_BUS_SPACE_MEM       I386_BUS_SPACE_MEM
> >> >> >> >> +#define        ELF_KERN_STR            "elf32 kernel"
> >> >> >> >>  #endif
> >> >> >> >> @@ -701,16 +699,11 @@
> >> >> >> >>                         panic("ram_attach: resource %d failed to attach",
> >> >> > rid);
> >> >> >> >>                 rid++;
> >> >> >> >>         }
> >> >> >> >> -       return (0);
> >> >> >> >> -}
> >> >> >> >> -#else
> >> >> >> >> -static int
> >> >> >> >> -ram_attach(device_t dev)
> >> >> >> >> -{
> >> >> >> >> -       struct resource *res;
> >> >> >> >> -       vm_paddr_t *p;
> >> >> >> >> -       int error, i, rid;
> >> >> >> >>
> >> >> >> >> +       /* If at least one smap attached, return. */
> >> >> >> >> +       if (rid != 0)
> >> >> >> >> +               return (0);
> >> >> >> >> +
> >> >> >> >
> >> >> >> > Perhaps this instead:
> >> >> >> >
> >> >> >> >        /* If we found an SMAP, return. */
> >> >> >> >        if (smapbase != NULL)
> >> >> >> >                return (0);
> >> >> >>
> >> >> >> No, I don't think this check is right, smapbase will always be != NULL
> >> >> >> (otherwise the code panics).
> >> >> >
> >> >> > Oh, that needs to be fixed then.  It can be NULL on i386 with an old loader
> >> >> > (or on a really old machine without an SMAP).  The amd64 nexus code could
> >> >> > assume it would never be NULL, but i386 cannot.
> >> >> >
> >> >> > It should probably more closely match what i386 does during the memory probe
> >> >> > which is:
> >> >> >
> >> >> >        kmdp = search("elf kernel");
> >> >> >        if (kmdp == NULL)
> >> >> >                kmdp = search("elfXX kernel");
> >> >> >        if (kmdp != NULL)
> >> >> >                smapbase = preload_search(...);
> >> >> >        else
> >> >> >                smapbase = NULL;
> >> >> >        if (smapbase != NULL) {
> >> >> >                for (smap = ...) {
> >> >> >                }
> >> >> >
> >> >> >                return (0);
> >> >> >        }
> >> >> >
> >> >> >        /* fall through to old i386 code using phys_avail[] */
> >> >>
> >> >> This further patch should address your concerns about nexus.c:
> >> >> Index: nexus.c
> >> >> ===================================================================
> >> >> --- nexus.c     (revision 214457)
> >> >> +++ nexus.c     (working copy)
> >> >> @@ -52,9 +52,7 @@
> >> >>  #include 
> >> >>  #include 
> >> >>  #include 
> >> >> -#ifdef __amd64__
> >> >>  #include 
> >> >> -#endif
> >> >>  #include 
> >> >>  #include 
> >> >>  #include 
> >> >> @@ -67,12 +65,10 @@
> >> >>  #include 
> >> >>  #include 
> >> >>
> >> >> -#ifdef __amd64__
> >> >>  #include 
> >> >> -#include 
> >> >> -#endif
> >> >>  #include 
> >> >>  #include 
> >> >> +#include 
> >> >>
> >> >>  #ifdef DEV_APIC
> >> >>  #include "pcib_if.h"
> >> >> @@ -89,13 +85,15 @@
> >> >>  #include 
> >> >>
> >> >>  #ifdef __amd64__
> >> >> -#define        RMAN_BUS_SPACE_IO       AMD64_BUS_SPACE_IO
> >> >> -#define        RMAN_BUS_SPACE_MEM      AMD64_BUS_SPACE_MEM
> >> >> +#define        BUS_SPACE_IO    AMD64_BUS_SPACE_IO
> >> >> +#define        BUS_SPACE_MEM   AMD64_BUS_SPACE_MEM
> >> >>  #else
> >> >> -#define        RMAN_BUS_SPACE_IO       I386_BUS_SPACE_IO
> >> >> -#define        RMAN_BUS_SPACE_MEM      I386_BUS_SPACE_MEM
> >> >> +#define        BUS_SPACE_IO    I386_BUS_SPACE_IO
> >> >> +#define        BUS_SPACE_MEM   I386_BUS_SPACE_MEM
> >> >>  #endif
> >> >>
> >> >> +#define        ELF_KERN_STR    ("elf"__XSTRING(__ELF_WORD_SIZE)" kernel")
> >> >> +
> >> >>  static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
> >> >>
> >> >>  #define DEVTONX(dev)   ((struct nexus_device *)device_get_ivars(dev))
> >> >> @@ -435,7 +433,7 @@
> >> >>  #else
> >> >>                 rman_set_bushandle(r, rman_get_start(r));
> >> >>  #endif
> >> >> -               rman_set_bustag(r, RMAN_BUS_SPACE_IO);
> >> >> +               rman_set_bustag(r, BUS_SPACE_IO);
> >> >>                 break;
> >> >>         case SYS_RES_MEMORY:
> >> >>  #ifdef PC98
> >> >> @@ -446,7 +444,7 @@
> >> >>  #endif
> >> >>                 vaddr = pmap_mapdev(rman_get_start(r), rman_get_size(r));
> >> >>                 rman_set_virtual(r, vaddr);
> >> >> -               rman_set_bustag(r, RMAN_BUS_SPACE_MEM);
> >> >> +               rman_set_bustag(r, BUS_SPACE_MEM);
> >> >>  #ifdef PC98
> >> >>                 /* PC-98: the type of bus_space_handle_t is the structure. */
> >> >>                 bh->bsh_base = (bus_addr_t) vaddr;
> >> >> @@ -668,48 +666,45 @@
> >> >>         return (0);
> >> >>  }
> >> >>
> >> >> -#ifdef __amd64__
> >> >>  static int
> >> >>  ram_attach(device_t dev)
> >> >>  {
> >> >>         struct bios_smap *smapbase, *smap, *smapend;
> >> >>         struct resource *res;
> >> >> +       vm_paddr_t *p;
> >> >>         caddr_t kmdp;
> >> >>         uint32_t smapsize;
> >> >> -       int error, rid;
> >> >> +       int error, i, rid;
> >> >>
> >> >>         /* Retrieve the system memory map from the loader. */
> >> >>         kmdp = preload_search_by_type("elf kernel");
> >> >>         if (kmdp == NULL)
> >> >> -               kmdp = preload_search_by_type("elf64 kernel");
> >> >> -       smapbase = (struct bios_smap *)preload_search_info(kmdp,
> >> >> -           MODINFO_METADATA | MODINFOMD_SMAP);
> >> >> -       smapsize = *((u_int32_t *)smapbase - 1);
> >> >> -       smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
> >> >> +               kmdp = preload_search_by_type(ELF_KERN_STR);
> >> >> +       if (kmdp != NULL) {
> >> >> +               smapbase = (struct bios_smap *)preload_search_info(kmdp,
> >> >> +                   MODINFO_METADATA | MODINFOMD_SMAP);
> >> >> +               smapsize = *((u_int32_t *)smapbase - 1);
> >> >> +               smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
> >> >
> >> > I think this doesn't check for the case that smapbase is NULL.  I would
> >> > expect kmdp to always be non-NULL in practice (it just means we have a
> >> > kernel).  However, the preload_search_info() can fail when booting on an old
> >> > machine without an SMAP or an old loader that doesn't pass the SMAP to i386.
> >>
> >> I don't understand where is the problem.
> >> smap is only used when it is consistent in that patch, otherwise it is
> >> not used and fallsthrough the physavail[] approach.
> >> It doesn't need to be set to NULL or checked.
> >>
> >> I guess that you want to patch the file and see how it looks like,
> >> will be easier to review than inline .diff, in this case.
> >
> > The preload_search_info() can fail and return NULL (old machine with no SMAP
> > or an older /boot/loader on i386).  Then when you do this:
> >
> >        smapsize = *((u_int32_t *)smapbase - 1);
> >
> > the kernel will panic.
> 
> Ah, I thought that it could be failing only with a NULL kmdp.
> That patch should fix it then:

I think this looks fine, but I haven't tested it. :)

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 17:39:37 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 8C964106566B;
	Fri, 29 Oct 2010 17:39:36 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: src-committers@FreeBSD.org
Date: Fri, 29 Oct 2010 13:39:13 -0400
User-Agent: KMail/1.6.2
References: <201010280758.o9S7w6Vj069186@svn.freebsd.org>
In-Reply-To: <201010280758.o9S7w6Vj069186@svn.freebsd.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201010291339.18565.jkim@FreeBSD.org>
Cc: Attilio Rao , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r214446 - 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: Fri, 29 Oct 2010 17:39:37 -0000

On Thursday 28 October 2010 03:58 am, Attilio Rao wrote:
> Author: attilio
> Date: Thu Oct 28 07:58:06 2010
> New Revision: 214446
> URL: http://svn.freebsd.org/changeset/base/214446
>
> Log:
>   Merge the mptable support from MD bits to x86 subtree.
>
>   Sponsored by:	Sandvine Incorporated
>   Discussed with:	jhb

This commit broke amd64 build with "device mptable".  I had to do the 
following to fix sys/x86/x86/mptable.c:

@@ -27,7 +27,9 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#ifdef __i386__
 #include "opt_mptable_force_htt.h"
+#endif
 #include 
 #include 
 #include 

Alternatively, you may add "MPTABLE_FORCE_HTT" in 
sys/conf/options.amd64 but I am not sure this option is useful for 
amd64.

Jung-uk Kim

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 18:29: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 9FC64106564A;
	Fri, 29 Oct 2010 18:29:27 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 280A48FC19;
	Fri, 29 Oct 2010 18:29:26 +0000 (UTC)
Received: by qyk2 with SMTP id 2so2336809qyk.13
	for ; Fri, 29 Oct 2010 11:29:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=Z4qz/ApwvUCTgBPkUx036AtHDueSc1ivXqnn8SBpFOA=;
	b=YvU/ntooXPTMqBx+y2yS1fn930j3h/ZhHvKSeJJk77fgk9xQYZ7x8RTiRyc4/W5khH
	AsWA+Ukd6YH8wNNoQX6zHEBJI55Sz/JpqjhAPs5A19qA0zKemPQY8+qgvDnQ8dHSo2N3
	zHjQdQxb7r8BFMozsfs8DjMqNcknnxTPnX78s=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=Rp+JJEOiinyYNv92jrlNZrD6hnGGp01gsrMWy+oH2s/EuUP00FGfwhZU9+gxLGC+c6
	1cnVeoYGQNo1pqKcuXaEyURGM7GnLhrrCYWEY6RTtd7BDupX7cUgpTwrBDAEAHs+3CdC
	BK2uG9ad9NaA6otewzenEVM075mZ/SzI6pFKI=
MIME-Version: 1.0
Received: by 10.229.97.68 with SMTP id k4mr12122457qcn.261.1288376965793; Fri,
	29 Oct 2010 11:29:25 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.237.9 with HTTP; Fri, 29 Oct 2010 11:29:25 -0700 (PDT)
In-Reply-To: <201010291339.18565.jkim@FreeBSD.org>
References: <201010280758.o9S7w6Vj069186@svn.freebsd.org>
	<201010291339.18565.jkim@FreeBSD.org>
Date: Fri, 29 Oct 2010 20:29:25 +0200
X-Google-Sender-Auth: bE3mvVxgr4fLi2tOXJTRf4nXa1Y
Message-ID: 
From: Attilio Rao 
To: Jung-uk Kim 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214446 - 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: Fri, 29 Oct 2010 18:29:27 -0000

2010/10/29 Jung-uk Kim :
> On Thursday 28 October 2010 03:58 am, Attilio Rao wrote:
>> Author: attilio
>> Date: Thu Oct 28 07:58:06 2010
>> New Revision: 214446
>> URL: http://svn.freebsd.org/changeset/base/214446
>>
>> Log:
>> =C2=A0 Merge the mptable support from MD bits to x86 subtree.
>>
>> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated
>> =C2=A0 Discussed with: =C2=A0 =C2=A0 jhb
>
> This commit broke amd64 build with "device mptable". =C2=A0I had to do th=
e
> following to fix sys/x86/x86/mptable.c:
>
> @@ -27,7 +27,9 @@
> =C2=A0#include 
> =C2=A0__FBSDID("$FreeBSD$");
>
> +#ifdef __i386__
> =C2=A0#include "opt_mptable_force_htt.h"
> +#endif
> =C2=A0#include 
> =C2=A0#include 
> =C2=A0#include 
>
> Alternatively, you may add "MPTABLE_FORCE_HTT" in
> sys/conf/options.amd64 but I am not sure this option is useful for
> amd64.

Gosh, I left it out.
Yes, I think this should be the right fix.

Thanks,
Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 18:33: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 04D81106564A;
	Fri, 29 Oct 2010 18:33:44 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E6A6F8FC13;
	Fri, 29 Oct 2010 18:33: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 o9TIXhdj048830;
	Fri, 29 Oct 2010 18:33:43 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TIXhZo048828;
	Fri, 29 Oct 2010 18:33:43 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201010291833.o9TIXhZo048828@svn.freebsd.org>
From: Attilio Rao 
Date: Fri, 29 Oct 2010 18:33: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: r214515 - 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: Fri, 29 Oct 2010 18:33:44 -0000

Author: attilio
Date: Fri Oct 29 18:33:43 2010
New Revision: 214515
URL: http://svn.freebsd.org/changeset/base/214515

Log:
  - Merge ram_attach() implementation for i386 and amd64
  - Rename RES_BUS_SPACE_* into BUS_SPACE_* for consistency
  - Trim out an unnecessary checking condition
  
  Sponsored by:	Sandvine Incorporated
  Requested and reviewed by:	jhb

Modified:
  head/sys/x86/x86/nexus.c

Modified: head/sys/x86/x86/nexus.c
==============================================================================
--- head/sys/x86/x86/nexus.c	Fri Oct 29 15:03:29 2010	(r214514)
+++ head/sys/x86/x86/nexus.c	Fri Oct 29 18:33:43 2010	(r214515)
@@ -52,9 +52,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef __amd64__
 #include 
-#endif
 #include 
 #include 
 #include 
@@ -67,12 +65,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef __amd64__
 #include 
-#include 
-#endif
 #include 
 #include 
+#include 
 
 #ifdef DEV_APIC
 #include "pcib_if.h"
@@ -89,13 +85,15 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #ifdef __amd64__
-#define	RMAN_BUS_SPACE_IO	AMD64_BUS_SPACE_IO
-#define	RMAN_BUS_SPACE_MEM	AMD64_BUS_SPACE_MEM
+#define	BUS_SPACE_IO	AMD64_BUS_SPACE_IO
+#define	BUS_SPACE_MEM	AMD64_BUS_SPACE_MEM
 #else
-#define	RMAN_BUS_SPACE_IO	I386_BUS_SPACE_IO
-#define	RMAN_BUS_SPACE_MEM	I386_BUS_SPACE_MEM
+#define	BUS_SPACE_IO	I386_BUS_SPACE_IO
+#define	BUS_SPACE_MEM	I386_BUS_SPACE_MEM
 #endif
 
+#define	ELF_KERN_STR	("elf"__XSTRING(__ELF_WORD_SIZE)" kernel")
+
 static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
 
 #define DEVTONX(dev)	((struct nexus_device *)device_get_ivars(dev))
@@ -435,7 +433,7 @@ nexus_activate_resource(device_t bus, de
 #else
 		rman_set_bushandle(r, rman_get_start(r));
 #endif
-		rman_set_bustag(r, RMAN_BUS_SPACE_IO);
+		rman_set_bustag(r, BUS_SPACE_IO);
 		break;
 	case SYS_RES_MEMORY:
 #ifdef PC98
@@ -446,7 +444,7 @@ nexus_activate_resource(device_t bus, de
 #endif
 		vaddr = pmap_mapdev(rman_get_start(r), rman_get_size(r));
 		rman_set_virtual(r, vaddr);
-		rman_set_bustag(r, RMAN_BUS_SPACE_MEM);
+		rman_set_bustag(r, BUS_SPACE_MEM);
 #ifdef PC98
 		/* PC-98: the type of bus_space_handle_t is the structure. */
 		bh->bsh_base = (bus_addr_t) vaddr;
@@ -668,48 +666,48 @@ ram_probe(device_t dev)
 	return (0);
 }
 
-#ifdef __amd64__
 static int
 ram_attach(device_t dev)
 {
 	struct bios_smap *smapbase, *smap, *smapend;
 	struct resource *res;
+	vm_paddr_t *p;
 	caddr_t kmdp;
 	uint32_t smapsize;
-	int error, rid;
+	int error, i, rid;
 
 	/* Retrieve the system memory map from the loader. */
 	kmdp = preload_search_by_type("elf kernel");
 	if (kmdp == NULL)
-		kmdp = preload_search_by_type("elf64 kernel");  
-	smapbase = (struct bios_smap *)preload_search_info(kmdp,
-	    MODINFO_METADATA | MODINFOMD_SMAP);
-	smapsize = *((u_int32_t *)smapbase - 1);
-	smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
-
-	rid = 0;
-	for (smap = smapbase; smap < smapend; smap++) {
-		if (smap->type != SMAP_TYPE_MEMORY || smap->length == 0)
-			continue;
-		error = bus_set_resource(dev, SYS_RES_MEMORY, rid, smap->base,
-		    smap->length);
-		if (error)
-			panic("ram_attach: resource %d failed set with %d", rid,
-			    error);
-		res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0);
-		if (res == NULL)
-			panic("ram_attach: resource %d failed to attach", rid);
-		rid++;
+		kmdp = preload_search_by_type(ELF_KERN_STR);  
+	if (kmdp != NULL)
+		smapbase = (struct bios_smap *)preload_search_info(kmdp,
+		    MODINFO_METADATA | MODINFOMD_SMAP);
+	else
+		smapbase = NULL;
+	if (smapbase != NULL) {
+		smapsize = *((u_int32_t *)smapbase - 1);
+		smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
+
+		rid = 0;
+		for (smap = smapbase; smap < smapend; smap++) {
+			if (smap->type != SMAP_TYPE_MEMORY ||
+			    smap->length == 0)
+				continue;
+			error = bus_set_resource(dev, SYS_RES_MEMORY, rid,
+			    smap->base, smap->length);
+			if (error)
+			panic("ram_attach: resource %d failed set with %d",
+				    rid, error);
+			res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+			    0);
+			if (res == NULL)
+			panic("ram_attach: resource %d failed to attach",
+				    rid);
+			rid++;
+		}
+		return (0);
 	}
-	return (0);
-}
-#else
-static int
-ram_attach(device_t dev)
-{
-	struct resource *res;
-	vm_paddr_t *p;
-	int error, i, rid;
 
 	/*
 	 * We use the dump_avail[] array rather than phys_avail[] for
@@ -743,7 +741,6 @@ ram_attach(device_t dev)
 	}
 	return (0);
 }
-#endif
 
 static device_method_t ram_methods[] = {
 	/* Device interface */

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 18:38: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 C6E91106564A;
	Fri, 29 Oct 2010 18:38:36 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B50698FC12;
	Fri, 29 Oct 2010 18:38: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 o9TIca0G049154;
	Fri, 29 Oct 2010 18:38:36 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TIcaGd049152;
	Fri, 29 Oct 2010 18:38:36 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201010291838.o9TIcaGd049152@svn.freebsd.org>
From: Attilio Rao 
Date: Fri, 29 Oct 2010 18:38: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: r214516 - 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: Fri, 29 Oct 2010 18:38:36 -0000

Author: attilio
Date: Fri Oct 29 18:38:36 2010
New Revision: 214516
URL: http://svn.freebsd.org/changeset/base/214516

Log:
  Merging mptable under x86 left this option undefined for amd64 case.
  Fix that.
  
  Sponsored by:	Sandvine Incorporated
  Reported by:	jkim

Modified:
  head/sys/conf/options.amd64

Modified: head/sys/conf/options.amd64
==============================================================================
--- head/sys/conf/options.amd64	Fri Oct 29 18:33:43 2010	(r214515)
+++ head/sys/conf/options.amd64	Fri Oct 29 18:38:36 2010	(r214516)
@@ -8,6 +8,7 @@ COUNT_IPIS		opt_smp.h
 MAXMEM
 PERFMON
 PMAP_SHPGPERPROC	opt_pmap.h
+MPTABLE_FORCE_HTT
 MP_WATCHDOG
 
 # Options for emulators.  These should only be used at config time, so

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 18:41: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 E1970106576C;
	Fri, 29 Oct 2010 18:41:09 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CF34F8FC1D;
	Fri, 29 Oct 2010 18:41: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 o9TIf9tZ049341;
	Fri, 29 Oct 2010 18:41:09 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TIf9Sh049339;
	Fri, 29 Oct 2010 18:41:09 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010291841.o9TIf9Sh049339@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 18:41: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: r214517 - head/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: Fri, 29 Oct 2010 18:41:10 -0000

Author: rpaulo
Date: Fri Oct 29 18:41:09 2010
New Revision: 214517
URL: http://svn.freebsd.org/changeset/base/214517

Log:
  Sync DLTs with the latest pcap version.

Modified:
  head/sys/net/bpf.h

Modified: head/sys/net/bpf.h
==============================================================================
--- head/sys/net/bpf.h	Fri Oct 29 18:38:36 2010	(r214516)
+++ head/sys/net/bpf.h	Fri Oct 29 18:41:09 2010	(r214517)
@@ -844,6 +844,143 @@ struct bpf_zbuf_header {
  */
 #define DLT_IEEE802_15_4_NONASK_PHY     215
 
+/* 
+ * David Gibson  requested this for
+ * captures from the Linux kernel /dev/input/eventN devices. This
+ * is used to communicate keystrokes and mouse movements from the
+ * Linux kernel to display systems, such as Xorg. 
+ */
+#define	DLT_LINUX_EVDEV		216
+
+/*
+ * GSM Um and Abis interfaces, preceded by a "gsmtap" header.
+ *
+ * Requested by Harald Welte .
+ */
+#define	DLT_GSMTAP_UM		217
+#define	DLT_GSMTAP_ABIS		218
+
+/*
+ * MPLS, with an MPLS label as the link-layer header.
+ * Requested by Michele Marchetto  on behalf
+ * of OpenBSD.
+ */
+#define	DLT_MPLS		219
+
+/*
+ * USB packets, beginning with a Linux USB header, with the USB header
+ * padded to 64 bytes; required for memory-mapped access.
+ */
+#define	DLT_USB_LINUX_MMAPPED	220
+
+/*
+ * DECT packets, with a pseudo-header; requested by
+ * Matthias Wenzel .
+ */
+#define	DLT_DECT		221
+/*
+ * From: "Lidwa, Eric (GSFC-582.0)[SGT INC]" 
+ * Date: Mon, 11 May 2009 11:18:30 -0500
+ *
+ * DLT_AOS. We need it for AOS Space Data Link Protocol.
+ *   I have already written dissectors for but need an OK from
+ *   legal before I can submit a patch.
+ *
+ */
+#define	DLT_AOS			222
+
+/*
+ * Wireless HART (Highway Addressable Remote Transducer)
+ * From the HART Communication Foundation
+ * IES/PAS 62591
+ *
+ * Requested by Sam Roberts .
+ */
+#define	DLT_WIHART		223
+
+/*
+ * Fibre Channel FC-2 frames, beginning with a Frame_Header.
+ * Requested by Kahou Lei .
+ */
+#define	DLT_FC_2		224
+
+/*
+ * Fibre Channel FC-2 frames, beginning with an encoding of the
+ * SOF, and ending with an encoding of the EOF.
+ *
+ * The encodings represent the frame delimiters as 4-byte sequences
+ * representing the corresponding ordered sets, with K28.5
+ * represented as 0xBC, and the D symbols as the corresponding
+ * byte values; for example, SOFi2, which is K28.5 - D21.5 - D1.2 - D21.2,
+ * is represented as 0xBC 0xB5 0x55 0x55.
+ *
+ * Requested by Kahou Lei .
+ */
+#define	DLT_FC_2_WITH_FRAME_DELIMS	225
+/*
+ * Solaris ipnet pseudo-header; requested by Darren Reed .
+ *
+ * The pseudo-header starts with a one-byte version number; for version 2,
+ * the pseudo-header is:
+ *
+ * struct dl_ipnetinfo {
+ *     u_int8_t   dli_version;
+ *     u_int8_t   dli_family;
+ *     u_int16_t  dli_htype;
+ *     u_int32_t  dli_pktlen;
+ *     u_int32_t  dli_ifindex;
+ *     u_int32_t  dli_grifindex;
+ *     u_int32_t  dli_zsrc;
+ *     u_int32_t  dli_zdst;
+ * };
+ *
+ * dli_version is 2 for the current version of the pseudo-header.
+ *
+ * dli_family is a Solaris address family value, so it's 2 for IPv4
+ * and 26 for IPv6.
+ *
+ * dli_htype is a "hook type" - 0 for incoming packets, 1 for outgoing
+ * packets, and 2 for packets arriving from another zone on the same
+ * machine.
+ *
+ * dli_pktlen is the length of the packet data following the pseudo-header
+ * (so the captured length minus dli_pktlen is the length of the
+ * pseudo-header, assuming the entire pseudo-header was captured).
+ *
+ * dli_ifindex is the interface index of the interface on which the
+ * packet arrived.
+ *
+ * dli_grifindex is the group interface index number (for IPMP interfaces).
+ *
+ * dli_zsrc is the zone identifier for the source of the packet.
+ *
+ * dli_zdst is the zone identifier for the destination of the packet.
+ *
+ * A zone number of 0 is the global zone; a zone number of 0xffffffff
+ * means that the packet arrived from another host on the network, not
+ * from another zone on the same machine.
+ *
+ * An IPv4 or IPv6 datagram follows the pseudo-header; dli_family indicates
+ * which of those it is.
+ */
+#define	DLT_IPNET			226
+
+/*
+ * CAN (Controller Area Network) frames, with a pseudo-header as supplied
+ * by Linux SocketCAN.  See Documentation/networking/can.txt in the Linux
+ * source.
+ *
+ * Requested by Felix Obenhuber .
+ */
+#define	DLT_CAN_SOCKETCAN		227
+
+/*
+ * Raw IPv4/IPv6; different from DLT_RAW in that the DLT_ value specifies
+ * whether it's v4 or v6.  Requested by Darren Reed .
+ */
+#define	DLT_IPV4			228
+#define	DLT_IPV6			229
+
 /*
  * DLT and savefile link type values are split into a class and
  * a member of that class.  A class value of 0 indicates a regular

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 18:43: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 1140F1065675;
	Fri, 29 Oct 2010 18:43:24 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F02C28FC1C;
	Fri, 29 Oct 2010 18:43: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 o9TIhNcI049501;
	Fri, 29 Oct 2010 18:43:23 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TIhNQ6049491;
	Fri, 29 Oct 2010 18:43:23 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010291843.o9TIhNQ6049491@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 18:43: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: r214518 - in head/contrib/libpcap: . ChmodBPF SUNOS4
	Win32 bpf/net lbl missing msdos net pcap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 18:43:24 -0000

Author: rpaulo
Date: Fri Oct 29 18:43:23 2010
New Revision: 214518
URL: http://svn.freebsd.org/changeset/base/214518

Log:
  Merge libpcap-1.1.1.

Added:
  head/contrib/libpcap/ChmodBPF/
     - copied from r214514, vendor/libpcap/dist/ChmodBPF/
  head/contrib/libpcap/README.Win32
     - copied unchanged from r214514, vendor/libpcap/dist/README.Win32
  head/contrib/libpcap/README.aix
     - copied unchanged from r214514, vendor/libpcap/dist/README.aix
  head/contrib/libpcap/README.dag
     - copied unchanged from r214514, vendor/libpcap/dist/README.dag
  head/contrib/libpcap/README.hpux
     - copied unchanged from r214514, vendor/libpcap/dist/README.hpux
  head/contrib/libpcap/README.linux
     - copied unchanged from r214514, vendor/libpcap/dist/README.linux
  head/contrib/libpcap/README.macosx
     - copied unchanged from r214514, vendor/libpcap/dist/README.macosx
  head/contrib/libpcap/README.septel
     - copied unchanged from r214514, vendor/libpcap/dist/README.septel
  head/contrib/libpcap/README.sita
     - copied unchanged from r214514, vendor/libpcap/dist/README.sita
  head/contrib/libpcap/README.tru64
     - copied unchanged from r214514, vendor/libpcap/dist/README.tru64
  head/contrib/libpcap/SUNOS4/
     - copied from r214514, vendor/libpcap/dist/SUNOS4/
  head/contrib/libpcap/Win32/
     - copied from r214514, vendor/libpcap/dist/Win32/
  head/contrib/libpcap/msdos/
     - copied from r214514, vendor/libpcap/dist/msdos/
  head/contrib/libpcap/opentest.c
     - copied unchanged from r214514, vendor/libpcap/dist/opentest.c
  head/contrib/libpcap/org.tcpdump.chmod_bpf.plist
     - copied unchanged from r214514, vendor/libpcap/dist/org.tcpdump.chmod_bpf.plist
  head/contrib/libpcap/pcap-can-linux.c
     - copied unchanged from r214514, vendor/libpcap/dist/pcap-can-linux.c
  head/contrib/libpcap/pcap-can-linux.h
     - copied unchanged from r214514, vendor/libpcap/dist/pcap-can-linux.h
  head/contrib/libpcap/pcap-common.c
     - copied unchanged from r214514, vendor/libpcap/dist/pcap-common.c
  head/contrib/libpcap/pcap-common.h
     - copied unchanged from r214514, vendor/libpcap/dist/pcap-common.h
  head/contrib/libpcap/pcap-snf.c
     - copied unchanged from r214514, vendor/libpcap/dist/pcap-snf.c
  head/contrib/libpcap/pcap-snf.h
     - copied unchanged from r214514, vendor/libpcap/dist/pcap-snf.h
  head/contrib/libpcap/pcap/ipnet.h
     - copied unchanged from r214514, vendor/libpcap/dist/pcap/ipnet.h
  head/contrib/libpcap/selpolltest.c
     - copied unchanged from r214514, vendor/libpcap/dist/selpolltest.c
  head/contrib/libpcap/sf-pcap-ng.c
     - copied unchanged from r214514, vendor/libpcap/dist/sf-pcap-ng.c
  head/contrib/libpcap/sf-pcap-ng.h
     - copied unchanged from r214514, vendor/libpcap/dist/sf-pcap-ng.h
  head/contrib/libpcap/sf-pcap.c
     - copied unchanged from r214514, vendor/libpcap/dist/sf-pcap.c
  head/contrib/libpcap/sf-pcap.h
     - copied unchanged from r214514, vendor/libpcap/dist/sf-pcap.h
Deleted:
  head/contrib/libpcap/net/bpf_filter.c
Modified:
  head/contrib/libpcap/CHANGES
  head/contrib/libpcap/CREDITS
  head/contrib/libpcap/INSTALL.txt
  head/contrib/libpcap/Makefile.in
  head/contrib/libpcap/README
  head/contrib/libpcap/TODO
  head/contrib/libpcap/VERSION
  head/contrib/libpcap/arcnet.h
  head/contrib/libpcap/atmuni31.h
  head/contrib/libpcap/bpf/net/bpf_filter.c
  head/contrib/libpcap/bpf_dump.c
  head/contrib/libpcap/bpf_image.c
  head/contrib/libpcap/config.guess
  head/contrib/libpcap/config.h.in
  head/contrib/libpcap/config.sub
  head/contrib/libpcap/configure
  head/contrib/libpcap/configure.in
  head/contrib/libpcap/dlpisubs.c
  head/contrib/libpcap/dlpisubs.h
  head/contrib/libpcap/etherent.c
  head/contrib/libpcap/ethertype.h
  head/contrib/libpcap/fad-getad.c
  head/contrib/libpcap/fad-gifc.c
  head/contrib/libpcap/fad-glifc.c
  head/contrib/libpcap/fad-null.c
  head/contrib/libpcap/fad-win32.c
  head/contrib/libpcap/filtertest.c
  head/contrib/libpcap/gencode.c
  head/contrib/libpcap/gencode.h
  head/contrib/libpcap/grammar.y
  head/contrib/libpcap/inet.c
  head/contrib/libpcap/lbl/os-aix4.h
  head/contrib/libpcap/lbl/os-hpux11.h
  head/contrib/libpcap/lbl/os-osf4.h
  head/contrib/libpcap/lbl/os-osf5.h
  head/contrib/libpcap/lbl/os-solaris2.h
  head/contrib/libpcap/lbl/os-sunos4.h
  head/contrib/libpcap/lbl/os-ultrix4.h
  head/contrib/libpcap/llc.h
  head/contrib/libpcap/missing/snprintf.c
  head/contrib/libpcap/nametoaddr.c
  head/contrib/libpcap/nlpid.h
  head/contrib/libpcap/optimize.c
  head/contrib/libpcap/pcap-bpf.c
  head/contrib/libpcap/pcap-bpf.h
  head/contrib/libpcap/pcap-bt-linux.c
  head/contrib/libpcap/pcap-bt-linux.h
  head/contrib/libpcap/pcap-config.1
  head/contrib/libpcap/pcap-config.in
  head/contrib/libpcap/pcap-dag.c
  head/contrib/libpcap/pcap-dag.h
  head/contrib/libpcap/pcap-dlpi.c
  head/contrib/libpcap/pcap-dos.c
  head/contrib/libpcap/pcap-dos.h
  head/contrib/libpcap/pcap-enet.c
  head/contrib/libpcap/pcap-filter.manmisc.in
  head/contrib/libpcap/pcap-int.h
  head/contrib/libpcap/pcap-libdlpi.c
  head/contrib/libpcap/pcap-linktype.manmisc.in
  head/contrib/libpcap/pcap-linux.c
  head/contrib/libpcap/pcap-namedb.h
  head/contrib/libpcap/pcap-nit.c
  head/contrib/libpcap/pcap-null.c
  head/contrib/libpcap/pcap-pf.c
  head/contrib/libpcap/pcap-savefile.manfile.in
  head/contrib/libpcap/pcap-septel.c
  head/contrib/libpcap/pcap-septel.h
  head/contrib/libpcap/pcap-sita.html
  head/contrib/libpcap/pcap-snit.c
  head/contrib/libpcap/pcap-snoop.c
  head/contrib/libpcap/pcap-stdinc.h
  head/contrib/libpcap/pcap-usb-linux.c
  head/contrib/libpcap/pcap-usb-linux.h
  head/contrib/libpcap/pcap-win32.c
  head/contrib/libpcap/pcap.3pcap.in
  head/contrib/libpcap/pcap.c
  head/contrib/libpcap/pcap.h
  head/contrib/libpcap/pcap/bluetooth.h
  head/contrib/libpcap/pcap/bpf.h
  head/contrib/libpcap/pcap/namedb.h
  head/contrib/libpcap/pcap/pcap.h
  head/contrib/libpcap/pcap/sll.h
  head/contrib/libpcap/pcap/usb.h
  head/contrib/libpcap/pcap/vlan.h
  head/contrib/libpcap/pcap_activate.3pcap
  head/contrib/libpcap/pcap_breakloop.3pcap
  head/contrib/libpcap/pcap_can_set_rfmon.3pcap
  head/contrib/libpcap/pcap_close.3pcap
  head/contrib/libpcap/pcap_compile.3pcap.in
  head/contrib/libpcap/pcap_create.3pcap
  head/contrib/libpcap/pcap_datalink.3pcap.in
  head/contrib/libpcap/pcap_datalink_name_to_val.3pcap
  head/contrib/libpcap/pcap_datalink_val_to_name.3pcap
  head/contrib/libpcap/pcap_dump.3pcap
  head/contrib/libpcap/pcap_dump_close.3pcap
  head/contrib/libpcap/pcap_dump_file.3pcap
  head/contrib/libpcap/pcap_dump_flush.3pcap
  head/contrib/libpcap/pcap_dump_ftell.3pcap
  head/contrib/libpcap/pcap_dump_open.3pcap.in
  head/contrib/libpcap/pcap_file.3pcap
  head/contrib/libpcap/pcap_fileno.3pcap
  head/contrib/libpcap/pcap_findalldevs.3pcap
  head/contrib/libpcap/pcap_free_datalinks.3pcap
  head/contrib/libpcap/pcap_freealldevs.3pcap
  head/contrib/libpcap/pcap_freecode.3pcap
  head/contrib/libpcap/pcap_get_selectable_fd.3pcap
  head/contrib/libpcap/pcap_geterr.3pcap
  head/contrib/libpcap/pcap_inject.3pcap
  head/contrib/libpcap/pcap_is_swapped.3pcap
  head/contrib/libpcap/pcap_lib_version.3pcap
  head/contrib/libpcap/pcap_list_datalinks.3pcap.in
  head/contrib/libpcap/pcap_lookupdev.3pcap
  head/contrib/libpcap/pcap_lookupnet.3pcap
  head/contrib/libpcap/pcap_loop.3pcap
  head/contrib/libpcap/pcap_major_version.3pcap
  head/contrib/libpcap/pcap_next_ex.3pcap
  head/contrib/libpcap/pcap_offline_filter.3pcap
  head/contrib/libpcap/pcap_open_dead.3pcap.in
  head/contrib/libpcap/pcap_open_live.3pcap
  head/contrib/libpcap/pcap_open_offline.3pcap.in
  head/contrib/libpcap/pcap_set_buffer_size.3pcap
  head/contrib/libpcap/pcap_set_datalink.3pcap
  head/contrib/libpcap/pcap_set_promisc.3pcap
  head/contrib/libpcap/pcap_set_rfmon.3pcap
  head/contrib/libpcap/pcap_set_snaplen.3pcap
  head/contrib/libpcap/pcap_set_timeout.3pcap
  head/contrib/libpcap/pcap_setdirection.3pcap
  head/contrib/libpcap/pcap_setfilter.3pcap
  head/contrib/libpcap/pcap_setnonblock.3pcap
  head/contrib/libpcap/pcap_snapshot.3pcap
  head/contrib/libpcap/pcap_stats.3pcap
  head/contrib/libpcap/pcap_statustostr.3pcap
  head/contrib/libpcap/pcap_strerror.3pcap
  head/contrib/libpcap/ppp.h
  head/contrib/libpcap/runlex.sh
  head/contrib/libpcap/savefile.c
  head/contrib/libpcap/scanner.l
  head/contrib/libpcap/sunatmpos.h
Directory Properties:
  head/contrib/libpcap/   (props changed)

Modified: head/contrib/libpcap/CHANGES
==============================================================================
--- head/contrib/libpcap/CHANGES	Fri Oct 29 18:41:09 2010	(r214517)
+++ head/contrib/libpcap/CHANGES	Fri Oct 29 18:43:23 2010	(r214518)
@@ -1,4 +1,77 @@
-@(#) $Header: /tcpdump/master/libpcap/CHANGES,v 1.67.2.4 2008-10-28 00:27:42 ken Exp $ (LBL)
+Thu.    April 1, 2010.  guy@alum.mit.edu.
+Summary for 1.1.1 libpcap release
+	Update CHANGES to reflect more of the changes in 1.1.0.
+	Fix build on RHEL5.
+	Fix shared library build on AIX.
+
+Thu.	March 11, 2010.  ken@netfunctional.ca/guy@alum.mit.edu.
+Summary for 1.1.0 libpcap release
+	Add SocketCAN capture support
+	Add Myricom SNF API support
+	Update Endace DAG and ERF support
+	Add support for shared libraries on Solaris, HP-UX, and AIX
+	Build, install, and un-install shared libraries by default;
+	  don't build/install shared libraries on platforms we don't support
+	Fix building from a directory other than the source directory
+	Fix compiler warnings and builds on some platforms
+	Update config.guess and config.sub
+	Support monitor mode on mac80211 devices on Linux
+	Fix USB memory-mapped capturing on Linux; it requires a new DLT_
+	  value
+	On Linux, scan /sys/class/net for devices if we have it; scan
+	  it, or /proc/net/dev if we don't have /sys/class/net, even if
+	  we have getifaddrs(), as it'll find interfaces with no
+	  addresses
+	Add limited support for reading pcap-ng files
+	Fix BPF driver-loading error handling on AIX
+	Support getting the full-length interface description on FreeBSD
+	In the lexical analyzer, free up any addrinfo structure we got back
+	  from getaddrinfo().
+	Add support for BPF and libdlpi in OpenSolaris (and SXCE)
+	Hyphenate "link-layer" everywhere
+	Add /sys/kernel/debug/usb/usbmon to the list of usbmon locations
+	In pcap_read_linux_mmap(), if there are no frames available, call
+	  poll() even if we're in non-blocking mode, so we pick up
+	  errors, and check for the errors in question.
+	Note that poll() works on BPF devices is Snow Leopard
+	If an ENXIO or ENETDOWN is received, it may mean the device has
+	  gone away.  Deal with it.
+	For BPF, raise the default capture buffer size to from 32k to 512k
+	Support ps_ifdrop on Linux
+	Added a bunch of #ifdef directives to make wpcap.dll (WinPcap) compile
+	 under cygwin.
+	Changes to Linux mmapped captures.
+	Fix bug where create_ring would fail for particular snaplen and
+	  buffer size combinations
+	Update pcap-config so that it handles libpcap requiring
+	  additional libraries
+	Add workaround for threadsafeness on Windows
+	Add missing mapping for DLT_ENC <-> LINKTYPE_ENC
+	DLT: Add DLT_CAN_SOCKETCAN
+	DLT: Add Solaris ipnet
+	Don't check for DLT_IPNET if it's not defined
+	Add link-layer types for Fibre Channel FC-2
+	Add link-layer types for Wireless HART
+	Add link-layer types for AOS
+	Add link-layer types for DECT
+	Autoconf fixes (AIX, HP-UX, OSF/1, Tru64 cleanups)
+	Install headers unconditionally, and include vlan.h/bluetooth.h if
+	  enabled
+	Autoconf fixes+cleanup
+	Support enabling/disabling bluetooth (--{en,dis}able-bluetooth)
+	Support disabling SITA support (--without-sita)
+	Return -1 on failure to create packet ring (if supported but
+	  creation failed)
+	Fix handling of 'any' device, so that it can be opened, and no longer
+	  attempt to open it in Monitor mode
+	Add support for snapshot length for USB Memory-Mapped Interface
+	Fix configure and build on recent Linux kernels
+	Fix memory-mapped Linux capture to support pcap_next() and
+	  pcap_next_ex()
+	Fixes for Linux USB capture
+	DLT: Add DLT_LINUX_EVDEV
+	DLT: Add DLT_GSMTAP_UM
+	DLT: Add DLT_GSMTAP_ABIS
 
 Mon.    October 27, 2008.  ken@netfunctional.ca.  Summary for 1.0.0 libpcap release
 	Compile with IPv6 support by default
@@ -12,7 +85,10 @@ Mon.    October 27, 2008.  ken@netfuncti
 	Variable length 802.11 header support
 	X2E data type support 
 	SITA ACN Interface support - see README.sita
+	Support for memory-mapped capture on Linux
 	Support for zerocopy BPF on platforms that support it
+	Support for setting buffer size when opening devices
+	Support for setting monitor mode when opening 802.11 devices
 	Better support for dealing with VLAN tagging/stripping on Linux
 	Fix dynamic library support on OSX
 	Return PCAP_ERROR_IFACE_NOT_UP if the interface isn't 'UP', so applications
@@ -22,7 +98,7 @@ Mon.    October 27, 2008.  ken@netfuncti
 	On Linux, ignore ENETDOWN so we can continue to capture packets if the 
 	 interface goes down and comes back up again.
 	On Linux, support new tpacket frame headers (2.6.27+)
-	On Mac OS X, add scripts for changing permissions on /dev/pbf* and launchd plist
+	On Mac OS X, add scripts for changing permissions on /dev/bpf* and launchd plist
 	On Solaris, support 'passive mode' on systems that support it
 	Fixes to autoconf and general build environment
 	Man page reorganization + cleanup

Modified: head/contrib/libpcap/CREDITS
==============================================================================
--- head/contrib/libpcap/CREDITS	Fri Oct 29 18:41:09 2010	(r214517)
+++ head/contrib/libpcap/CREDITS	Fri Oct 29 18:43:23 2010	(r214518)
@@ -10,9 +10,10 @@ The current maintainers:
 Additional people who have contributed patches:
 
 	Alan Bawden			
+	Albert Chin			
 	Alexander 'Leo' Bergolth	
 	Alexey Kuznetsov		
-	Albert Chin			
+	Alon Bar-Lev			
 	Andrew Brown			
 	Antti Kantee			
 	Arien Vijn			
@@ -23,24 +24,28 @@ Additional people who have contributed p
 	Charles M. Hannum		
 	Chris G. Demetriou		
 	Chris Lightfoot			
+	Chris Maynard			
 	Chris Pepper			
+	Christian Bell			
 	Christian Peron			
 	Daniele Orlandi			
-	Darren Reed			
+	Darren Reed			
 	David Kaelbling			
 	David Young			
 	Dean Gaudet			
 	Don Ebright			 
 	Dug Song			
+	Dustin Spicuzza			
 	Eric Anderson			
 	Erik de Castro Lopo		
+	Felix Obenhuber			
 	Florent Drouin			
 	Franz Schaefer			
 	Fulko Hew			
+	Fumiyuki Shimizu		
 	Gianluca Varenni		
 	Gilbert Hoyek			
 	Gisle Vanem			
-	Gisle Vanem			
 	Graeme Hewson			
 	Greg Stark			
 	Greg Troxel			
@@ -53,11 +58,13 @@ Additional people who have contributed p
 	Jason R. Thorpe			
 	Javier Achirica			
 	Jean Tourrilhes			
+	Jean-Louis Charton		
 	Jefferson Ogata			
 	Jesper Peterson			
 	Joerg Mayer			
 	John Bankier			
 	Jon Lindgren			
+	Jon Smirl			
 	Juergen Schoenwaelder		
 	Jung-uk Kim			
 	Kazushi Sugyo			
@@ -67,19 +74,22 @@ Additional people who have contributed p
 	Krzysztof Halasa		
 	Lorenzo Cavallaro		
 	Loris Degioanni			
-	Love Hörnquist-Åstrand		
+	Love Hörnquist-Åstrand		
 	Luis Martin Garcia		
 	Maciej W. Rozycki		
 	Marcus Felipe Pereira		
 	Mark C. Brown			
 	Mark Pizzolato			
+	Markus Mayer			
 	Martin Husemann			
+	Márton Németh			
 	Matthew Luckie			
 	Max Laier			
 	Mike Frysinger			
 	Mike Kershaw			
 	Mike Wiacek			
 	Monroe Williams			
+	N. Leiten			
 	Nicolas Dade			
 	Octavian Cerna			
 	Olaf Kirch			
@@ -93,15 +103,20 @@ Additional people who have contributed p
 	Pawel Pokrywka			
 	Peter Fales			
 	Peter Jeremy			
+	Peter Volkov			
 	Phil Wood			
 	Rafal Maszkowski		
 					
 	Richard Stearn			
 	Rick Jones			
+	Robert Edmonds			
+	Roberto Mariani			
+	Romain Francoise		
 	Sagun Shakya			
 	Scott Barron			
 	Scott Gifford			
 	Sebastian Krahmer		
+	Sebastien Roy			
 	Sepherosa Ziehau		
 	Shaun Clowes			
 	Solomon Peachy			
@@ -109,12 +124,16 @@ Additional people who have contributed p
 	Stephen Donnelly		
 	Takashi Yamamoto		
 	Tanaka Shin-ya			
+	Tobias Poschwatta		
 	Tony Li				
 	Torsten Landschoff	 	
 	Uns Lider			
 	Uwe Girlich			
+	Wesley Shields			
 	Xianjie Zhang			
+	Xin Li				
 	Yen Yen Lim
+	Yvan Vanhullebus		
 	Yoann Vandoorselaere		
 
 The original LBL crew:

Modified: head/contrib/libpcap/INSTALL.txt
==============================================================================
--- head/contrib/libpcap/INSTALL.txt	Fri Oct 29 18:41:09 2010	(r214517)
+++ head/contrib/libpcap/INSTALL.txt	Fri Oct 29 18:43:23 2010	(r214518)
@@ -1,4 +1,4 @@
-@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.21.2.8 2008-06-12 20:25:38 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.29 2008-06-12 20:21:51 guy Exp $ (LBL)
 
 To build libpcap, run "./configure" (a shell script). The configure
 script will determine your system attributes and generate an

Modified: head/contrib/libpcap/Makefile.in
==============================================================================
--- head/contrib/libpcap/Makefile.in	Fri Oct 29 18:41:09 2010	(r214517)
+++ head/contrib/libpcap/Makefile.in	Fri Oct 29 18:43:23 2010	(r214518)
@@ -17,7 +17,7 @@
 #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
-# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.108.2.28 2008-10-23 22:13:21 guy Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.142 2008-11-22 17:30:24 guy Exp $ (LBL)
 
 #
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -44,14 +44,17 @@ VPATH = @srcdir@
 # You shouldn't need to edit anything below.
 #
 
+LD = /usr/bin/ld
 CC = @CC@
 CCOPT = @V_CCOPT@
 INCLS = -I. @V_INCLS@
 DEFS = @DEFS@ @V_DEFS@
-LIBS = @V_LIBS@
-DAGLIBS = @DAGLIBS@
-DEPLIBS = @DEPLIBS@
+ADDLOBJS = @ADDLOBJS@
+ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
+LIBS = @LIBS@
+LDFLAGS = @LDFLAGS@
 DYEXT = @DYEXT@
+V_RPATH_OPT = @V_RPATH_OPT@
 PROG=libpcap
 
 # Standard CFLAGS
@@ -77,12 +80,13 @@ YACC = @V_YACC@
 	@rm -f $@
 	$(CC) $(CFLAGS) -c $(srcdir)/$*.c
 
-PSRC =	pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@
+PSRC =	pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@
 FSRC =  fad-@V_FINDALLDEVS@.c
 SSRC =  @SSRC@
-CSRC =	pcap.c inet.c gencode.c optimize.c nametoaddr.c \
-	etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
-GENSRC = scanner.c grammar.c version.c
+CSRC =	pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \
+	savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \
+	bpf_image.c bpf_dump.c
+GENSRC = scanner.c grammar.c bpf_filter.c version.c
 LIBOBJS = @LIBOBJS@
 
 SRC =	$(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
@@ -90,8 +94,20 @@ SRC =	$(PSRC) $(FSRC) $(CSRC) $(SSRC) $(
 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
 # hack the extra indirection
 OBJ =	$(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
-HDR = \
-	acconfig.h \
+PUBHDR = \
+	pcap.h \
+	pcap-bpf.h \
+	pcap-namedb.h \
+	pcap/bpf.h \
+	pcap/bluetooth.h \
+	pcap/ipnet.h \
+	pcap/namedb.h \
+	pcap/pcap.h \
+	pcap/sll.h \
+	pcap/vlan.h \
+	pcap/usb.h
+
+HDR = $(PUBHDR) \
 	arcnet.h \
 	atmuni31.h \
 	ethertype.h \
@@ -99,30 +115,23 @@ HDR = \
 	ieee80211.h \
 	llc.h \
 	nlpid.h \
-	pcap/bluetooth.h \
-	pcap/bpf.h \
-	pcap/namedb.h \
-	pcap/pcap.h \
-	pcap/sll.h \
-	pcap/usb.h \
-	pcap/vlan.h \
-	pcap.h \
+	pcap-common.h \
 	pcap-int.h \
-	pcap-namedb.h \
 	pcap-stdinc.h \
 	ppp.h \
+	sf-pcap.h \
+	sf-pcap-ng.h \
 	sunatmpos.h
 
 GENHDR = \
 	scanner.h tokdefs.h version.h
 
-TAGHDR = \
-	pcap-bpf.h
-
 TAGFILES = \
-	$(SRC) $(HDR) $(TAGHDR)
+	$(SRC) $(HDR)
 
-CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
+CLEANFILES = $(OBJ) libpcap.* filtertest findalldevstest selpolltest \
+	opentest $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
+	lex.yy.c pcap-config
 
 MAN1 = pcap-config.1
 
@@ -254,13 +263,14 @@ EXTRA_DIST = \
 	msdos/pktdrvr.c \
 	msdos/pktdrvr.h \
 	msdos/readme.dos \
-	net/bpf_filter.c \
+	opentest.c \
 	org.tcpdump.chmod_bpf.plist \
 	packaging/pcap.spec.in \
 	pcap-bpf.c \
-	pcap-bpf.h \
 	pcap-bt-linux.c \
 	pcap-bt-linux.h \
+	pcap-can-linux.c \
+	pcap-can-linux.h \
 	pcap-config.in \
 	pcap-dag.c \
 	pcap-dag.h \
@@ -280,6 +290,8 @@ EXTRA_DIST = \
 	pcap-sita.h \
 	pcap-sita.c \
 	pcap-sita.html \
+	pcap-snf.c \
+	pcap-snf.h \
 	pcap-snit.c \
 	pcap-snoop.c \
 	pcap-usb-linux.c \
@@ -287,6 +299,7 @@ EXTRA_DIST = \
 	pcap-win32.c \
 	runlex.sh \
 	scanner.l \
+	selpolltest.c \
 	Win32/Include/Gnuc.h \
 	Win32/Include/addrinfo.h \
 	Win32/Include/bittypes.h \
@@ -311,42 +324,94 @@ EXTRA_DIST = \
 	Win32/Src/inet_net.c \
 	Win32/Src/inet_pton.c
 
-all: libpcap.a pcap-config
+all: libpcap.a shared pcap-config
 
 libpcap.a: $(OBJ)
 	@rm -f $@
-	$(AR) rc $@ $(OBJ) $(LIBS)
+	ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
 	$(RANLIB) $@
 
 shared: libpcap.$(DYEXT)
 
-#
-# XXX - this works with GNU ld, but won't necessarily work with native
-# ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
-#
 libpcap.so: $(OBJ)
 	@rm -f $@
-	$(CC) -shared -Wl,-soname,$@.1 -o $@.`cat $(srcdir)/VERSION` $(OBJ) $(DAGLIBS)
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	@V_SHLIB_CMD@ @V_SHLIB_OPT@ @V_SONAME_OPT@$@.$$MAJOR_VER $(LDFLAGS) \
+	    -o $@.$$VER $(OBJ) $(ADDLOBJS) $(LIBS)
 
 #
 # The following rule succeeds, but the result is untested.
 #
-# XXX - OS X installs the library as "libpcap.A.dylib", with that as the
-# install_name, and sets the current version to 1 as well.  VERSION
-# might contain a not-purely-numeric version number, but
-# -current_version requires a purely numeric version, so this won't
-# work with top-of-tree builds.
+# In Mac OS X, the libpcap dylib has the name "libpcap.A.dylib", with
+# its full path as the install_name, and with the compatibility and
+# current version both set to 1.  The compatibility version is set to
+# 1 so that programs built with a newer version of the library will run
+# against older versions; multi-platform software probably will fail if
+# it uses APIs added in the newer version, but Mac OS X-specific software
+# will use weak linking and check at run time whether those APIs are
+# available.
+#
+# We also use "A" as the major version, and 1 as the compatibility version,
+# but set the current version to the value in VERSION, with any non-numeric
+# stuff stripped off (the compatibility and current version must be of the
+# form X[.Y[.Z]], with Y and Z possibly absent, and with all components
+# numeric).
 #
 libpcap.dylib: $(OBJ)
 	rm -f libpcap*.dylib
-	$(CC) -dynamiclib -undefined error -o libpcap.`cat $(srcdir)/VERSION`.dylib $(OBJ) \
-		-install_name $(libdir)/libpcap.A.dylib \
-		-compatibility_version 1 \
-		-current_version `sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=A; \
+	COMPAT_VER=1; \
+	CURRENT_VER=`sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`; \
+	$(CC) -dynamiclib -undefined error $(LDFLAGS) \
+	    -o libpcap.$$VER.dylib $(OBJ) $(ADDLOBJS) $(LIBS) \
+	    -install_name $(libdir)/libpcap.$$MAJOR_VER.dylib \
+	    -compatibility_version $$COMPAT_VER \
+	    -current_version $$CURRENT_VER
+
+#
+# The HP-UX linker manual says that the convention for a versioned library
+# is libXXX.{number}, not libXXX.sl.{number}.  That appears to be the case
+# on at least one HP-UX 11.00 system; libXXX.sl is a symlink to
+# libXXX.{number}.
+#
+# The manual also says "library-level versioning" (think "sonames") was
+# added in HP-UX 10.0.
+#
+# XXX - this assumes we're using the HP linker, rather than the GNU
+# linker, even with GCC.
+#
+libpcap.sl: $(OBJ)
+	@MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	rm -f libpcap.$$MAJOR_VER
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	ld -b $(LDFLAGS) -o libpcap.$$MAJOR_VER +h libpcap.$$MAJOR_VER \
+	    $(OBJ) $(ADDLOBJS) $(LIBS)
+
+#
+# AIX is different from everybody else.  A shared library is an archive
+# library with one or more shared-object components.  We still build a
+# normal static archive library on AIX, for the benefit of the traditional
+# scheme of building libpcap and tcpdump in subdirectories of the
+# same directory, with tcpdump statically linked with the libpcap
+# in question, but we also build a shared library as "libpcap.shareda"
+# and install *it*, rather than the static library, as "libpcap.a".
+#
+libpcap.shareda: $(OBJ)
+	@rm -f $@ shr.o
+	$(CC) @V_SHLIB_OPT@ -o shr.o $(OBJ) $(ADDLOBJS) $(LDFLAGS) $(LIBS)
+	ar rc $@ shr.o
+
+#
+# For platforms that don't support shared libraries (or on which we
+# don't support shared libraries).
+#
+libpcap.none:
 
 scanner.c: $(srcdir)/scanner.l
 	@rm -f $@
-	./runlex.sh $(LEX) -o$@ $<
+	$(srcdir)/runlex.sh $(LEX) -o$@ $<
 
 scanner.o: scanner.c tokdefs.h
 	$(CC) $(CFLAGS) -c scanner.c
@@ -372,7 +437,13 @@ snprintf.o: $(srcdir)/missing/snprintf.c
 
 version.c: $(srcdir)/VERSION
 	@rm -f $@
-	sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
+	if grep GIT ${srcdir}/VERSION >/dev/null; then \
+		read ver <${srcdir}/VERSION; \
+		echo $$ver | tr -d '\012'; \
+		date +_%Y_%m_%d; \
+	else \
+		cat ${srcdir}/VERSION; \
+	fi | sed -e 's/.*/char pcap_version[] = "&";/' > $@
 
 #
 # NOTE: this really is supposed to be static; importing a string
@@ -383,7 +454,13 @@ version.c: $(srcdir)/VERSION
 #
 version.h: $(srcdir)/VERSION
 	@rm -f $@
-	sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
+	if grep GIT ${srcdir}/VERSION >/dev/null; then \
+		read ver <${srcdir}/VERSION; \
+		echo $$ver | tr -d '\012'; \
+		date +_%Y_%m_%d; \
+	else \
+		cat ${srcdir}/VERSION; \
+	fi | sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' > $@
 
 bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
 	rm -f bpf_filter.c
@@ -395,12 +472,13 @@ bpf_filter.o: bpf_filter.c
 #
 # Generate the pcap-config script.
 #
-pcap-config: pcap-config.in Makefile
+pcap-config: $(srcdir)/pcap-config.in
 	@rm -f $@ $@.tmp
 	sed -e 's|@includedir[@]|$(includedir)|g' \
 	    -e 's|@libdir[@]|$(libdir)|g' \
-	    -e 's|@DEPLIBS[@]|$(DEPLIBS)|g' \
-	    pcap-config.in >$@.tmp
+	    -e 's|@LIBS[@]|$(LIBS)|g' \
+	    -e 's|@V_RPATH_OPT[@]|$(V_RPATH_OPT)|g' \
+	    $(srcdir)/pcap-config.in >$@.tmp
 	mv $@.tmp $@
 	chmod a+x $@
 
@@ -408,16 +486,20 @@ pcap-config: pcap-config.in Makefile
 # Test programs - not built by default, and not installed.
 #
 filtertest: filtertest.c libpcap.a
-	$(CC) $(CFLAGS) -I. -L. -o filtertest filtertest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o filtertest $(srcdir)/filtertest.c libpcap.a $(LIBS)
 
 findalldevstest: findalldevstest.c libpcap.a
-	$(CC) $(CFLAGS) -I. -L. -o findalldevstest findalldevstest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o findalldevstest $(srcdir)/findalldevstest.c libpcap.a $(LIBS)
+
+selpolltest: selpolltest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o selpolltest $(srcdir)/selpolltest.c libpcap.a $(LIBS)
+
+opentest: opentest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o opentest $(srcdir)/opentest.c libpcap.a $(LIBS)
 
-install: libpcap.a pcap-config
+install: install-shared install-archive pcap-config
 	[ -d $(DESTDIR)$(libdir) ] || \
 	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
-	$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
-	$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
 	[ -d $(DESTDIR)$(includedir) ] || \
 	    (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
 	[ -d $(DESTDIR)$(includedir)/pcap ] || \
@@ -430,91 +512,151 @@ install: libpcap.a pcap-config
 	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@)
 	[ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \
 	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@)
-	$(INSTALL_DATA) $(srcdir)/pcap/pcap.h \
-	    $(DESTDIR)$(includedir)/pcap/pcap.h
-	$(INSTALL_DATA) $(srcdir)/pcap/bpf.h \
-	    $(DESTDIR)$(includedir)/pcap/bpf.h
-	$(INSTALL_DATA) $(srcdir)/pcap/namedb.h \
-	    $(DESTDIR)$(includedir)/pcap/namedb.h
-	$(INSTALL_DATA) $(srcdir)/pcap/sll.h \
-	    $(DESTDIR)$(includedir)/pcap/sll.h
-	$(INSTALL_DATA) $(srcdir)/pcap/usb.h \
-	    $(DESTDIR)$(includedir)/pcap/usb.h
-	$(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
-	$(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
-	    $(DESTDIR)$(includedir)/pcap-bpf.h
-	$(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
-	    $(DESTDIR)$(includedir)/pcap-namedb.h
+	for i in $(PUBHDR); do \
+		$(INSTALL_DATA) $(srcdir)/$$i \
+		    $(DESTDIR)$(includedir)/$$i; done
+	[ -d $(DESTDIR)$(bindir) ] || \
+	    (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
 	$(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config
 	for i in $(MAN1); do \
 		$(INSTALL_DATA) $(srcdir)/$$i \
 		    $(DESTDIR)$(mandir)/man1/$$i; done
-	for i in $(MAN3PCAP); do \
+	for i in $(MAN3PCAP_NOEXPAND); do \
 		$(INSTALL_DATA) $(srcdir)/$$i \
 		    $(DESTDIR)$(mandir)/man3/$$i; done
+	for i in $(MAN3PCAP_EXPAND:.in=); do \
+		$(INSTALL_DATA) $$i \
+		    $(DESTDIR)$(mandir)/man3/$$i; done
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_name.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_major_version.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_next_ex.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
 	ln $(DESTDIR)$(mandir)/man3/pcap_setnonblock.3pcap \
 		 $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
 	for i in $(MANFILE); do \
-		$(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manfile.in/.manfile/'` \
+		$(INSTALL_DATA) `echo $$i | sed 's/.manfile.in/.manfile/'` \
 		    $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
 	for i in $(MANMISC); do \
-		$(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manmisc.in/.manmisc/'` \
+		$(INSTALL_DATA) `echo $$i | sed 's/.manmisc.in/.manmisc/'` \
 		    $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
 
 install-shared: install-shared-$(DYEXT)
 install-shared-so: libpcap.so
-	$(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	$(INSTALL_PROGRAM) libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$VER; \
+	ln -sf libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \
+	ln -sf libpcap.so.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.so
 install-shared-dylib: libpcap.dylib
-	$(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
-	VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.A.dylib;  ln -sf libpcap.A.dylib libpcap.dylib
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=A; \
+	$(INSTALL_PROGRAM) libpcap.$$VER.dylib $(DESTDIR)$(libdir)/libpcap.$$VER.dylib; \
+	ln -sf libpcap.$$VER.dylib $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER.dylib; \
+	ln -sf libpcap.$$MAJOR_VER.dylib $(DESTDIR)$(libdir)/libpcap.dylib
+install-shared-sl: libpcap.sl
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	$(INSTALL_PROGRAM) libpcap.$$MAJOR_VER $(DESTDIR)$(libdir)
+	ln -sf libpcap.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.sl
+install-shared-shareda: libpcap.shareda
+	#
+	# AIX shared libraries are weird.  They're archive libraries
+	# with one or more shared object components.
+	#
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	$(INSTALL_PROGRAM) libpcap.shareda $(DESTDIR)$(libdir)/libpcap.a
+install-shared-none:
 
-uninstall:
+install-archive: install-archive-$(DYEXT)
+install-archive-so install-archive-dylib install-archive-sl install-archive-none: libpcap.a
+	#
+	# Most platforms have separate suffixes for shared and
+	# archive libraries, so we install both.
+	#
+	[ -d $(DESTDIR)$(libdir) ] || \
+	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
+	$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
+	$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
+install-archive-shareda:
+	#
+	# AIX, however, doesn't, so we don't install the archive
+	# library on AIX.
+	#
+
+uninstall: uninstall-shared
 	rm -f $(DESTDIR)$(libdir)/libpcap.a
-	rm -f $(DESTDIR)$(includedir)/pcap/pcap.h
-	rm -f $(DESTDIR)$(includedir)/pcap/bpf.h
-	rm -f $(DESTDIR)$(includedir)/pcap/namedb.h
-	rm -f $(DESTDIR)$(includedir)/pcap/sll.h
-	rm -f $(DESTDIR)$(includedir)/pcap/usb.h
+	for i in $(PUBHDR); do \
+		rm -f $(DESTDIR)$(includedir)/$$i; done
 	-rmdir $(DESTDIR)$(includedir)/pcap
-	rm -f $(DESTDIR)$(includedir)/pcap.h
-	rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
-	rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
+	rm -f $(DESTDIR)/$(bindir)/pcap-config
 	for i in $(MAN1); do \
 		rm -f $(DESTDIR)$(mandir)/man1/$$i; done
 	for i in $(MAN3PCAP); do \
 		rm -f $(DESTDIR)$(mandir)/man3/$$i; done
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
-	rm -f  $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
+	rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
 	for i in $(MANFILE); do \
 		rm -f $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
 	for i in $(MANMISC); do \
 		rm -f $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
 
+uninstall-shared: uninstall-shared-$(DYEXT)
+uninstall-shared-so:
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.so.$$VER; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.so
+uninstall-shared-dylib:
+	VER=`cat $(srcdir)/VERSION`; \
+	MAJOR_VER=A; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.$$VER.dylib; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER.dylib; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.dylib
+uninstall-shared-sl:
+	MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER; \
+	rm -f $(DESTDIR)$(libdir)/libpcap.sl
+uninstall-shared-shareda:
+	rm -f $(DESTDIR)$(libdir)/libpcap.a
+uninstall-shared-none:
+
 clean:
-	rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
+	rm -f $(CLEANFILES)
 
 distclean: clean
 	rm -f Makefile config.cache config.log config.status \
@@ -530,7 +672,7 @@ packaging/pcap.spec: packaging/pcap.spec
 	RPMVERSION=`cat VERSION | sed s/-.*//g`; \
 		sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $<   > $@
 
-releasetar:
+releasetar: 
 	@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
 	   mkdir $$name; \
 	   tar cf - $(CSRC) $(HDR) $(MAN1) $(MAN3PCAP_EXPAND) \

Modified: head/contrib/libpcap/README
==============================================================================
--- head/contrib/libpcap/README	Fri Oct 29 18:41:09 2010	(r214517)
+++ head/contrib/libpcap/README	Fri Oct 29 18:43:23 2010	(r214518)
@@ -1,19 +1,17 @@
-@(#) $Header: /tcpdump/master/libpcap/README,v 1.30.4.3 2008-10-17 10:39:20 ken Exp $ (LBL)
+@(#) $Header: /tcpdump/master/libpcap/README,v 1.34 2008-12-14 19:44:14 guy Exp $ (LBL)
 
-LIBPCAP 1.0.0
+LIBPCAP 1.x.y
 
 www.tcpdump.org
 
 Please send inquiries/comments/reports to:
 	tcpdump-workers@lists.tcpdump.org
 
-Anonymous CVS is available via:
-	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master login
-	(password "anoncvs")
-	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout libpcap
+Anonymous Git is available via:
+	git clone git://bpf.tcpdump.org/libpcap
 
-Version 1.0.0 of LIBPCAP can be retrieved with the CVS tag "libpcap_1_0":
-	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_1_0 libpcap
+Version 1.x.y of LIBPCAP can be retrieved with the CVS tag "libpcap_1_{x}rel{y}":
+	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_1_{x}rel{y} libpcap
 
 Please submit patches against the master copy to the libpcap project on
 sourceforge.net.
@@ -80,10 +78,10 @@ information on configuring that option.
 Note to Linux distributions and *BSD systems that include libpcap:
 
 There's now a rule to make a shared library, which should work on Linux 
-and *BSD (and OS X).
+and *BSD, among other platforms.
 
 It sets the soname of the library to "libpcap.so.1"; this is what it 
-should be, *NOT* libpcap.so.1.0 or libpcap.so.1.0.0 or something such as 
+should be, *NOT* libpcap.so.1.x or libpcap.so.1.x.y or something such as 
 that.
 
 We've been maintaining binary compatibility between libpcap releases for 

Copied: head/contrib/libpcap/README.Win32 (from r214514, vendor/libpcap/dist/README.Win32)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/libpcap/README.Win32	Fri Oct 29 18:43:23 2010	(r214518, copy of r214514, vendor/libpcap/dist/README.Win32)
@@ -0,0 +1,46 @@
+Under Win32, libpcap is integrated in the WinPcap packet capture system. 
+WinPcap provides a framework that allows libpcap to capture the packets 
+under Windows 95, Windows 98, Windows ME, Windows NT 4, Windows 2000 
+and Windows XP.
+WinPcap binaries and source code can be found at http://winpcap.polito.it: 
+they include also a developer's pack with all the necessary to compile 
+libpcap-based applications under Windows.
+
+How to compile libpcap with Visual Studio
+-----------------------------------------
+
+In order to compile libpcap you will need:
+
+- version 6 (or higher) of Microsoft Visual Studio
+- The November 2001 (or later) edition of Microsoft Platform 
+Software Development Kit (SDK), that contains some necessary includes 
+for IPv6 support. You can download it from http://www.microsoft.com/sdk
+- the latest WinPcap sources from http://winpcap.polito.it/install 
+
+The WinPcap source code already contains a recent (usually the latest 
+stable) version of libpcap. If you need to compile a different one, 
+simply download it from www.tcpdump.org and copy the sources in the 
+winpcap\wpcap\libpcap folder of the WinPcap distribution. If you want to
+compile a libpcap source retrieved from the tcpdump.org Git, you will 
+have to create the scanner and the grammar by hand (with lex and yacc) 
+or with the cygnus makefile, since The Visual Studio project is not able
+to build them.
+
+Open the project file winpcap\wpcap\prj\wpcap.dsw with Visual Studio and 
+build wpcap.dll. wpcap.lib, the library file to link with the applications, 
+will be generated in winpcap\wpcap\lib\. wpcap.dll will be generated in 
+winpcap\wpcap\prj\release or winpcap\wpcap\prj\debug depending on the type 
+of binary that is being created.
+
+How to compile libpcap with Cygnus
+----------------------------------
+
+To build wpcap.dll, cd to the directory WPCAP/PRJ of the WinPcap source code 
+distribution and type "make". libwpcap.a, the library file to link with the 
+applications, will be generated in winpcap\wpcap\lib\. wpcap.dll will be 
+generated in winpcap\wpcap\prj.
+
+Remember, you CANNOT use the MSVC-generated .lib files with gcc, use 
+libwpcap.a instead.
+
+"make install" installs wpcap.dll in the Windows system folder.

Copied: head/contrib/libpcap/README.aix (from r214514, vendor/libpcap/dist/README.aix)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/libpcap/README.aix	Fri Oct 29 18:43:23 2010	(r214518, copy of r214514, vendor/libpcap/dist/README.aix)
@@ -0,0 +1,81 @@
+Using BPF:
+
+(1) AIX 4.x's version of BPF is undocumented and somewhat unstandard; the
+    current BPF support code includes changes that should work around
+    that; it appears to compile and work on at least one AIX 4.3.3
+    machine.
+
+    Note that the BPF driver and the "/dev/bpf" devices might not exist
+    on your machine; AIX's tcpdump loads the driver and creates the
+    devices if they don't already exist.  Our libpcap should do the
+    same, and the configure script should detect that it's on an AIX
+    system and choose BPF even if the devices aren't there.
+
+(2) If libpcap doesn't compile on your machine when configured to use
+    BPF, or if the workarounds fail to make it work correctly, you
+    should send to tcpdump-workers@lists.tcpdump.org a detailed bug
+    report (if the compile fails, send us the compile error messages;
+    if it compiles but fails to work correctly, send us as detailed as
+    possible a description of the symptoms, including indications of the
+    network link-layer type being wrong or time stamps being wrong).
+
+    If you fix the problems yourself, please submit a patch to
+
+	http://sourceforge.net/projects/libpcap/
+
+    so we can incorporate them into the next release.
+
+    If you don't fix the problems yourself, you can, as a workaround,
+    make libpcap use DLPI instead of BPF.
+
+    This can be done by specifying the flag:
+
+       --with-pcap=dlpi
+
+    to the "configure" script for libpcap.
+
+If you use DLPI:
+
+(1) It is a good idea to have the latest version of the DLPI driver on
+    your system, since certain versions may be buggy and cause your AIX
+    system to crash.  DLPI is included in the fileset bos.rte.tty.  I
+    found that the DLPI driver that came with AIX 4.3.2 was buggy, and
+    had to upgrade to bos.rte.tty 4.3.2.4:
+
+	    lslpp -l bos.rte.tty
+
+	    bos.rte.tty     4.3.2.4  COMMITTED  Base TTY Support and Commands
+
+    Updates for AIX filesets can be obtained from:
+    ftp://service.software.ibm.com/aix/fixes/
+
+    These updates can be installed with the smit program.
+
+(2) After compiling libpcap, you need to make sure that the DLPI driver
+    is loaded.  Type:
+
+	    strload -q -d dlpi
+
+    If the result is:
+
+	    dlpi: yes
+
+    then the DLPI driver is loaded correctly.
+
+    If it is:
+
+	    dlpi: no
+
+    Then you need to type:
+
+	    strload -f /etc/dlpi.conf
+ 
+    Check again with strload -q -d dlpi that the dlpi driver is loaded.  
+
+    Alternatively, you can uncomment the lines for DLPI in
+    /etc/pse.conf and reboot the machine; this way DLPI will always
+    be loaded when you boot your system.
+
+(3) There appears to be a problem in the DLPI code in some versions of
+    AIX, causing a warning about DL_PROMISC_MULTI failing; this might
+    be responsible for DLPI not being able to capture outgoing packets.

Copied: head/contrib/libpcap/README.dag (from r214514, vendor/libpcap/dist/README.dag)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/libpcap/README.dag	Fri Oct 29 18:43:23 2010	(r214518, copy of r214514, vendor/libpcap/dist/README.dag)
@@ -0,0 +1,114 @@
+
+The following instructions apply if you have a Linux or FreeBSD platform and
+want libpcap to support the DAG range of passive network monitoring cards from
+Endace (http://www.endace.com, see below for further contact details).
+
+1) Install and build the DAG software distribution by following the
+instructions supplied with that package. Current Endace customers can download
+the DAG software distibution from https://www.endace.com
+
+2) Configure libcap. To allow the 'configure' script to locate the DAG
+software distribution use the '--with-dag' option:
+
+        ./configure --with-dag=DIR
+
+Where DIR is the root of the DAG software distribution, for example
+/var/src/dag. If the DAG software is correctly detected 'configure' will
+report:
+
+        checking whether we have DAG API... yes
+
+If 'configure' reports that there is no DAG API, the directory may have been
+incorrectly specified or the DAG software was not built before configuring
+libpcap.
+
+See also the libpcap INSTALL.txt file for further libpcap configuration
+options.
+
+Building libpcap at this stage will include support for both the native packet
+capture stream (linux or bpf) and for capturing from DAG cards. To build
+libpcap with only DAG support specify the capture type as 'dag' when
+configuring libpcap:
+
+        ./configure --with-dag=DIR --with-pcap=dag
+
+Applications built with libpcap configured in this way will only detect DAG
+cards and will not capture from the native OS packet stream.
+
+----------------------------------------------------------------------
+
+Libpcap when built for DAG cards against dag-2.5.1 or later releases:
+
+Timeouts are supported. pcap_dispatch() will return after to_ms milliseconds
+regardless of how many packets are received. If to_ms is zero pcap_dispatch()
+will block waiting for data indefinitely.
+
+pcap_dispatch() will block on and process a minimum of 64kB of data (before
+filtering) for efficiency. This can introduce high latencies on quiet
+interfaces unless a timeout value is set. The timeout expiring will override
+the 64kB minimum causing pcap_dispatch() to process any available data and
+return.
+
+pcap_setnonblock is supported. When nonblock is set, pcap_dispatch() will
+check once for available data, process any data available up to count, then
+return immediately.
+
+pcap_findalldevs() is supported, e.g. dag0, dag1...
+
+Some DAG cards can provide more than one 'stream' of received data.
+This can be data from different physical ports, or separated by filtering
+or load balancing mechanisms. Receive streams have even numbers, e.g.
+dag0:0, dag0:2 etc. Specifying transmit streams for capture is not supported.
+

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 18:45: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 EF2441065695;
	Fri, 29 Oct 2010 18:45:10 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DD7E88FC1C;
	Fri, 29 Oct 2010 18:45: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 o9TIjArt049642;
	Fri, 29 Oct 2010 18:45:10 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TIjAO7049640;
	Fri, 29 Oct 2010 18:45:10 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010291845.o9TIjAO7049640@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 18:45: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: r214519 - head/lib/libpcap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 18:45:11 -0000

Author: rpaulo
Date: Fri Oct 29 18:45:10 2010
New Revision: 214519
URL: http://svn.freebsd.org/changeset/base/214519

Log:
  Update for libpcap-1.1.1.

Modified:
  head/lib/libpcap/Makefile

Modified: head/lib/libpcap/Makefile
==============================================================================
--- head/lib/libpcap/Makefile	Fri Oct 29 18:43:23 2010	(r214518)
+++ head/lib/libpcap/Makefile	Fri Oct 29 18:45:10 2010	(r214519)
@@ -9,7 +9,7 @@ LIB=	pcap
 SRCS=	grammar.y tokdefs.h version.h pcap-bpf.c \
 	pcap.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \
 	etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \
-	scanner.l version.c
+	scanner.l sf-pcap.c sf-pcap-ng.c version.c
 
 # Old compatibility headers
 INCS=	pcap.h pcap-int.h pcap-namedb.h pcap-bpf.h

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 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 0112E106564A;
	Fri, 29 Oct 2010 18:50:39 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C8C918FC1C;
	Fri, 29 Oct 2010 18:50: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 o9TIoclo049998;
	Fri, 29 Oct 2010 18:50:38 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TIoc7T049997;
	Fri, 29 Oct 2010 18:50:38 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010291850.o9TIoc7T049997@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 18:50: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: r214520 - in head/contrib/libpcap: . ChmodBPF SUNOS4
	Win32 msdos
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 18:50:39 -0000

Author: rpaulo
Date: Fri Oct 29 18:50:38 2010
New Revision: 214520
URL: http://svn.freebsd.org/changeset/base/214520

Log:
  Remove unused files.

Deleted:
  head/contrib/libpcap/ChmodBPF/
  head/contrib/libpcap/FREEBSD-Xlist
  head/contrib/libpcap/FREEBSD-upgrade
  head/contrib/libpcap/README.Win32
  head/contrib/libpcap/README.aix
  head/contrib/libpcap/README.macosx
  head/contrib/libpcap/README.tru64
  head/contrib/libpcap/SUNOS4/
  head/contrib/libpcap/Win32/
  head/contrib/libpcap/msdos/
  head/contrib/libpcap/org.tcpdump.chmod_bpf.plist

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 18:56: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 8C945106566C;
	Fri, 29 Oct 2010 18:56:51 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6070A8FC1A;
	Fri, 29 Oct 2010 18:56: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 o9TIupGV050344;
	Fri, 29 Oct 2010 18:56:51 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TIupEC050343;
	Fri, 29 Oct 2010 18:56:51 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010291856.o9TIupEC050343@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 18:56: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: r214521 - head/contrib/libpcap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 18:56:51 -0000

Author: rpaulo
Date: Fri Oct 29 18:56:51 2010
New Revision: 214521
URL: http://svn.freebsd.org/changeset/base/214521

Log:
  Remove more unused files.

Deleted:
  head/contrib/libpcap/README.dag
  head/contrib/libpcap/README.hpux
  head/contrib/libpcap/README.linux
  head/contrib/libpcap/README.septel
  head/contrib/libpcap/README.sita

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 19:07: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 4D78B106566B;
	Fri, 29 Oct 2010 19:07:37 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B8D98FC0A;
	Fri, 29 Oct 2010 19:07: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 o9TJ7bQS051067;
	Fri, 29 Oct 2010 19:07:37 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TJ7bTG051065;
	Fri, 29 Oct 2010 19:07:37 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201010291907.o9TJ7bTG051065@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 29 Oct 2010 19:07: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: r214522 - 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, 29 Oct 2010 19:07:37 -0000

Author: trasz
Date: Fri Oct 29 19:07:36 2010
New Revision: 214522
URL: http://svn.freebsd.org/changeset/base/214522

Log:
  Fix uninitialized variable.
  
  Found with:	Coverity Prevent(tm)
  CID:		8632

Modified:
  head/sys/kern/subr_acl_nfs4.c

Modified: head/sys/kern/subr_acl_nfs4.c
==============================================================================
--- head/sys/kern/subr_acl_nfs4.c	Fri Oct 29 18:56:51 2010	(r214521)
+++ head/sys/kern/subr_acl_nfs4.c	Fri Oct 29 19:07:36 2010	(r214522)
@@ -162,7 +162,7 @@ vaccess_acl_nfs4(enum vtype type, uid_t 
 	accmode_t priv_granted = 0;
 	int denied, explicitly_denied, access_mask, is_directory,
 	    must_be_owner = 0;
-	mode_t file_mode;
+	mode_t file_mode = 0;
 
 	KASSERT((accmode & ~(VEXEC | VWRITE | VREAD | VADMIN | VAPPEND |
 	    VEXPLICIT_DENY | VREAD_NAMED_ATTRS | VWRITE_NAMED_ATTRS |

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 19:17: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 49D04106566C;
	Fri, 29 Oct 2010 19:17:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1D6428FC13;
	Fri, 29 Oct 2010 19:17: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 o9TJH8Rj051633;
	Fri, 29 Oct 2010 19:17:08 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TJH8MU051631;
	Fri, 29 Oct 2010 19:17:08 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201010291917.o9TJH8MU051631@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 29 Oct 2010 19:17: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: r214523 - head/usr.sbin/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: Fri, 29 Oct 2010 19:17:08 -0000

Author: jhb
Date: Fri Oct 29 19:17:07 2010
New Revision: 214523
URL: http://svn.freebsd.org/changeset/base/214523

Log:
  Remove support for creating the 'machine' symlink as well as creating the
  extra MACHINE_ARCH symlink for certain platforms (such as pc98).  The
  support for creating these symlinks was added to sys/conf/kern.post.mk in
  changeset 152964.  The intention of that commit was to remove this code
  from config(8), but config(8) was never updated.
  
  Approved by:	imp

Modified:
  head/usr.sbin/config/main.c

Modified: head/usr.sbin/config/main.c
==============================================================================
--- head/usr.sbin/config/main.c	Fri Oct 29 19:07:36 2010	(r214522)
+++ head/usr.sbin/config/main.c	Fri Oct 29 19:17:07 2010	(r214523)
@@ -108,7 +108,6 @@ main(int argc, char **argv)
 	struct stat buf;
 	int ch, len;
 	char *p;
-	char xxx[MAXPATHLEN];
 	char *kernfile;
 	int printmachine;
 
@@ -218,32 +217,6 @@ main(int argc, char **argv)
 	} else if (!S_ISDIR(buf.st_mode))
 		errx(EXIT_FAILURE, "%s isn't a directory", p);
 
-	/*
-	 * make symbolic links in compilation directory
-	 * for "sys" (to make genassym.c work along with #include )
-	 * and similarly for "machine".
-	 */
-	if (*srcdir == '\0')
-		(void)snprintf(xxx, sizeof(xxx), "../../include");
-	else
-		(void)snprintf(xxx, sizeof(xxx), "%s/%s/include",
-		    srcdir, machinename);
-	(void) unlink(path("machine"));
-	(void) symlink(xxx, path("machine"));
-	if (strcmp(machinename, machinearch) != 0) {
-		/*
-		 * make symbolic links in compilation directory for
-		 * machinearch, if it is different than machinename.
-		 */
-		if (*srcdir == '\0')
-			(void)snprintf(xxx, sizeof(xxx), "../../../%s/include",
-			    machinearch);
-		else
-			(void)snprintf(xxx, sizeof(xxx), "%s/%s/include",
-			    srcdir, machinearch);
-		(void) unlink(path(machinearch));
-		(void) symlink(xxx, path(machinearch));
-	}
 	configfile();			/* put config file into kernel*/
 	options();			/* make options .h files */
 	makefile();			/* build Makefile */

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 19:34: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 BAA38106564A;
	Fri, 29 Oct 2010 19:34:57 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A7A428FC0A;
	Fri, 29 Oct 2010 19:34: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 o9TJYvJD052572;
	Fri, 29 Oct 2010 19:34:57 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TJYv7M052569;
	Fri, 29 Oct 2010 19:34:57 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201010291934.o9TJYv7M052569@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 29 Oct 2010 19:34: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: r214524 - in head: bin/sh
	tools/regression/bin/sh/expansion
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 19:34:58 -0000

Author: jilles
Date: Fri Oct 29 19:34:57 2010
New Revision: 214524
URL: http://svn.freebsd.org/changeset/base/214524

Log:
  sh: Fix some issues with CTL* bytes and ${var#pat}.
  
  subevalvar() incorrectly assumed that CTLESC bytes were present iff the
  expansion was quoted. However, they are present iff various processing such
  as word splitting is to be done later on.
  
  Example:
    v=@$e@$e@$e@
    y="${v##*"$e"}"
    echo "$y"
  failed if $e contained the magic CTLESC byte.
  
  Exp-run done by:	pav (with some other sh(1) changes)

Added:
  head/tools/regression/bin/sh/expansion/trim6.0   (contents, props changed)
Modified:
  head/bin/sh/expand.c

Modified: head/bin/sh/expand.c
==============================================================================
--- head/bin/sh/expand.c	Fri Oct 29 19:17:07 2010	(r214523)
+++ head/bin/sh/expand.c	Fri Oct 29 19:34:57 2010	(r214524)
@@ -98,7 +98,7 @@ static struct arglist exparg;		/* holds 
 static void argstr(char *, int);
 static char *exptilde(char *, int);
 static void expbackq(union node *, int, int);
-static int subevalvar(char *, char *, int, int, int, int);
+static int subevalvar(char *, char *, int, int, int, int, int);
 static char *evalvar(char *, int);
 static int varisset(char *, int);
 static void varvalue(char *, int, int, int);
@@ -526,7 +526,7 @@ expbackq(union node *cmd, int quoted, in
 
 static int
 subevalvar(char *p, char *str, int strloc, int subtype, int startloc,
-  int varflags)
+  int varflags, int quotes)
 {
 	char *startp;
 	char *loc = NULL;
@@ -571,12 +571,12 @@ subevalvar(char *p, char *str, int strlo
 		for (loc = startp; loc < str; loc++) {
 			c = *loc;
 			*loc = '\0';
-			if (patmatch(str, startp, varflags & VSQUOTE)) {
+			if (patmatch(str, startp, quotes)) {
 				*loc = c;
 				goto recordleft;
 			}
 			*loc = c;
-			if ((varflags & VSQUOTE) && *loc == CTLESC)
+			if (quotes && *loc == CTLESC)
 				loc++;
 		}
 		return 0;
@@ -585,14 +585,13 @@ subevalvar(char *p, char *str, int strlo
 		for (loc = str - 1; loc >= startp;) {
 			c = *loc;
 			*loc = '\0';
-			if (patmatch(str, startp, varflags & VSQUOTE)) {
+			if (patmatch(str, startp, quotes)) {
 				*loc = c;
 				goto recordleft;
 			}
 			*loc = c;
 			loc--;
-			if ((varflags & VSQUOTE) && loc > startp &&
-			    *(loc - 1) == CTLESC) {
+			if (quotes && loc > startp && *(loc - 1) == CTLESC) {
 				for (q = startp; q < loc; q++)
 					if (*q == CTLESC)
 						q++;
@@ -604,14 +603,13 @@ subevalvar(char *p, char *str, int strlo
 
 	case VSTRIMRIGHT:
 		for (loc = str - 1; loc >= startp;) {
-			if (patmatch(str, loc, varflags & VSQUOTE)) {
+			if (patmatch(str, loc, quotes)) {
 				amount = loc - expdest;
 				STADJUST(amount, expdest);
 				return 1;
 			}
 			loc--;
-			if ((varflags & VSQUOTE) && loc > startp &&
-			    *(loc - 1) == CTLESC) {
+			if (quotes && loc > startp && *(loc - 1) == CTLESC) {
 				for (q = startp; q < loc; q++)
 					if (*q == CTLESC)
 						q++;
@@ -623,12 +621,12 @@ subevalvar(char *p, char *str, int strlo
 
 	case VSTRIMRIGHTMAX:
 		for (loc = startp; loc < str - 1; loc++) {
-			if (patmatch(str, loc, varflags & VSQUOTE)) {
+			if (patmatch(str, loc, quotes)) {
 				amount = loc - expdest;
 				STADJUST(amount, expdest);
 				return 1;
 			}
-			if ((varflags & VSQUOTE) && *loc == CTLESC)
+			if (quotes && *loc == CTLESC)
 				loc++;
 		}
 		return 0;
@@ -779,7 +777,7 @@ record:
 		STPUTC('\0', expdest);
 		patloc = expdest - stackblock();
 		if (subevalvar(p, NULL, patloc, subtype,
-			       startloc, varflags) == 0) {
+		    startloc, varflags, quotes) == 0) {
 			int amount = (expdest - stackblock() - patloc) + 1;
 			STADJUST(-amount, expdest);
 		}
@@ -790,7 +788,8 @@ record:
 	case VSASSIGN:
 	case VSQUESTION:
 		if (!set) {
-			if (subevalvar(p, var, 0, subtype, startloc, varflags)) {
+			if (subevalvar(p, var, 0, subtype, startloc, varflags,
+			    quotes)) {
 				varflags &= ~VSNUL;
 				/*
 				 * Remove any recorded regions beyond

Added: head/tools/regression/bin/sh/expansion/trim6.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/trim6.0	Fri Oct 29 19:34:57 2010	(r214524)
@@ -0,0 +1,22 @@
+# $FreeBSD$
+
+e=
+for i in 0 1 2 3; do
+	for j in 0 1 2 3 4 5 6 7; do
+		for k in 0 1 2 3 4 5 6 7; do
+			case $i$j$k in
+			000) continue ;;
+			esac
+			e="$e\\$i$j$k"
+		done
+	done
+done
+e=$(printf "$e")
+v=@$e@$e@
+y=${v##*"$e"}
+yq="${v##*"$e"}"
+[ "$y" = @ ] || echo "error when unquoted in non-splitting context"
+[ "$yq" = @ ] || echo "error when quoted in non-splitting context"
+[ "${v##*"$e"}" = @ ] || echo "error when quoted in splitting context"
+IFS=
+[ ${v##*"$e"} = @ ] || echo "error when unquoted in splitting context"

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 20:23: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 3821910656A4;
	Fri, 29 Oct 2010 20:23:42 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 25E9D8FC1B;
	Fri, 29 Oct 2010 20:23: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 o9TKNglF055302;
	Fri, 29 Oct 2010 20:23:42 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TKNgL3055300;
	Fri, 29 Oct 2010 20:23:42 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201010292023.o9TKNgL3055300@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 29 Oct 2010 20:23: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: r214525 - 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: Fri, 29 Oct 2010 20:23:42 -0000

Author: jilles
Date: Fri Oct 29 20:23:41 2010
New Revision: 214525
URL: http://svn.freebsd.org/changeset/base/214525

Log:
  sh: Error out on various specials/keywords in the wrong place in backticks.
  
  Example:
    echo `date)`
  
  Exp-run done by:	pav (with some other sh(1) changes)
  Obtained from:		NetBSD (Christos Zoulas, NetBSD PR 11317)

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Fri Oct 29 19:34:57 2010	(r214524)
+++ head/bin/sh/parser.c	Fri Oct 29 20:23:41 2010	(r214525)
@@ -106,7 +106,7 @@ static struct parser_temp *parser_temp;
 static int noaliases = 0;
 
 
-static union node *list(int);
+static union node *list(int, int);
 static union node *andor(void);
 static union node *pipeline(void);
 static union node *command(void);
@@ -220,12 +220,12 @@ parsecmd(int interact)
 	if (t == TNL)
 		return NULL;
 	tokpushback++;
-	return list(1);
+	return list(1, 0);
 }
 
 
 static union node *
-list(int nlflag)
+list(int nlflag, int erflag)
 {
 	union node *n1, *n2, *n3;
 	int tok;
@@ -287,7 +287,7 @@ list(int nlflag)
 				pungetc();		/* push back EOF on input */
 			return n1;
 		default:
-			if (nlflag)
+			if (nlflag || erflag)
 				synexpect(-1);
 			tokpushback++;
 			return n1;
@@ -398,24 +398,24 @@ command(void)
 	case TIF:
 		n1 = (union node *)stalloc(sizeof (struct nif));
 		n1->type = NIF;
-		if ((n1->nif.test = list(0)) == NULL)
+		if ((n1->nif.test = list(0, 0)) == NULL)
 			synexpect(-1);
 		if (readtoken() != TTHEN)
 			synexpect(TTHEN);
-		n1->nif.ifpart = list(0);
+		n1->nif.ifpart = list(0, 0);
 		n2 = n1;
 		while (readtoken() == TELIF) {
 			n2->nif.elsepart = (union node *)stalloc(sizeof (struct nif));
 			n2 = n2->nif.elsepart;
 			n2->type = NIF;
-			if ((n2->nif.test = list(0)) == NULL)
+			if ((n2->nif.test = list(0, 0)) == NULL)
 				synexpect(-1);
 			if (readtoken() != TTHEN)
 				synexpect(TTHEN);
-			n2->nif.ifpart = list(0);
+			n2->nif.ifpart = list(0, 0);
 		}
 		if (lasttoken == TELSE)
-			n2->nif.elsepart = list(0);
+			n2->nif.elsepart = list(0, 0);
 		else {
 			n2->nif.elsepart = NULL;
 			tokpushback++;
@@ -429,13 +429,13 @@ command(void)
 		int got;
 		n1 = (union node *)stalloc(sizeof (struct nbinary));
 		n1->type = (lasttoken == TWHILE)? NWHILE : NUNTIL;
-		if ((n1->nbinary.ch1 = list(0)) == NULL)
+		if ((n1->nbinary.ch1 = list(0, 0)) == NULL)
 			synexpect(-1);
 		if ((got=readtoken()) != TDO) {
 TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
 			synexpect(TDO);
 		}
-		n1->nbinary.ch2 = list(0);
+		n1->nbinary.ch2 = list(0, 0);
 		if (readtoken() != TDONE)
 			synexpect(TDONE);
 		checkkwd = 1;
@@ -487,7 +487,7 @@ TRACE(("expecting DO got %s %s\n", tokna
 			t = TEND;
 		else
 			synexpect(-1);
-		n1->nfor.body = list(0);
+		n1->nfor.body = list(0, 0);
 		if (readtoken() != t)
 			synexpect(t);
 		checkkwd = 1;
@@ -527,7 +527,7 @@ TRACE(("expecting DO got %s %s\n", tokna
 			ap->narg.next = NULL;
 			if (lasttoken != TRP)
 				noaliases = 0, synexpect(TRP);
-			cp->nclist.body = list(0);
+			cp->nclist.body = list(0, 0);
 
 			checkkwd = 2;
 			if ((t = readtoken()) != TESAC) {
@@ -545,14 +545,14 @@ TRACE(("expecting DO got %s %s\n", tokna
 	case TLP:
 		n1 = (union node *)stalloc(sizeof (struct nredir));
 		n1->type = NSUBSHELL;
-		n1->nredir.n = list(0);
+		n1->nredir.n = list(0, 0);
 		n1->nredir.redirect = NULL;
 		if (readtoken() != TRP)
 			synexpect(TRP);
 		checkkwd = 1;
 		break;
 	case TBEGIN:
-		n1 = list(0);
+		n1 = list(0, 0);
 		if (readtoken() != TEND)
 			synexpect(TEND);
 		checkkwd = 1;
@@ -1066,7 +1066,7 @@ done:
 		doprompt = 0;
 	}
 
-	n = list(0);
+	n = list(0, oldstyle);
 
 	if (oldstyle)
 		doprompt = saveprompt;

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 20:42: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 936131065672;
	Fri, 29 Oct 2010 20:42:02 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 819D98FC1A;
	Fri, 29 Oct 2010 20:42: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 o9TKg2Gf056208;
	Fri, 29 Oct 2010 20:42:02 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TKg2HM056206;
	Fri, 29 Oct 2010 20:42:02 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201010292042.o9TKg2HM056206@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 29 Oct 2010 20:42: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: r214526 - head/sys/boot/sparc64/loader
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 20:42:02 -0000

Author: marius
Date: Fri Oct 29 20:42:02 2010
New Revision: 214526
URL: http://svn.freebsd.org/changeset/base/214526

Log:
  Partially revert r203829; as it turns out what the PowerPC OFW loader did
  was incorrect as further down the road cons_probe() calls malloc() so the
  former can't be called before init_heap() has succeed. Instead just exit
  to the firmware in case init_heap() fails like OF_init() does when hitting
  a problem as we're then likely running in a very broken environment where
  hardly anything can be trusted to work.

Modified:
  head/sys/boot/sparc64/loader/main.c

Modified: head/sys/boot/sparc64/loader/main.c
==============================================================================
--- head/sys/boot/sparc64/loader/main.c	Fri Oct 29 20:23:41 2010	(r214525)
+++ head/sys/boot/sparc64/loader/main.c	Fri Oct 29 20:42:02 2010	(r214526)
@@ -811,15 +811,15 @@ main(int (*openfirm)(void *))
 	archsw.arch_autoload = sparc64_autoload;
 	archsw.arch_maphint = sparc64_maphint;
 
+	if (init_heap() == (vm_offset_t)-1)
+		OF_exit();
+	setheap((void *)heapva, (void *)(heapva + HEAPSZ));
+
 	/*
 	 * Probe for a console.
 	 */
 	cons_probe();
 
-	if (init_heap() == (vm_offset_t)-1)
-		panic("%s: can't claim heap", __func__);
-	setheap((void *)heapva, (void *)(heapva + HEAPSZ));
-
 	if ((root = OF_peer(0)) == -1)
 		panic("%s: can't get root phandle", __func__);
 	OF_getprop(root, "compatible", compatible, sizeof(compatible));

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 20:51: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 0D43C1065679;
	Fri, 29 Oct 2010 20:51:31 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EF8F08FC16;
	Fri, 29 Oct 2010 20:51: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 o9TKpUo8056725;
	Fri, 29 Oct 2010 20:51:30 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TKpUcb056723;
	Fri, 29 Oct 2010 20:51:30 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201010292051.o9TKpUcb056723@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 29 Oct 2010 20:51: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: r214528 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 20:51:31 -0000

Author: marius
Date: Fri Oct 29 20:51:30 2010
New Revision: 214528
URL: http://svn.freebsd.org/changeset/base/214528

Log:
  - When resetting pm_active and pm_context of a pmap in pmap_pinit() we
    need locking as otherwise we may race against the other parts of the
    MD code which expects a consistent state of these. While at it move
    the resetting of the pmap before entering it in the TSB.
  - Spell a 0 as TLB_CTX_KERNEL.

Modified:
  head/sys/sparc64/sparc64/pmap.c

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Fri Oct 29 20:50:59 2010	(r214527)
+++ head/sys/sparc64/sparc64/pmap.c	Fri Oct 29 20:51:30 2010	(r214528)
@@ -1065,7 +1065,7 @@ pmap_pinit0(pmap_t pm)
 
 	PMAP_LOCK_INIT(pm);
 	for (i = 0; i < MAXCPU; i++)
-		pm->pm_context[i] = 0;
+		pm->pm_context[i] = TLB_CTX_KERNEL;
 	pm->pm_active = 0;
 	pm->pm_tsb = NULL;
 	pm->pm_tsb_obj = NULL;
@@ -1103,6 +1103,12 @@ pmap_pinit(pmap_t pm)
 	if (pm->pm_tsb_obj == NULL)
 		pm->pm_tsb_obj = vm_object_allocate(OBJT_PHYS, TSB_PAGES);
 
+	mtx_lock_spin(&sched_lock);
+	for (i = 0; i < MAXCPU; i++)
+		pm->pm_context[i] = -1;
+	pm->pm_active = 0;
+	mtx_unlock_spin(&sched_lock);
+
 	VM_OBJECT_LOCK(pm->pm_tsb_obj);
 	for (i = 0; i < TSB_PAGES; i++) {
 		m = vm_page_grab(pm->pm_tsb_obj, i, VM_ALLOC_NOBUSY |
@@ -1114,9 +1120,6 @@ pmap_pinit(pmap_t pm)
 	VM_OBJECT_UNLOCK(pm->pm_tsb_obj);
 	pmap_qenter((vm_offset_t)pm->pm_tsb, ma, TSB_PAGES);
 
-	for (i = 0; i < MAXCPU; i++)
-		pm->pm_context[i] = -1;
-	pm->pm_active = 0;
 	bzero(&pm->pm_stats, sizeof(pm->pm_stats));
 	return (1);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 20: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 D3E79106566C;
	Fri, 29 Oct 2010 20:54:04 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C27AA8FC14;
	Fri, 29 Oct 2010 20: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 o9TKs4xO056879;
	Fri, 29 Oct 2010 20:54:04 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TKs4cu056877;
	Fri, 29 Oct 2010 20:54:04 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010292054.o9TKs4cu056877@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 20:54: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: r214529 - head/lib/libpcap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 20:54:04 -0000

Author: rpaulo
Date: Fri Oct 29 20:54:04 2010
New Revision: 214529
URL: http://svn.freebsd.org/changeset/base/214529

Log:
  add pcap-common.c.
  
  Submitted by:	dim

Modified:
  head/lib/libpcap/Makefile

Modified: head/lib/libpcap/Makefile
==============================================================================
--- head/lib/libpcap/Makefile	Fri Oct 29 20:51:30 2010	(r214528)
+++ head/lib/libpcap/Makefile	Fri Oct 29 20:54:04 2010	(r214529)
@@ -7,7 +7,7 @@ SHLIBDIR?= /lib
 
 LIB=	pcap
 SRCS=	grammar.y tokdefs.h version.h pcap-bpf.c \
-	pcap.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \
+	pcap.c pcap-common.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \
 	etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \
 	scanner.l sf-pcap.c sf-pcap-ng.c version.c
 

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 21:04: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 29124106564A;
	Fri, 29 Oct 2010 21:03:59 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D42178FC0C;
	Fri, 29 Oct 2010 21: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 o9TL3xZB057399;
	Fri, 29 Oct 2010 21:03:59 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TL3x0B057397;
	Fri, 29 Oct 2010 21:03:59 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010292103.o9TL3x0B057397@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 21: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: r214530 - head/usr.sbin/tcpdump/tcpdump
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 21:04:00 -0000

Author: rpaulo
Date: Fri Oct 29 21:03:59 2010
New Revision: 214530
URL: http://svn.freebsd.org/changeset/base/214530

Log:
  Add print-ipnet.c
  
  Submitted by:	dim

Modified:
  head/usr.sbin/tcpdump/tcpdump/Makefile

Modified: head/usr.sbin/tcpdump/tcpdump/Makefile
==============================================================================
--- head/usr.sbin/tcpdump/tcpdump/Makefile	Fri Oct 29 20:54:04 2010	(r214529)
+++ head/usr.sbin/tcpdump/tcpdump/Makefile	Fri Oct 29 21:03:59 2010	(r214530)
@@ -17,7 +17,7 @@ SRCS =	addrtoname.c af.c checksum.c cpac
 	print-egp.c print-eap.c print-eigrp.c \
 	print-esp.c print-ether.c print-fddi.c print-forces.c print-fr.c \
 	print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
-	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c \
+	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \
 	print-ipx.c print-isakmp.c print-isoclns.c print-juniper.c print-krb.c \
 	print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
         print-lmp.c print-lspping.c \

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 21:06: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 5686B1065696;
	Fri, 29 Oct 2010 21:06:58 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 447118FC0C;
	Fri, 29 Oct 2010 21:06: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 o9TL6wPL057583;
	Fri, 29 Oct 2010 21:06:58 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TL6wtU057580;
	Fri, 29 Oct 2010 21:06:58 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201010292106.o9TL6wtU057580@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 29 Oct 2010 21:06: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: r214531 - in head: bin/sh tools/regression/bin/sh/errors
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 21:06:58 -0000

Author: jilles
Date: Fri Oct 29 21:06:57 2010
New Revision: 214531
URL: http://svn.freebsd.org/changeset/base/214531

Log:
  sh: Detect various additional errors in the parser.
  
  Apart from detecting breakage earlier or at all, this also fixes a segfault
  in the testsuite. The "handling" of the breakage left an invalid internal
  representation in some cases.
  
  Examples:
    echo a; do echo b
    echo `) echo a`
    echo `date; do do do`
  
  Exp-run done by:	pav (with some other sh(1) changes)

Added:
  head/tools/regression/bin/sh/errors/bad-keyword1.0   (contents, props changed)
Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Fri Oct 29 21:03:59 2010	(r214530)
+++ head/bin/sh/parser.c	Fri Oct 29 21:06:57 2010	(r214531)
@@ -220,7 +220,7 @@ parsecmd(int interact)
 	if (t == TNL)
 		return NULL;
 	tokpushback++;
-	return list(1, 0);
+	return list(1, 1);
 }
 
 
@@ -231,7 +231,7 @@ list(int nlflag, int erflag)
 	int tok;
 
 	checkkwd = 2;
-	if (nlflag == 0 && tokendlist[peektoken()])
+	if (!nlflag && !erflag && tokendlist[peektoken()])
 		return NULL;
 	n1 = NULL;
 	for (;;) {
@@ -277,7 +277,7 @@ list(int nlflag, int erflag)
 				tokpushback++;
 			}
 			checkkwd = 2;
-			if (tokendlist[peektoken()])
+			if (!nlflag && !erflag && tokendlist[peektoken()])
 				return n1;
 			break;
 		case TEOF:

Added: head/tools/regression/bin/sh/errors/bad-keyword1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/errors/bad-keyword1.0	Fri Oct 29 21:06:57 2010	(r214531)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+echo ':; fi' | sh -n 2>/dev/null && exit 1
+exit 0

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 21:20: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 D3FE01065672;
	Fri, 29 Oct 2010 21:20:14 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C2B788FC1A;
	Fri, 29 Oct 2010 21:20: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 o9TLKEaZ058581;
	Fri, 29 Oct 2010 21:20:14 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TLKEhM058579;
	Fri, 29 Oct 2010 21:20:14 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010292120.o9TLKEhM058579@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 21:20: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: r214533 - head/sbin/pflogd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 21:20:14 -0000

Author: rpaulo
Date: Fri Oct 29 21:20:14 2010
New Revision: 214533
URL: http://svn.freebsd.org/changeset/base/214533

Log:
  Force include ../../libpcap/config.h since privsep.c groks pcap's
  internals.

Modified:
  head/sbin/pflogd/Makefile

Modified: head/sbin/pflogd/Makefile
==============================================================================
--- head/sbin/pflogd/Makefile	Fri Oct 29 21:12:44 2010	(r214532)
+++ head/sbin/pflogd/Makefile	Fri Oct 29 21:20:14 2010	(r214533)
@@ -6,6 +6,8 @@ PROG=	pflogd
 SRCS= 	pflogd.c pidfile.c privsep.c privsep_fdpass.c
 MAN=	pflogd.8
 
+CFLAGS=-include ../../lib/libpcap/config.h
+
 LDADD=	-lpcap -lutil
 DPADD=	${LIBPCAP} ${LIBUTIL}
 

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 21: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 A1675106567A;
	Fri, 29 Oct 2010 21:20:56 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FD258FC0C;
	Fri, 29 Oct 2010 21: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 o9TLKuPs058663;
	Fri, 29 Oct 2010 21:20:56 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TLKuvX058661;
	Fri, 29 Oct 2010 21:20:56 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201010292120.o9TLKuvX058661@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 29 Oct 2010 21: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: r214534 - 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: Fri, 29 Oct 2010 21:20:56 -0000

Author: jilles
Date: Fri Oct 29 21:20:56 2010
New Revision: 214534
URL: http://svn.freebsd.org/changeset/base/214534

Log:
  sh: Reject function names ending in one of !%*+-=?@}~
  
  These do something else in ksh: name=(...) is an array or compound variable
  assignment and the others are extended patterns.
  
  This is the last patch of the ones tested in the exp run.
  
  Exp-run done by:	pav (with some other sh(1) changes)

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Fri Oct 29 21:20:14 2010	(r214533)
+++ head/bin/sh/parser.c	Fri Oct 29 21:20:56 2010	(r214534)
@@ -644,9 +644,13 @@ simplecmd(union node **rpp, union node *
 			/*
 			 * - Require plain text.
 			 * - Functions with '/' cannot be called.
+			 * - Reject name=().
+			 * - Reject ksh extended glob patterns.
 			 */
 			if (!noexpand(n->narg.text) || quoteflag ||
-			    strchr(n->narg.text, '/'))
+			    strchr(n->narg.text, '/') ||
+			    strchr("!%*+-=?@}~",
+				n->narg.text[strlen(n->narg.text) - 1]))
 				synerror("Bad function name");
 			rmescapes(n->narg.text);
 			if (find_builtin(n->narg.text, &special) >= 0 &&

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 21:23: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 675BF1065679;
	Fri, 29 Oct 2010 21:23:34 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 55BDD8FC15;
	Fri, 29 Oct 2010 21:23: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 o9TLNYS1058908;
	Fri, 29 Oct 2010 21:23:34 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TLNYoQ058906;
	Fri, 29 Oct 2010 21:23:34 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010292123.o9TLNYoQ058906@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 21:23: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: r214535 - head/contrib/ipfilter/tools
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 21:23:34 -0000

Author: rpaulo
Date: Fri Oct 29 21:23:34 2010
New Revision: 214535
URL: http://svn.freebsd.org/changeset/base/214535

Log:
  Use pcap's bpf header, not our own copy of it.

Modified:
  head/contrib/ipfilter/tools/ipf_y.y

Modified: head/contrib/ipfilter/tools/ipf_y.y
==============================================================================
--- head/contrib/ipfilter/tools/ipf_y.y	Fri Oct 29 21:20:56 2010	(r214534)
+++ head/contrib/ipfilter/tools/ipf_y.y	Fri Oct 29 21:23:34 2010	(r214535)
@@ -10,8 +10,6 @@
 #include 
 #include 
 #ifdef IPFILTER_BPF
-# include "pcap-bpf.h"
-# define _NET_BPF_H_
 # include 
 #endif
 #include "netinet/ip_pool.h"

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 21:24: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 421071065670;
	Fri, 29 Oct 2010 21:24:57 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 30BC28FC17;
	Fri, 29 Oct 2010 21:24: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 o9TLOvtk059027;
	Fri, 29 Oct 2010 21:24:57 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TLOvi7059025;
	Fri, 29 Oct 2010 21:24:57 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010292124.o9TLOvi7059025@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 29 Oct 2010 21:24: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: r214536 - head/sbin/pflogd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 21:24:57 -0000

Author: rpaulo
Date: Fri Oct 29 21:24:56 2010
New Revision: 214536
URL: http://svn.freebsd.org/changeset/base/214536

Log:
  Add a ${.CURDIR} reference to the previous commit.
  
  Submitted by:	dim

Modified:
  head/sbin/pflogd/Makefile

Modified: head/sbin/pflogd/Makefile
==============================================================================
--- head/sbin/pflogd/Makefile	Fri Oct 29 21:23:34 2010	(r214535)
+++ head/sbin/pflogd/Makefile	Fri Oct 29 21:24:56 2010	(r214536)
@@ -6,7 +6,7 @@ PROG=	pflogd
 SRCS= 	pflogd.c pidfile.c privsep.c privsep_fdpass.c
 MAN=	pflogd.8
 
-CFLAGS=-include ../../lib/libpcap/config.h
+CFLAGS=-include ${.CURDIR}/../../lib/libpcap/config.h
 
 LDADD=	-lpcap -lutil
 DPADD=	${LIBPCAP} ${LIBUTIL}

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 21: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 B8D861065674;
	Fri, 29 Oct 2010 21:44:43 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8CEAC8FC1C;
	Fri, 29 Oct 2010 21:44: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 o9TLihwF060027;
	Fri, 29 Oct 2010 21:44:43 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TLihVc060022;
	Fri, 29 Oct 2010 21:44:43 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201010292144.o9TLihVc060022@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 29 Oct 2010 21:44: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: r214538 - 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: Fri, 29 Oct 2010 21:44:43 -0000

Author: jilles
Date: Fri Oct 29 21:44:43 2010
New Revision: 214538
URL: http://svn.freebsd.org/changeset/base/214538

Log:
  sh: Tweak some string constants to reduce code size.
  
  * Reduce some needless differences.
  * Shorten some error messages that should not happen.

Modified:
  head/bin/sh/eval.c
  head/bin/sh/histedit.c
  head/bin/sh/parser.c
  head/bin/sh/var.c

Modified: head/bin/sh/eval.c
==============================================================================
--- head/bin/sh/eval.c	Fri Oct 29 21:29:43 2010	(r214537)
+++ head/bin/sh/eval.c	Fri Oct 29 21:44:43 2010	(r214538)
@@ -1130,7 +1130,7 @@ commandcmd(int argc, char **argv)
 		return typecmd_impl(2, argv - 1, cmd, path);
 	}
 	if (argc != 0)
-		error("commandcmd() called while it should not be");
+		error("commandcmd bad call");
 
 	/*
 	 * Do nothing successfully if no command was specified;

Modified: head/bin/sh/histedit.c
==============================================================================
--- head/bin/sh/histedit.c	Fri Oct 29 21:29:43 2010	(r214537)
+++ head/bin/sh/histedit.c	Fri Oct 29 21:44:43 2010	(r214538)
@@ -297,7 +297,7 @@ histcmd(int argc, char **argv)
 		laststr = argv[1];
 		break;
 	default:
-		error("too many args");
+		error("too many arguments");
 	}
 	/*
 	 * Turn into event numbers.
@@ -329,7 +329,7 @@ histcmd(int argc, char **argv)
 		editfile = editfilestr;
 		if ((efp = fdopen(fd, "w")) == NULL) {
 			close(fd);
-			error("can't allocate stdio buffer for temp");
+			error("Out of space");
 		}
 	}
 

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Fri Oct 29 21:29:43 2010	(r214537)
+++ head/bin/sh/parser.c	Fri Oct 29 21:44:43 2010	(r214538)
@@ -1738,7 +1738,7 @@ getprompt(void *unused __unused)
 	char *fmt;
 	const char *pwd;
 	int i, trim;
-	static char internal_error[] = "";
+	static char internal_error[] = "??";
 
 	/*
 	 * Select prompt format.

Modified: head/bin/sh/var.c
==============================================================================
--- head/bin/sh/var.c	Fri Oct 29 21:29:43 2010	(r214537)
+++ head/bin/sh/var.c	Fri Oct 29 21:44:43 2010	(r214538)
@@ -826,7 +826,7 @@ setvarcmd(int argc, char **argv)
 	else if (argc == 3)
 		setvar(argv[1], argv[2], 0);
 	else
-		error("List assignment not implemented");
+		error("too many arguments");
 	return 0;
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 22:22: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 23DA11065670;
	Fri, 29 Oct 2010 22:22:52 +0000 (UTC)
	(envelope-from pjd@garage.freebsd.pl)
Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60])
	by mx1.freebsd.org (Postfix) with ESMTP id BC6298FC13;
	Fri, 29 Oct 2010 22:22:41 +0000 (UTC)
Received: by mail.garage.freebsd.pl (Postfix, from userid 65534)
	id D0C6345CA6; Sat, 30 Oct 2010 00:22:39 +0200 (CEST)
Received: from localhost (chello089073192049.chello.pl [89.73.192.49])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.garage.freebsd.pl (Postfix) with ESMTP id 0B8F845683;
	Sat, 30 Oct 2010 00:22:33 +0200 (CEST)
Date: Sat, 30 Oct 2010 00:21:59 +0200
From: Pawel Jakub Dawidek 
To: David Xu 
Message-ID: <20101029222159.GA2160@garage.freebsd.pl>
References: <201010291331.o9TDVAtm027022@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND"
Content-Disposition: inline
In-Reply-To: <201010291331.o9TDVAtm027022@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: r214510 - in head: include lib/libc/gen 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, 29 Oct 2010 22:22:52 -0000


--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Oct 29, 2010 at 01:31:10PM +0000, David Xu wrote:
> Author: davidxu
> Date: Fri Oct 29 13:31:10 2010
> New Revision: 214510
> URL: http://svn.freebsd.org/changeset/base/214510
>=20
> Log:
>   Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset,
>   also add sysconf() key _SC_CPUSET_SIZE to get sysctl value.
>  =20
>   Submitted by: gcooper
[...]
> +#ifdef _SC_CPUSET_SIZE
> +	case _SC_CPUSET_SIZE:
> +		len =3D sizeof(lvalue);
> +		if (sysctlbyname("kern.sched.cpusetsize", &lvalue, &len, NULL,
> +		    0) =3D=3D -1)
> +			return (-1);
> +		return (lvalue);
> +#endif
[...]
> +static size_t _kern_cpuset_size =3D sizeof(cpuset_t);
[...]
> +/*=20
> + * Return the size of cpuset_t at the kernel level
> + *
> + * XXX (gcooper): replace ULONG with SIZE once CTLTYPE_SIZE is implement=
ed.
> + */
> +SYSCTL_ULONG(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
> +    &_kern_cpuset_size, 0, "Kernel-level cpuset_t struct size");
> +

Because it is used via sysconf(3), I don't think it should be converted
to CTLTYPE_SIZE at all. I even think it would be safer to make
_kern_cpuset_size a long (sysconf's lvalue is long) and (just for
consistency) use SYSCTL_LONG().

Also note, that on i386 long is 32bit and on amd64 long is 64bit, so
32bit process running on 64bit system won't be able to read this sysctl.
Or do we detect 32bit processes on 64bit systems and convert such types
in the kernel?

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--d6Gm4EdcadzBjdND
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAkzLSQcACgkQForvXbEpPzT9zgCgu05p5kDCR6F2Jq/fLwkInLyP
0FoAoIHy+zaUSTmZ6k638am2GQyXJGHg
=pnvc
-----END PGP SIGNATURE-----

--d6Gm4EdcadzBjdND--

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 22:26: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 034EA106566C;
	Fri, 29 Oct 2010 22:26:44 +0000 (UTC)
	(envelope-from pjd@garage.freebsd.pl)
Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60])
	by mx1.freebsd.org (Postfix) with ESMTP id A07D68FC08;
	Fri, 29 Oct 2010 22:26:43 +0000 (UTC)
Received: by mail.garage.freebsd.pl (Postfix, from userid 65534)
	id 6146D45CA6; Sat, 30 Oct 2010 00:26:42 +0200 (CEST)
Received: from localhost (chello089073192049.chello.pl [89.73.192.49])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.garage.freebsd.pl (Postfix) with ESMTP id A84BE45683;
	Sat, 30 Oct 2010 00:26:36 +0200 (CEST)
Date: Sat, 30 Oct 2010 00:26:02 +0200
From: Pawel Jakub Dawidek 
To: David Xu 
Message-ID: <20101029222602.GB2160@garage.freebsd.pl>
References: <201010291331.o9TDVAtm027022@svn.freebsd.org>
	<20101029222159.GA2160@garage.freebsd.pl>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="TakKZr9L6Hm6aLOc"
Content-Disposition: inline
In-Reply-To: <20101029222159.GA2160@garage.freebsd.pl>
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: r214510 - in head: include lib/libc/gen 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, 29 Oct 2010 22:26:44 -0000


--TakKZr9L6Hm6aLOc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Oct 30, 2010 at 12:21:59AM +0200, Pawel Jakub Dawidek wrote:
> Also note, that on i386 long is 32bit and on amd64 long is 64bit, so
> 32bit process running on 64bit system won't be able to read this sysctl.
> Or do we detect 32bit processes on 64bit systems and convert such types
> in the kernel?

We do the conversion, so ignore this part of my e-mail.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--TakKZr9L6Hm6aLOc
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAkzLSfkACgkQForvXbEpPzSuwgCg+R/zhO+SZSaT1Fcj8i2V7A+V
8WYAnjmsZ5FkbZd6ZFx+OmpyhfYuWVLi
=SThl
-----END PGP SIGNATURE-----

--TakKZr9L6Hm6aLOc--

From owner-svn-src-all@FreeBSD.ORG  Fri Oct 29 22:57: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 66BB3106566B;
	Fri, 29 Oct 2010 22:57:14 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 54E438FC0C;
	Fri, 29 Oct 2010 22:57: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 o9TMvEvN064017;
	Fri, 29 Oct 2010 22:57:14 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9TMvEeX064015;
	Fri, 29 Oct 2010 22:57:14 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201010292257.o9TMvEeX064015@svn.freebsd.org>
From: Dimitry Andric 
Date: Fri, 29 Oct 2010 22:57: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: r214539 - head/lib/libpcap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Oct 2010 22:57:14 -0000

Author: dim
Date: Fri Oct 29 22:57:14 2010
New Revision: 214539
URL: http://svn.freebsd.org/changeset/base/214539

Log:
  Regenerate our lib/libpcap/config.h for libpcap 1.1.1.

Modified:
  head/lib/libpcap/config.h

Modified: head/lib/libpcap/config.h
==============================================================================
--- head/lib/libpcap/config.h	Fri Oct 29 21:44:43 2010	(r214538)
+++ head/lib/libpcap/config.h	Fri Oct 29 22:57:14 2010	(r214539)
@@ -1,15 +1,8 @@
 /* $FreeBSD$ */
 /* This is an edited copy of the config.h generated by configure. */
 
-/* config.h.  Generated by configure.  */
+/* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.in by autoheader.  */
-/* Long story short: aclocal.m4 depends on autoconf 2.13
- * implementation details wrt "const"; newer versions
- * have different implementation details so for now we
- * put "const" here.  This may cause duplicate definitions
- * in config.h but that should be OK since they're the same.
- */
-/* #undef const */
 
 /* Enable optimizer debugging */
 /* #undef BDEBUG */
@@ -17,15 +10,15 @@
 /* define if you have a cloning BPF device */
 #define HAVE_CLONING_BPF 1
 
-/* define if you have dag_get_stream_erf_types() */
-/* #undef HAVE_DAG_GET_STREAM_ERF_TYPES */
-
 /* define if you have the DAG API */
 /* #undef HAVE_DAG_API */
 
 /* define if you have dag_get_erf_types() */
 /* #undef HAVE_DAG_GET_ERF_TYPES */
 
+/* define if you have dag_get_stream_erf_types() */
+/* #undef HAVE_DAG_GET_STREAM_ERF_TYPES */
+
 /* define if you have streams capable DAG API */
 /* #undef HAVE_DAG_STREAMS_API */
 
@@ -33,12 +26,12 @@
    don't. */
 #define HAVE_DECL_ETHER_HOSTTON 1
 
-/* if passive_req_t primitive exists */
-/* #undef HAVE_DLPI_PASSIVE */
-
 /* define if you have a /dev/dlpi */
 /* #undef HAVE_DEV_DLPI */
 
+/* if passive_req_t primitive exists */
+/* #undef HAVE_DLPI_PASSIVE */
+
 /* Define to 1 if you have the `ether_hostton' function. */
 #define HAVE_ETHER_HOSTTON 1
 
@@ -60,12 +53,18 @@
 /* if libdlpi exists */
 /* #undef HAVE_LIBDLPI */
 
+/* if libnl exists */
+/* #undef HAVE_LIBNL */
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_LIMITS_H 1
 
 /* if tp_vlan_tci exists */
 /* #undef HAVE_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI */
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_LINUX_USBDEVICE_FS_H */
+
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_LINUX_WIRELESS_H */
 
@@ -85,27 +84,30 @@
 /* See Makefile */
 /* #undef HAVE_NET_PFVAR_H */
 
-/* if there's an os_proto.h */
+/* if there's an os_proto.h for this platform, to use additional prototypes */
 /* #undef HAVE_OS_PROTO_H */
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_PATHS_H 1
 
-/* define if you have a /proc/net/dev */
-/* #undef HAVE_PROC_NET_DEV */
+/* define if net/pfvar.h defines PF_NAT through PF_NORDR */
+#define HAVE_PF_NAT_THROUGH_PF_NORDR 1
 
 /* define if you have a Septel API */
 /* #undef HAVE_SEPTEL_API */
 
+/* define if you have Myricom SNF API */
+/* #undef HAVE_SNF_API */
+
 /* Define to 1 if you have the `snprintf' function. */
 #define HAVE_SNPRINTF 1
 
-/* if struct sockaddr has sa_len */
+/* if struct sockaddr has the sa_len member */
 #define HAVE_SOCKADDR_SA_LEN 1
 
 /* if struct sockaddr_storage exists */
 #define HAVE_SOCKADDR_STORAGE 1
- 
+
 /* define if socklen_t is defined */
 #define HAVE_SOCKLEN_T 1
 
@@ -130,9 +132,15 @@
 /* Define to 1 if you have the `strlcpy' function. */
 #define HAVE_STRLCPY 1
 
+/* Define to 1 if the system has the type `struct BPF_TIMEVAL'. */
+/* #undef HAVE_STRUCT_BPF_TIMEVAL */
+
 /* Define to 1 if the system has the type `struct ether_addr'. */
 /* #undef HAVE_STRUCT_ETHER_ADDR */
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_SYS_BITYPES_H */
+
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_SYS_BUFMOD_H */
 
@@ -157,6 +165,9 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_UNISTD_H 1
 
+/* if struct usbdevfs_ctrltransfer has bRequestType */
+/* #undef HAVE_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE */
+
 /* define if version.h is generated in the build procedure */
 #define HAVE_VERSION_H 1
 
@@ -170,6 +181,7 @@
 #define HAVE___ATTRIBUTE__ 1
 
 /* IPv6 */
+/* See Makefile */
 /* #undef INET6 */
 
 /* if unaligned access fails */
@@ -208,6 +220,9 @@
 /* target host supports Bluetooth sniffing */
 /* #undef PCAP_SUPPORT_BT */
 
+/* target host supports CAN sniffing */
+/* #undef PCAP_SUPPORT_CAN */
+
 /* target host supports USB sniffing */
 /* #undef PCAP_SUPPORT_USB */
 
@@ -220,12 +235,12 @@
 /* Enable parser debugging */
 /* #undef YYDEBUG */
 
-/* needed on HP-UX */
-/* #undef _HPUX_SOURCE */
-
 /* Number of bits in a file offset, on hosts where this is settable. */
 /* #undef _FILE_OFFSET_BITS */
 
+/* needed on HP-UX */
+/* #undef _HPUX_SOURCE */
+
 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).  */
 /* #undef _LARGEFILE_SOURCE */
 
@@ -235,20 +250,35 @@
 /* define on AIX to get certain functions */
 /* #undef _SUN */
 
+/* to handle Ultrix compilers that don't support const in prototypes */
+/* #undef const */
+
 /* Define as token for inline if inlining supported */
 #define inline inline
 
+/* Define to `short' if int16_t not defined. */
+/* #undef int16_t */
+
+/* Define to `int' if int32_t not defined. */
+/* #undef int32_t */
+
+/* Define to `long long' if int64_t not defined. */
+/* #undef int64_t */
+
+/* Define to `signed char' if int8_t not defined. */
+/* #undef int8_t */
+
 /* on sinix */
 /* #undef sinix */
 
-/* if we have u_int16_t */
+/* Define to `unsigned short' if u_int16_t not defined. */
 /* #undef u_int16_t */
 
-/* if we have u_int32_t */
+/* Define to `unsigned int' if u_int32_t not defined. */
 /* #undef u_int32_t */
 
-/* if we have u_int64_t */
+/* Define to `unsigned long long' if u_int64_t not defined. */
 /* #undef u_int64_t */
 
-/* if we have u_int8_t */
+/* Define to `unsigned char' if u_int8_t not defined. */
 /* #undef u_int8_t */

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 00:52: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 E900F1065674;
	Sat, 30 Oct 2010 00:52:46 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com
	[209.85.213.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 51CFE8FC0A;
	Sat, 30 Oct 2010 00:52:46 +0000 (UTC)
Received: by ywh2 with SMTP id 2so1874534ywh.13
	for ; Fri, 29 Oct 2010 17:52:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=Hm8BTEjJU+XiOFNBJ+lfI8D4n7IvJKxEUyuuDgpBNOw=;
	b=Axc/fxvt6uh9z48d5gJDWe5tHGyRmPGCpb0IlMF1pvYt31x8jtM5gXp1FRYWB+/QLD
	aEWNQKLR6h/HU04oAEsk3uNWu+7BBULEtcMilzSpYLsrDraBeVj/HV0j/78SmJGLiVxD
	QAkU+gIB7kgPACHByl5JQtI5B1ar+xpjaSolw=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=mBraQ6b0dCVWNqZTe/urVIgJdPA7tWXDKP1xLLG2EzdcMML4rWDCVUxu6NdzCQUcct
	ac4scM5vCnokR5XPGh9unAt1wnxzjqhj7SZygpHnlNubtuGj5wXYRC7gXbx+LqKCXSm9
	/55TJMpauBQrDYE1ycZFlv2jqA5+9t0Hyb2cI=
MIME-Version: 1.0
Received: by 10.90.4.7 with SMTP id 7mr5147982agd.100.1288399965005; Fri, 29
	Oct 2010 17:52:45 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.90.70.19 with HTTP; Fri, 29 Oct 2010 17:52:43 -0700 (PDT)
In-Reply-To: <20101029222159.GA2160@garage.freebsd.pl>
References: <201010291331.o9TDVAtm027022@svn.freebsd.org>
	<20101029222159.GA2160@garage.freebsd.pl>
Date: Fri, 29 Oct 2010 17:52:43 -0700
X-Google-Sender-Auth: F2Kg-kn54YmT40fyCftuhUKLr2w
Message-ID: 
From: Garrett Cooper 
To: Pawel Jakub Dawidek 
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, David Xu 
Subject: Re: svn commit: r214510 - in head: include lib/libc/gen 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, 30 Oct 2010 00:52:47 -0000

On Fri, Oct 29, 2010 at 3:21 PM, Pawel Jakub Dawidek  wrot=
e:
> On Fri, Oct 29, 2010 at 01:31:10PM +0000, David Xu wrote:
>> Author: davidxu
>> Date: Fri Oct 29 13:31:10 2010
>> New Revision: 214510
>> URL: http://svn.freebsd.org/changeset/base/214510
>>
>> Log:
>> =A0 Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset=
,
>> =A0 also add sysconf() key _SC_CPUSET_SIZE to get sysctl value.
>>
>> =A0 Submitted by: gcooper
> [...]
>> +#ifdef _SC_CPUSET_SIZE
>> + =A0 =A0 case _SC_CPUSET_SIZE:
>> + =A0 =A0 =A0 =A0 =A0 =A0 len =3D sizeof(lvalue);
>> + =A0 =A0 =A0 =A0 =A0 =A0 if (sysctlbyname("kern.sched.cpusetsize", &lva=
lue, &len, NULL,
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0) =3D=3D -1)
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (-1);
>> + =A0 =A0 =A0 =A0 =A0 =A0 return (lvalue);
>> +#endif
> [...]
>> +static size_t _kern_cpuset_size =3D sizeof(cpuset_t);
> [...]
>> +/*
>> + * Return the size of cpuset_t at the kernel level
>> + *
>> + * XXX (gcooper): replace ULONG with SIZE once CTLTYPE_SIZE is implemen=
ted.
>> + */
>> +SYSCTL_ULONG(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
>> + =A0 =A0&_kern_cpuset_size, 0, "Kernel-level cpuset_t struct size");
>> +
>
> Because it is used via sysconf(3), I don't think it should be converted
> to CTLTYPE_SIZE at all. I even think it would be safer to make
> _kern_cpuset_size a long (sysconf's lvalue is long) and (just for
> consistency) use SYSCTL_LONG().

size_t is synonymous with long though (minus the fact that size_t is
unsigned and long is signed).

cperciva came up with same question, and the thing that I noted is
that SYSCTL_SIZE, etc was going to be implemented in the not so
distant future (I have the tunables done; I was going to finish off
the sysctl(9) analogs all in one shot to avoid having to bump
__FreeBSD_version__ twice, but was waiting for all of the parts to
come in for my router box so I could get my test box online, but
that's a sidenote :)..).

des preferred the semantics of SIZE and POINTER, etc in the tunables
because of the concept it implies over a long (even though they're
basically synonyms at one level or another). The comment was there as
a reminder to me to get the work done quicker :).

> Also note, that on i386 long is 32bit and on amd64 long is 64bit, so
> 32bit process running on 64bit system won't be able to read this sysctl.
> Or do we detect 32bit processes on 64bit systems and convert such types
> in the kernel?

There are two things I've been thinking about with this work though:
1. sysctls truncate output over 64-bit with certain datatypes, like
LONGs (SIZE, POINTER, etc would apply as well in the above example). I
thought this was an undesirable loss of precision, but I'd need to
talk to someone else about this.
2. It might be convenient if there was a lookup table for certain
types like FDSET (like Robert brought up) where userland and kernel
space types can vary like with cpuset_t. Just an idea to ponder over
in my free time that I might bring up to more senior folks for more
thorough consideration because it would be a cleaner interface to
determining datatypes widths like this.

Thanks for the comments though :)!
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 01:12: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 423521065670;
	Sat, 30 Oct 2010 01:12:55 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 312748FC0C;
	Sat, 30 Oct 2010 01:12: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 o9U1Ctpk072650;
	Sat, 30 Oct 2010 01:12:55 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9U1CtqO072648;
	Sat, 30 Oct 2010 01:12:55 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201010300112.o9U1CtqO072648@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Sat, 30 Oct 2010 01:12:55 +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: r214542 - head/sys/dev/alc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 30 Oct 2010 01:12:55 -0000

Author: yongari
Date: Sat Oct 30 01:12:54 2010
New Revision: 214542
URL: http://svn.freebsd.org/changeset/base/214542

Log:
  Don't bother to enable ASPM L1 to save more power. Even though I am
  not able to trigger the issue with sample boards, some users seems
  to suffer from freeze/lockup when system is booted without UTP cable
  plugged in. I'm not sure whether this is BIOS issue or controller
  bug. This change fixes AR8132 lockup issue seen on EEE PC.
  
  Reported by:	kmoore
  Tested by:	kmoore

Modified:
  head/sys/dev/alc/if_alc.c

Modified: head/sys/dev/alc/if_alc.c
==============================================================================
--- head/sys/dev/alc/if_alc.c	Sat Oct 30 00:00:54 2010	(r214541)
+++ head/sys/dev/alc/if_alc.c	Sat Oct 30 01:12:54 2010	(r214542)
@@ -331,8 +331,8 @@ alc_miibus_statchg(device_t dev)
 		reg = CSR_READ_4(sc, ALC_MAC_CFG);
 		reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB;
 		CSR_WRITE_4(sc, ALC_MAC_CFG, reg);
+		alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active));
 	}
-	alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active));
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 01:19: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 768BD1065672;
	Sat, 30 Oct 2010 01:19:15 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 649F48FC13;
	Sat, 30 Oct 2010 01:19: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 o9U1JF1K073019;
	Sat, 30 Oct 2010 01:19:15 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9U1JFZv073017;
	Sat, 30 Oct 2010 01:19:15 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201010300119.o9U1JFZv073017@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 30 Oct 2010 01:19: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: r214543 - 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: Sat, 30 Oct 2010 01:19:15 -0000

Author: kib
Date: Sat Oct 30 01:19:15 2010
New Revision: 214543
URL: http://svn.freebsd.org/changeset/base/214543

Log:
  MFC r213916:
  Provide vfs.ncsizefactor instead of hard-coding namecache ratio.
  Move debug.ncnegfactor to vfs.ncnegfactor.
  Provide some descriptions for the namecache related sysctls.

Modified:
  stable/8/sys/kern/vfs_cache.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)

Modified: stable/8/sys/kern/vfs_cache.c
==============================================================================
--- stable/8/sys/kern/vfs_cache.c	Sat Oct 30 01:12:54 2010	(r214542)
+++ stable/8/sys/kern/vfs_cache.c	Sat Oct 30 01:19:15 2010	(r214543)
@@ -126,20 +126,27 @@ struct	namecache {
 static LIST_HEAD(nchashhead, namecache) *nchashtbl;	/* Hash Table */
 static TAILQ_HEAD(, namecache) ncneg;	/* Hash Table */
 static u_long	nchash;			/* size of hash table */
-SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, "");
+SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0,
+    "Size of namecache hash table");
 static u_long	ncnegfactor = 16;	/* ratio of negative entries */
+/* _debug sysctl left for backward compatibility */
 SYSCTL_ULONG(_debug, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0, "");
-static u_long	numneg;			/* number of cache entries allocated */
-SYSCTL_ULONG(_debug, OID_AUTO, numneg, CTLFLAG_RD, &numneg, 0, "");
+SYSCTL_ULONG(_vfs, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0,
+    "Ratio of negative namecache entries");
+static u_long	numneg;			/* number of negative entries allocated */
+SYSCTL_ULONG(_debug, OID_AUTO, numneg, CTLFLAG_RD, &numneg, 0,
+    "Number of negative entries in namecache");
 static u_long	numcache;		/* number of cache entries allocated */
-SYSCTL_ULONG(_debug, OID_AUTO, numcache, CTLFLAG_RD, &numcache, 0, "");
+SYSCTL_ULONG(_debug, OID_AUTO, numcache, CTLFLAG_RD, &numcache, 0,
+    "Number of namecache entries");
 static u_long	numcachehv;		/* number of cache entries with vnodes held */
-SYSCTL_ULONG(_debug, OID_AUTO, numcachehv, CTLFLAG_RD, &numcachehv, 0, "");
-#if 0
-static u_long	numcachepl;		/* number of cache purge for leaf entries */
-SYSCTL_ULONG(_debug, OID_AUTO, numcachepl, CTLFLAG_RD, &numcachepl, 0, "");
-#endif
-struct	nchstats nchstats;		/* cache effectiveness statistics */
+SYSCTL_ULONG(_debug, OID_AUTO, numcachehv, CTLFLAG_RD, &numcachehv, 0,
+    "Number of namecache entries with vnodes held");
+static u_int	ncsizefactor = 2;
+SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0,
+    "Size factor for namecache");
+
+struct nchstats	nchstats;		/* cache effectiveness statistics */
 
 static struct rwlock cache_lock;
 RW_SYSINIT(vfscache, &cache_lock, "Name Cache");
@@ -174,7 +181,8 @@ static uma_zone_t cache_zone_large;
 } while (0)
 
 static int	doingcache = 1;		/* 1 => enable the cache */
-SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0, "");
+SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0,
+    "VFS namecache enabled");
 
 /* Export size information to userland */
 SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG_RD, 0,
@@ -620,7 +628,7 @@ cache_enter(dvp, vp, cnp)
 	/*
 	 * Avoid blowout in namecache entries.
 	 */
-	if (numcache >= desiredvnodes * 2)
+	if (numcache >= desiredvnodes * ncsizefactor)
 		return;
 
 	flag = 0;

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 01:24: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 C1175106564A;
	Sat, 30 Oct 2010 01:24:26 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AF4E98FC12;
	Sat, 30 Oct 2010 01:24: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 o9U1OQCE073222;
	Sat, 30 Oct 2010 01:24:26 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9U1OQ87073220;
	Sat, 30 Oct 2010 01:24:26 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201010300124.o9U1OQ87073220@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 30 Oct 2010 01:24:26 +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: r214544 - stable/8/share/man/man7
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 30 Oct 2010 01:24:26 -0000

Author: kib
Date: Sat Oct 30 01:24:26 2010
New Revision: 214544
URL: http://svn.freebsd.org/changeset/base/214544

Log:
  MFC r213917:
  Document vfs.ncsizefactor and vfs.ncnegfactor.

Modified:
  stable/8/share/man/man7/tuning.7
Directory Properties:
  stable/8/share/man/man7/   (props changed)

Modified: stable/8/share/man/man7/tuning.7
==============================================================================
--- stable/8/share/man/man7/tuning.7	Sat Oct 30 01:19:15 2010	(r214543)
+++ stable/8/share/man/man7/tuning.7	Sat Oct 30 01:24:26 2010	(r214544)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 23, 2009
+.Dd October 16, 2010
 .Dt TUNING 7
 .Os
 .Sh NAME
@@ -511,6 +511,24 @@ Also,
 higher write queueing values may add latency to reads occurring at the same
 time.
 .Pp
+The
+.Va vfs.ncsizefactor
+sysctl defines how large VFS namecache may grow.
+The number of currently allocated entries in namecache is provided by
+.Va debug.numcache
+sysctl and the condition
+debug.numcache < kern.maxvnodes * vfs.ncsizefactor
+is adhered to.
+.Pp
+The
+.Va vfs.ncnegfactor
+sysctl defines how many negative entries VFS namecache is allowed to create.
+The number of currently allocated negative entries is provided by
+.Va debug.numneg
+sysctl and the condition
+vfs.ncnegfactor * debug.numneg < debug.numcache
+is adhered to.
+.Pp
 There are various other buffer-cache and VM page cache related sysctls.
 We do not recommend modifying these values.
 As of

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 04:53: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 CB3571065673;
	Sat, 30 Oct 2010 04:53:50 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AED508FC08;
	Sat, 30 Oct 2010 04:53: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 o9U4roJO080189;
	Sat, 30 Oct 2010 04:53:50 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9U4roZo080187;
	Sat, 30 Oct 2010 04:53:50 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201010300453.o9U4roZo080187@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 30 Oct 2010 04:53: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: r214546 - stable/8/sys/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: Sat, 30 Oct 2010 04:53:51 -0000

Author: alc
Date: Sat Oct 30 04:53:50 2010
New Revision: 214546
URL: http://svn.freebsd.org/changeset/base/214546

Log:
  MFC r213408
    If vm_map_find() is asked to allocate a superpage-aligned region of
    virtual addresses that is greater than a superpage in size but not a
    multiple of the superpage size, then vm_map_find() is not always
    expanding the kernel pmap to support the last few small pages being
    allocated.  Previously, we grew the kernel page table in
    vm_map_findspace() when we found the first available virtual address.
    Now, instead, we defer the call to pmap_growkernel() until we are
    committed to a range of virtual addresses in vm_map_insert().

Modified:
  stable/8/sys/vm/vm_map.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)

Modified: stable/8/sys/vm/vm_map.c
==============================================================================
--- stable/8/sys/vm/vm_map.c	Sat Oct 30 02:51:04 2010	(r214545)
+++ stable/8/sys/vm/vm_map.c	Sat Oct 30 04:53:50 2010	(r214546)
@@ -1166,6 +1166,9 @@ vm_map_insert(vm_map_t map, vm_object_t 
 	}
 
 charged:
+	/* Expand the kernel pmap, if necessary. */
+	if (map == kernel_map && end > kernel_vm_end)
+		pmap_growkernel(end);
 	if (object != NULL) {
 		/*
 		 * OBJ_ONEMAPPING must be cleared unless this mapping
@@ -1302,7 +1305,7 @@ vm_map_findspace(vm_map_t map, vm_offset
     vm_offset_t *addr)	/* OUT */
 {
 	vm_map_entry_t entry;
-	vm_offset_t end, st;
+	vm_offset_t st;
 
 	/*
 	 * Request must fit within min/max VM address and must avoid
@@ -1316,7 +1319,7 @@ vm_map_findspace(vm_map_t map, vm_offset
 	/* Empty tree means wide open address space. */
 	if (map->root == NULL) {
 		*addr = start;
-		goto found;
+		return (0);
 	}
 
 	/*
@@ -1326,7 +1329,7 @@ vm_map_findspace(vm_map_t map, vm_offset
 	map->root = vm_map_entry_splay(start, map->root);
 	if (start + length <= map->root->start) {
 		*addr = start;
-		goto found;
+		return (0);
 	}
 
 	/*
@@ -1337,7 +1340,7 @@ vm_map_findspace(vm_map_t map, vm_offset
 	st = (start > map->root->end) ? start : map->root->end;
 	if (length <= map->root->end + map->root->adj_free - st) {
 		*addr = st;
-		goto found;
+		return (0);
 	}
 
 	/* With max_free, can immediately tell if no solution. */
@@ -1355,22 +1358,13 @@ vm_map_findspace(vm_map_t map, vm_offset
 			entry = entry->left;
 		else if (entry->adj_free >= length) {
 			*addr = entry->end;
-			goto found;
+			return (0);
 		} else
 			entry = entry->right;
 	}
 
 	/* Can't get here, so panic if we do. */
 	panic("vm_map_findspace: max_free corrupt");
-
-found:
-	/* Expand the kernel pmap, if necessary. */
-	if (map == kernel_map) {
-		end = round_page(*addr + length);
-		if (end > kernel_vm_end)
-			pmap_growkernel(end);
-	}
-	return (0);
 }
 
 int

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 08:18: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 7374710656AB;
	Sat, 30 Oct 2010 08:18:17 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
	by mx1.freebsd.org (Postfix) with ESMTP id 192988FC13;
	Sat, 30 Oct 2010 08:18:15 +0000 (UTC)
Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua
	[212.40.38.100])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA18403;
	Sat, 30 Oct 2010 11:18:14 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Received: from localhost.topspin.kiev.ua ([127.0.0.1])
	by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
	id 1PC6di-000J4t-EI; Sat, 30 Oct 2010 11:18:14 +0300
Message-ID: <4CCBD4C6.2070505@freebsd.org>
Date: Sat, 30 Oct 2010 11:18:14 +0300
From: Andriy Gapon 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.11) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.5
MIME-Version: 1.0
To: David Xu 
References: <201010290935.o9T9ZbXH089952@svn.freebsd.org>
In-Reply-To: <201010290935.o9T9ZbXH089952@svn.freebsd.org>
X-Enigmail-Version: 1.1.2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214506 - head/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: Sat, 30 Oct 2010 08:18:17 -0000

on 29/10/2010 12:35 David Xu said the following:
> Author: davidxu
> Date: Fri Oct 29 09:35:36 2010
> New Revision: 214506
> URL: http://svn.freebsd.org/changeset/base/214506
> 
> Log:
>   Return previous sigaction correctly.
>   
>   Submitted by:	avg

Thanks!

> Modified:
>   head/lib/libthr/thread/thr_sig.c
> 
> Modified: head/lib/libthr/thread/thr_sig.c
> ==============================================================================
> --- head/lib/libthr/thread/thr_sig.c	Fri Oct 29 09:23:26 2010	(r214505)
> +++ head/lib/libthr/thread/thr_sig.c	Fri Oct 29 09:35:36 2010	(r214506)
> @@ -547,7 +547,10 @@ _sigaction(int sig, const struct sigacti
>  
>  	if (oldact.sa_handler != SIG_DFL &&
>  	    oldact.sa_handler != SIG_IGN) {
> -		oldact = _thr_sigact[sig-1].sigact;
> +		if (act != NULL)
> +			oldact = oldact2;
> +		else if (oact != NULL)
> +			oldact = _thr_sigact[sig-1].sigact;
>  	}
>  
>  	_thr_rwl_unlock(&_thr_sigact[sig-1].lock);


-- 
Andriy Gapon

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 10:09: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 228D61065672;
	Sat, 30 Oct 2010 10:09:00 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au
	[211.29.132.190])
	by mx1.freebsd.org (Postfix) with ESMTP id A9EE48FC1E;
	Sat, 30 Oct 2010 10:08:59 +0000 (UTC)
Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au
	(c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165])
	by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o9UA8u0T015813
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 30 Oct 2010 21:08:57 +1100
Date: Sat, 30 Oct 2010 21:08:56 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Pawel Jakub Dawidek 
In-Reply-To: <20101029222159.GA2160@garage.freebsd.pl>
Message-ID: <20101030203424.M1007@besplex.bde.org>
References: <201010291331.o9TDVAtm027022@svn.freebsd.org>
	<20101029222159.GA2160@garage.freebsd.pl>
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, David Xu 
Subject: Re: svn commit: r214510 - in head: include lib/libc/gen 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, 30 Oct 2010 10:09:00 -0000

On Sat, 30 Oct 2010, Pawel Jakub Dawidek wrote:

> On Fri, Oct 29, 2010 at 01:31:10PM +0000, David Xu wrote:
>> Log:
>>   Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset,
>>   also add sysconf() key _SC_CPUSET_SIZE to get sysctl value.
>>
>>   Submitted by: gcooper
> [...]
>> +#ifdef _SC_CPUSET_SIZE
>> +	case _SC_CPUSET_SIZE:
>> +		len = sizeof(lvalue);
>> +		if (sysctlbyname("kern.sched.cpusetsize", &lvalue, &len, NULL,
>> +		    0) == -1)
>> +			return (-1);
>> +		return (lvalue);
>> +#endif
> [...]
>> +static size_t _kern_cpuset_size = sizeof(cpuset_t);

No need for this or its bogus type, since it is a small compile-time
constant value.

> [...]
>> +/*
>> + * Return the size of cpuset_t at the kernel level
>> + *
>> + * XXX (gcooper): replace ULONG with SIZE once CTLTYPE_SIZE is implemented.
>> + */
>> +SYSCTL_ULONG(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
>> +    &_kern_cpuset_size, 0, "Kernel-level cpuset_t struct size");
>> +

Just use:

SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
     0, sizeof(cpuset_t), "sizeof(cpuset_t) in the kernel");

the same as for all debugging sizeofs in kern_mib.c.  (I also changed the
style of the message to be more like the ones there.  (sysctl -ad | greo
sizeof on ref9-i386 shows only 1 other inconsistency: the banal description
is missing for debug.sizeof.namecache.))

> Because it is used via sysconf(3), I don't think it should be converted
> to CTLTYPE_SIZE at all. I even think it would be safer to make
> _kern_cpuset_size a long (sysconf's lvalue is long) and (just for
> consistency) use SYSCTL_LONG().
>
> Also note, that on i386 long is 32bit and on amd64 long is 64bit, so
> 32bit process running on 64bit system won't be able to read this sysctl.
> Or do we detect 32bit processes on 64bit systems and convert such types
> in the kernel?

Just use int.  16-bit ints are only large enough for 8*32767 CPUs, but
32-bit ints are large enough for 8*2147482647 CPUs, which should be
enough for anyone.  Also use 'int value' instead of 'long lvalue' in
sysconf.c.

Using u_long is also bogus.  Because the value is returned by sysconf(3),
u_long won't actually work if it is actually needed, because if the
value exceeds LONG_MAX then `return (lvalue)' will blindly overflow.
But the value is very far from exeeding even INT_MAX, so there is no
problem.  (Overflow would actually occur earlier, via the type pun of
using sysctl for a u_long variable to read the variable into a plain
long.  It is unclear that this type pun is safe even when there is no
overflow.)

The kernel isn't going to be having any data structures larger than
2147482647 bytes any time soon, so 32-bit ints are plenty large enough
for returning the size of any data structure in the kernel.  However,
16-bit ints wouldn't be.  Careful code might use size_t to avoid
assuming anything about sizeof(int), but with 32-bit ints this mainly
gives bloat when size_t is 64 bits.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 10: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 6AE36106566B;
	Sat, 30 Oct 2010 10:28:33 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 58C3E8FC1B;
	Sat, 30 Oct 2010 10:28: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 o9UASXcA091328;
	Sat, 30 Oct 2010 10:28:33 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UASXA2091326;
	Sat, 30 Oct 2010 10:28:33 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201010301028.o9UASXA2091326@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Sat, 30 Oct 2010 10:28: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: r214547 - stable/8/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: Sat, 30 Oct 2010 10:28:33 -0000

Author: ume
Date: Sat Oct 30 10:28:33 2010
New Revision: 214547
URL: http://svn.freebsd.org/changeset/base/214547

Log:
  MFC r213403: Clear errno for each method dispatch.

Modified:
  stable/8/lib/libc/net/nsdispatch.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/locale/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/net/nsdispatch.c
==============================================================================
--- stable/8/lib/libc/net/nsdispatch.c	Sat Oct 30 04:53:50 2010	(r214546)
+++ stable/8/lib/libc/net/nsdispatch.c	Sat Oct 30 10:28:33 2010	(r214547)
@@ -707,11 +707,13 @@ _nsdispatch(void *retval, const ns_dtab 
 				va_end(ap);
 			} else {
 				cache_flag = 0;
+				errno = 0;
 				va_start(ap, defaults);
 				result = method(retval, mdata, ap);
 				va_end(ap);
 			}
 #else /* NS_CACHING */
+			errno = 0;
 			va_start(ap, defaults);
 			result = method(retval, mdata, ap);
 			va_end(ap);

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 10:30: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 844FA106564A;
	Sat, 30 Oct 2010 10:30:50 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0595F8FC1A;
	Sat, 30 Oct 2010 10:30: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 o9UAUnMc091570;
	Sat, 30 Oct 2010 10:30:49 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UAUnQO091566;
	Sat, 30 Oct 2010 10:30:49 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201010301030.o9UAUnQO091566@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Sat, 30 Oct 2010 10:30:49 +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: r214548 - stable/8/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: Sat, 30 Oct 2010 10:30:50 -0000

Author: ume
Date: Sat Oct 30 10:30:49 2010
New Revision: 214548
URL: http://svn.freebsd.org/changeset/base/214548

Log:
  MFC r213453: When no protocol entry is found, getproto*_r(3)
  should return zero.

Modified:
  stable/8/lib/libc/net/getproto.c
  stable/8/lib/libc/net/getprotoent.c
  stable/8/lib/libc/net/getprotoname.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/locale/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/net/getproto.c
==============================================================================
--- stable/8/lib/libc/net/getproto.c	Sat Oct 30 10:28:33 2010	(r214547)
+++ stable/8/lib/libc/net/getproto.c	Sat Oct 30 10:30:49 2010	(r214548)
@@ -123,7 +123,7 @@ getprotobynumber_r(int proto, struct pro
 
 	if (rv != NS_SUCCESS) {
 		errno = ret_errno;
-		return ((ret_errno != 0) ? ret_errno : -1);
+		return (ret_errno);
 	}
 	return (0);
 }

Modified: stable/8/lib/libc/net/getprotoent.c
==============================================================================
--- stable/8/lib/libc/net/getprotoent.c	Sat Oct 30 10:28:33 2010	(r214547)
+++ stable/8/lib/libc/net/getprotoent.c	Sat Oct 30 10:30:49 2010	(r214548)
@@ -494,7 +494,7 @@ getprotoent_r(struct protoent *pptr, cha
 
 	if (rv != NS_SUCCESS) {
 		errno = ret_errno;
-		return ((ret_errno != 0) ? ret_errno : -1);
+		return (ret_errno);
 	}
 	return (0);
 }

Modified: stable/8/lib/libc/net/getprotoname.c
==============================================================================
--- stable/8/lib/libc/net/getprotoname.c	Sat Oct 30 10:28:33 2010	(r214547)
+++ stable/8/lib/libc/net/getprotoname.c	Sat Oct 30 10:30:49 2010	(r214548)
@@ -131,7 +131,7 @@ getprotobyname_r(const char *name, struc
 
 	if (rv != NS_SUCCESS) {
 		errno = ret_errno;
-		return ((ret_errno != 0) ? ret_errno : -1);
+		return (ret_errno);
 	}
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 10:37: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 8E77E106566B;
	Sat, 30 Oct 2010 10:37:11 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7C2088FC0C;
	Sat, 30 Oct 2010 10:37: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 o9UAbBLl091874;
	Sat, 30 Oct 2010 10:37:11 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UAbBFD091872;
	Sat, 30 Oct 2010 10:37:11 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201010301037.o9UAbBFD091872@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Sat, 30 Oct 2010 10:37:11 +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: r214549 - stable/7/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: Sat, 30 Oct 2010 10:37:11 -0000

Author: ume
Date: Sat Oct 30 10:37:11 2010
New Revision: 214549
URL: http://svn.freebsd.org/changeset/base/214549

Log:
  MFC r213403: Clear errno for each method dispatch.

Modified:
  stable/7/lib/libc/net/nsdispatch.c
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/net/nsdispatch.c
==============================================================================
--- stable/7/lib/libc/net/nsdispatch.c	Sat Oct 30 10:30:49 2010	(r214548)
+++ stable/7/lib/libc/net/nsdispatch.c	Sat Oct 30 10:37:11 2010	(r214549)
@@ -673,11 +673,13 @@ _nsdispatch(void *retval, const ns_dtab 
 				va_end(ap);
 			} else {
 				cache_flag = 0;
+				errno = 0;
 				va_start(ap, defaults);
 				result = method(retval, mdata, ap);
 				va_end(ap);
 			}
 #else /* NS_CACHING */
+			errno = 0;
 			va_start(ap, defaults);
 			result = method(retval, mdata, ap);
 			va_end(ap);

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 10: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 8A9BA1065670;
	Sat, 30 Oct 2010 10:38:24 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 784938FC14;
	Sat, 30 Oct 2010 10: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 o9UAcO4d091958;
	Sat, 30 Oct 2010 10:38:24 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UAcO9G091954;
	Sat, 30 Oct 2010 10:38:24 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201010301038.o9UAcO9G091954@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Sat, 30 Oct 2010 10:38:24 +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: r214550 - stable/7/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: Sat, 30 Oct 2010 10:38:24 -0000

Author: ume
Date: Sat Oct 30 10:38:23 2010
New Revision: 214550
URL: http://svn.freebsd.org/changeset/base/214550

Log:
  MFC r213453: When no protocol entry is found, getproto*_r(3)
  should return zero.

Modified:
  stable/7/lib/libc/net/getproto.c
  stable/7/lib/libc/net/getprotoent.c
  stable/7/lib/libc/net/getprotoname.c
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/net/getproto.c
==============================================================================
--- stable/7/lib/libc/net/getproto.c	Sat Oct 30 10:37:11 2010	(r214549)
+++ stable/7/lib/libc/net/getproto.c	Sat Oct 30 10:38:23 2010	(r214550)
@@ -123,7 +123,7 @@ getprotobynumber_r(int proto, struct pro
 
 	if (rv != NS_SUCCESS) {
 		errno = ret_errno;
-		return ((ret_errno != 0) ? ret_errno : -1);
+		return (ret_errno);
 	}
 	return (0);
 }

Modified: stable/7/lib/libc/net/getprotoent.c
==============================================================================
--- stable/7/lib/libc/net/getprotoent.c	Sat Oct 30 10:37:11 2010	(r214549)
+++ stable/7/lib/libc/net/getprotoent.c	Sat Oct 30 10:38:23 2010	(r214550)
@@ -494,7 +494,7 @@ getprotoent_r(struct protoent *pptr, cha
 
 	if (rv != NS_SUCCESS) {
 		errno = ret_errno;
-		return ((ret_errno != 0) ? ret_errno : -1);
+		return (ret_errno);
 	}
 	return (0);
 }

Modified: stable/7/lib/libc/net/getprotoname.c
==============================================================================
--- stable/7/lib/libc/net/getprotoname.c	Sat Oct 30 10:37:11 2010	(r214549)
+++ stable/7/lib/libc/net/getprotoname.c	Sat Oct 30 10:38:23 2010	(r214550)
@@ -131,7 +131,7 @@ getprotobyname_r(const char *name, struc
 
 	if (rv != NS_SUCCESS) {
 		errno = ret_errno;
-		return ((ret_errno != 0) ? ret_errno : -1);
+		return (ret_errno);
 	}
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 11:30: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 3B4481065674;
	Sat, 30 Oct 2010 11:30:50 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2949B8FC15;
	Sat, 30 Oct 2010 11:30: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 o9UBUoQq095445;
	Sat, 30 Oct 2010 11:30:50 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UBUogA095443;
	Sat, 30 Oct 2010 11:30:50 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201010301130.o9UBUogA095443@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Oct 2010 11:30:50 +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: r214551 - 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, 30 Oct 2010 11:30:50 -0000

Author: bz
Date: Sat Oct 30 11:30:49 2010
New Revision: 214551
URL: http://svn.freebsd.org/changeset/base/214551

Log:
  MFC r213930:
  
    Close a race acquiring the IF_ADDR_LOCK() for each entry while iterating
    over all interfaces to make sure the address will neither change nor be
    freed while we are working on it.
  
    PR:		kern/146250
    Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)

Modified:
  stable/7/sys/net/rtsock.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/net/rtsock.c
==============================================================================
--- stable/7/sys/net/rtsock.c	Sat Oct 30 10:38:23 2010	(r214550)
+++ stable/7/sys/net/rtsock.c	Sat Oct 30 11:30:49 2010	(r214551)
@@ -1261,6 +1261,7 @@ sysctl_iflist(int af, struct walkarg *w)
 	TAILQ_FOREACH(ifp, &ifnet, if_link) {
 		if (w->w_arg && w->w_arg != ifp->if_index)
 			continue;
+		IF_ADDR_LOCK(ifp);
 		ifa = ifp->if_addr;
 		info.rti_info[RTAX_IFP] = ifa->ifa_addr;
 		len = rt_msg2(RTM_IFINFO, &info, NULL, w);
@@ -1300,10 +1301,13 @@ sysctl_iflist(int af, struct walkarg *w)
 					goto done;
 			}
 		}
+		IF_ADDR_UNLOCK(ifp);
 		info.rti_info[RTAX_IFA] = info.rti_info[RTAX_NETMASK] =
 			info.rti_info[RTAX_BRD] = NULL;
 	}
 done:
+	if (ifp != NULL)
+		IF_ADDR_UNLOCK(ifp);
 	IFNET_RUNLOCK();
 	return (error);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 11:54: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 7AE171065675;
	Sat, 30 Oct 2010 11:54:55 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 690F78FC12;
	Sat, 30 Oct 2010 11:54: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 o9UBstps096076;
	Sat, 30 Oct 2010 11:54:55 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UBstRo096074;
	Sat, 30 Oct 2010 11:54:55 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201010301154.o9UBstRo096074@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Oct 2010 11:54: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: r214552 - stable/8/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, 30 Oct 2010 11:54:55 -0000

Author: bz
Date: Sat Oct 30 11:54:55 2010
New Revision: 214552
URL: http://svn.freebsd.org/changeset/base/214552

Log:
  MFC r213930:
  
    Close a race acquiring the IF_ADDR_LOCK() for each entry while iterating
    over all interfaces to make sure the address will neither change nor be
    freed while we are working on it.
  
    PR:		kern/146250
    Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)

Modified:
  stable/8/sys/net/rtsock.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)

Modified: stable/8/sys/net/rtsock.c
==============================================================================
--- stable/8/sys/net/rtsock.c	Sat Oct 30 11:30:49 2010	(r214551)
+++ stable/8/sys/net/rtsock.c	Sat Oct 30 11:54:55 2010	(r214552)
@@ -1473,6 +1473,7 @@ sysctl_iflist(int af, struct walkarg *w)
 	TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
 		if (w->w_arg && w->w_arg != ifp->if_index)
 			continue;
+		IF_ADDR_LOCK(ifp);
 		ifa = ifp->if_addr;
 		info.rti_info[RTAX_IFP] = ifa->ifa_addr;
 		len = rt_msg2(RTM_IFINFO, &info, NULL, w);
@@ -1530,10 +1531,13 @@ sysctl_iflist(int af, struct walkarg *w)
 					goto done;
 			}
 		}
+		IF_ADDR_UNLOCK(ifp);
 		info.rti_info[RTAX_IFA] = info.rti_info[RTAX_NETMASK] =
 			info.rti_info[RTAX_BRD] = NULL;
 	}
 done:
+	if (ifp != NULL)
+		IF_ADDR_UNLOCK(ifp);
 	IFNET_RUNLOCK();
 	return (error);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 12:05: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 639BD106566B;
	Sat, 30 Oct 2010 12:05:20 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 51D918FC1A;
	Sat, 30 Oct 2010 12:05: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 o9UC5Kcn096534;
	Sat, 30 Oct 2010 12:05:20 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UC5KDV096532;
	Sat, 30 Oct 2010 12:05:20 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201010301205.o9UC5KDV096532@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Oct 2010 12:05: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: r214553 - 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: Sat, 30 Oct 2010 12:05:20 -0000

Author: bz
Date: Sat Oct 30 12:05:20 2010
New Revision: 214553
URL: http://svn.freebsd.org/changeset/base/214553

Log:
  MFC r213932:
  
    MfP4 CH182763 (original version):
  
    Make it harder to exploit certain in_control() related races between the
    intiial lookup at the beginning and the time we will remove the entry
    from the lists by re-checking that entry is still in the list before
    trying to remove it.
  
    Reported by:  Nima Misaghian (nima_misa hotmail.com) on net@ 20100817
    Tested by:    Nima Misaghian (nima_misa hotmail.com) (original version)
    PR:           kern/146250
    Submitted by: Mikolaj Golub (to.my.trociny gmail.com) (different version)

Modified:
  stable/8/sys/netinet/in.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)

Modified: stable/8/sys/netinet/in.c
==============================================================================
--- stable/8/sys/netinet/in.c	Sat Oct 30 11:54:55 2010	(r214552)
+++ stable/8/sys/netinet/in.c	Sat Oct 30 12:05:20 2010	(r214553)
@@ -599,6 +599,21 @@ in_control(struct socket *so, u_long cmd
 	}
 
 	IF_ADDR_LOCK(ifp);
+	/* Re-check that ia is still part of the list. */
+	TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+		if (ifa == &ia->ia_ifa)
+			break;
+	}
+	if (ifa == NULL) {
+		/*
+		 * If we lost the race with another thread, there is no need to
+		 * try it again for the next loop as there is no other exit
+		 * path between here and out.
+		 */
+		IF_ADDR_UNLOCK(ifp);
+		error = EADDRNOTAVAIL;
+		goto out;
+	}
 	TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link);
 	IF_ADDR_UNLOCK(ifp);
 	ifa_free(&ia->ia_ifa);				/* if_addrhead */

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 12:39: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 CFECB1065679;
	Sat, 30 Oct 2010 12:39:51 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B3B7B8FC13;
	Sat, 30 Oct 2010 12:39: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 o9UCdpAK097476;
	Sat, 30 Oct 2010 12:39:51 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UCdpTw097473;
	Sat, 30 Oct 2010 12:39:51 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201010301239.o9UCdpTw097473@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Oct 2010 12:39:51 +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: r214554 - in stable/8/sys: conf 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: Sat, 30 Oct 2010 12:39:51 -0000

Author: bz
Date: Sat Oct 30 12:39:51 2010
New Revision: 214554
URL: http://svn.freebsd.org/changeset/base/214554

Log:
  MFC r214303:
  
    Add initial inet DDB support for show in_ifaddr and show sin commands which
    proved to be useful while debugging address list problems.

Added:
  stable/8/sys/netinet/in_debug.c
     - copied unchanged from r214303, head/sys/netinet/in_debug.c
Modified:
  stable/8/sys/conf/files
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)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Sat Oct 30 12:05:20 2010	(r214553)
+++ stable/8/sys/conf/files	Sat Oct 30 12:39:51 2010	(r214554)
@@ -2500,6 +2500,7 @@ netinet/if_atm.c		optional atm
 netinet/if_ether.c		optional inet ether
 netinet/igmp.c			optional inet
 netinet/in.c			optional inet
+netinet/in_debug.c		optional inet ddb
 netinet/ip_carp.c		optional inet carp | inet6 carp
 netinet/in_gif.c		optional gif inet
 netinet/ip_gre.c		optional gre inet

Copied: stable/8/sys/netinet/in_debug.c (from r214303, head/sys/netinet/in_debug.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/netinet/in_debug.c	Sat Oct 30 12:39:51 2010	(r214554, copy of r214303, head/sys/netinet/in_debug.c)
@@ -0,0 +1,120 @@
+/*-
+ * Copyright (c) 2010 Bjoern A. Zeeb 
+ * 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 "opt_ddb.h"
+
+#include 
+#include 
+#include 
+
+#ifdef DDB
+#include 
+#endif
+
+#include 
+#include 
+
+#include 
+#include 
+
+#ifdef DDB
+static void
+in_show_sockaddr_in(struct sockaddr_in *sin)
+{
+
+#define	SIN_DB_RPINTF(f, e)	db_printf("\t   %s = " f "\n", #e, sin->e);
+	db_printf("\tsockaddr_in = %p\n", sin);
+	SIN_DB_RPINTF("%u", sin_len);
+	SIN_DB_RPINTF("%u", sin_family);
+	SIN_DB_RPINTF("%u", sin_port);
+	SIN_DB_RPINTF("0x%08x", sin_addr.s_addr);
+	db_printf("\t   %s = %02x%02x%02x%02x%02x%02x%02x%02x\n",
+	    "sin_zero[8]",
+	    sin->sin_zero[0], sin->sin_zero[1],
+	    sin->sin_zero[2], sin->sin_zero[3],
+	    sin->sin_zero[4], sin->sin_zero[5],
+	    sin->sin_zero[6], sin->sin_zero[7]);
+#undef SIN_DB_RPINTF
+}
+
+DB_SHOW_COMMAND(sin, db_show_sin)
+{
+	struct sockaddr_in *sin;
+
+	sin = (struct sockaddr_in *)addr;
+	if (sin == NULL) {
+		/* usage: No need to confess if you didn't sin. */
+		db_printf("usage: show sin \n");
+		return;
+	}
+
+	in_show_sockaddr_in(sin);
+}
+
+static void
+in_show_in_ifaddr(struct in_ifaddr *ia)
+{
+
+#define	IA_DB_RPINTF(f, e)	db_printf("\t   %s = " f "\n", #e, ia->e);
+#define	IA_DB_RPINTF_PTR(f, e)	db_printf("\t   %s = " f "\n", #e, &ia->e);
+#define	IA_DB_RPINTF_DPTR(f, e)	db_printf("\t  *%s = " f "\n", #e, *ia->e);
+	db_printf("\tin_ifaddr = %p\n", ia);
+	IA_DB_RPINTF_PTR("%p", ia_ifa);
+	IA_DB_RPINTF("0x%08lx", ia_net);
+	IA_DB_RPINTF("0x%08lx", ia_netmask);
+	IA_DB_RPINTF("0x%08lx", ia_subnet);
+	IA_DB_RPINTF("0x%08lx", ia_subnetmask);
+	IA_DB_RPINTF("0x%08x", ia_netbroadcast.s_addr);
+	IA_DB_RPINTF("%p", ia_hash.le_next);
+	IA_DB_RPINTF("%p", ia_hash.le_prev);
+	IA_DB_RPINTF_DPTR("%p", ia_hash.le_prev);
+	IA_DB_RPINTF("%p", ia_link.tqe_next);
+	IA_DB_RPINTF("%p", ia_link.tqe_prev);
+	IA_DB_RPINTF_DPTR("%p", ia_link.tqe_prev);
+	IA_DB_RPINTF_PTR("%p", ia_addr);
+	IA_DB_RPINTF_PTR("%p", ia_dstaddr);
+	IA_DB_RPINTF_PTR("%p", ia_sockmask);
+#undef IA_DB_RPINTF_DPTR
+#undef IA_DB_RPINTF_PTR
+#undef IA_DB_RPINTF
+}
+
+DB_SHOW_COMMAND(in_ifaddr, db_show_in_ifaddr)
+{
+	struct in_ifaddr *ia;
+
+	ia = (struct in_ifaddr *)addr;
+	if (ia == NULL) {
+		db_printf("usage: show in_ifaddr \n");
+		return;
+	}
+
+	in_show_in_ifaddr(ia);
+}
+#endif

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 13:58: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 E646F1065672;
	Sat, 30 Oct 2010 13:58:03 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id C651A8FC08;
	Sat, 30 Oct 2010 13:58:02 +0000 (UTC)
Received: by wwi17 with SMTP id 17so2845811wwi.31
	for ; Sat, 30 Oct 2010 06:58:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type;
	bh=ZT4QpLXxLvhROeCGwGSN+znNgaSaN6Qr5iJyYbojMi0=;
	b=KupCRTR0nFnYjB60e1se+c0LSee5ap3T6BTqofDs5LDwX3AhpQEEz4lTTLN7Ad1Gnn
	LwU3/0NzBAWh0jcbrDpw+0RiFSrzq7ExWWKD3Ra0x8nQnDlb8wp/B+YEVPDSrnOeq1yq
	4LmFCxn59a4BfRhHVYBOpThfX+nvFxvxQ34tM=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	b=my1BykgFtyV5N7uNVkn6qjXZnhv26NcbNn0NpvOQ1cx5yZEzUklj1mmFsEunYzbSum
	KpGjgulrotJ30nfAQwfN7CKrwvzCIzzan50McXVUFs0H517gBepry7D1vMHo27uqyWmZ
	K6PJBhFssdqveoxfVQYAUW7rhsbUro05D9ELA=
MIME-Version: 1.0
Received: by 10.216.58.209 with SMTP id q59mr545691wec.41.1288447081194; Sat,
	30 Oct 2010 06:58:01 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.10.198 with HTTP; Sat, 30 Oct 2010 06:58:01 -0700 (PDT)
In-Reply-To: <20101030203424.M1007@besplex.bde.org>
References: <201010291331.o9TDVAtm027022@svn.freebsd.org>
	<20101029222159.GA2160@garage.freebsd.pl>
	<20101030203424.M1007@besplex.bde.org>
Date: Sat, 30 Oct 2010 06:58:01 -0700
X-Google-Sender-Auth: e3eVA1vUX1aS3nv1u3ywGwvow1A
Message-ID: 
From: Garrett Cooper 
To: Bruce Evans 
Content-Type: multipart/mixed; boundary=000e0ce02a0a96247c0493d5f6ad
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Pawel Jakub Dawidek ,
	David Xu 
Subject: Re: svn commit: r214510 - in head: include lib/libc/gen 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, 30 Oct 2010 13:58:04 -0000

--000e0ce02a0a96247c0493d5f6ad
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Sat, Oct 30, 2010 at 3:08 AM, Bruce Evans  wrote:
> On Sat, 30 Oct 2010, Pawel Jakub Dawidek wrote:
>
>> On Fri, Oct 29, 2010 at 01:31:10PM +0000, David Xu wrote:
>>>
>>> Log:
>>> =A0Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset=
,
>>> =A0also add sysconf() key _SC_CPUSET_SIZE to get sysctl value.
>>>
>>> =A0Submitted by: gcooper
>>
>> [...]
>>>
>>> +#ifdef _SC_CPUSET_SIZE
>>> + =A0 =A0 =A0 case _SC_CPUSET_SIZE:
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 len =3D sizeof(lvalue);
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sysctlbyname("kern.sched.cpusetsize",=
 &lvalue, &len,
>>> NULL,
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0) =3D=3D -1)
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (-1);
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (lvalue);
>>> +#endif
>>
>> [...]
>>>
>>> +static size_t _kern_cpuset_size =3D sizeof(cpuset_t);
>
> No need for this or its bogus type, since it is a small compile-time
> constant value.
>
>> [...]
>>>
>>> +/*
>>> + * Return the size of cpuset_t at the kernel level
>>> + *
>>> + * XXX (gcooper): replace ULONG with SIZE once CTLTYPE_SIZE is
>>> implemented.
>>> + */
>>> +SYSCTL_ULONG(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
>>> + =A0 =A0&_kern_cpuset_size, 0, "Kernel-level cpuset_t struct size");
>>> +
>
> Just use:
>
> SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
> =A0 =A00, sizeof(cpuset_t), "sizeof(cpuset_t) in the kernel");
>
> the same as for all debugging sizeofs in kern_mib.c. =A0(I also changed t=
he
> style of the message to be more like the ones there. =A0(sysctl -ad | gre=
o
> sizeof on ref9-i386 shows only 1 other inconsistency: the banal descripti=
on
> is missing for debug.sizeof.namecache.))

Yeah... it was silly of me to do it that way, in hindsight :(...

>> Because it is used via sysconf(3), I don't think it should be converted
>> to CTLTYPE_SIZE at all. I even think it would be safer to make
>> _kern_cpuset_size a long (sysconf's lvalue is long) and (just for
>> consistency) use SYSCTL_LONG().
>>
>> Also note, that on i386 long is 32bit and on amd64 long is 64bit, so
>> 32bit process running on 64bit system won't be able to read this sysctl.
>> Or do we detect 32bit processes on 64bit systems and convert such types
>> in the kernel?
>
> Just use int. =A016-bit ints are only large enough for 8*32767 CPUs, but
> 32-bit ints are large enough for 8*2147482647 CPUs, which should be
> enough for anyone. =A0Also use 'int value' instead of 'long lvalue' in
> sysconf.c.

That won't really do much good, otherwise it would oppose the POSIX
API definition :/...

> Using u_long is also bogus. =A0Because the value is returned by sysconf(3=
),
> u_long won't actually work if it is actually needed, because if the
> value exceeds LONG_MAX then `return (lvalue)' will blindly overflow.
> But the value is very far from exeeding even INT_MAX, so there is no
> problem. =A0(Overflow would actually occur earlier, via the type pun of
> using sysctl for a u_long variable to read the variable into a plain
> long. =A0It is unclear that this type pun is safe even when there is no
> overflow.)
>
> The kernel isn't going to be having any data structures larger than
> 2147482647 bytes any time soon, so 32-bit ints are plenty large enough
> for returning the size of any data structure in the kernel. =A0However,
> 16-bit ints wouldn't be. =A0Careful code might use size_t to avoid
> assuming anything about sizeof(int), but with 32-bit ints this mainly
> gives bloat when size_t is 64 bits.

    Ok.
Thanks!
-Garrett

--000e0ce02a0a96247c0493d5f6ad
Content-Type: text/x-patch; charset=US-ASCII;
	name="cpuset_t-less_suckage.patch"
Content-Disposition: attachment; filename="cpuset_t-less_suckage.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gfwk3lu30

SW5kZXg6IHN5cy9rZXJuL3NjaGVkX3VsZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9rZXJuL3NjaGVk
X3VsZS5jCShyZXZpc2lvbiAyMTQ1NTQpCisrKyBzeXMva2Vybi9zY2hlZF91bGUuYwkod29ya2lu
ZyBjb3B5KQpAQCAtMjcxMiw4ICsyNzEyLDYgQEAKIAlzYnVmX2RlbGV0ZSh0b3BvKTsKIAlyZXR1
cm4gKGVycik7CiB9Ci0KLXN0YXRpYyBzaXplX3QgX2tlcm5fY3B1c2V0X3NpemUgPSBzaXplb2Yo
Y3B1c2V0X3QpOwogI2VuZGlmCiAKIFNZU0NUTF9OT0RFKF9rZXJuLCBPSURfQVVUTywgc2NoZWQs
IENUTEZMQUdfUlcsIDAsICJTY2hlZHVsZXIiKTsKQEAgLTI3NTEsMTMgKzI3NDksOSBAQAogICAg
IENUTEZMQUdfUkQsIE5VTEwsIDAsIHN5c2N0bF9rZXJuX3NjaGVkX3RvcG9sb2d5X3NwZWMsICJB
IiwgCiAgICAgIlhNTCBkdW1wIG9mIGRldGVjdGVkIENQVSB0b3BvbG9neSIpOwogCi0vKiAKLSAq
IFJldHVybiB0aGUgc2l6ZSBvZiBjcHVzZXRfdCBhdCB0aGUga2VybmVsIGxldmVsCi0gKgotICog
WFhYIChnY29vcGVyKTogcmVwbGFjZSBVTE9ORyB3aXRoIFNJWkUgb25jZSBDVExUWVBFX1NJWkUg
aXMgaW1wbGVtZW50ZWQuCi0gKi8KLVNZU0NUTF9VTE9ORyhfa2Vybl9zY2hlZCwgT0lEX0FVVE8s
IGNwdXNldHNpemUsIENUTEZMQUdfUkQsCi0gICAgJl9rZXJuX2NwdXNldF9zaXplLCAwLCAiS2Vy
bmVsLWxldmVsIGNwdXNldF90IHN0cnVjdCBzaXplIik7CisvKiBSZXR1cm4gdGhlIHNpemUgb2Yg
Y3B1c2V0X3QgYXQgdGhlIGtlcm5lbCBsZXZlbCAqLworU1lTQ1RMX0lOVChfa2Vybl9zY2hlZCwg
T0lEX0FVVE8sIGNwdXNldHNpemUsIENUTEZMQUdfUkQsCisgICAgMCwgc2l6ZW9mKGNwdXNldF90
KSwgInNpemVvZihjcHVzZXRfdCkiKTsKIAogI2VuZGlmCiAK
--000e0ce02a0a96247c0493d5f6ad--

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 14: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 DD0FB106564A;
	Sat, 30 Oct 2010 14:08:26 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CB6928FC12;
	Sat, 30 Oct 2010 14:08: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 o9UE8QcE000534;
	Sat, 30 Oct 2010 14:08:26 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UE8QNS000532;
	Sat, 30 Oct 2010 14:08:26 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201010301408.o9UE8QNS000532@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 30 Oct 2010 14:08: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: r214556 - 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, 30 Oct 2010 14:08:27 -0000

Author: kib
Date: Sat Oct 30 14:08:26 2010
New Revision: 214556
URL: http://svn.freebsd.org/changeset/base/214556

Log:
  Remove sysctl debug.ncnegfactor, it is renamed to vfs.ncnegfactor.
  
  MFC:	do not

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Sat Oct 30 13:25:41 2010	(r214555)
+++ head/sys/kern/vfs_cache.c	Sat Oct 30 14:08:26 2010	(r214556)
@@ -129,8 +129,6 @@ static u_long	nchash;			/* size of hash 
 SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0,
     "Size of namecache hash table");
 static u_long	ncnegfactor = 16;	/* ratio of negative entries */
-/* _debug sysctl left for backward compatibility */
-SYSCTL_ULONG(_debug, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0, "");
 SYSCTL_ULONG(_vfs, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0,
     "Ratio of negative namecache entries");
 static u_long	numneg;			/* number of negative entries allocated */

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 16:02: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 874BD106566C;
	Sat, 30 Oct 2010 16:02:16 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 741938FC14;
	Sat, 30 Oct 2010 16:02: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 o9UG2GjW004033;
	Sat, 30 Oct 2010 16:02:16 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UG2Got004030;
	Sat, 30 Oct 2010 16:02:16 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201010301602.o9UG2Got004030@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Oct 2010 16:02: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: r214557 - in stable/7/sys: conf 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: Sat, 30 Oct 2010 16:02:16 -0000

Author: bz
Date: Sat Oct 30 16:02:16 2010
New Revision: 214557
URL: http://svn.freebsd.org/changeset/base/214557

Log:
  MFC r214303:
  
    Add initial inet DDB support for show in_ifaddr and show sin commands which
    proved to be useful while debugging address list problems.

Added:
  stable/7/sys/netinet/in_debug.c
     - copied, changed from r214303, head/sys/netinet/in_debug.c
Modified:
  stable/7/sys/conf/files
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/conf/files
==============================================================================
--- stable/7/sys/conf/files	Sat Oct 30 14:08:26 2010	(r214556)
+++ stable/7/sys/conf/files	Sat Oct 30 16:02:16 2010	(r214557)
@@ -1954,6 +1954,7 @@ netinet/if_atm.c		optional atm
 netinet/if_ether.c		optional ether
 netinet/igmp.c			optional inet
 netinet/in.c			optional inet
+netinet/in_debug.c		optional inet ddb
 netinet/ip_carp.c		optional carp
 netinet/in_gif.c		optional gif inet
 netinet/ip_gre.c		optional gre inet

Copied and modified: stable/7/sys/netinet/in_debug.c (from r214303, head/sys/netinet/in_debug.c)
==============================================================================
--- head/sys/netinet/in_debug.c	Sun Oct 24 22:02:36 2010	(r214303, copy source)
+++ stable/7/sys/netinet/in_debug.c	Sat Oct 30 16:02:16 2010	(r214557)
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_ddb.h"
 
 #include 
+#include 
 #include 
 #include 
 

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 16:09: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 DA2E4106566B;
	Sat, 30 Oct 2010 16:09:15 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ACD558FC0C;
	Sat, 30 Oct 2010 16:09: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 o9UG9FrG004280;
	Sat, 30 Oct 2010 16:09:15 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UG9Frw004278;
	Sat, 30 Oct 2010 16:09:15 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201010301609.o9UG9Frw004278@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 30 Oct 2010 16:09:15 +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: r214558 - stable/7/sys/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: Sat, 30 Oct 2010 16:09:16 -0000

Author: alc
Date: Sat Oct 30 16:09:15 2010
New Revision: 214558
URL: http://svn.freebsd.org/changeset/base/214558

Log:
  MFC r213408
    If vm_map_find() is asked to allocate a superpage-aligned region of
    virtual addresses that is greater than a superpage in size but not a
    multiple of the superpage size, then vm_map_find() is not always
    expanding the kernel pmap to support the last few small pages being
    allocated.  Previously, we grew the kernel page table in
    vm_map_findspace() when we found the first available virtual address.
    Now, instead, we defer the call to pmap_growkernel() until we are
    committed to a range of virtual addresses in vm_map_insert().

Modified:
  stable/7/sys/vm/vm_map.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/vm/vm_map.c
==============================================================================
--- stable/7/sys/vm/vm_map.c	Sat Oct 30 16:02:16 2010	(r214557)
+++ stable/7/sys/vm/vm_map.c	Sat Oct 30 16:09:15 2010	(r214558)
@@ -978,6 +978,9 @@ vm_map_insert(vm_map_t map, vm_object_t 
 	if (cow & MAP_DISABLE_COREDUMP)
 		protoeflags |= MAP_ENTRY_NOCOREDUMP;
 
+	/* Expand the kernel pmap, if necessary. */
+	if (map == kernel_map && end > kernel_vm_end)
+		pmap_growkernel(end);
 	if (object != NULL) {
 		/*
 		 * OBJ_ONEMAPPING must be cleared unless this mapping
@@ -1099,7 +1102,7 @@ vm_map_findspace(vm_map_t map, vm_offset
     vm_offset_t *addr)	/* OUT */
 {
 	vm_map_entry_t entry;
-	vm_offset_t end, st;
+	vm_offset_t st;
 
 	/*
 	 * Request must fit within min/max VM address and must avoid
@@ -1113,7 +1116,7 @@ vm_map_findspace(vm_map_t map, vm_offset
 	/* Empty tree means wide open address space. */
 	if (map->root == NULL) {
 		*addr = start;
-		goto found;
+		return (0);
 	}
 
 	/*
@@ -1123,7 +1126,7 @@ vm_map_findspace(vm_map_t map, vm_offset
 	map->root = vm_map_entry_splay(start, map->root);
 	if (start + length <= map->root->start) {
 		*addr = start;
-		goto found;
+		return (0);
 	}
 
 	/*
@@ -1134,7 +1137,7 @@ vm_map_findspace(vm_map_t map, vm_offset
 	st = (start > map->root->end) ? start : map->root->end;
 	if (length <= map->root->end + map->root->adj_free - st) {
 		*addr = st;
-		goto found;
+		return (0);
 	}
 
 	/* With max_free, can immediately tell if no solution. */
@@ -1152,22 +1155,13 @@ vm_map_findspace(vm_map_t map, vm_offset
 			entry = entry->left;
 		else if (entry->adj_free >= length) {
 			*addr = entry->end;
-			goto found;
+			return (0);
 		} else
 			entry = entry->right;
 	}
 
 	/* Can't get here, so panic if we do. */
 	panic("vm_map_findspace: max_free corrupt");
-
-found:
-	/* Expand the kernel pmap, if necessary. */
-	if (map == kernel_map) {
-		end = round_page(*addr + length);
-		if (end > kernel_vm_end)
-			pmap_growkernel(end);
-	}
-	return (0);
 }
 
 int

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 16:25: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 4E57F106566C;
	Sat, 30 Oct 2010 16:25:09 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B3A28FC13;
	Sat, 30 Oct 2010 16:25: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 o9UGP9eu004776;
	Sat, 30 Oct 2010 16:25:09 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UGP9QZ004773;
	Sat, 30 Oct 2010 16:25:09 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201010301625.o9UGP9QZ004773@svn.freebsd.org>
From: Dimitry Andric 
Date: Sat, 30 Oct 2010 16:25: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: r214559 - head/usr.sbin/tcpdump/tcpdump
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 30 Oct 2010 16:25:09 -0000

Author: dim
Date: Sat Oct 30 16:25:08 2010
New Revision: 214559
URL: http://svn.freebsd.org/changeset/base/214559

Log:
  Regenerate our usr.sbin/tcpdump/tcpdump/config.h for tcpdump 4.1.1, and
  remove unused HAVE_RC5_H and HAVE_CAST_H defines from CFLAGS.

Modified:
  head/usr.sbin/tcpdump/tcpdump/Makefile
  head/usr.sbin/tcpdump/tcpdump/config.h

Modified: head/usr.sbin/tcpdump/tcpdump/Makefile
==============================================================================
--- head/usr.sbin/tcpdump/tcpdump/Makefile	Sat Oct 30 16:09:15 2010	(r214558)
+++ head/usr.sbin/tcpdump/tcpdump/Makefile	Sat Oct 30 16:25:08 2010	(r214559)
@@ -56,7 +56,7 @@ LDADD=	-ll -lpcap
 DPADD+= ${LIBCRYPTO}
 LDADD+= -lcrypto
 CFLAGS+= -I${DESTDIR}/usr/include/openssl
-CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_RC5_H -DHAVE_CAST_H -DHAVE_OPENSSL_EVP_H
+CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_CAST_H -DHAVE_OPENSSL_EVP_H
 .endif
 
 .if ${MK_PF} != "no"

Modified: head/usr.sbin/tcpdump/tcpdump/config.h
==============================================================================
--- head/usr.sbin/tcpdump/tcpdump/config.h	Sat Oct 30 16:09:15 2010	(r214558)
+++ head/usr.sbin/tcpdump/tcpdump/config.h	Sat Oct 30 16:25:08 2010	(r214559)
@@ -1,14 +1,11 @@
 /* $FreeBSD$ */
 /* This is an edited copy of the config.h generated by configure. */
 
-/* config.h.  Generated by configure.  */
+/* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.in by autoheader.  */
 /* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in --
  * make them to acconfig.h and rerun autoheader */
 
-/* Define if you have SSLeay 0.9.0b with the buggy cast128. */
-/* #undef HAVE_BUGGY_CAST128 */
-
 /* Define if you enable IPv6 support */
 /* See Makefile */
 /* #undef INET6 */
@@ -16,23 +13,12 @@
 /* Define if you enable support for the libsmi. */
 /* #undef LIBSMI */
 
-/* Define if you have the  header file.  */
-/* #undef HAVE_SMI_H */
-
 /* define if you have struct __res_state_ext */
 /* #undef HAVE_RES_STATE_EXT */
 
 /* define if your struct __res_state has the nsort member */
 /* #undef HAVE_NEW_RES_STATE */
 
-/*
- * define if struct ether_header.ether_dhost is a struct with ether_addr_octet
- */
-/* #undef ETHER_HEADER_HAS_EA */
-
-/* define if struct ether_arp contains arp_xsha */
-/* #undef ETHER_ARP_HAS_X */
-
 /* define if you have the addrinfo function. */
 #define HAVE_ADDRINFO 1
 
@@ -48,18 +34,9 @@
 /* define if INADDRSZ is defined (XXX not used!) */
 #define HAVE_INADDRSZ 1
 
-/* define if this is a development version, to use additional prototypes. */
-/* #undef HAVE_OS_PROTO_H */
-
-/* define if  defines __P() */
-/* #undef HAVE_PORTABLE_PROTOTYPE */
-
 /* define if RES_USE_INET6 is defined */
 #define HAVE_RES_USE_INET6 1
 
-/* define if struct sockaddr has the sa_len member */
-#define HAVE_SOCKADDR_SA_LEN 1
-
 /* define if you have struct sockaddr_storage */
 #define HAVE_SOCKADDR_STORAGE 1
 
@@ -96,18 +73,6 @@
 /* define if you have getrpcbynumber() */
 #define HAVE_GETRPCBYNUMBER 1
 
-/* define if unaligned memory accesses fail */
-/* #undef LBL_ALIGN */
-
-/* The successful return value from signal (?)XXX */
-#define RETSIGVAL 
-
-/* Define this on IRIX */
-/* #undef _BSD_SIGNALS */
-
-/* For HP/UX ANSI compiler? */
-/* #undef _HPUX_SOURCE */
-
 /* AIX hack. */
 /* #undef _SUN */
 
@@ -120,14 +85,6 @@
 /* Whether or not to include the possibly-buggy SMB printer */
 #define TCPDUMP_DO_SMB 1
 
-/* Long story short: aclocal.m4 depends on autoconf 2.13
- * implementation details wrt "const"; newer versions
- * have different implementation details so for now we
- * put "const" here.  This may cause duplicate definitions
- * in config.h but that should be OK since they're the same.
- */
-/* #undef const */
-
 /* Define if you have the dnet_htoa function.  */
 /* #undef HAVE_DNET_HTOA */
 
@@ -156,9 +113,6 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_FCNTL_H 1
 
-/* Define to 1 if you have the `getaddrinfo' function. */
-#define HAVE_GETADDRINFO 1
-
 /* Define to 1 if you have the `getnameinfo' function. */
 #define HAVE_GETNAMEINFO 1
 
@@ -195,9 +149,18 @@
 /* See Makefile */
 /* #undef HAVE_OPENSSL_EVP_H 1 */
 
+/* if there's an os_proto.h for this platform, to use additional prototypes */
+/* #undef HAVE_OS_PROTO_H */
+
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_PCAP_BLUETOOTH_H */
+
 /* Define to 1 if you have the `pcap_breakloop' function. */
 #define HAVE_PCAP_BREAKLOOP 1
 
+/* Define to 1 if you have the `pcap_create' function. */
+#define HAVE_PCAP_CREATE 1
+
 /* Define to 1 if you have the `pcap_dump_flush' function. */
 #define HAVE_PCAP_DUMP_FLUSH 1
 
@@ -210,6 +173,9 @@
 /* Define to 1 if you have the `pcap_lib_version' function. */
 #define HAVE_PCAP_LIB_VERSION 1
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_PCAP_USB_H */
+
 /* Define to 1 if you have the `pfopen' function. */
 /* #undef HAVE_PFOPEN */
 
@@ -231,6 +197,9 @@
 /* Define to 1 if you have the `snprintf' function. */
 #define HAVE_SNPRINTF 1
 
+/* if struct sockaddr has the sa_len member */
+#define HAVE_SOCKADDR_SA_LEN 1
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_STDINT_H 1
 
@@ -285,6 +254,9 @@
 /* define if your compiler has __attribute__ */
 #define HAVE___ATTRIBUTE__ 1
 
+/* if unaligned access fails */
+/* #undef LBL_ALIGN */
+
 /* Define to 1 if netinet/ether.h declares `ether_ntohost' */
 /* #undef NETINET_ETHER_H_DECLARES_ETHER_NTOHOST */
 
@@ -309,21 +281,23 @@
 /* Define as the return type of signal handlers (`int' or `void'). */
 #define RETSIGTYPE void
 
+/* return value of signal handlers */
+#define RETSIGVAL 
+
 /* The size of `char', as computed by sizeof. */
-#define SIZEOF_CHAR 1
+#undef SIZEOF_CHAR
 
 /* The size of `int', as computed by sizeof. */
-#define SIZEOF_INT 4
+#undef SIZEOF_INT
 
 /* The size of `long', as computed by sizeof. */
-/* XXX: This is wrong, but possibly unused */
-#define SIZEOF_LONG 4
+#undef SIZEOF_LONG
 
 /* The size of `long long', as computed by sizeof. */
-#define SIZEOF_LONG_LONG 8
+#undef SIZEOF_LONG_LONG
 
 /* The size of `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
+#undef SIZEOF_SHORT
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
@@ -331,6 +305,19 @@
 /* Define to 1 if you can safely include both  and . */
 #define TIME_WITH_SYS_TIME 1
 
+/* get BSD semantics on Irix */
+/* #undef _BSD_SIGNALS */
+
+/* needed on HP-UX */
+/* #undef _HPUX_SOURCE */
+
+/* define if your compiler allows __attribute__((format)) to be applied to
+   function pointers */
+#define __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS 1
+
+/* to handle Ultrix compilers that don't support const in prototypes */
+/* #undef const */
+
 /* Define as token for inline if inlining supported */
 #define inline inline
 

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 16:30: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 98A8A106564A;
	Sat, 30 Oct 2010 16:30:50 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 866868FC12;
	Sat, 30 Oct 2010 16:30: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 o9UGUoM7005237;
	Sat, 30 Oct 2010 16:30:50 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UGUoee005235;
	Sat, 30 Oct 2010 16:30:50 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201010301630.o9UGUoee005235@svn.freebsd.org>
From: Dimitry Andric 
Date: Sat, 30 Oct 2010 16:30: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: r214560 - head/usr.sbin/tcpdump/tcpdump
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 30 Oct 2010 16:30:50 -0000

Author: dim
Date: Sat Oct 30 16:30:50 2010
New Revision: 214560
URL: http://svn.freebsd.org/changeset/base/214560

Log:
  Actually remove the HAVE_CAST_H define this time.

Modified:
  head/usr.sbin/tcpdump/tcpdump/Makefile

Modified: head/usr.sbin/tcpdump/tcpdump/Makefile
==============================================================================
--- head/usr.sbin/tcpdump/tcpdump/Makefile	Sat Oct 30 16:25:08 2010	(r214559)
+++ head/usr.sbin/tcpdump/tcpdump/Makefile	Sat Oct 30 16:30:50 2010	(r214560)
@@ -56,7 +56,7 @@ LDADD=	-ll -lpcap
 DPADD+= ${LIBCRYPTO}
 LDADD+= -lcrypto
 CFLAGS+= -I${DESTDIR}/usr/include/openssl
-CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_CAST_H -DHAVE_OPENSSL_EVP_H
+CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_OPENSSL_EVP_H
 .endif
 
 .if ${MK_PF} != "no"

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 16: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 0EF171065672;
	Sat, 30 Oct 2010 16:53:43 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F0D1E8FC1D;
	Sat, 30 Oct 2010 16: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 o9UGrg8v006463;
	Sat, 30 Oct 2010 16:53:42 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UGrg64006461;
	Sat, 30 Oct 2010 16:53:42 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201010301653.o9UGrg64006461@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 30 Oct 2010 16: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: r214562 - 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: Sat, 30 Oct 2010 16:53:43 -0000

Author: rpaulo
Date: Sat Oct 30 16:53:42 2010
New Revision: 214562
URL: http://svn.freebsd.org/changeset/base/214562

Log:
  When the make target is 'install', don't descend into the clang
  libraries subdirectories since there's nothing to do there. This saves
  us quite a few seconds off installworld, esp. if the disk I/O is slow.

Modified:
  head/lib/clang/Makefile

Modified: head/lib/clang/Makefile
==============================================================================
--- head/lib/clang/Makefile	Sat Oct 30 16:51:25 2010	(r214561)
+++ head/lib/clang/Makefile	Sat Oct 30 16:53:42 2010	(r214562)
@@ -1,5 +1,6 @@
 # $FreeBSD$
 
+.if !make(install)
 SUBDIR=	libclanganalysis \
 	libclangast \
 	libclangbasic \
@@ -48,8 +49,9 @@ SUBDIR=	libclanganalysis \
 	libllvmx86asmprinter \
 	libllvmx86codegen \
 	libllvmx86disassembler \
-	libllvmx86info \
-	\
-	include
+	libllvmx86info
+.endif
+
+SUBDIR+= include
 
 .include 

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 17:21: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 F0C98106564A;
	Sat, 30 Oct 2010 17:21:32 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DEDA48FC15;
	Sat, 30 Oct 2010 17:21: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 o9UHLWHs007734;
	Sat, 30 Oct 2010 17:21:32 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UHLWCe007732;
	Sat, 30 Oct 2010 17:21:32 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201010301721.o9UHLWCe007732@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 30 Oct 2010 17:21: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: r214563 - 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: Sat, 30 Oct 2010 17:21:33 -0000

Author: alc
Date: Sat Oct 30 17:21:32 2010
New Revision: 214563
URL: http://svn.freebsd.org/changeset/base/214563

Log:
  Don't demote in pmap_demote_DMAP() if the specified length is zero.

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Sat Oct 30 16:53:42 2010	(r214562)
+++ head/sys/amd64/amd64/pmap.c	Sat Oct 30 17:21:32 2010	(r214563)
@@ -4968,6 +4968,11 @@ pmap_demote_DMAP(vm_paddr_t base, vm_siz
 	vm_offset_t va;
 	boolean_t changed;
 
+	if (len == 0)
+		return;
+	KASSERT(powerof2(len), ("pmap_demote_DMAP: len is not a power of 2"));
+	KASSERT((base & (len - 1)) == 0,
+	    ("pmap_demote_DMAP: base is not a multiple of len"));
 	if (len < NBPDP) {
 		va = PHYS_TO_DMAP(base);
 		changed = FALSE;

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 18:00: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 7D8C8106564A;
	Sat, 30 Oct 2010 18:00:53 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B2EE8FC14;
	Sat, 30 Oct 2010 18:00: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 o9UI0rmM009555;
	Sat, 30 Oct 2010 18:00:53 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UI0rSp009552;
	Sat, 30 Oct 2010 18:00:53 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201010301800.o9UI0rSp009552@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 30 Oct 2010 18:00: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: r214564 - head/sys/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: Sat, 30 Oct 2010 18:00:53 -0000

Author: alc
Date: Sat Oct 30 18:00:53 2010
New Revision: 214564
URL: http://svn.freebsd.org/changeset/base/214564

Log:
  Correct some format strings used by sysctls.
  
  MFC after:	1 week

Modified:
  head/sys/vm/vm_phys.c
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_phys.c
==============================================================================
--- head/sys/vm/vm_phys.c	Sat Oct 30 17:21:32 2010	(r214563)
+++ head/sys/vm/vm_phys.c	Sat Oct 30 18:00:53 2010	(r214564)
@@ -137,11 +137,11 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS)
 			sbuf_printf(&sbuf, "-- --      ");
 		sbuf_printf(&sbuf, "--\n");
 		for (oind = VM_NFREEORDER - 1; oind >= 0; oind--) {
-			sbuf_printf(&sbuf, "  %2.2d (%6.6dK)", oind,
+			sbuf_printf(&sbuf, "  %2d (%6dK)", oind,
 			    1 << (PAGE_SHIFT - 10 + oind));
 			for (pind = 0; pind < VM_NFREEPOOL; pind++) {
 				fl = vm_phys_free_queues[flind][pind];
-				sbuf_printf(&sbuf, "  |  %6.6d", fl[oind].lcnt);
+				sbuf_printf(&sbuf, "  |  %6d", fl[oind].lcnt);
 			}
 			sbuf_printf(&sbuf, "\n");
 		}

Modified: head/sys/vm/vm_reserv.c
==============================================================================
--- head/sys/vm/vm_reserv.c	Sat Oct 30 17:21:32 2010	(r214563)
+++ head/sys/vm/vm_reserv.c	Sat Oct 30 18:00:53 2010	(r214564)
@@ -193,7 +193,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER
 			unused_pages += VM_LEVEL_0_NPAGES - rv->popcnt;
 		}
 		mtx_unlock(&vm_page_queue_free_mtx);
-		sbuf_printf(&sbuf, "%5.5d: %6.6dK, %6.6d\n", level,
+		sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level,
 		    unused_pages * (PAGE_SIZE / 1024), counter);
 	}
 	error = sbuf_finish(&sbuf);

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 18:52: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 2FCEA1065674;
	Sat, 30 Oct 2010 18:52:45 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1DCD38FC08;
	Sat, 30 Oct 2010 18:52: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 o9UIqjr5012019;
	Sat, 30 Oct 2010 18:52:45 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UIqjeR012017;
	Sat, 30 Oct 2010 18:52:45 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201010301852.o9UIqjeR012017@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Oct 2010 18:52: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: r214565 - head/sys/netipsec
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 30 Oct 2010 18:52:45 -0000

Author: bz
Date: Sat Oct 30 18:52:44 2010
New Revision: 214565
URL: http://svn.freebsd.org/changeset/base/214565

Log:
  Announce both IPsec and UDP Encap (NAT-T) if available for
  feature_present(3) checks.
  
  This will help to run-time detect and conditionally handle specific
  optionas of either feature in user space (i.e. in libipsec).
  
  Descriptions read by:	rwatson
  MFC after:		2 weeks

Modified:
  head/sys/netipsec/ipsec.c

Modified: head/sys/netipsec/ipsec.c
==============================================================================
--- head/sys/netipsec/ipsec.c	Sat Oct 30 18:00:53 2010	(r214564)
+++ head/sys/netipsec/ipsec.c	Sat Oct 30 18:52:44 2010	(r214565)
@@ -126,6 +126,11 @@ VNET_DEFINE(int, ip4_esp_randpad) = -1;
  */
 VNET_DEFINE(int, crypto_support) = CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE;
 
+FEATURE(ipsec, "Internet Protocol Security (IPsec)");
+#ifdef IPSEC_NAT_T
+FEATURE(ipsec_natt, "UDP Encapsulation of IPsec ESP Packets ('NAT-T')");
+#endif
+
 SYSCTL_DECL(_net_inet_ipsec);
 
 /* net.inet.ipsec */

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 20:51: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 B79691065670;
	Sat, 30 Oct 2010 20:51:25 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A62A28FC26;
	Sat, 30 Oct 2010 20:51: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 o9UKpP19021289;
	Sat, 30 Oct 2010 20:51:25 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UKpPAp021287;
	Sat, 30 Oct 2010 20:51:25 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201010302051.o9UKpPAp021287@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 30 Oct 2010 20:51: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: r214566 - head/sys/dev/mii
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 30 Oct 2010 20:51:25 -0000

Author: marius
Date: Sat Oct 30 20:51:25 2010
New Revision: 214566
URL: http://svn.freebsd.org/changeset/base/214566

Log:
  Correct a bug in r213893; within a PHY driver MIIF_PHYPRIVn should be used
  instead of MIIF_MACPRIVn. This didn't make a functional difference though.

Modified:
  head/sys/dev/mii/e1000phy.c

Modified: head/sys/dev/mii/e1000phy.c
==============================================================================
--- head/sys/dev/mii/e1000phy.c	Sat Oct 30 18:52:44 2010	(r214565)
+++ head/sys/dev/mii/e1000phy.c	Sat Oct 30 20:51:25 2010	(r214566)
@@ -206,7 +206,7 @@ e1000phy_reset(struct mii_softc *sc)
 			reg &= ~E1000_SCR_MODE_MASK;
 			reg |= E1000_SCR_MODE_1000BX;
 			PHY_WRITE(sc, E1000_SCR, reg);
-			if ((sc->mii_flags & MIIF_MACPRIV0) != 0) {
+			if ((sc->mii_flags & MIIF_PHYPRIV0) != 0) {
 				/* Set SIGDET polarity low for SFP module. */
 				PHY_WRITE(sc, E1000_EADR, 1);
 				reg = PHY_READ(sc, E1000_SCR);

From owner-svn-src-all@FreeBSD.ORG  Sat Oct 30 21:01: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 BBBE7106564A;
	Sat, 30 Oct 2010 21:01:19 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A65928FC14;
	Sat, 30 Oct 2010 21:01: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 o9UL1JVN022284;
	Sat, 30 Oct 2010 21:01:19 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UL1JcI022264;
	Sat, 30 Oct 2010 21:01:19 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201010302101.o9UL1JcI022264@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 30 Oct 2010 21:01:19 +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: r214567 - in vendor/bind9/dist: . bin/dnssec bin/named
	bin/named/include/named bin/nsupdate doc/arm lib/dns
	lib/dns/include/dns lib/isc lib/isc/include/isc lib/lwres/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: Sat, 30 Oct 2010 21:01:19 -0000

Author: dougb
Date: Sat Oct 30 21:01:18 2010
New Revision: 214567
URL: http://svn.freebsd.org/changeset/base/214567

Log:
  Vendor import of BIND 9.6-ESV-R2

Modified:
  vendor/bind9/dist/CHANGES
  vendor/bind9/dist/README
  vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.html
  vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.html
  vendor/bind9/dist/bin/dnssec/dnssec-keygen.html
  vendor/bind9/dist/bin/dnssec/dnssec-signzone.html
  vendor/bind9/dist/bin/named/include/named/globals.h
  vendor/bind9/dist/bin/named/main.c
  vendor/bind9/dist/bin/named/query.c
  vendor/bind9/dist/bin/named/server.c
  vendor/bind9/dist/bin/nsupdate/nsupdate.html
  vendor/bind9/dist/doc/arm/Bv9ARM-book.xml
  vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html
  vendor/bind9/dist/doc/arm/Bv9ARM.html
  vendor/bind9/dist/doc/arm/Bv9ARM.pdf
  vendor/bind9/dist/doc/arm/isc-logo.eps
  vendor/bind9/dist/doc/arm/isc-logo.pdf
  vendor/bind9/dist/doc/arm/man.dig.html
  vendor/bind9/dist/doc/arm/man.dnssec-dsfromkey.html
  vendor/bind9/dist/doc/arm/man.dnssec-keyfromlabel.html
  vendor/bind9/dist/doc/arm/man.dnssec-keygen.html
  vendor/bind9/dist/doc/arm/man.dnssec-signzone.html
  vendor/bind9/dist/doc/arm/man.host.html
  vendor/bind9/dist/doc/arm/man.named-checkconf.html
  vendor/bind9/dist/doc/arm/man.named-checkzone.html
  vendor/bind9/dist/doc/arm/man.named.html
  vendor/bind9/dist/doc/arm/man.nsupdate.html
  vendor/bind9/dist/doc/arm/man.rndc-confgen.html
  vendor/bind9/dist/doc/arm/man.rndc.conf.html
  vendor/bind9/dist/doc/arm/man.rndc.html
  vendor/bind9/dist/lib/dns/adb.c
  vendor/bind9/dist/lib/dns/api
  vendor/bind9/dist/lib/dns/include/dns/diff.h
  vendor/bind9/dist/lib/dns/include/dns/ncache.h
  vendor/bind9/dist/lib/dns/include/dns/rdataset.h
  vendor/bind9/dist/lib/dns/include/dns/resolver.h
  vendor/bind9/dist/lib/dns/include/dns/result.h
  vendor/bind9/dist/lib/dns/include/dns/types.h
  vendor/bind9/dist/lib/dns/include/dns/validator.h
  vendor/bind9/dist/lib/dns/ncache.c
  vendor/bind9/dist/lib/dns/rbtdb.c
  vendor/bind9/dist/lib/dns/rdatalist.c
  vendor/bind9/dist/lib/dns/rdataset.c
  vendor/bind9/dist/lib/dns/rdataslab.c
  vendor/bind9/dist/lib/dns/resolver.c
  vendor/bind9/dist/lib/dns/result.c
  vendor/bind9/dist/lib/dns/sdb.c
  vendor/bind9/dist/lib/dns/sdlz.c
  vendor/bind9/dist/lib/dns/validator.c
  vendor/bind9/dist/lib/dns/view.c
  vendor/bind9/dist/lib/isc/api
  vendor/bind9/dist/lib/isc/include/isc/mem.h
  vendor/bind9/dist/lib/isc/mem.c
  vendor/bind9/dist/lib/lwres/man/lwres.html
  vendor/bind9/dist/lib/lwres/man/lwres_buffer.html
  vendor/bind9/dist/lib/lwres/man/lwres_config.html
  vendor/bind9/dist/lib/lwres/man/lwres_context.html
  vendor/bind9/dist/lib/lwres/man/lwres_gabn.html
  vendor/bind9/dist/lib/lwres/man/lwres_gai_strerror.html
  vendor/bind9/dist/lib/lwres/man/lwres_getaddrinfo.html
  vendor/bind9/dist/lib/lwres/man/lwres_gethostent.html
  vendor/bind9/dist/lib/lwres/man/lwres_getipnode.html
  vendor/bind9/dist/lib/lwres/man/lwres_getnameinfo.html
  vendor/bind9/dist/lib/lwres/man/lwres_getrrsetbyname.html
  vendor/bind9/dist/lib/lwres/man/lwres_gnba.html
  vendor/bind9/dist/lib/lwres/man/lwres_hstrerror.html
  vendor/bind9/dist/lib/lwres/man/lwres_inetntop.html
  vendor/bind9/dist/lib/lwres/man/lwres_noop.html
  vendor/bind9/dist/lib/lwres/man/lwres_packet.html
  vendor/bind9/dist/lib/lwres/man/lwres_resutil.html
  vendor/bind9/dist/version

Modified: vendor/bind9/dist/CHANGES
==============================================================================
--- vendor/bind9/dist/CHANGES	Sat Oct 30 20:51:25 2010	(r214566)
+++ vendor/bind9/dist/CHANGES	Sat Oct 30 21:01:18 2010	(r214567)
@@ -1,9 +1,48 @@
-	--- 9.6.2-P2 released ---
+	--- 9.6-ESV-R2 released ---
+
+2939.	[func]		Check that named successfully skips NSEC3 records
+			that fail to match the NSEC3PARAM record currently
+			in use. [RT# 21868]
+
+2937.	[bug]		Worked around an apparent race condition in over
+			memory conditions.  Without this fix a DNS cache DB or
+			ADB could incorrectly stay in an over memory state,
+			effectively refusing further caching, which
+			subsequently made a BIND 9 caching server unworkable.
+			This fix prevents this problem from happening by
+			polling the state of the memory context, rather than
+			making a copy of the state, which appeared to cause
+			a race.  This is a "workaround" in that it doesn't
+			solve the possible race per se, but several experiments
+			proved this change solves the symptom.  Also, the
+			polling overhead hasn't been reported to be an issue.
+			This bug should only affect a caching server that
+			specifies a finite max-cache-size.  It's also quite
+			likely that the bug happens only when enabling threads,
+			but it's not confirmed yet. [RT #21818]
+
+2925.	[bug]		Named failed to accept uncachable negative responses
+			from insecure zones. [RT# 21555]
+
+2921.	[bug]		The resolver could attempt to destroy a fetch context
+			too soon.  [RT #19878]
+
+2900.	[bug]		The placeholder negative caching element was not
+			properly constructed triggering a INSIST in 
+			dns_ncache_towire(). [RT #21346]
+			
+2890.	[bug]		Handle the introduction of new trusted-keys and
+			DS, DLV RRsets better. [RT #21097]
+
+2869.	[bug]		Fix arguments to dns_keytable_findnextkeynode() call.
+			[RT #20877]
+
+	--- 9.6-ESV-R1 released ---
 
 2876.	[bug]		Named could return SERVFAIL for negative responses
 			from unsigned zones. [RT #21131]
 
-	--- 9.6.2-P1 released ---
+	--- 9.6-ESV released ---
 
 2852.	[bug]		Handle broken DNSSEC trust chains better. [RT #15619]
 

Modified: vendor/bind9/dist/README
==============================================================================
--- vendor/bind9/dist/README	Sat Oct 30 20:51:25 2010	(r214566)
+++ vendor/bind9/dist/README	Sat Oct 30 21:01:18 2010	(r214567)
@@ -42,6 +42,12 @@ BIND 9
 		Stichting NLnet - NLnet Foundation
 		Nominum, Inc.
 
+BIND 9.6-ESV (Extended Support Version)
+
+	BIND 9.6-ESV will be supported until March 31, 2013, at
+	which time you will need to upgrade to the current release
+	of BIND.
+
 BIND 9.6.2
 
 	BIND 9.6.2 is a maintenance release, fixing bugs in 9.6.1.

Modified: vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.html
==============================================================================
--- vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.html	Sat Oct 30 20:51:25 2010	(r214566)
+++ vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.html	Sat Oct 30 21:01:18 2010	(r214567)
@@ -1,5 +1,5 @@
 
 
-
+
 
 
 
@@ -33,14 +33,14 @@
 

dnssec-dsfromkey {-s} [-v level] [-1] [-2] [-a alg] [-c class] [-d dir] {dnsname}

-

DESCRIPTION

+

DESCRIPTION

dnssec-dsfromkey outputs the Delegation Signer (DS) resource record (RR), as defined in RFC 3658 and RFC 4509, for the given key(s).

-

OPTIONS

+

OPTIONS

-1

@@ -81,7 +81,7 @@

-

EXAMPLE

+

EXAMPLE

To build the SHA-256 DS RR from the Kexample.com.+003+26160 @@ -96,7 +96,7 @@

-

FILES

+

FILES

The keyfile can be designed by the key identification Knnnn.+aaa+iiiii or the full file name @@ -110,13 +110,13 @@

-

CAVEAT

+

CAVEAT

A keyfile error can give a "file not found" even if the file exists.

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -125,7 +125,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.html ============================================================================== --- vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.html Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.html Sat Oct 30 21:01:18 2010 (r214567) @@ -13,7 +13,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -31,7 +31,7 @@

dnssec-keyfromlabel {-a algorithm} {-l label} [-c class] [-f flag] [-k] [-n nametype] [-p protocol] [-t type] [-v level] {name}

-

DESCRIPTION

+

DESCRIPTION

dnssec-keyfromlabel gets keys with the given label from a crypto hardware and builds key files for DNSSEC (Secure DNS), as defined in RFC 2535 @@ -39,7 +39,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm
@@ -120,7 +120,7 @@
-

GENERATED KEY FILES

+

GENERATED KEY FILES

When dnssec-keyfromlabel completes successfully, @@ -161,7 +161,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -169,7 +169,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: vendor/bind9/dist/bin/dnssec/dnssec-keygen.html ============================================================================== --- vendor/bind9/dist/bin/dnssec/dnssec-keygen.html Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/bin/dnssec/dnssec-keygen.html Sat Oct 30 21:01:18 2010 (r214567) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -32,7 +32,7 @@

dnssec-keygen {-a algorithm} {-b keysize} {-n nametype} [-c class] [-e] [-f flag] [-g generator] [-h] [-k] [-p protocol] [-r randomdev] [-s strength] [-t type] [-v level] {name}

-

DESCRIPTION

+

DESCRIPTION

dnssec-keygen generates keys for DNSSEC (Secure DNS), as defined in RFC 2535 and RFC 4034. It can also generate keys for use with @@ -45,7 +45,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm
@@ -155,7 +155,7 @@
-

GENERATED KEYS

+

GENERATED KEYS

When dnssec-keygen completes successfully, @@ -201,7 +201,7 @@

-

EXAMPLE

+

EXAMPLE

To generate a 768-bit DSA key for the domain example.com, the following command would be @@ -222,7 +222,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-signzone(8), BIND 9 Administrator Reference Manual, RFC 2539, @@ -231,7 +231,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: vendor/bind9/dist/bin/dnssec/dnssec-signzone.html ============================================================================== --- vendor/bind9/dist/bin/dnssec/dnssec-signzone.html Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/bin/dnssec/dnssec-signzone.html Sat Oct 30 21:01:18 2010 (r214567) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -32,7 +32,7 @@

dnssec-signzone [-a] [-c class] [-d directory] [-e end-time] [-f output-file] [-g] [-h] [-k key] [-l domain] [-i interval] [-I input-format] [-j jitter] [-N soa-seria l-format] [-o origin] [-O output-format] [-p] [-P] [-r randomdev] [-s start-time] [-t] [-v level] [-z] [-3 salt] [-H iterations] [-A] {zonefile} [key...]

-

DESCRIPTION

+

DESCRIPTION

dnssec-signzone signs a zone. It generates NSEC and RRSIG records and produces a signed version of the @@ -43,7 +43,7 @@

-

OPTIONS

+

OPTIONS

-a

@@ -273,7 +273,7 @@

-

EXAMPLE

+

EXAMPLE

The following command signs the example.com zone with the DSA key generated by dnssec-keygen @@ -302,7 +302,7 @@ db.example.com.signed %

-

KNOWN BUGS

+

KNOWN BUGS

dnssec-signzone was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys @@ -327,14 +327,14 @@ db.example.com.signed

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), BIND 9 Administrator Reference Manual, RFC 4033.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: vendor/bind9/dist/bin/named/include/named/globals.h ============================================================================== --- vendor/bind9/dist/bin/named/include/named/globals.h Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/bin/named/include/named/globals.h Sat Oct 30 21:01:18 2010 (r214567) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008, 2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: globals.h,v 1.80 2008/11/16 22:49:18 marka Exp $ */ +/* $Id: globals.h,v 1.80.84.2 2010/06/26 23:46:15 tbox Exp $ */ #ifndef NAMED_GLOBALS_H #define NAMED_GLOBALS_H 1 @@ -132,6 +132,7 @@ EXTERN int ns_g_listen INIT(3); EXTERN isc_time_t ns_g_boottime; EXTERN isc_boolean_t ns_g_memstatistics INIT(ISC_FALSE); EXTERN isc_boolean_t ns_g_clienttest INIT(ISC_FALSE); +EXTERN isc_boolean_t ns_g_nosoa INIT(ISC_FALSE); #undef EXTERN #undef INIT Modified: vendor/bind9/dist/bin/named/main.c ============================================================================== --- vendor/bind9/dist/bin/named/main.c Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/bin/named/main.c Sat Oct 30 21:01:18 2010 (r214567) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: main.c,v 1.166.34.3 2009/04/03 20:18:59 marka Exp $ */ +/* $Id: main.c,v 1.166.34.3.24.3 2010/09/06 03:58:32 marka Exp $ */ /*! \file */ @@ -446,13 +446,15 @@ parse_command_line(int argc, char *argv[ /* XXXJAB should we make a copy? */ ns_g_chrootdir = isc_commandline_argument; break; - case 'T': + case 'T': /* NOT DOCUMENTED */ /* * clienttest: make clients single shot with their * own memory context. */ if (strcmp(isc_commandline_argument, "clienttest") == 0) ns_g_clienttest = ISC_TRUE; + else if (!strcmp(isc_commandline_argument, "nosoa")) + ns_g_nosoa = ISC_TRUE; else fprintf(stderr, "unknown -T flag '%s\n", isc_commandline_argument); Modified: vendor/bind9/dist/bin/named/query.c ============================================================================== --- vendor/bind9/dist/bin/named/query.c Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/bin/named/query.c Sat Oct 30 21:01:18 2010 (r214567) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.16 2009/12/30 08:34:29 jinmei Exp $ */ +/* $Id: query.c,v 1.313.20.16.10.2 2010/06/26 23:46:14 tbox Exp $ */ /*! \file */ @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -2038,7 +2039,7 @@ query_addrrset(ns_client_t *client, dns_ static inline isc_result_t query_addsoa(ns_client_t *client, dns_db_t *db, dns_dbversion_t *version, - isc_boolean_t zero_ttl) + isc_boolean_t zero_ttl, isc_boolean_t isassociated) { dns_name_t *name; dns_dbnode_t *node; @@ -2056,6 +2057,12 @@ query_addsoa(ns_client_t *client, dns_db node = NULL; /* + * Don't add the SOA record for test which set "-T nosoa". + */ + if (ns_g_nosoa && (!WANTDNSSEC(client) || !isassociated)) + return (ISC_R_SUCCESS); + + /* * Get resources and make 'name' be the database origin. */ result = dns_message_gettempname(client->message, &name); @@ -4324,7 +4331,8 @@ query_find(ns_client_t *client, dns_fetc /* * Add SOA. */ - result = query_addsoa(client, db, version, ISC_FALSE); + result = query_addsoa(client, db, version, ISC_FALSE, + dns_rdataset_isassociated(rdataset)); if (result != ISC_R_SUCCESS) { QUERY_ERROR(result); goto cleanup; @@ -4372,9 +4380,11 @@ query_find(ns_client_t *client, dns_fetc zone != NULL && #endif dns_zone_getzeronosoattl(zone)) - result = query_addsoa(client, db, version, ISC_TRUE); + result = query_addsoa(client, db, version, ISC_TRUE, + dns_rdataset_isassociated(rdataset)); else - result = query_addsoa(client, db, version, ISC_FALSE); + result = query_addsoa(client, db, version, ISC_FALSE, + dns_rdataset_isassociated(rdataset)); if (result != ISC_R_SUCCESS) { QUERY_ERROR(result); goto cleanup; @@ -4742,7 +4752,7 @@ query_find(ns_client_t *client, dns_fetc * Add SOA. */ result = query_addsoa(client, db, version, - ISC_FALSE); + ISC_FALSE, ISC_FALSE); if (result == ISC_R_SUCCESS) result = ISC_R_NOMORE; } else { Modified: vendor/bind9/dist/bin/named/server.c ============================================================================== --- vendor/bind9/dist/bin/named/server.c Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/bin/named/server.c Sat Oct 30 21:01:18 2010 (r214567) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.520.12.11.8.2 2010/02/25 10:57:11 tbox Exp $ */ +/* $Id: server.c,v 1.520.12.11.10.1 2010/03/03 22:06:36 marka Exp $ */ /*! \file */ Modified: vendor/bind9/dist/bin/nsupdate/nsupdate.html ============================================================================== --- vendor/bind9/dist/bin/nsupdate/nsupdate.html Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/bin/nsupdate/nsupdate.html Sat Oct 30 21:01:18 2010 (r214567) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -32,7 +32,7 @@

nsupdate [-d] [-D] [[-g] | [-o] | [-y [hmac:]keyname:secret] | [-k keyfile]] [-t timeout] [-u udptimeout] [-r udpretries] [-R randomdev] [-v] [filename]

-

DESCRIPTION

+

DESCRIPTION

nsupdate is used to submit Dynamic DNS Update requests as defined in RFC2136 to a name server. @@ -169,7 +169,7 @@

-

INPUT FORMAT

+

INPUT FORMAT

nsupdate reads input from filename @@ -433,7 +433,7 @@

-

EXAMPLES

+

EXAMPLES

The examples below show how nsupdate @@ -487,7 +487,7 @@

-

FILES

+

FILES

/etc/resolv.conf

@@ -506,7 +506,7 @@

-

SEE ALSO

+

SEE ALSO

RFC2136, RFC3007, RFC2104, @@ -519,7 +519,7 @@

-

BUGS

+

BUGS

The TSIG key is redundantly stored in two separate files. This is a consequence of nsupdate using the DST library Modified: vendor/bind9/dist/doc/arm/Bv9ARM-book.xml ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM-book.xml Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/doc/arm/Bv9ARM-book.xml Sat Oct 30 21:01:18 2010 (r214567) @@ -18,7 +18,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> - + BIND 9 Administrator Reference Manual Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html Sat Oct 30 21:01:18 2010 (r214567) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html Sat Oct 30 21:01:18 2010 (r214567) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html Sat Oct 30 21:01:18 2010 (r214567) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html Sat Oct 30 21:01:18 2010 (r214567) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: vendor/bind9/dist/doc/arm/Bv9ARM.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.html Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/doc/arm/Bv9ARM.html Sat Oct 30 21:01:18 2010 (r214567) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: vendor/bind9/dist/doc/arm/Bv9ARM.pdf ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/bind9/dist/doc/arm/isc-logo.eps ============================================================================== --- vendor/bind9/dist/doc/arm/isc-logo.eps Sat Oct 30 20:51:25 2010 (r214566) +++ vendor/bind9/dist/doc/arm/isc-logo.eps Sat Oct 30 21:01:18 2010 (r214567) @@ -1,255 +1,63 @@ %!PS-Adobe-3.1 EPSF-3.0 -%%Title: Alternate-ISC-logo-v2.ai -%%Creator: Adobe Illustrator(R) 11 -%%AI8_CreatorVersion: 11.0.0 -%AI9_PrintingDataBegin -%%For: Douglas E. Appelt -%%CreationDate: 10/22/04 -%%BoundingBox: 0 0 255 149 -%%HiResBoundingBox: 0 0 254.8672 148.7520 -%%CropBox: 0 0 254.8672 148.7520 +%ADO_DSC_Encoding: MacOS Roman +%%Title: ISC_logo_only_RGB.eps +%%Creator: Adobe Illustrator(R) 13.0 +%%For: Brian Reid +%%CreationDate: 3/25/10 +%%BoundingBox: 0 0 118 46 +%%HiResBoundingBox: 0 0 117.9991 45.0176 +%%CropBox: 0 0 117.9991 45.0176 %%LanguageLevel: 2 %%DocumentData: Clean7Bit +%ADOBeginClientInjection: DocumentHeader "AI11EPS" +%%AI8_CreatorVersion: 13.0.2 %AI9_PrintingDataBegin %ADO_BuildNumber: Adobe Illustrator(R) 13.0.2 x434 R agm 4.4379 ct 5.1039 %ADO_ContainsXMP: MainFirst +%ADOEndClientInjection: DocumentHeader "AI11EPS" %%Pages: 1 -%%DocumentNeededResources: -%%DocumentSuppliedResources: procset Adobe_AGM_Image (1.0 0) -%%+ procset Adobe_CoolType_Utility_T42 (1.0 0) -%%+ procset Adobe_CoolType_Utility_MAKEOCF (1.19 0) -%%+ procset Adobe_CoolType_Core (2.23 0) -%%+ procset Adobe_AGM_Core (2.0 0) -%%+ procset Adobe_AGM_Utils (1.0 0) -%%DocumentFonts: -%%DocumentNeededFonts: -%%DocumentNeededFeatures: -%%DocumentSuppliedFeatures: -%%DocumentProcessColors: Cyan Magenta Yellow Black -%%DocumentCustomColors: (PANTONE 1805 C) -%%+ (PANTONE 871 C) -%%+ (PANTONE 301 C) -%%+ (PANTONE 7506 C) -%%CMYKCustomColor: 0 0.9100 1 0.2300 (PANTONE 1805 C) -%%+ 0.3569 0.3608 0.6353 0.1882 (PANTONE 871 C) -%%+ 1 0.4500 0 0.1800 (PANTONE 301 C) -%%+ 0 0.0500 0.1500 0 (PANTONE 7506 C) -%%RGBCustomColor: -%ADO_ContainsXMP: MainFirst -%AI7_Thumbnail: 128 76 8 -%%BeginData: 10692 Hex Bytes -%0000330000660000990000CC0033000033330033660033990033CC0033FF -%0066000066330066660066990066CC0066FF009900009933009966009999 -%0099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF3300FF66 -%00FF9900FFCC3300003300333300663300993300CC3300FF333300333333 -%3333663333993333CC3333FF3366003366333366663366993366CC3366FF -%3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC99 -%33CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF660000660033 -%6600666600996600CC6600FF6633006633336633666633996633CC6633FF -%6666006666336666666666996666CC6666FF669900669933669966669999 -%6699CC6699FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF33 -%66FF6666FF9966FFCC66FFFF9900009900339900669900999900CC9900FF -%9933009933339933669933999933CC9933FF996600996633996666996699 -%9966CC9966FF9999009999339999669999999999CC9999FF99CC0099CC33 -%99CC6699CC9999CCCC99CCFF99FF0099FF3399FF6699FF9999FFCC99FFFF -%CC0000CC0033CC0066CC0099CC00CCCC00FFCC3300CC3333CC3366CC3399 -%CC33CCCC33FFCC6600CC6633CC6666CC6699CC66CCCC66FFCC9900CC9933 -%CC9966CC9999CC99CCCC99FFCCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF -%CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0033FF0066FF0099FF00CC -%FF3300FF3333FF3366FF3399FF33CCFF33FFFF6600FF6633FF6666FF6699 -%FF66CCFF66FFFF9900FF9933FF9966FF9999FF99CCFF99FFFFCC00FFCC33 -%FFCC66FFCC99FFCCCCFFCCFFFFFF33FFFF66FFFF99FFFFCC110000001100 -%000011111111220000002200000022222222440000004400000044444444 -%550000005500000055555555770000007700000077777777880000008800 -%000088888888AA000000AA000000AAAAAAAABB000000BB000000BBBBBBBB -%DD000000DD000000DDDDDDDDEE000000EE000000EEEEEEEE0000000000FF -%00FF0000FFFFFF0000FF00FFFFFF00FFFFFF -%524C45FD1CF852FD63FFF820272726272727264B27272627272726272727 -%26272727264B20F827FD63FFF827FFFFFFCFFF84365AFFFFFFCFFFFFFFCF -%FFFFFFCFFD04FFCAF852FD63FFF827CFCFCACFCA2F0607A8CFCACFCACFCA -%CFCACFCACFCACFCACF7CF827FD63FFF800FFCFFFA8A8070D06A8CFFFCFFF -%CFFFCFFFCFFFCFFFCFFFCFA7F852FD63FFF800077E2F0D060D060706537D -%CF7D2FA8CFCACFCACFCACFCAFF7CF827FD63FFF8000D062F070D062F070D -%062F2F0D062FCACFCFFFCFCFCFFFCFA1F852FD63FFF8050707062E517651 -%522807060706072ECFCACFCACFCACFCAFF7CF827FD63FFF8002F067C757B -%757C757B512F072F2FFFCFCFCFFFCFFFCFFFCFA1F852FD63FFF805075251 -%75517551755175512F062FCACFCACFCACFCACFCAFF7CF827FD63FFF8F859 -%75765176757C517C757B2E2F07A8CFFFCFCFCFFFCFCFCFA1F852FD63FFF8 -%00517551757CCFCAA751755175060753CFCACFCACFCACFCACF7CF827FD63 -%FFF8F87C75757CFFCFFFCFA7517C752F072F59A8CFCFCFFFCFFFCFA7F852 -%FD04FFA87D527DA8FD5AFFF827757551A1CFCFCAFFA0755175280D060706 -%A8CFCFCACFCAFF7CF827FD05FF27F827FD5BFFF8F87C51767CFFCFFFCFA0 -%517C752F062F060D84FFCFFFCFFFCFA1F852FD05FF7DF87DFD5BFFF80552 -%7551757CC9A7A05175517606072F7E7DCFCACFC9CFCAFF6FF827FD05FF52 -%F852FD27FFA8FD33FFF80059757C7575517C517C517C2E2F06CFCFFFCFCF -%9293CAFFCF6FF852FD05FF7DF87DFD04FFA8FD05FF7D7DA8FF527D7D7D52 -%7D52A8FFA8527D527DA8FF7D7D527D52FD05FFA8FD05FFA87D7DFFFFA852 -%7D527DA8FF527D7D7D527D52A8FD19FFF805075275755175517551752D0D -%0653CFFFCFFFA78C6899939344F827FD05FF52F852FFFFFFA8F87DFD04FF -%7D27FFA87D7DA8F827A87D7DFFA8F827A8527DFFA8F852A827F8A8FFFFFF -%7DF8FD05FF2752FFFFA8F827A8527DA87D7DA8F827A87D7DFD19FFF8F82F -%0752517C757B757C2E0D062FA8C999CFCFC28C928C8C8C6EF852FD05FF7D -%F87DFD04FFF8F87DFFFFFF7D52FD05FFF852FD05FFF87DFD05FFF852FFFF -%F852FFFFFF7DF8F8FD04FF7D52FFFFFFF87DFD07FFF852FD1CFFF8000607 -%062F2852282E060D0607067D928C9293688C6892688C44F827FD05FF52F8 -%52FFFFFFA85252F852FFFF7D27FD05FFF87DFD04FFA8F852FD05FFF852FF -%FFF8A8FFFFFF7D5227F8A8FFFF527DFFFFA8F852FD07FFF87DFD1CFFF800 -%852F2F062F070D062F072F062F0D9A8C928C928C928C928C6EF852FD05FF -%7DF87DFD04FF27FF52F852FF7D52FD05FFF852FD05FFF82752527DFFFFF8 -%52FF527DFD04FF527DFF27F8A8FF7D7DFFFFFFF82752527DFD04FFF852FD -%1CFFF827CFCF7D2F060D062F2F7EA82F062F938C68928C8C68926E994AF8 -%27FD05FF52F852FFFFFFA827FFFF52F852A852FD05FFF87DFD04FFA8F852 -%FF7DA8FFFFF82752F8A8FD04FF7D52FFA827F8A87D7DFFFFA8F852FF7DA8 -%FD04FFF87DFD1CFFF827FFCFFFA80D062FA8CFCFCA927693928C928C9292 -%75517C7B51F852FD05FF7DF87DFFFFFFA827FFFFFF52F8F87DFD05FFF852 -%FD05FFF87DFD05FFF852FF52F8A8FFFFFF5252FFFFFF27F8277DFFFFFFF8 -%7DFD07FFF852FD1CFFF827CFCFCACF06062ECFCAFF928C688C6892688C6E -%765175517C26F827FD05FF52F852FFFFFFA827FD04FF52F852FD05FFF852 -%FD04FFA8F852FFFFA8A8FFF87DFFFFF8F8A8FFFF5227FD04FF27F8A8FFFF -%A8F852FFFFA8A8FFFFFFF852FD1CFFF827FFCFFFCF7E53A8CFFFCFC99292 -%8C928C92757C757C517C7551F852FD04FFA852F852A8FFFFA8F8A8FD04FF -%527DFD04FF7DF827FD04FFA8F827525252FF7DF827FFFFFF2727A8FF5227 -%A8FD04FF52A8FFFFA8F827525252FFFFFF7DF827FD1CFFF827CFCFCACFCF -%CFCAFD04CF93688C688C6F7651755175517C4BF827FD05FFA8FFA8FFFFFF -%A8FFA8FD0BFFA8FFA8FFFFFFA8FFA8A8A8FFFFFFA8FFA8FFFFFFA8FFA8FF -%A8FD09FFA8FFA8A8A8FD05FFA8FFA8FD1BFFF827FFCFCFCFFFCFCFCFFFCF -%C38C928C8C6E7C7576517C75767551F852FD63FFF827CFCFCACFCACFCACF -%92928C8C688C6875517551755175517526F827FD63FFF827FFCFFFCFFFCF -%FFCA938C928C928C99517C757C517C757C7551F852FD63FFF827CFCFCACF -%CACFCACFA093688C6892757551755175517551754BF827FD63FFF827FFCF -%FFCFCFCFFFCFFF998C8C926E7C7576517C7576517CA7A1F852FD06FFA87D -%527DA8FD58FFF827CFCFCACFCACFCAFFCF996892686F5175517551755175 -%7CFF7CF827FD05FF7D2752A82727A8FD57FFF827FFCFFFCFFFCFFFC2BB8C -%928C8C6E7C757C517C757C51CFFFA1F852FD05FF2752FFFFFF52FD58FFF8 -%27CFCFCACFCACFCF99688C68928C6F5175517551755175CAFF7CF827FD04 -%FFA8F852FD5CFFF827FFCFCFCFFFCFFFA0998C928C926E7C517C7576517C -%51CACFA1F852FD04FFA827F87DFFFFFFA8527DFD04FF527DFFFFA87D52A8 -%FF7D527D527D527D7DFF7D7D527D527DFFFFFFA8FD06FFA8FD04FFA87D7D -%7DFD26FFF827CFCFCACFCACFCACFCF99688C6893517551755175517575FF -%7CF827FD05FF52F8F852FFFFFF52F8A8FFFF7D27A8FF5252A8A852A852A8 -%7DF827A87D7DFFA8F852A87D52FFFFFFF8A8FD04FF5227FFFFFF7D27A8A8 -%52A8FD25FFF827FFCFFFCFFFCFFFCFFFA08C8C92927C517C757C517C7575 -%7C7CF852FD06FF52F8F852FFFFFF27F8FFFF52A8FFFFF87DFD07FFF87DFD -%05FFF852FD06FFF827FD04FF2727FFFFFF2752FD29FFF827CFCFCACFCACF -%CACFA799688C68927575517551755175517526F84BFD07FF52F8F87DFFFF -%A8F87D7D52FFFFFFF8F87DFD05FFA8F852FD05FFF87DFD05FFA8F8F8A8FF -%FF7DF8F8A8FFFF52F852A8FD27FFF827FFCFFFCFCFCFFFCF9368928C928C -%995176517C7576517C7551F852FD08FF7DF8F8FFFFFF52F827FD05FFF8F8 -%27FD05FFF87DFD05FFF8277D527DFFFF7D52F852FFFF277DF8A8FFFFFF52 -%F8F87DFD26FFF827CFCFCACFCACFCAFF938C688C688C6875517551755175 -%517C26F827FD09FF27F8A8FFFFFFF852FD06FF52F827FFFFFFA8F852FD05 -%FFF852A8A87DFFFF527D7DF8FF7D52A8F87DFD04FF7DF8F8A8FD25FFF827 -%FFCFFFCFFFCFFFCFCFCFC98C928C92927C517C757C517C7551F852FD04FF -%7DFD04FF7DF8FD04FFF852FD07FF7DF8A8FFFFFFF87DFD05FFF852FD05FF -%52A8FF272752A8FFF87DFD06FFF8A8FD25FFF827CFCFCACFCACFCAFD04CF -%99688C688C6E7651755175517C4BF827FD04FF5227FFFFA8F852FD04FFF8 -%7DFFFFFF7D7DFFFF7D27FD04FFF852FD05FFF852FFFFA8FFFF27A8FF7DF8 -%52FFFFF852FFA852FFFF7D27A8FD25FFF827FFCFCFCFFFCFCFCFFFCFCF92 -%928C928C926E7C517C75767551F852FD04FF7D272752277DFD04FF7DF827 -%FFFFFF7D27525227FD04FFA8F852A8FFFFFF7D2727525252FFA8F8A8FFFF -%52FFFFFF2727A8FF275252527DFD26FFF827CFCFCACFCACFCACFCAFF998C -%688C688C688C68755176517526F827FD07FFA8FD07FFA8FFA8FFFFFFA8A8 -%A8FD05FFA8FFA8FD05FFA8FFA8A8A8FFA8FFA8FD07FFA8FFFFFFA8A8FD28 -%FFF827FFCFFFCFFFCFFFCFFFCFCF92C29A928C928C928C99757C7551F852 -%FD63FFF827CFCFCACFCACFCACFCAFD04CFFF998C68928C8C6892689344F8 -%27FD63FFF827FFCFFFCFCFCFFFCFCFCFFFCFCFCFC98C928C928C928C928C -%68F852FD63FFF827CFCFCACFCACFCAA8537ECACFCAFF938C6899688C688C -%689244F827FD63FFF827FFCFFFCFFFCFA8072F07FFCFFFCFCF992F0D5992 -%928C928C68F852FD08FF7D7D527D52A8A8FD54FFF827CFCFCACFCACFA70D -%060753A87DA8CA5A0607069368929AC244F827FD06FF7DF8527D7D7D52F8 -%27FD54FFF827FFCFCFCFFFCFCF2F2F070D062F072F062F07539993C2FFFF -%76F852FD05FF7DF87DFD06FF27FD54FFF827CFCFCACFCACF7D0D060D0607 -%060D0607060753FFCACFCAFF76F827FD04FFA8F827FD07FFA8A8FD15FFA8 -%FD3DFFF827FFCFFFCFFF592F062F072F2852282F072F072F7DFFCFFFCFA7 -%F852FD04FF52F87DFD0CFFA87D7D7DFD05FFA8FD05FF7D7DA8FFFFA87D7D -%7DFFFFFFA87D527D7DFD04FFA8527D527DA8FFFF7D527D527D527D7DFF7D -%7D7DFFFFA8527DA8FFFFA8527DFFFFFFA8FD06FFA8FFFFF827CF5959CA53 -%07060D066F688C6892684B060D06077DCFCFCF7CF827FD04FF27F8A8FD0A -%FFA82752A87D52F852FFFFA8F87DFD04FF7D27FFFF7D27A87D52FFFF5227 -%7DA87D27F8A8FFFFA8F827A827F8A8A852A87DF827A87D7DFFA8F852FFFF -%A8F827FD04FF2727FFFFFFF8A8FD04FF5227FFFFF827A9062F070D062F28 -%928C928C928C928C92282F072F847E5953F852FD04FFF8F8A8FD0AFF2752 -%FD04FF7DF87DFFFFF8F852FFFFFF7D52FFFFF8A8FFFFA8FF7DF8A8FD04FF -%27F8FFFFFFF87DFFFFF87DFD04FFF87DFD05FFF852FFFFFFF87DFD04FF27 -%52FFFFFFF827FD04FF2727FFFFF8272F07060D060D278C688C68928C8C68 -%8C688C060D0607060D06F827FFFFFFA827F87DFD09FF7DF8FD06FF27F8FF -%A85252F852FFFF7D27FFFF27F87DFFFFFF2727FD05FF7DF852FFA8F852FF -%A8F87DFFFFFFA8F852FD05FFF852FFFFA8F852FD04FF5252FFFFA8F8F8A8 -%FFFF7DF827A8FFF827FF2F2F070D06938C928CBCC9CFC9BB8C928C6F070D -%062F0706F852FD04FF27F852FD09FF52F8FD06FF52F8FFFF27FF52F852FF -%7D52FFFFA827F827A8FFF852FD06FFF852FFFFF852FF7D7DFD05FFF87DFD -%05FFF852FFFFFFF87DFD04FF2752FFFF7D52F852FFFF277DF8A8FFF827CF -%CF2F0D064C689268C2CFFFCFFFCFC2688C682E0607062F52F827FD04FF7D -%F8F8A8FD08FF52F8A8FD05FF52F8FFA827FFFF52F852A852FD04FF7DF827 -%FF2727FD05FFA8F852FFA8F82752F8A8FD04FFA8F852FD05FFF852FFFFA8 -%F852FD04FF5252FFFF7D7D7DF8FF7D52A8F87DFFF827FFCF59062F6F8C8C -%99CFFFCFFFCFFFCF938C8C4B2F0759CFA7F852FD05FF52F827FD06FF7DFF -%A8F852FD05FFF852FFA827FFFFFF52F8F87DFD05FF7DF8FF52F8A8FD04FF -%A8F8A8FFFFF87DFF52F8FD05FFF87DFD05FFF852FFFFFFF852FD04FF277D -%FFFF27A8FF272752FFFFF87DFFF827CFCF2F070693688C99FFCACFCACFCA -%FF998C686F060759CF7CF827FD05FFA852F8F87DFFFFFF5227FFFF52F87D -%FFFFFF5227A8FFA827FD04FF52F852FF527DFFFF5227FFFFF827A8FFFFFF -%2752FFFFFFF852FFFF27F8FFFFFFA8F852FD05FFF87DFFFFFF52F8A8FFFF -%7D27A8FFFF27A8FF7DF852FFFFF827FFF827FFCF53062F6E928CC2FFFFCF -%FFCFFFCFC28C926F2F077ECFA7F852FD07FFA8FD06277DFFFFFF7D27277D -%527DFFFFFF7DF8A8FD04FF527DFFA827525252A8FFFFFF5227527D52A8FF -%FFFFA8F852A8FFA82727A8FFA8F852A8FFFFFF7DF827FD04FF52277D5252 -%A8FFFFA8F8A8FFFF52FFFFFF2727A8F827CFCF2F07066F8C8C92FFCFCFCA -%CFCFCF8C8C8C4B060D59CF7CF827FD0BFFA8FD09FFA8FD05FFA8FFA8FD09 -%FFA8A8FD07FFA8A8FD05FFA8FFA8FD05FFA8FFA8FFA8FD05FFA8FFA8FD05 -%FFA8FD05FFA8FFA8FD07FFA8FFF827AF2F2F070D4B928C8CA0FFCFFFCFFF -%998C8C92280D067ECFA1F852FD63FFF8270707060D0607688C688C99C9CA -%C9938C688C680D0607065A76F827FD63FFF8275A062F070D07528C928C92 -%8C928C928C928C2F070D062F072EF852FD63FFF84B842F597E0607064C8C -%8C68928C8C688C6828060D0607060D52F827FD63FFF827FFCFCFCF7E060D -%062F6F928C928C934B2F070D0684A85A59A1F852FD63FFF827CFCFCACFCA -%590607060D06282728060D0607067ECACFCFCF7CF827FD63FFF827FFCFFF -%CFFFCF59062F070D072F070D062F2FA8CFFFCFFFCFA7F852FD63FFF827CF -%CFCACFCACF2F07060D0607060D06070653CFCFCACFCAFF7CF827FD63FFF8 -%27FFCFFFCFCFA82F070D59CFA8A8A859060D07FD04CFFFCFA1F852FD63FF -%F827CFCFCACFCFA82F0D2FCFCACFCFCFA80D060DA8CFCACFCAFF7CF827FD -%63FFF827FFCFFFCFFFCFFFA8FFCFFFCFFFCFFF7E7EA8FFCFFFCFFFFFA7F8 -%52FD63FFFD09F820FD07F820FD07F820F8F827FD63FF27F827F820F827F8 -%20F827F820F827F820F827F820F827F820F827F87CFDE2FFFF -%%EndData +%%DocumentNeededResources: +%%DocumentSuppliedResources: procset Adobe_AGM_Image 1.0 0 +%%+ procset Adobe_CoolType_Utility_T42 1.0 0 +%%+ procset Adobe_CoolType_Utility_MAKEOCF 1.23 0 +%%+ procset Adobe_CoolType_Core 2.31 0 +%%+ procset Adobe_AGM_Core 2.0 0 +%%+ procset Adobe_AGM_Utils 1.0 0 +%%DocumentFonts: +%%DocumentNeededFonts: +%%DocumentNeededFeatures: +%%DocumentSuppliedFeatures: +%%DocumentCustomColors: +%%CMYKCustomColor: +%%RGBCustomColor: %%EndComments + + + + + + + %%BeginDefaults %%ViewingOrientation: 1 0 0 1 %%EndDefaults %%BeginProlog %%BeginResource: procset Adobe_AGM_Utils 1.0 0 %%Version: 1.0 0 -%%Copyright: Copyright (C) 2000-2003 Adobe Systems, Inc. All Rights Reserved. -systemdict /setpacking known -{ - currentpacking - true setpacking -} if -userdict /Adobe_AGM_Utils 68 dict dup begin put +%%Copyright: Copyright(C)2000-2006 Adobe Systems, Inc. All Rights Reserved. +systemdict/setpacking known +{currentpacking true setpacking}if +userdict/Adobe_AGM_Utils 73 dict dup begin put /bdf -{ - bind def -} bind def -/nd{ - null def -}bdf +{bind def}bind def +/nd{null def}bdf /xdf -{ - exch def -}bdf -/ldf -{ - load def -}bdf +{exch def}bdf +/ldf +{load def}bdf /ddf -{ - put -}bdf +{put}bdf /xddf -{ - 3 -1 roll put -}bdf +{3 -1 roll put}bdf /xpt -{ - exch put -}bdf +{exch put}bdf /ndf { exch dup where{ @@ -266,54 +74,48 @@ userdict /Adobe_AGM_Utils 68 dict dup be exch def }ifelse }def -/bdict -{ - mark -}bdf -/edict -{ - counttomark 2 idiv dup dict begin {def} repeat pop currentdict end -}def +/gx +{get exec}bdf /ps_level /languagelevel where{ - pop systemdict /languagelevel get exec + pop systemdict/languagelevel gx }{ 1 }ifelse def -/level2 +/level2 ps_level 2 ge def -/level3 +/level3 ps_level 3 ge def /ps_version - {version cvr} stopped { - -1 - }if + {version cvr}stopped{-1}if def +/set_gvm +{currentglobal exch setglobal}bdf +/reset_gvm +{setglobal}bdf /makereadonlyarray { - /packedarray where{ - pop packedarray + /packedarray where{pop packedarray }{ - array astore readonly - }ifelse + array astore readonly}ifelse }bdf /map_reserved_ink_name { - dup type /stringtype eq{ - dup /Red eq{ - pop (_Red_) + dup type/stringtype eq{ + dup/Red eq{ + pop(_Red_) }{ - dup /Green eq{ - pop (_Green_) + dup/Green eq{ + pop(_Green_) }{ - dup /Blue eq{ - pop (_Blue_) + dup/Blue eq{ + pop(_Blue_) }{ - dup () cvn eq{ - pop (Process) + dup()cvn eq{ + pop(Process) }if }ifelse }ifelse @@ -329,20 +131,20 @@ def /AGMUTIL_GSTATE_clr_comps 12 array def mark currentcolor counttomark {AGMUTIL_GSTATE_clr_comps AGMUTIL_GSTATE_clr_indx 3 -1 roll put - /AGMUTIL_GSTATE_clr_indx AGMUTIL_GSTATE_clr_indx 1 add def} repeat pop + /AGMUTIL_GSTATE_clr_indx AGMUTIL_GSTATE_clr_indx 1 add def}repeat pop /AGMUTIL_GSTATE_fnt rootfont def *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Oct 30 21:01: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 EF9801065670; Sat, 30 Oct 2010 21:01:54 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C14D88FC25; Sat, 30 Oct 2010 21:01: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 o9UL1skf022369; Sat, 30 Oct 2010 21:01:54 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UL1sKA022368; Sat, 30 Oct 2010 21:01:54 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201010302101.o9UL1sKA022368@svn.freebsd.org> From: Doug Barton Date: Sat, 30 Oct 2010 21:01:54 +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: r214568 - vendor/bind9/9.6-ESV-R2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2010 21:01:55 -0000 Author: dougb Date: Sat Oct 30 21:01:54 2010 New Revision: 214568 URL: http://svn.freebsd.org/changeset/base/214568 Log: Tag the 9.6-ESV-R2 release Added: vendor/bind9/9.6-ESV-R2/ - copied from r214567, vendor/bind9/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Oct 30 23:01: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 6E34C1065693; Sat, 30 Oct 2010 23:01:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 429388FC1B; Sat, 30 Oct 2010 23:01: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 o9UN1CWh029147; Sat, 30 Oct 2010 23:01:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UN1Cim029145; Sat, 30 Oct 2010 23:01:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010302301.o9UN1Cim029145@svn.freebsd.org> From: Dimitry Andric Date: Sat, 30 Oct 2010 23:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214570 - svnadmin/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: Sat, 30 Oct 2010 23:01:12 -0000 Author: dim Date: Sat Oct 30 23:01:11 2010 New Revision: 214570 URL: http://svn.freebsd.org/changeset/base/214570 Log: Temporarily raise my limit, so I can import another binutils snapshot. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sat Oct 30 22:50:14 2010 (r214569) +++ svnadmin/conf/sizelimit.conf Sat Oct 30 23:01:11 2010 (r214570) @@ -32,3 +32,4 @@ gonzo kmacy jb jeff +dim From owner-svn-src-all@FreeBSD.ORG Sat Oct 30 23:02: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 54E9F106566B; Sat, 30 Oct 2010 23:02:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DFDA8FC20; Sat, 30 Oct 2010 23:02: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 o9UN2Zwt029334; Sat, 30 Oct 2010 23:02:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UN2Z1m029328; Sat, 30 Oct 2010 23:02:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010302302.o9UN2Z1m029328@svn.freebsd.org> From: Dimitry Andric Date: Sat, 30 Oct 2010 23:02: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: r214571 - in vendor/binutils/dist: . bfd bfd/doc bfd/po binutils binutils/doc binutils/po binutils/testsuite binutils/testsuite/binutils-all binutils/testsuite/binutils-all/arm binutils... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2010 23:02:35 -0000 Author: dim Date: Sat Oct 30 23:02:32 2010 New Revision: 214571 URL: http://svn.freebsd.org/changeset/base/214571 Log: Import the binutils master branch from the sourceware CVS repository, exactly as it was on Tue, 3 Jul 2007 07:54:19 +0000. Corresponds to git commit 397a64b350470350c8e0adb2af84439ea0f89272, which was the last commit before switching to GPLv3. Added: vendor/binutils/dist/bfd/ChangeLog-2006 vendor/binutils/dist/bfd/coff-x86_64.c vendor/binutils/dist/bfd/cpu-cr16.c vendor/binutils/dist/bfd/cpu-mep.c vendor/binutils/dist/bfd/cpu-score.c vendor/binutils/dist/bfd/cpu-spu.c vendor/binutils/dist/bfd/efi-app-x86_64.c vendor/binutils/dist/bfd/elf-attrs.c vendor/binutils/dist/bfd/elf32-avr.h vendor/binutils/dist/bfd/elf32-cr16.c vendor/binutils/dist/bfd/elf32-mep.c vendor/binutils/dist/bfd/elf32-score.c vendor/binutils/dist/bfd/elf32-sh-relocs.h vendor/binutils/dist/bfd/elf32-spu.c vendor/binutils/dist/bfd/elf32-spu.h vendor/binutils/dist/bfd/mep-relocs.pl (contents, props changed) vendor/binutils/dist/bfd/pe-arm-wince.c vendor/binutils/dist/bfd/pe-x86_64.c vendor/binutils/dist/bfd/pei-arm-wince.c vendor/binutils/dist/bfd/pei-x86_64.c vendor/binutils/dist/binutils/ChangeLog-2006 vendor/binutils/dist/binutils/bin2c.c vendor/binutils/dist/binutils/embedspu.sh vendor/binutils/dist/binutils/mclex.c vendor/binutils/dist/binutils/mcparse.y vendor/binutils/dist/binutils/sysdep.h vendor/binutils/dist/binutils/testsuite/binutils-all/arm/ vendor/binutils/dist/binutils/testsuite/binutils-all/arm/objdump.exp vendor/binutils/dist/binutils/testsuite/binutils-all/arm/thumb2-cond.s vendor/binutils/dist/binutils/testsuite/binutils-all/copy-1.d vendor/binutils/dist/binutils/testsuite/binutils-all/copy-1.s vendor/binutils/dist/binutils/testsuite/binutils-all/copy-2.d vendor/binutils/dist/binutils/testsuite/binutils-all/copy-3.d vendor/binutils/dist/binutils/testsuite/binutils-all/copytest.s vendor/binutils/dist/binutils/testsuite/binutils-all/empty.s vendor/binutils/dist/binutils/testsuite/binutils-all/localize-hidden-1.d vendor/binutils/dist/binutils/testsuite/binutils-all/localize-hidden-1.s vendor/binutils/dist/binutils/testsuite/binutils-all/localize-hidden-2.d vendor/binutils/dist/binutils/testsuite/binutils-all/localize-hidden-2.s vendor/binutils/dist/binutils/testsuite/binutils-all/needed-by-reloc.s vendor/binutils/dist/binutils/testsuite/binutils-all/strip-1.d vendor/binutils/dist/binutils/testsuite/binutils-all/strip-2.d vendor/binutils/dist/binutils/testsuite/binutils-all/strip-3.d vendor/binutils/dist/binutils/testsuite/binutils-all/windres/MSG00001.bin (contents, props changed) vendor/binutils/dist/binutils/testsuite/binutils-all/windres/html.rc vendor/binutils/dist/binutils/testsuite/binutils-all/windres/html.rsd vendor/binutils/dist/binutils/testsuite/binutils-all/windres/html1.hm vendor/binutils/dist/binutils/testsuite/binutils-all/windres/html2.hm vendor/binutils/dist/binutils/testsuite/binutils-all/windres/messagetable.rc vendor/binutils/dist/binutils/testsuite/binutils-all/windres/messagetable.rsd vendor/binutils/dist/binutils/testsuite/binutils-all/windres/strtab2.rc vendor/binutils/dist/binutils/testsuite/binutils-all/windres/strtab2.rsd vendor/binutils/dist/binutils/testsuite/binutils-all/windres/version.rc vendor/binutils/dist/binutils/testsuite/binutils-all/windres/version.rsd vendor/binutils/dist/binutils/testsuite/binutils-all/windres/version_cat.rc vendor/binutils/dist/binutils/testsuite/binutils-all/windres/version_cat.rsd vendor/binutils/dist/binutils/windint.h vendor/binutils/dist/binutils/windmc.c vendor/binutils/dist/binutils/windmc.h vendor/binutils/dist/compile (contents, props changed) vendor/binutils/dist/config.rpath (contents, props changed) vendor/binutils/dist/config/confsubdir.m4 vendor/binutils/dist/config/ld-symbolic.m4 vendor/binutils/dist/config/mt-mep vendor/binutils/dist/config/mt-spu vendor/binutils/dist/config/multi.m4 vendor/binutils/dist/config/unwind_ipinfo.m4 vendor/binutils/dist/configure.ac vendor/binutils/dist/djunpack.bat (contents, props changed) vendor/binutils/dist/elfcpp/ vendor/binutils/dist/elfcpp/README vendor/binutils/dist/elfcpp/elfcpp.h vendor/binutils/dist/elfcpp/elfcpp_config.h vendor/binutils/dist/elfcpp/elfcpp_file.h vendor/binutils/dist/elfcpp/elfcpp_internal.h vendor/binutils/dist/elfcpp/elfcpp_swap.h vendor/binutils/dist/elfcpp/i386.h vendor/binutils/dist/gas/ChangeLog-2006 vendor/binutils/dist/gas/config/tc-cr16.c vendor/binutils/dist/gas/config/tc-cr16.h vendor/binutils/dist/gas/config/tc-mep.c vendor/binutils/dist/gas/config/tc-mep.h vendor/binutils/dist/gas/config/tc-score.c vendor/binutils/dist/gas/config/tc-score.h vendor/binutils/dist/gas/config/tc-spu.c vendor/binutils/dist/gas/config/tc-spu.h vendor/binutils/dist/gas/config/te-pep.h vendor/binutils/dist/gas/doc/c-avr.texi vendor/binutils/dist/gas/doc/c-cr16.texi vendor/binutils/dist/gas/testsuite/ChangeLog-2006 vendor/binutils/dist/gas/testsuite/gas/all/relax.d vendor/binutils/dist/gas/testsuite/gas/all/relax.s vendor/binutils/dist/gas/testsuite/gas/arm/arm-it.d vendor/binutils/dist/gas/testsuite/gas/arm/arm-it.s vendor/binutils/dist/gas/testsuite/gas/arm/armv1.l vendor/binutils/dist/gas/testsuite/gas/arm/backslash-at.d vendor/binutils/dist/gas/testsuite/gas/arm/backslash-at.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-alu-encoding-bad.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-alu-encoding-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-alu-encoding-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-alu-parsing-bad.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-alu-parsing-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-alu-parsing-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-alu.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-alu.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldc-encoding-bad.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldc-encoding-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldc-encoding-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldc-parsing-bad.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldc-parsing-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldc-parsing-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldc.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldc.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldr-encoding-bad.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldr-encoding-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldr-encoding-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldr-parsing-bad.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldr-parsing-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldr-parsing-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldr.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldr.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldrs-encoding-bad.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldrs-encoding-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldrs-encoding-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldrs-parsing-bad.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldrs-parsing-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldrs-parsing-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldrs.d vendor/binutils/dist/gas/testsuite/gas/arm/group-reloc-ldrs.s vendor/binutils/dist/gas/testsuite/gas/arm/itblock.s vendor/binutils/dist/gas/testsuite/gas/arm/iwmmxt-wldsttbh.d vendor/binutils/dist/gas/testsuite/gas/arm/iwmmxt-wldsttbh.s vendor/binutils/dist/gas/testsuite/gas/arm/iwmmxt2.d vendor/binutils/dist/gas/testsuite/gas/arm/iwmmxt2.s vendor/binutils/dist/gas/testsuite/gas/arm/local_function.d vendor/binutils/dist/gas/testsuite/gas/arm/local_function.s vendor/binutils/dist/gas/testsuite/gas/arm/local_label_coff.d vendor/binutils/dist/gas/testsuite/gas/arm/local_label_coff.s vendor/binutils/dist/gas/testsuite/gas/arm/local_label_elf.d vendor/binutils/dist/gas/testsuite/gas/arm/local_label_elf.s vendor/binutils/dist/gas/testsuite/gas/arm/local_label_wince.d vendor/binutils/dist/gas/testsuite/gas/arm/local_label_wince.s vendor/binutils/dist/gas/testsuite/gas/arm/mapshort-eabi.d vendor/binutils/dist/gas/testsuite/gas/arm/mapshort-elf.d vendor/binutils/dist/gas/testsuite/gas/arm/mapshort.s vendor/binutils/dist/gas/testsuite/gas/arm/mul-overlap-v6.d vendor/binutils/dist/gas/testsuite/gas/arm/mul-overlap-v6.s vendor/binutils/dist/gas/testsuite/gas/arm/mul-overlap.d vendor/binutils/dist/gas/testsuite/gas/arm/mul-overlap.l vendor/binutils/dist/gas/testsuite/gas/arm/mul-overlap.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-cond-bad-inc.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-cond-bad.d vendor/binutils/dist/gas/testsuite/gas/arm/neon-cond-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/neon-cond-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-cond-bad_t2.d vendor/binutils/dist/gas/testsuite/gas/arm/neon-cond-bad_t2.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-cond.d vendor/binutils/dist/gas/testsuite/gas/arm/neon-cond.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-const.d vendor/binutils/dist/gas/testsuite/gas/arm/neon-const.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-cov.d vendor/binutils/dist/gas/testsuite/gas/arm/neon-cov.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-ldst-es.d vendor/binutils/dist/gas/testsuite/gas/arm/neon-ldst-es.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-ldst-rm.d vendor/binutils/dist/gas/testsuite/gas/arm/neon-ldst-rm.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-omit.d vendor/binutils/dist/gas/testsuite/gas/arm/neon-omit.s vendor/binutils/dist/gas/testsuite/gas/arm/neon-psyn.d vendor/binutils/dist/gas/testsuite/gas/arm/neon-psyn.s vendor/binutils/dist/gas/testsuite/gas/arm/noarm.d vendor/binutils/dist/gas/testsuite/gas/arm/noarm.l vendor/binutils/dist/gas/testsuite/gas/arm/noarm.s vendor/binutils/dist/gas/testsuite/gas/arm/relax_branch_align.d vendor/binutils/dist/gas/testsuite/gas/arm/relax_branch_align.s vendor/binutils/dist/gas/testsuite/gas/arm/srs-arm.d vendor/binutils/dist/gas/testsuite/gas/arm/srs-arm.l vendor/binutils/dist/gas/testsuite/gas/arm/srs-arm.s vendor/binutils/dist/gas/testsuite/gas/arm/srs-t2.d vendor/binutils/dist/gas/testsuite/gas/arm/srs-t2.l vendor/binutils/dist/gas/testsuite/gas/arm/srs-t2.s vendor/binutils/dist/gas/testsuite/gas/arm/thumb1_unified.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb1_unified.s vendor/binutils/dist/gas/testsuite/gas/arm/thumb2_add.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb2_add.s vendor/binutils/dist/gas/testsuite/gas/arm/thumb2_ldmstm.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb2_ldmstm.s vendor/binutils/dist/gas/testsuite/gas/arm/thumb32.l vendor/binutils/dist/gas/testsuite/gas/arm/thumbrel.d vendor/binutils/dist/gas/testsuite/gas/arm/thumbrel.s vendor/binutils/dist/gas/testsuite/gas/arm/thumbver.d vendor/binutils/dist/gas/testsuite/gas/arm/thumbver.s vendor/binutils/dist/gas/testsuite/gas/arm/vfp-neon-overlap.d vendor/binutils/dist/gas/testsuite/gas/arm/vfp-neon-overlap.s vendor/binutils/dist/gas/testsuite/gas/arm/vfp-neon-syntax-inc.s vendor/binutils/dist/gas/testsuite/gas/arm/vfp-neon-syntax.d vendor/binutils/dist/gas/testsuite/gas/arm/vfp-neon-syntax.s vendor/binutils/dist/gas/testsuite/gas/arm/vfp-neon-syntax_t2.d vendor/binutils/dist/gas/testsuite/gas/arm/vfp-neon-syntax_t2.s vendor/binutils/dist/gas/testsuite/gas/arm/vfpv3-32drs.d vendor/binutils/dist/gas/testsuite/gas/arm/vfpv3-32drs.s vendor/binutils/dist/gas/testsuite/gas/arm/vfpv3-const-conv.d vendor/binutils/dist/gas/testsuite/gas/arm/vfpv3-const-conv.s vendor/binutils/dist/gas/testsuite/gas/arm/wince.d vendor/binutils/dist/gas/testsuite/gas/arm/wince.s vendor/binutils/dist/gas/testsuite/gas/cfi/cfi-common-5.d vendor/binutils/dist/gas/testsuite/gas/cfi/cfi-common-5.s vendor/binutils/dist/gas/testsuite/gas/cfi/cfi-common-6.d vendor/binutils/dist/gas/testsuite/gas/cfi/cfi-common-6.s vendor/binutils/dist/gas/testsuite/gas/cfi/cfi-hppa-1.d vendor/binutils/dist/gas/testsuite/gas/cfi/cfi-hppa-1.s vendor/binutils/dist/gas/testsuite/gas/cr16/ vendor/binutils/dist/gas/testsuite/gas/cr16/add_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/add_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/and_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/and_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/ash_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/ash_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/bal_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/bal_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/bcc_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/bcc_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/beq0_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/beq0_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/cbitb_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/cbitb_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/cbitw_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/cbitw_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/cinv_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/cinv_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/cmp_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/cmp_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/cr16.exp vendor/binutils/dist/gas/testsuite/gas/cr16/excp_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/excp_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/jal_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/jal_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/jcc_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/jcc_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/loadb_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/loadb_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/loadd_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/loadd_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/loadm_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/loadm_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/loadw_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/loadw_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/lpsp_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/lpsp_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/lsh_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/lsh_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/mov_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/mov_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/mul_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/mul_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/or_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/or_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/pop_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/pop_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/popret_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/popret_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/push_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/push_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/sbitb_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/sbitb_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/sbitw_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/sbitw_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/scc_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/scc_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/storb_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/storb_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/stord_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/stord_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/storm_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/storm_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/storw_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/storw_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/sub_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/sub_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/tbit_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/tbit_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/tbitb_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/tbitb_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/tbitw_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/tbitw_test.s vendor/binutils/dist/gas/testsuite/gas/cr16/xor_test.d vendor/binutils/dist/gas/testsuite/gas/cr16/xor_test.s vendor/binutils/dist/gas/testsuite/gas/elf/equ-reloc.d vendor/binutils/dist/gas/testsuite/gas/elf/equ-reloc.s vendor/binutils/dist/gas/testsuite/gas/elf/section2.e-armelf vendor/binutils/dist/gas/testsuite/gas/elf/section2.e-score vendor/binutils/dist/gas/testsuite/gas/elf/section2.e-xtensa vendor/binutils/dist/gas/testsuite/gas/i386/addr16.d vendor/binutils/dist/gas/testsuite/gas/i386/addr16.s vendor/binutils/dist/gas/testsuite/gas/i386/addr32.d vendor/binutils/dist/gas/testsuite/gas/i386/addr32.s vendor/binutils/dist/gas/testsuite/gas/i386/amdfam10.d vendor/binutils/dist/gas/testsuite/gas/i386/amdfam10.s vendor/binutils/dist/gas/testsuite/gas/i386/crc32-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/crc32.d vendor/binutils/dist/gas/testsuite/gas/i386/crc32.s vendor/binutils/dist/gas/testsuite/gas/i386/fp.d vendor/binutils/dist/gas/testsuite/gas/i386/fp.s vendor/binutils/dist/gas/testsuite/gas/i386/inval-crc32.l vendor/binutils/dist/gas/testsuite/gas/i386/inval-crc32.s vendor/binutils/dist/gas/testsuite/gas/i386/nops-1-i386.d vendor/binutils/dist/gas/testsuite/gas/i386/nops-1-i686.d vendor/binutils/dist/gas/testsuite/gas/i386/nops-1-merom.d vendor/binutils/dist/gas/testsuite/gas/i386/nops-1.d vendor/binutils/dist/gas/testsuite/gas/i386/nops-1.s vendor/binutils/dist/gas/testsuite/gas/i386/nops-2-i386.d vendor/binutils/dist/gas/testsuite/gas/i386/nops-2-merom.d vendor/binutils/dist/gas/testsuite/gas/i386/nops-2.d vendor/binutils/dist/gas/testsuite/gas/i386/nops-2.s vendor/binutils/dist/gas/testsuite/gas/i386/nops-3.d vendor/binutils/dist/gas/testsuite/gas/i386/nops-3.s vendor/binutils/dist/gas/testsuite/gas/i386/nops.d vendor/binutils/dist/gas/testsuite/gas/i386/nops.s vendor/binutils/dist/gas/testsuite/gas/i386/opcode-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/opcode-suffix.d vendor/binutils/dist/gas/testsuite/gas/i386/simd-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/simd.d vendor/binutils/dist/gas/testsuite/gas/i386/simd.s vendor/binutils/dist/gas/testsuite/gas/i386/sse4_1.d vendor/binutils/dist/gas/testsuite/gas/i386/sse4_1.s vendor/binutils/dist/gas/testsuite/gas/i386/sse4_2.d vendor/binutils/dist/gas/testsuite/gas/i386/sse4_2.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-addr32-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-amdfam10.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-amdfam10.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-cbw-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-cbw.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-cbw.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-crc32-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-crc32.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-crc32.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-gidt.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-gidt.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-inval-crc32.l vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-inval-crc32.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-io-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-io-suffix.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-io.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-io.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-nops-1-k8.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-nops-1-merom.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-nops-1-nocona.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-nops-1.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-nops-1.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-nops.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-nops.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-rip-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-simd-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-simd.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-simd.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-sse4_1.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-sse4_1.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-sse4_2.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-sse4_2.s vendor/binutils/dist/gas/testsuite/gas/lns/lns-common-1-alt.d vendor/binutils/dist/gas/testsuite/gas/m68k/br-isaa.d vendor/binutils/dist/gas/testsuite/gas/m68k/br-isaa.s vendor/binutils/dist/gas/testsuite/gas/m68k/br-isab.d vendor/binutils/dist/gas/testsuite/gas/m68k/br-isab.s vendor/binutils/dist/gas/testsuite/gas/m68k/br-isac.d vendor/binutils/dist/gas/testsuite/gas/m68k/br-isac.s vendor/binutils/dist/gas/testsuite/gas/m68k/cpu32.d vendor/binutils/dist/gas/testsuite/gas/m68k/cpu32.s vendor/binutils/dist/gas/testsuite/gas/m68k/ctrl-1.d vendor/binutils/dist/gas/testsuite/gas/m68k/ctrl-1.s vendor/binutils/dist/gas/testsuite/gas/m68k/ctrl-2.d vendor/binutils/dist/gas/testsuite/gas/m68k/ctrl-2.s vendor/binutils/dist/gas/testsuite/gas/m68k/fido.d vendor/binutils/dist/gas/testsuite/gas/m68k/fido.s vendor/binutils/dist/gas/testsuite/gas/m68k/mcf-coproc.d vendor/binutils/dist/gas/testsuite/gas/m68k/mcf-coproc.s vendor/binutils/dist/gas/testsuite/gas/m68k/mcf-trap.d vendor/binutils/dist/gas/testsuite/gas/m68k/mcf-trap.s vendor/binutils/dist/gas/testsuite/gas/m68k/mcf-wdebug.d vendor/binutils/dist/gas/testsuite/gas/m68k/mcf-wdebug.s vendor/binutils/dist/gas/testsuite/gas/m68k/p3041.d vendor/binutils/dist/gas/testsuite/gas/m68k/p3041.s vendor/binutils/dist/gas/testsuite/gas/mep/ vendor/binutils/dist/gas/testsuite/gas/mep/allinsn.d vendor/binutils/dist/gas/testsuite/gas/mep/allinsn.exp vendor/binutils/dist/gas/testsuite/gas/mep/allinsn.le.d vendor/binutils/dist/gas/testsuite/gas/mep/allinsn.s vendor/binutils/dist/gas/testsuite/gas/mep/branch1.d vendor/binutils/dist/gas/testsuite/gas/mep/branch1.s vendor/binutils/dist/gas/testsuite/gas/mep/complex-relocs.exp vendor/binutils/dist/gas/testsuite/gas/mep/dj1.d vendor/binutils/dist/gas/testsuite/gas/mep/dj1.le.d vendor/binutils/dist/gas/testsuite/gas/mep/dj1.s vendor/binutils/dist/gas/testsuite/gas/mep/dj2.d vendor/binutils/dist/gas/testsuite/gas/mep/dj2.le.d vendor/binutils/dist/gas/testsuite/gas/mep/dj2.s vendor/binutils/dist/gas/testsuite/gas/mep/relocs-bad3.s vendor/binutils/dist/gas/testsuite/gas/mep/relocs-junk1.s vendor/binutils/dist/gas/testsuite/gas/mep/relocs-junk2.s vendor/binutils/dist/gas/testsuite/gas/mep/relocs-refs.s vendor/binutils/dist/gas/testsuite/gas/mep/relocs-syms.s vendor/binutils/dist/gas/testsuite/gas/mep/relocs.d vendor/binutils/dist/gas/testsuite/gas/mips/elf-rel26.d vendor/binutils/dist/gas/testsuite/gas/mips/elf-rel26.s vendor/binutils/dist/gas/testsuite/gas/mips/elf-rel6-n32.d vendor/binutils/dist/gas/testsuite/gas/mips/elf-rel6-n64.d vendor/binutils/dist/gas/testsuite/gas/mips/mips-gp32-fp64.l vendor/binutils/dist/gas/testsuite/gas/mips/mips-gp64-fp32-pic.l vendor/binutils/dist/gas/testsuite/gas/mips/mips16-intermix.d vendor/binutils/dist/gas/testsuite/gas/mips/mips16-intermix.s vendor/binutils/dist/gas/testsuite/gas/mips/mips16e-64.d vendor/binutils/dist/gas/testsuite/gas/mips/mips16e-64.l vendor/binutils/dist/gas/testsuite/gas/mips/mips16e-64.s vendor/binutils/dist/gas/testsuite/gas/mips/mips16e.d vendor/binutils/dist/gas/testsuite/gas/mips/mips16e.s vendor/binutils/dist/gas/testsuite/gas/mips/mips32-dspr2.d vendor/binutils/dist/gas/testsuite/gas/mips/mips32-dspr2.s vendor/binutils/dist/gas/testsuite/gas/mips/mips32-sf32.d vendor/binutils/dist/gas/testsuite/gas/mips/mips32-sf32.s vendor/binutils/dist/gas/testsuite/gas/mips/mips64-dsp.d vendor/binutils/dist/gas/testsuite/gas/mips/mips64-dsp.s vendor/binutils/dist/gas/testsuite/gas/mips/noreorder.d vendor/binutils/dist/gas/testsuite/gas/mips/noreorder.s vendor/binutils/dist/gas/testsuite/gas/mips/smartmips.d vendor/binutils/dist/gas/testsuite/gas/mips/smartmips.s vendor/binutils/dist/gas/testsuite/gas/ppc/cell.d vendor/binutils/dist/gas/testsuite/gas/ppc/cell.s vendor/binutils/dist/gas/testsuite/gas/ppc/range.l vendor/binutils/dist/gas/testsuite/gas/ppc/range.s vendor/binutils/dist/gas/testsuite/gas/ppc/range64.l vendor/binutils/dist/gas/testsuite/gas/ppc/range64.s vendor/binutils/dist/gas/testsuite/gas/ppc/reloc.d vendor/binutils/dist/gas/testsuite/gas/ppc/reloc.s vendor/binutils/dist/gas/testsuite/gas/s390/zarch-z9-ec.d vendor/binutils/dist/gas/testsuite/gas/s390/zarch-z9-ec.s vendor/binutils/dist/gas/testsuite/gas/score/ vendor/binutils/dist/gas/testsuite/gas/score/addi.d vendor/binutils/dist/gas/testsuite/gas/score/addi.s vendor/binutils/dist/gas/testsuite/gas/score/b.d vendor/binutils/dist/gas/testsuite/gas/score/b.s vendor/binutils/dist/gas/testsuite/gas/score/bittst.d vendor/binutils/dist/gas/testsuite/gas/score/bittst.s vendor/binutils/dist/gas/testsuite/gas/score/br.d vendor/binutils/dist/gas/testsuite/gas/score/br.s vendor/binutils/dist/gas/testsuite/gas/score/ldi.d vendor/binutils/dist/gas/testsuite/gas/score/ldi.s vendor/binutils/dist/gas/testsuite/gas/score/ls32ls16.d vendor/binutils/dist/gas/testsuite/gas/score/ls32ls16.s vendor/binutils/dist/gas/testsuite/gas/score/ls32ls16p.d vendor/binutils/dist/gas/testsuite/gas/score/ls32ls16p.s vendor/binutils/dist/gas/testsuite/gas/score/move.d vendor/binutils/dist/gas/testsuite/gas/score/move.s vendor/binutils/dist/gas/testsuite/gas/score/nop.d vendor/binutils/dist/gas/testsuite/gas/score/nop.s vendor/binutils/dist/gas/testsuite/gas/score/postlw.d vendor/binutils/dist/gas/testsuite/gas/score/postlw.s vendor/binutils/dist/gas/testsuite/gas/score/presw.d vendor/binutils/dist/gas/testsuite/gas/score/presw.s vendor/binutils/dist/gas/testsuite/gas/score/rD_rA.d vendor/binutils/dist/gas/testsuite/gas/score/rD_rA.s vendor/binutils/dist/gas/testsuite/gas/score/rD_rA_BN.d vendor/binutils/dist/gas/testsuite/gas/score/rD_rA_BN.s vendor/binutils/dist/gas/testsuite/gas/score/rD_rA_rB.d vendor/binutils/dist/gas/testsuite/gas/score/rD_rA_rB.s vendor/binutils/dist/gas/testsuite/gas/score/relax.exp vendor/binutils/dist/gas/testsuite/gas/score/tcond.d vendor/binutils/dist/gas/testsuite/gas/score/tcond.s vendor/binutils/dist/gas/testsuite/gas/sh/too_large.d vendor/binutils/dist/gas/testsuite/gas/sh/too_large.s vendor/binutils/dist/gas/testsuite/gas/sparc/pr4587.l vendor/binutils/dist/gas/testsuite/gas/sparc/pr4587.s vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch1.d vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch1.s vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch2.d vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch2.s vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch3.d vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch3.s vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch4.d vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch4.s vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch5.d vendor/binutils/dist/gas/testsuite/gas/sparc/v9branch5.s vendor/binutils/dist/gas/testsuite/gas/z8k/reglabel.d vendor/binutils/dist/gas/testsuite/gas/z8k/reglabel.s vendor/binutils/dist/gold/ vendor/binutils/dist/gold/Makefile.am vendor/binutils/dist/gold/Makefile.in vendor/binutils/dist/gold/README vendor/binutils/dist/gold/aclocal.m4 vendor/binutils/dist/gold/archive.cc vendor/binutils/dist/gold/archive.h vendor/binutils/dist/gold/common.cc vendor/binutils/dist/gold/common.h vendor/binutils/dist/gold/config.in vendor/binutils/dist/gold/configure (contents, props changed) vendor/binutils/dist/gold/configure.ac vendor/binutils/dist/gold/defstd.cc vendor/binutils/dist/gold/defstd.h vendor/binutils/dist/gold/dirsearch.cc vendor/binutils/dist/gold/dirsearch.h vendor/binutils/dist/gold/dynobj.cc vendor/binutils/dist/gold/dynobj.h vendor/binutils/dist/gold/fileread.cc vendor/binutils/dist/gold/fileread.h vendor/binutils/dist/gold/gold-threads.cc vendor/binutils/dist/gold/gold-threads.h vendor/binutils/dist/gold/gold.cc vendor/binutils/dist/gold/gold.h vendor/binutils/dist/gold/i386.cc vendor/binutils/dist/gold/layout.cc vendor/binutils/dist/gold/layout.h vendor/binutils/dist/gold/main.cc vendor/binutils/dist/gold/merge.cc vendor/binutils/dist/gold/merge.h vendor/binutils/dist/gold/object.cc vendor/binutils/dist/gold/object.h vendor/binutils/dist/gold/options.cc vendor/binutils/dist/gold/options.h vendor/binutils/dist/gold/output.cc vendor/binutils/dist/gold/output.h vendor/binutils/dist/gold/po/ vendor/binutils/dist/gold/po/Make-in vendor/binutils/dist/gold/po/POTFILES.in vendor/binutils/dist/gold/po/gold.pot vendor/binutils/dist/gold/readsyms.cc vendor/binutils/dist/gold/readsyms.h vendor/binutils/dist/gold/reloc-types.h vendor/binutils/dist/gold/reloc.cc vendor/binutils/dist/gold/reloc.h vendor/binutils/dist/gold/resolve.cc vendor/binutils/dist/gold/script-c.h vendor/binutils/dist/gold/script.cc vendor/binutils/dist/gold/script.h vendor/binutils/dist/gold/stringpool.cc vendor/binutils/dist/gold/stringpool.h vendor/binutils/dist/gold/strtab.h vendor/binutils/dist/gold/symtab.cc vendor/binutils/dist/gold/symtab.h vendor/binutils/dist/gold/target-reloc.h vendor/binutils/dist/gold/target-select.cc vendor/binutils/dist/gold/target-select.h vendor/binutils/dist/gold/target.h vendor/binutils/dist/gold/testsuite/ vendor/binutils/dist/gold/testsuite/Makefile.am vendor/binutils/dist/gold/testsuite/Makefile.in vendor/binutils/dist/gold/testsuite/object_unittest.cc vendor/binutils/dist/gold/testsuite/test.cc vendor/binutils/dist/gold/testsuite/test.h vendor/binutils/dist/gold/testsuite/testfile.cc vendor/binutils/dist/gold/testsuite/testfile.h vendor/binutils/dist/gold/testsuite/testmain.cc vendor/binutils/dist/gold/workqueue.cc vendor/binutils/dist/gold/workqueue.h vendor/binutils/dist/gold/yyscript.y vendor/binutils/dist/gprof/po/ms.po vendor/binutils/dist/include/coff/x86_64.h vendor/binutils/dist/include/elf/cr16.h vendor/binutils/dist/include/elf/mep.h vendor/binutils/dist/include/elf/score.h vendor/binutils/dist/include/elf/spu.h vendor/binutils/dist/include/opcode/cr16.h vendor/binutils/dist/include/opcode/score-datadep.h vendor/binutils/dist/include/opcode/score-inst.h vendor/binutils/dist/include/opcode/spu-insns.h vendor/binutils/dist/include/opcode/spu.h vendor/binutils/dist/intl/README vendor/binutils/dist/intl/VERSION vendor/binutils/dist/intl/config.h.in vendor/binutils/dist/intl/config.intl.in vendor/binutils/dist/intl/configure.ac vendor/binutils/dist/intl/dcigettext.c vendor/binutils/dist/intl/dcngettext.c vendor/binutils/dist/intl/dngettext.c vendor/binutils/dist/intl/eval-plural.h vendor/binutils/dist/intl/gmo.h vendor/binutils/dist/intl/libgnuintl.h vendor/binutils/dist/intl/localcharset.c vendor/binutils/dist/intl/localcharset.h vendor/binutils/dist/intl/locale.alias vendor/binutils/dist/intl/localename.c vendor/binutils/dist/intl/log.c vendor/binutils/dist/intl/ngettext.c vendor/binutils/dist/intl/osdep.c vendor/binutils/dist/intl/plural-exp.c vendor/binutils/dist/intl/plural-exp.h vendor/binutils/dist/intl/plural.c vendor/binutils/dist/intl/plural.y vendor/binutils/dist/intl/relocatable.c vendor/binutils/dist/intl/relocatable.h vendor/binutils/dist/ld/ChangeLog-2006 vendor/binutils/dist/ld/emulparams/arm_wince_pe.sh vendor/binutils/dist/ld/emulparams/avr6.sh vendor/binutils/dist/ld/emulparams/elf32_spu.sh vendor/binutils/dist/ld/emulparams/elf32cr16.sh vendor/binutils/dist/ld/emulparams/elf32mep.sh (contents, props changed) vendor/binutils/dist/ld/emulparams/elf64bmip-defs.sh vendor/binutils/dist/ld/emulparams/i386pep.sh vendor/binutils/dist/ld/emulparams/scoreelf.sh vendor/binutils/dist/ld/emulparams/shelf_uclinux.sh vendor/binutils/dist/ld/emulparams/shelf_vxworks.sh vendor/binutils/dist/ld/emulparams/shlelf_vxworks.sh vendor/binutils/dist/ld/emultempl/avrelf.em vendor/binutils/dist/ld/emultempl/cr16elf.em vendor/binutils/dist/ld/emultempl/elf-generic.em vendor/binutils/dist/ld/emultempl/genelf.em vendor/binutils/dist/ld/emultempl/mipself.em vendor/binutils/dist/ld/emultempl/pep.em vendor/binutils/dist/ld/emultempl/scoreelf.em vendor/binutils/dist/ld/emultempl/spu_ovl.S vendor/binutils/dist/ld/emultempl/spu_ovl.o (contents, props changed) vendor/binutils/dist/ld/emultempl/spuelf.em vendor/binutils/dist/ld/pep-dll.c vendor/binutils/dist/ld/pep-dll.h vendor/binutils/dist/ld/po/ga.po vendor/binutils/dist/ld/po/zh_TW.po vendor/binutils/dist/ld/scripttempl/elf32cr16.sc vendor/binutils/dist/ld/scripttempl/mep.sc vendor/binutils/dist/ld/scripttempl/pep.sc vendor/binutils/dist/ld/testsuite/ChangeLog-2006 vendor/binutils/dist/ld/testsuite/ld-arm/arm-be8.d vendor/binutils/dist/ld/testsuite/ld-arm/arm-be8.s vendor/binutils/dist/ld/testsuite/ld-arm/arm-movwt.d vendor/binutils/dist/ld/testsuite/ld-arm/arm-movwt.s vendor/binutils/dist/ld/testsuite/ld-arm/arm-pic-veneer.d vendor/binutils/dist/ld/testsuite/ld-arm/arm-pic-veneer.s vendor/binutils/dist/ld/testsuite/ld-arm/armthumb-lib.d vendor/binutils/dist/ld/testsuite/ld-arm/armthumb-lib.sym vendor/binutils/dist/ld/testsuite/ld-arm/attr-merge.attr vendor/binutils/dist/ld/testsuite/ld-arm/attr-merge.s vendor/binutils/dist/ld/testsuite/ld-arm/emit-relocs1-vxworks.d vendor/binutils/dist/ld/testsuite/ld-arm/emit-relocs1.d vendor/binutils/dist/ld/testsuite/ld-arm/emit-relocs1.s vendor/binutils/dist/ld/testsuite/ld-arm/gc-unwind.d vendor/binutils/dist/ld/testsuite/ld-arm/gc-unwind.s vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs-alu-bad.d vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs-alu-bad.s vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs-ldc-bad.d vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs-ldc-bad.s vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs-ldr-bad.d vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs-ldr-bad.s vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs-ldrs-bad.d vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs-ldrs-bad.s vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs.d vendor/binutils/dist/ld/testsuite/ld-arm/group-relocs.s vendor/binutils/dist/ld/testsuite/ld-arm/jump19.d vendor/binutils/dist/ld/testsuite/ld-arm/jump19.s vendor/binutils/dist/ld/testsuite/ld-arm/preempt-app.s vendor/binutils/dist/ld/testsuite/ld-arm/preempt-app.sym vendor/binutils/dist/ld/testsuite/ld-arm/thumb1-bl.d vendor/binutils/dist/ld/testsuite/ld-arm/thumb1-bl.s vendor/binutils/dist/ld/testsuite/ld-arm/thumb2-bl-as-thumb1-bad.d vendor/binutils/dist/ld/testsuite/ld-arm/thumb2-bl-as-thumb1-bad.s vendor/binutils/dist/ld/testsuite/ld-arm/thumb2-bl-bad.d vendor/binutils/dist/ld/testsuite/ld-arm/thumb2-bl-bad.s vendor/binutils/dist/ld/testsuite/ld-arm/thumb2-bl.d vendor/binutils/dist/ld/testsuite/ld-arm/thumb2-bl.s vendor/binutils/dist/ld/testsuite/ld-arm/use-thumb-lib.s vendor/binutils/dist/ld/testsuite/ld-arm/use-thumb-lib.sym vendor/binutils/dist/ld/testsuite/ld-arm/vfp11-fix-none.d vendor/binutils/dist/ld/testsuite/ld-arm/vfp11-fix-none.s vendor/binutils/dist/ld/testsuite/ld-arm/vfp11-fix-scalar.d vendor/binutils/dist/ld/testsuite/ld-arm/vfp11-fix-scalar.s vendor/binutils/dist/ld/testsuite/ld-arm/vfp11-fix-vector.d vendor/binutils/dist/ld/testsuite/ld-arm/vfp11-fix-vector.s vendor/binutils/dist/ld/testsuite/ld-arm/vxworks1-lib.td vendor/binutils/dist/ld/testsuite/ld-discard/zero-rel.d vendor/binutils/dist/ld/testsuite/ld-discard/zero-rel.s vendor/binutils/dist/ld/testsuite/ld-elf/begin.c vendor/binutils/dist/ld/testsuite/ld-elf/beginwarn.c vendor/binutils/dist/ld/testsuite/ld-elf/binutils.exp vendor/binutils/dist/ld/testsuite/ld-elf/commonpage1.d vendor/binutils/dist/ld/testsuite/ld-elf/data1.c vendor/binutils/dist/ld/testsuite/ld-elf/data1.h vendor/binutils/dist/ld/testsuite/ld-elf/del.cc vendor/binutils/dist/ld/testsuite/ld-elf/dl1.c vendor/binutils/dist/ld/testsuite/ld-elf/dl1.list vendor/binutils/dist/ld/testsuite/ld-elf/dl1.out vendor/binutils/dist/ld/testsuite/ld-elf/dl1main.c vendor/binutils/dist/ld/testsuite/ld-elf/dl2.c vendor/binutils/dist/ld/testsuite/ld-elf/dl2.list vendor/binutils/dist/ld/testsuite/ld-elf/dl2a.list vendor/binutils/dist/ld/testsuite/ld-elf/dl2a.out vendor/binutils/dist/ld/testsuite/ld-elf/dl2b.out vendor/binutils/dist/ld/testsuite/ld-elf/dl2main.c vendor/binutils/dist/ld/testsuite/ld-elf/dl2xxx.c vendor/binutils/dist/ld/testsuite/ld-elf/dl2xxx.list vendor/binutils/dist/ld/testsuite/ld-elf/dl3.cc vendor/binutils/dist/ld/testsuite/ld-elf/dl3.list vendor/binutils/dist/ld/testsuite/ld-elf/dl3a.out vendor/binutils/dist/ld/testsuite/ld-elf/dl3b.out vendor/binutils/dist/ld/testsuite/ld-elf/dl3header.h vendor/binutils/dist/ld/testsuite/ld-elf/dl3main.cc vendor/binutils/dist/ld/testsuite/ld-elf/dl4.c vendor/binutils/dist/ld/testsuite/ld-elf/dl4.list vendor/binutils/dist/ld/testsuite/ld-elf/dl4a.out vendor/binutils/dist/ld/testsuite/ld-elf/dl4b.out vendor/binutils/dist/ld/testsuite/ld-elf/dl4main.c vendor/binutils/dist/ld/testsuite/ld-elf/dl4xxx.c vendor/binutils/dist/ld/testsuite/ld-elf/dl4xxx.list vendor/binutils/dist/ld/testsuite/ld-elf/dl5.cc vendor/binutils/dist/ld/testsuite/ld-elf/dl5.out vendor/binutils/dist/ld/testsuite/ld-elf/dl6.c vendor/binutils/dist/ld/testsuite/ld-elf/dl6a.out vendor/binutils/dist/ld/testsuite/ld-elf/dl6amain.c vendor/binutils/dist/ld/testsuite/ld-elf/dl6b.out vendor/binutils/dist/ld/testsuite/ld-elf/dl6bmain.c vendor/binutils/dist/ld/testsuite/ld-elf/dl6cmain.c vendor/binutils/dist/ld/testsuite/ld-elf/dl6dmain.c vendor/binutils/dist/ld/testsuite/ld-elf/dummy.c vendor/binutils/dist/ld/testsuite/ld-elf/dwarf.exp vendor/binutils/dist/ld/testsuite/ld-elf/dwarf1.c vendor/binutils/dist/ld/testsuite/ld-elf/dwarf1.h vendor/binutils/dist/ld/testsuite/ld-elf/dwarf1.out vendor/binutils/dist/ld/testsuite/ld-elf/dwarf1main.c vendor/binutils/dist/ld/testsuite/ld-elf/dynbss1.c vendor/binutils/dist/ld/testsuite/ld-elf/eh-frame-hdr.d vendor/binutils/dist/ld/testsuite/ld-elf/eh-frame-hdr.s vendor/binutils/dist/ld/testsuite/ld-elf/eh4.d vendor/binutils/dist/ld/testsuite/ld-elf/eh4.s vendor/binutils/dist/ld/testsuite/ld-elf/eh4a.s vendor/binutils/dist/ld/testsuite/ld-elf/eh5.d vendor/binutils/dist/ld/testsuite/ld-elf/eh5.s vendor/binutils/dist/ld/testsuite/ld-elf/eh5a.s vendor/binutils/dist/ld/testsuite/ld-elf/eh5b.s vendor/binutils/dist/ld/testsuite/ld-elf/end.c vendor/binutils/dist/ld/testsuite/ld-elf/endhidden.c vendor/binutils/dist/ld/testsuite/ld-elf/endprotected.c vendor/binutils/dist/ld/testsuite/ld-elf/expr1.d vendor/binutils/dist/ld/testsuite/ld-elf/expr1.s vendor/binutils/dist/ld/testsuite/ld-elf/expr1.t vendor/binutils/dist/ld/testsuite/ld-elf/extract-symbol-1.ld vendor/binutils/dist/ld/testsuite/ld-elf/extract-symbol-1.s vendor/binutils/dist/ld/testsuite/ld-elf/extract-symbol-1sec.d vendor/binutils/dist/ld/testsuite/ld-elf/extract-symbol-1sym.d vendor/binutils/dist/ld/testsuite/ld-elf/foo.c vendor/binutils/dist/ld/testsuite/ld-elf/foo.map vendor/binutils/dist/ld/testsuite/ld-elf/group3a.d vendor/binutils/dist/ld/testsuite/ld-elf/group3a.s vendor/binutils/dist/ld/testsuite/ld-elf/group3b.d vendor/binutils/dist/ld/testsuite/ld-elf/group3b.s vendor/binutils/dist/ld/testsuite/ld-elf/hash.d vendor/binutils/dist/ld/testsuite/ld-elf/header.d vendor/binutils/dist/ld/testsuite/ld-elf/header.s vendor/binutils/dist/ld/testsuite/ld-elf/header.t vendor/binutils/dist/ld/testsuite/ld-elf/hidden.out vendor/binutils/dist/ld/testsuite/ld-elf/linkonce1.d vendor/binutils/dist/ld/testsuite/ld-elf/linkonce1a.s vendor/binutils/dist/ld/testsuite/ld-elf/linkonce1b.s vendor/binutils/dist/ld/testsuite/ld-elf/linkonce2.d vendor/binutils/dist/ld/testsuite/ld-elf/loadaddr.s vendor/binutils/dist/ld/testsuite/ld-elf/loadaddr1.d vendor/binutils/dist/ld/testsuite/ld-elf/loadaddr1.t vendor/binutils/dist/ld/testsuite/ld-elf/loadaddr2.d vendor/binutils/dist/ld/testsuite/ld-elf/loadaddr2.t vendor/binutils/dist/ld/testsuite/ld-elf/loadaddr3.t vendor/binutils/dist/ld/testsuite/ld-elf/loadaddr3a.d vendor/binutils/dist/ld/testsuite/ld-elf/loadaddr3b.d vendor/binutils/dist/ld/testsuite/ld-elf/main.c vendor/binutils/dist/ld/testsuite/ld-elf/maxpage1.d vendor/binutils/dist/ld/testsuite/ld-elf/maxpage1.s vendor/binutils/dist/ld/testsuite/ld-elf/maxpage2.d vendor/binutils/dist/ld/testsuite/ld-elf/maxpage3.t vendor/binutils/dist/ld/testsuite/ld-elf/maxpage3a.d vendor/binutils/dist/ld/testsuite/ld-elf/maxpage3b.d vendor/binutils/dist/ld/testsuite/ld-elf/maxpage3c.d vendor/binutils/dist/ld/testsuite/ld-elf/multibss1.d vendor/binutils/dist/ld/testsuite/ld-elf/multibss1.s vendor/binutils/dist/ld/testsuite/ld-elf/new.cc vendor/binutils/dist/ld/testsuite/ld-elf/nobits-1.d vendor/binutils/dist/ld/testsuite/ld-elf/nobits-1.s vendor/binutils/dist/ld/testsuite/ld-elf/nobits-1.t vendor/binutils/dist/ld/testsuite/ld-elf/noload-1.d vendor/binutils/dist/ld/testsuite/ld-elf/noload-1.s vendor/binutils/dist/ld/testsuite/ld-elf/noload-1.t vendor/binutils/dist/ld/testsuite/ld-elf/noload-2.d vendor/binutils/dist/ld/testsuite/ld-elf/normal.out vendor/binutils/dist/ld/testsuite/ld-elf/note-1.d vendor/binutils/dist/ld/testsuite/ld-elf/note-1.s vendor/binutils/dist/ld/testsuite/ld-elf/note-1.t vendor/binutils/dist/ld/testsuite/ld-elf/overlay.d vendor/binutils/dist/ld/testsuite/ld-elf/overlay.s vendor/binutils/dist/ld/testsuite/ld-elf/overlay.t vendor/binutils/dist/ld/testsuite/ld-elf/pass.out vendor/binutils/dist/ld/testsuite/ld-elf/shared.exp vendor/binutils/dist/ld/testsuite/ld-elf/stab.d vendor/binutils/dist/ld/testsuite/ld-elf/symbol2ref.s vendor/binutils/dist/ld/testsuite/ld-elf/symbol2w.s vendor/binutils/dist/ld/testsuite/ld-elf/tbss1.s vendor/binutils/dist/ld/testsuite/ld-elf/tbss2.s vendor/binutils/dist/ld/testsuite/ld-elf/tdata1.s vendor/binutils/dist/ld/testsuite/ld-elf/tdata2.s vendor/binutils/dist/ld/testsuite/ld-elf/tls_common.exp vendor/binutils/dist/ld/testsuite/ld-elf/tls_common.s vendor/binutils/dist/ld/testsuite/ld-elf/warn.out vendor/binutils/dist/ld/testsuite/ld-elf/warn2.d vendor/binutils/dist/ld/testsuite/ld-elf/wrap.exp vendor/binutils/dist/ld/testsuite/ld-elf/wrap1.c vendor/binutils/dist/ld/testsuite/ld-elf/wrap1.out vendor/binutils/dist/ld/testsuite/ld-elf/wrap1a.c vendor/binutils/dist/ld/testsuite/ld-elf/wrap1b.c vendor/binutils/dist/ld/testsuite/ld-i386/alloc.d vendor/binutils/dist/ld/testsuite/ld-i386/alloc.s vendor/binutils/dist/ld/testsuite/ld-i386/alloc.t vendor/binutils/dist/ld/testsuite/ld-i386/pcrel16abs.d vendor/binutils/dist/ld/testsuite/ld-i386/pcrel16abs.s vendor/binutils/dist/ld/testsuite/ld-i386/vxworks1-lib.td vendor/binutils/dist/ld/testsuite/ld-i386/warn1.d vendor/binutils/dist/ld/testsuite/ld-i386/warn1.s vendor/binutils/dist/ld/testsuite/ld-ia64/merge1.d vendor/binutils/dist/ld/testsuite/ld-ia64/merge1.s vendor/binutils/dist/ld/testsuite/ld-ia64/merge2.d vendor/binutils/dist/ld/testsuite/ld-ia64/merge2.s vendor/binutils/dist/ld/testsuite/ld-ia64/merge3.d vendor/binutils/dist/ld/testsuite/ld-ia64/merge3.s vendor/binutils/dist/ld/testsuite/ld-ia64/merge4.d vendor/binutils/dist/ld/testsuite/ld-ia64/merge4.s vendor/binutils/dist/ld/testsuite/ld-ia64/merge5.d vendor/binutils/dist/ld/testsuite/ld-ia64/merge5.s vendor/binutils/dist/ld/testsuite/ld-libs/ vendor/binutils/dist/ld/testsuite/ld-libs/lib-1.s vendor/binutils/dist/ld/testsuite/ld-libs/lib-2.d vendor/binutils/dist/ld/testsuite/ld-libs/lib-2.s vendor/binutils/dist/ld/testsuite/ld-libs/libs.exp vendor/binutils/dist/ld/testsuite/ld-m68k/plt1-68020.d vendor/binutils/dist/ld/testsuite/ld-m68k/plt1-cpu32.d vendor/binutils/dist/ld/testsuite/ld-m68k/plt1-empty.s vendor/binutils/dist/ld/testsuite/ld-m68k/plt1-isab.d vendor/binutils/dist/ld/testsuite/ld-m68k/plt1-isac.d vendor/binutils/dist/ld/testsuite/ld-m68k/plt1.ld vendor/binutils/dist/ld/testsuite/ld-m68k/plt1.s vendor/binutils/dist/ld/testsuite/ld-mep/ vendor/binutils/dist/ld/testsuite/ld-mep/mep.exp vendor/binutils/dist/ld/testsuite/ld-mep/mep1.ld vendor/binutils/dist/ld/testsuite/ld-mep/mep1.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-0.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-00.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-02.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-03.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-1.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-10.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-12.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-13.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-14.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-2.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-20.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-21.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-22.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-23.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-3.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-30.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-31.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-32.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-33.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-4.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/hash1.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/hash1a.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/hash1b.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/hash1c.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips16-call-global-1.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips16-call-global-2.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips16-call-global-3.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips16-call-global.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips16-intermix-1.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips16-intermix-2.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips16-intermix.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips16-local-stubs-1.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips16-local-stubs-1.s vendor/binutils/dist/ld/testsuite/ld-mips-elf/reloc-3-n32.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/reloc-3.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/vxworks1-lib.td vendor/binutils/dist/ld/testsuite/ld-pe/direct.exp vendor/binutils/dist/ld/testsuite/ld-pe/direct_client.c vendor/binutils/dist/ld/testsuite/ld-pe/direct_dll.c vendor/binutils/dist/ld/testsuite/ld-pe/image_size.d vendor/binutils/dist/ld/testsuite/ld-pe/image_size.s vendor/binutils/dist/ld/testsuite/ld-pe/image_size.t vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-0.s vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-00.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-01.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-02.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-1.s vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-10.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-11.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-12.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-13.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-2.s vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-20.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-21.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-22.d vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-3.s vendor/binutils/dist/ld/testsuite/ld-powerpc/attr-gnu-4-31.d vendor/binutils/dist/ld/testsuite/ld-powerpc/plt1.d vendor/binutils/dist/ld/testsuite/ld-powerpc/plt1.s vendor/binutils/dist/ld/testsuite/ld-powerpc/relbrlt.d vendor/binutils/dist/ld/testsuite/ld-powerpc/relbrlt.s vendor/binutils/dist/ld/testsuite/ld-powerpc/vxworks1-lib.td vendor/binutils/dist/ld/testsuite/ld-scripts/alignof.exp vendor/binutils/dist/ld/testsuite/ld-scripts/alignof.s vendor/binutils/dist/ld/testsuite/ld-scripts/alignof.t vendor/binutils/dist/ld/testsuite/ld-scripts/default-script.exp vendor/binutils/dist/ld/testsuite/ld-scripts/default-script.s vendor/binutils/dist/ld/testsuite/ld-scripts/default-script.t vendor/binutils/dist/ld/testsuite/ld-scripts/default-script1.d vendor/binutils/dist/ld/testsuite/ld-scripts/default-script2.d vendor/binutils/dist/ld/testsuite/ld-scripts/default-script3.d vendor/binutils/dist/ld/testsuite/ld-scripts/default-script4.d vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-1.d vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-1.s vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-1.t vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-2.s vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-2a.d vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-2a.t vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-2b.d vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-2b.t vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-3.s vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-3a.d vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-3a.t vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-3b.d vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-3b.t vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-3c.d vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address-3c.t vendor/binutils/dist/ld/testsuite/ld-scripts/empty-address.exp vendor/binutils/dist/ld/testsuite/ld-scripts/expr.exp vendor/binutils/dist/ld/testsuite/ld-scripts/expr1.d vendor/binutils/dist/ld/testsuite/ld-scripts/expr1.s vendor/binutils/dist/ld/testsuite/ld-scripts/expr1.t vendor/binutils/dist/ld/testsuite/ld-scripts/extern.exp vendor/binutils/dist/ld/testsuite/ld-scripts/extern.s vendor/binutils/dist/ld/testsuite/ld-scripts/extern.t vendor/binutils/dist/ld/testsuite/ld-scripts/sort.t vendor/binutils/dist/ld/testsuite/ld-scripts/sort_b_a-1.d vendor/binutils/dist/ld/testsuite/ld-scripts/sort_b_a-1.s vendor/binutils/dist/ld/testsuite/ld-scripts/sort_b_n-1.d vendor/binutils/dist/ld/testsuite/ld-scripts/sort_b_n-1.s vendor/binutils/dist/ld/testsuite/ld-sh/reloc1.d vendor/binutils/dist/ld/testsuite/ld-sh/reloc1.s vendor/binutils/dist/ld/testsuite/ld-sh/sh-vxworks.exp vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1-le.dd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1-lib-le.dd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1-lib.dd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1-lib.nd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1-lib.rd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1-lib.s vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1-lib.td vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1-static.d vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1.dd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1.ld vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1.rd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks1.s vendor/binutils/dist/ld/testsuite/ld-sh/vxworks2-static.sd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks2.s vendor/binutils/dist/ld/testsuite/ld-sh/vxworks2.sd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks3-le.dd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks3-lib-le.dd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks3-lib.dd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks3-lib.s vendor/binutils/dist/ld/testsuite/ld-sh/vxworks3.dd vendor/binutils/dist/ld/testsuite/ld-sh/vxworks3.s vendor/binutils/dist/ld/testsuite/ld-sh/vxworks4.d vendor/binutils/dist/ld/testsuite/ld-sh/vxworks4a.s vendor/binutils/dist/ld/testsuite/ld-sh/vxworks4b.s vendor/binutils/dist/ld/testsuite/ld-sparc/vxworks1-lib.td vendor/binutils/dist/ld/testsuite/ld-spu/ vendor/binutils/dist/ld/testsuite/ld-spu/ear.d vendor/binutils/dist/ld/testsuite/ld-spu/ear.s vendor/binutils/dist/ld/testsuite/ld-spu/embed.rd vendor/binutils/dist/ld/testsuite/ld-spu/ovl.d vendor/binutils/dist/ld/testsuite/ld-spu/ovl.lnk vendor/binutils/dist/ld/testsuite/ld-spu/ovl.s vendor/binutils/dist/ld/testsuite/ld-spu/ovl2.d vendor/binutils/dist/ld/testsuite/ld-spu/ovl2.s vendor/binutils/dist/ld/testsuite/ld-spu/spu.exp vendor/binutils/dist/ld/testsuite/ld-vxworks/ vendor/binutils/dist/ld/testsuite/ld-vxworks/rpath-1.d vendor/binutils/dist/ld/testsuite/ld-vxworks/rpath-1.s vendor/binutils/dist/ld/testsuite/ld-vxworks/vxworks.exp vendor/binutils/dist/libiberty/filename_cmp.c vendor/binutils/dist/ltgcc.m4 vendor/binutils/dist/ltoptions.m4 vendor/binutils/dist/ltsugar.m4 vendor/binutils/dist/ltversion.m4 vendor/binutils/dist/opcodes/ChangeLog-2006 vendor/binutils/dist/opcodes/cr16-dis.c vendor/binutils/dist/opcodes/cr16-opc.c vendor/binutils/dist/opcodes/i386-gen.c vendor/binutils/dist/opcodes/i386-opc.c vendor/binutils/dist/opcodes/i386-opc.h vendor/binutils/dist/opcodes/i386-opc.tbl vendor/binutils/dist/opcodes/i386-reg.tbl vendor/binutils/dist/opcodes/i386-tbl.h vendor/binutils/dist/opcodes/mep-asm.c vendor/binutils/dist/opcodes/mep-desc.c vendor/binutils/dist/opcodes/mep-desc.h vendor/binutils/dist/opcodes/mep-dis.c vendor/binutils/dist/opcodes/mep-ibld.c vendor/binutils/dist/opcodes/mep-opc.c vendor/binutils/dist/opcodes/mep-opc.h vendor/binutils/dist/opcodes/score-dis.c vendor/binutils/dist/opcodes/score-opc.h vendor/binutils/dist/opcodes/spu-dis.c vendor/binutils/dist/opcodes/spu-opc.c Deleted: vendor/binutils/dist/bfd/doc/aoutx.texi vendor/binutils/dist/bfd/doc/archive.texi vendor/binutils/dist/bfd/doc/archures.texi vendor/binutils/dist/bfd/doc/bfd.info vendor/binutils/dist/bfd/doc/bfdio.texi vendor/binutils/dist/bfd/doc/bfdt.texi vendor/binutils/dist/bfd/doc/bfdwin.texi vendor/binutils/dist/bfd/doc/cache.texi vendor/binutils/dist/bfd/doc/coffcode.texi vendor/binutils/dist/bfd/doc/core.texi vendor/binutils/dist/bfd/doc/elf.texi vendor/binutils/dist/bfd/doc/elfcode.texi vendor/binutils/dist/bfd/doc/format.texi vendor/binutils/dist/bfd/doc/hash.texi vendor/binutils/dist/bfd/doc/init.texi vendor/binutils/dist/bfd/doc/libbfd.texi vendor/binutils/dist/bfd/doc/linker.texi vendor/binutils/dist/bfd/doc/mmo.texi vendor/binutils/dist/bfd/doc/opncls.texi vendor/binutils/dist/bfd/doc/reloc.texi vendor/binutils/dist/bfd/doc/section.texi vendor/binutils/dist/bfd/doc/syms.texi vendor/binutils/dist/bfd/doc/targets.texi vendor/binutils/dist/bfd/po/da.gmo vendor/binutils/dist/bfd/po/es.gmo vendor/binutils/dist/bfd/po/fr.gmo vendor/binutils/dist/bfd/po/ja.gmo vendor/binutils/dist/bfd/po/ro.gmo vendor/binutils/dist/bfd/po/rw.gmo vendor/binutils/dist/bfd/po/sv.gmo vendor/binutils/dist/bfd/po/tr.gmo vendor/binutils/dist/bfd/po/vi.gmo vendor/binutils/dist/bfd/po/zh_CN.gmo vendor/binutils/dist/binutils/acinclude.m4 vendor/binutils/dist/binutils/arlex.c vendor/binutils/dist/binutils/arparse.c vendor/binutils/dist/binutils/arparse.h vendor/binutils/dist/binutils/budemang.c vendor/binutils/dist/binutils/budemang.h vendor/binutils/dist/binutils/deflex.c vendor/binutils/dist/binutils/defparse.c vendor/binutils/dist/binutils/defparse.h vendor/binutils/dist/binutils/doc/addr2line.1 vendor/binutils/dist/binutils/doc/ar.1 vendor/binutils/dist/binutils/doc/binutils.info vendor/binutils/dist/binutils/doc/config.texi vendor/binutils/dist/binutils/doc/cxxfilt.man vendor/binutils/dist/binutils/doc/dlltool.1 vendor/binutils/dist/binutils/doc/nlmconv.1 vendor/binutils/dist/binutils/doc/nm.1 vendor/binutils/dist/binutils/doc/objcopy.1 vendor/binutils/dist/binutils/doc/objdump.1 vendor/binutils/dist/binutils/doc/ranlib.1 vendor/binutils/dist/binutils/doc/readelf.1 vendor/binutils/dist/binutils/doc/size.1 vendor/binutils/dist/binutils/doc/strings.1 vendor/binutils/dist/binutils/doc/strip.1 vendor/binutils/dist/binutils/doc/windres.1 vendor/binutils/dist/binutils/nlmheader.c vendor/binutils/dist/binutils/nlmheader.h vendor/binutils/dist/binutils/po/da.gmo vendor/binutils/dist/binutils/po/es.gmo vendor/binutils/dist/binutils/po/fi.gmo vendor/binutils/dist/binutils/po/fr.gmo vendor/binutils/dist/binutils/po/ja.gmo vendor/binutils/dist/binutils/po/ro.gmo vendor/binutils/dist/binutils/po/ru.gmo vendor/binutils/dist/binutils/po/rw.gmo vendor/binutils/dist/binutils/po/sv.gmo vendor/binutils/dist/binutils/po/tr.gmo vendor/binutils/dist/binutils/po/vi.gmo vendor/binutils/dist/binutils/po/zh_CN.gmo vendor/binutils/dist/binutils/po/zh_TW.gmo vendor/binutils/dist/binutils/rclex.l vendor/binutils/dist/binutils/rcparse.c vendor/binutils/dist/binutils/rcparse.h vendor/binutils/dist/binutils/sysinfo.c vendor/binutils/dist/binutils/sysinfo.h vendor/binutils/dist/binutils/syslex.c vendor/binutils/dist/configure.in vendor/binutils/dist/etc/configure.info vendor/binutils/dist/etc/standards.info vendor/binutils/dist/gas/bfin-lex.c vendor/binutils/dist/gas/bfin-parse.c vendor/binutils/dist/gas/bfin-parse.h vendor/binutils/dist/gas/config/obj-ieee.c vendor/binutils/dist/gas/config/obj-ieee.h vendor/binutils/dist/gas/doc/as.1 vendor/binutils/dist/gas/doc/as.info vendor/binutils/dist/gas/doc/asconfig.texi vendor/binutils/dist/gas/doc/gasver.texi vendor/binutils/dist/gas/itbl-lex.c vendor/binutils/dist/gas/itbl-parse.c vendor/binutils/dist/gas/itbl-parse.h vendor/binutils/dist/gas/m68k-parse.c vendor/binutils/dist/gas/po/es.gmo vendor/binutils/dist/gas/po/fr.gmo vendor/binutils/dist/gas/po/rw.gmo vendor/binutils/dist/gas/po/tr.gmo vendor/binutils/dist/gas/testsuite/gas/mips/mips32-dsp.l vendor/binutils/dist/gas/testsuite/gas/mips/mips32-mt.l vendor/binutils/dist/gas/testsuite/gas/s390/operands.d vendor/binutils/dist/gas/testsuite/gas/s390/operands.s vendor/binutils/dist/gas/testsuite/gas/s390/operands64.d vendor/binutils/dist/gas/testsuite/gas/s390/operands64.s vendor/binutils/dist/gettext.m4 vendor/binutils/dist/gprof/acinclude.m4 vendor/binutils/dist/gprof/bsd_callg_bl.c vendor/binutils/dist/gprof/config.texi vendor/binutils/dist/gprof/flat_bl.c vendor/binutils/dist/gprof/fsf_callg_bl.c vendor/binutils/dist/gprof/gprof.1 vendor/binutils/dist/gprof/gprof.info vendor/binutils/dist/gprof/po/da.gmo vendor/binutils/dist/gprof/po/de.gmo vendor/binutils/dist/gprof/po/es.gmo vendor/binutils/dist/gprof/po/fr.gmo vendor/binutils/dist/gprof/po/ga.gmo vendor/binutils/dist/gprof/po/id.gmo vendor/binutils/dist/gprof/po/pt_BR.gmo vendor/binutils/dist/gprof/po/rw.gmo vendor/binutils/dist/gprof/po/sv.gmo vendor/binutils/dist/gprof/po/tr.gmo vendor/binutils/dist/gprof/po/vi.gmo vendor/binutils/dist/include/bin-bugs.h vendor/binutils/dist/intl/acconfig.h vendor/binutils/dist/intl/cat-compat.c vendor/binutils/dist/intl/config.in vendor/binutils/dist/intl/configure.in vendor/binutils/dist/intl/gettext.h vendor/binutils/dist/intl/intlh.inst.in vendor/binutils/dist/intl/libgettext.h vendor/binutils/dist/intl/libintl.glibc vendor/binutils/dist/intl/linux-msg.sed vendor/binutils/dist/intl/po2tbl.sed.in vendor/binutils/dist/intl/xopen-msg.sed vendor/binutils/dist/ld/acinclude.m4 vendor/binutils/dist/ld/configdoc.texi vendor/binutils/dist/ld/emulparams/xtensa-config.sh vendor/binutils/dist/ld/ld.1 vendor/binutils/dist/ld/ld.info vendor/binutils/dist/ld/ldgram.c vendor/binutils/dist/ld/ldgram.h vendor/binutils/dist/ld/ldlex.c vendor/binutils/dist/ld/ldver.texi vendor/binutils/dist/ld/po/da.gmo vendor/binutils/dist/ld/po/es.gmo vendor/binutils/dist/ld/po/fr.gmo vendor/binutils/dist/ld/po/sv.gmo vendor/binutils/dist/ld/po/tr.gmo vendor/binutils/dist/ld/po/vi.gmo vendor/binutils/dist/ld/po/zh_CN.gmo vendor/binutils/dist/ltcf-c.sh vendor/binutils/dist/ltcf-cxx.sh vendor/binutils/dist/ltcf-gcj.sh vendor/binutils/dist/ltconfig vendor/binutils/dist/opcodes/acinclude.m4 vendor/binutils/dist/opcodes/po/da.gmo vendor/binutils/dist/opcodes/po/de.gmo vendor/binutils/dist/opcodes/po/es.gmo vendor/binutils/dist/opcodes/po/fi.gmo vendor/binutils/dist/opcodes/po/fr.gmo vendor/binutils/dist/opcodes/po/ga.gmo vendor/binutils/dist/opcodes/po/id.gmo vendor/binutils/dist/opcodes/po/nl.gmo vendor/binutils/dist/opcodes/po/pt_BR.gmo vendor/binutils/dist/opcodes/po/ro.gmo vendor/binutils/dist/opcodes/po/sv.gmo vendor/binutils/dist/opcodes/po/tr.gmo vendor/binutils/dist/opcodes/po/vi.gmo vendor/binutils/dist/opcodes/po/zh_CN.gmo Modified: vendor/binutils/dist/.cvsignore vendor/binutils/dist/COPYING.LIBGLOSS vendor/binutils/dist/COPYING.NEWLIB vendor/binutils/dist/ChangeLog vendor/binutils/dist/MAINTAINERS vendor/binutils/dist/Makefile.def vendor/binutils/dist/Makefile.in vendor/binutils/dist/Makefile.tpl vendor/binutils/dist/bfd/ChangeLog vendor/binutils/dist/bfd/ChangeLog-0203 vendor/binutils/dist/bfd/ChangeLog-2004 vendor/binutils/dist/bfd/ChangeLog-2005 vendor/binutils/dist/bfd/Makefile.am vendor/binutils/dist/bfd/Makefile.in vendor/binutils/dist/bfd/acinclude.m4 vendor/binutils/dist/bfd/aclocal.m4 vendor/binutils/dist/bfd/aix386-core.c vendor/binutils/dist/bfd/aix5ppc-core.c vendor/binutils/dist/bfd/aout-adobe.c vendor/binutils/dist/bfd/aout-arm.c vendor/binutils/dist/bfd/aout-ns32k.c vendor/binutils/dist/bfd/aout-target.h vendor/binutils/dist/bfd/aout-tic30.c vendor/binutils/dist/bfd/aoutf1.h vendor/binutils/dist/bfd/aoutx.h vendor/binutils/dist/bfd/archive.c vendor/binutils/dist/bfd/archive64.c vendor/binutils/dist/bfd/archures.c vendor/binutils/dist/bfd/bfd-in.h vendor/binutils/dist/bfd/bfd-in2.h vendor/binutils/dist/bfd/bfd.c vendor/binutils/dist/bfd/bfdio.c vendor/binutils/dist/bfd/binary.c vendor/binutils/dist/bfd/bout.c vendor/binutils/dist/bfd/cache.c vendor/binutils/dist/bfd/cf-i386lynx.c vendor/binutils/dist/bfd/cisco-core.c vendor/binutils/dist/bfd/coff-alpha.c vendor/binutils/dist/bfd/coff-apollo.c vendor/binutils/dist/bfd/coff-arm.c vendor/binutils/dist/bfd/coff-aux.c vendor/binutils/dist/bfd/coff-h8300.c vendor/binutils/dist/bfd/coff-h8500.c vendor/binutils/dist/bfd/coff-i386.c vendor/binutils/dist/bfd/coff-i860.c vendor/binutils/dist/bfd/coff-i960.c vendor/binutils/dist/bfd/coff-ia64.c vendor/binutils/dist/bfd/coff-m68k.c vendor/binutils/dist/bfd/coff-m88k.c vendor/binutils/dist/bfd/coff-maxq.c vendor/binutils/dist/bfd/coff-mcore.c vendor/binutils/dist/bfd/coff-mips.c vendor/binutils/dist/bfd/coff-or32.c vendor/binutils/dist/bfd/coff-pmac.c vendor/binutils/dist/bfd/coff-ppc.c vendor/binutils/dist/bfd/coff-rs6000.c vendor/binutils/dist/bfd/coff-sh.c vendor/binutils/dist/bfd/coff-sparc.c vendor/binutils/dist/bfd/coff-stgo32.c vendor/binutils/dist/bfd/coff-tic30.c vendor/binutils/dist/bfd/coff-tic4x.c vendor/binutils/dist/bfd/coff-tic54x.c vendor/binutils/dist/bfd/coff-tic80.c vendor/binutils/dist/bfd/coff-w65.c vendor/binutils/dist/bfd/coff-we32k.c vendor/binutils/dist/bfd/coff-z80.c vendor/binutils/dist/bfd/coff-z8k.c vendor/binutils/dist/bfd/coff64-rs6000.c vendor/binutils/dist/bfd/coffcode.h vendor/binutils/dist/bfd/coffgen.c vendor/binutils/dist/bfd/cofflink.c vendor/binutils/dist/bfd/config.bfd vendor/binutils/dist/bfd/config.in vendor/binutils/dist/bfd/configure vendor/binutils/dist/bfd/configure.in vendor/binutils/dist/bfd/corefile.c vendor/binutils/dist/bfd/cpu-alpha.c vendor/binutils/dist/bfd/cpu-arc.c vendor/binutils/dist/bfd/cpu-arm.c vendor/binutils/dist/bfd/cpu-avr.c vendor/binutils/dist/bfd/cpu-bfin.c vendor/binutils/dist/bfd/cpu-cr16c.c vendor/binutils/dist/bfd/cpu-cris.c vendor/binutils/dist/bfd/cpu-crx.c vendor/binutils/dist/bfd/cpu-d10v.c vendor/binutils/dist/bfd/cpu-d30v.c vendor/binutils/dist/bfd/cpu-dlx.c vendor/binutils/dist/bfd/cpu-fr30.c vendor/binutils/dist/bfd/cpu-frv.c vendor/binutils/dist/bfd/cpu-h8300.c vendor/binutils/dist/bfd/cpu-h8500.c vendor/binutils/dist/bfd/cpu-hppa.c vendor/binutils/dist/bfd/cpu-i370.c vendor/binutils/dist/bfd/cpu-i386.c vendor/binutils/dist/bfd/cpu-i860.c vendor/binutils/dist/bfd/cpu-i960.c vendor/binutils/dist/bfd/cpu-ia64.c vendor/binutils/dist/bfd/cpu-ip2k.c vendor/binutils/dist/bfd/cpu-iq2000.c vendor/binutils/dist/bfd/cpu-m10200.c vendor/binutils/dist/bfd/cpu-m10300.c vendor/binutils/dist/bfd/cpu-m32c.c vendor/binutils/dist/bfd/cpu-m32r.c vendor/binutils/dist/bfd/cpu-m68hc11.c vendor/binutils/dist/bfd/cpu-m68hc12.c vendor/binutils/dist/bfd/cpu-m68k.c vendor/binutils/dist/bfd/cpu-m88k.c vendor/binutils/dist/bfd/cpu-maxq.c vendor/binutils/dist/bfd/cpu-mcore.c vendor/binutils/dist/bfd/cpu-mips.c vendor/binutils/dist/bfd/cpu-mmix.c vendor/binutils/dist/bfd/cpu-msp430.c vendor/binutils/dist/bfd/cpu-mt.c vendor/binutils/dist/bfd/cpu-ns32k.c vendor/binutils/dist/bfd/cpu-openrisc.c vendor/binutils/dist/bfd/cpu-or32.c vendor/binutils/dist/bfd/cpu-pdp11.c vendor/binutils/dist/bfd/cpu-pj.c vendor/binutils/dist/bfd/cpu-powerpc.c vendor/binutils/dist/bfd/cpu-rs6000.c vendor/binutils/dist/bfd/cpu-s390.c vendor/binutils/dist/bfd/cpu-sh.c vendor/binutils/dist/bfd/cpu-sparc.c vendor/binutils/dist/bfd/cpu-tic30.c vendor/binutils/dist/bfd/cpu-tic4x.c vendor/binutils/dist/bfd/cpu-tic54x.c vendor/binutils/dist/bfd/cpu-tic80.c vendor/binutils/dist/bfd/cpu-v850.c vendor/binutils/dist/bfd/cpu-vax.c vendor/binutils/dist/bfd/cpu-w65.c vendor/binutils/dist/bfd/cpu-we32k.c vendor/binutils/dist/bfd/cpu-xc16x.c vendor/binutils/dist/bfd/cpu-xstormy16.c vendor/binutils/dist/bfd/cpu-xtensa.c vendor/binutils/dist/bfd/cpu-z80.c vendor/binutils/dist/bfd/cpu-z8k.c vendor/binutils/dist/bfd/doc/ChangeLog vendor/binutils/dist/bfd/doc/Makefile.am vendor/binutils/dist/bfd/doc/Makefile.in vendor/binutils/dist/bfd/doc/bfd.texinfo vendor/binutils/dist/bfd/doc/bfdint.texi vendor/binutils/dist/bfd/dwarf1.c vendor/binutils/dist/bfd/dwarf2.c vendor/binutils/dist/bfd/ecoff.c vendor/binutils/dist/bfd/ecofflink.c vendor/binutils/dist/bfd/efi-app-ia32.c vendor/binutils/dist/bfd/efi-app-ia64.c vendor/binutils/dist/bfd/elf-bfd.h vendor/binutils/dist/bfd/elf-eh-frame.c vendor/binutils/dist/bfd/elf-hppa.h vendor/binutils/dist/bfd/elf-m10200.c vendor/binutils/dist/bfd/elf-m10300.c vendor/binutils/dist/bfd/elf-strtab.c vendor/binutils/dist/bfd/elf-vxworks.c vendor/binutils/dist/bfd/elf.c vendor/binutils/dist/bfd/elf32-am33lin.c vendor/binutils/dist/bfd/elf32-arc.c vendor/binutils/dist/bfd/elf32-arm.c vendor/binutils/dist/bfd/elf32-avr.c vendor/binutils/dist/bfd/elf32-bfin.c vendor/binutils/dist/bfd/elf32-cr16c.c vendor/binutils/dist/bfd/elf32-cris.c vendor/binutils/dist/bfd/elf32-crx.c vendor/binutils/dist/bfd/elf32-d10v.c vendor/binutils/dist/bfd/elf32-d30v.c vendor/binutils/dist/bfd/elf32-dlx.c vendor/binutils/dist/bfd/elf32-fr30.c vendor/binutils/dist/bfd/elf32-frv.c vendor/binutils/dist/bfd/elf32-gen.c vendor/binutils/dist/bfd/elf32-h8300.c vendor/binutils/dist/bfd/elf32-hppa.c vendor/binutils/dist/bfd/elf32-i370.c vendor/binutils/dist/bfd/elf32-i386.c vendor/binutils/dist/bfd/elf32-i860.c vendor/binutils/dist/bfd/elf32-i960.c vendor/binutils/dist/bfd/elf32-ip2k.c vendor/binutils/dist/bfd/elf32-iq2000.c vendor/binutils/dist/bfd/elf32-m32c.c vendor/binutils/dist/bfd/elf32-m32r.c vendor/binutils/dist/bfd/elf32-m68hc11.c vendor/binutils/dist/bfd/elf32-m68hc12.c vendor/binutils/dist/bfd/elf32-m68hc1x.c vendor/binutils/dist/bfd/elf32-m68hc1x.h vendor/binutils/dist/bfd/elf32-m68k.c vendor/binutils/dist/bfd/elf32-m88k.c vendor/binutils/dist/bfd/elf32-mcore.c vendor/binutils/dist/bfd/elf32-mips.c vendor/binutils/dist/bfd/elf32-msp430.c vendor/binutils/dist/bfd/elf32-mt.c vendor/binutils/dist/bfd/elf32-openrisc.c vendor/binutils/dist/bfd/elf32-or32.c vendor/binutils/dist/bfd/elf32-pj.c vendor/binutils/dist/bfd/elf32-ppc.c vendor/binutils/dist/bfd/elf32-ppc.h vendor/binutils/dist/bfd/elf32-s390.c vendor/binutils/dist/bfd/elf32-sh-symbian.c vendor/binutils/dist/bfd/elf32-sh.c vendor/binutils/dist/bfd/elf32-sh64-com.c vendor/binutils/dist/bfd/elf32-sh64.c vendor/binutils/dist/bfd/elf32-sparc.c vendor/binutils/dist/bfd/elf32-v850.c vendor/binutils/dist/bfd/elf32-vax.c vendor/binutils/dist/bfd/elf32-xc16x.c vendor/binutils/dist/bfd/elf32-xstormy16.c vendor/binutils/dist/bfd/elf32-xtensa.c vendor/binutils/dist/bfd/elf64-alpha.c vendor/binutils/dist/bfd/elf64-gen.c vendor/binutils/dist/bfd/elf64-hppa.c vendor/binutils/dist/bfd/elf64-mips.c vendor/binutils/dist/bfd/elf64-mmix.c vendor/binutils/dist/bfd/elf64-ppc.c vendor/binutils/dist/bfd/elf64-s390.c vendor/binutils/dist/bfd/elf64-sh64.c vendor/binutils/dist/bfd/elf64-sparc.c vendor/binutils/dist/bfd/elf64-x86-64.c vendor/binutils/dist/bfd/elfcode.h vendor/binutils/dist/bfd/elflink.c vendor/binutils/dist/bfd/elfn32-mips.c vendor/binutils/dist/bfd/elfxx-ia64.c vendor/binutils/dist/bfd/elfxx-mips.c vendor/binutils/dist/bfd/elfxx-mips.h vendor/binutils/dist/bfd/elfxx-sparc.c vendor/binutils/dist/bfd/elfxx-sparc.h vendor/binutils/dist/bfd/elfxx-target.h vendor/binutils/dist/bfd/format.c vendor/binutils/dist/bfd/freebsd.h vendor/binutils/dist/bfd/gen-aout.c vendor/binutils/dist/bfd/hash.c vendor/binutils/dist/bfd/host-aout.c vendor/binutils/dist/bfd/hp300bsd.c vendor/binutils/dist/bfd/hppabsd-core.c vendor/binutils/dist/bfd/hpux-core.c vendor/binutils/dist/bfd/i386aout.c vendor/binutils/dist/bfd/i386bsd.c vendor/binutils/dist/bfd/i386linux.c vendor/binutils/dist/bfd/i386lynx.c vendor/binutils/dist/bfd/i386mach3.c vendor/binutils/dist/bfd/i386msdos.c vendor/binutils/dist/bfd/i386os9k.c vendor/binutils/dist/bfd/ieee.c vendor/binutils/dist/bfd/ihex.c vendor/binutils/dist/bfd/init.c vendor/binutils/dist/bfd/irix-core.c vendor/binutils/dist/bfd/libaout.h vendor/binutils/dist/bfd/libbfd-in.h vendor/binutils/dist/bfd/libbfd.c vendor/binutils/dist/bfd/libbfd.h vendor/binutils/dist/bfd/libcoff-in.h vendor/binutils/dist/bfd/libcoff.h vendor/binutils/dist/bfd/libecoff.h vendor/binutils/dist/bfd/libpei.h vendor/binutils/dist/bfd/linker.c vendor/binutils/dist/bfd/lynx-core.c vendor/binutils/dist/bfd/m68klinux.c vendor/binutils/dist/bfd/m88kmach3.c vendor/binutils/dist/bfd/mach-o-target.c vendor/binutils/dist/bfd/mach-o.c vendor/binutils/dist/bfd/merge.c vendor/binutils/dist/bfd/mipsbsd.c vendor/binutils/dist/bfd/mmo.c vendor/binutils/dist/bfd/netbsd-core.c vendor/binutils/dist/bfd/netbsd.h vendor/binutils/dist/bfd/newsos3.c vendor/binutils/dist/bfd/nlm-target.h vendor/binutils/dist/bfd/nlm.c vendor/binutils/dist/bfd/nlm32-alpha.c vendor/binutils/dist/bfd/nlm32-i386.c vendor/binutils/dist/bfd/nlm32-ppc.c vendor/binutils/dist/bfd/nlm32-sparc.c vendor/binutils/dist/bfd/nlmcode.h vendor/binutils/dist/bfd/oasys.c vendor/binutils/dist/bfd/opncls.c vendor/binutils/dist/bfd/osf-core.c vendor/binutils/dist/bfd/pc532-mach.c vendor/binutils/dist/bfd/pdp11.c vendor/binutils/dist/bfd/pe-arm.c vendor/binutils/dist/bfd/pe-i386.c vendor/binutils/dist/bfd/pe-mcore.c vendor/binutils/dist/bfd/pe-mips.c vendor/binutils/dist/bfd/pe-ppc.c vendor/binutils/dist/bfd/pe-sh.c vendor/binutils/dist/bfd/peXXigen.c vendor/binutils/dist/bfd/pef.c vendor/binutils/dist/bfd/pei-arm.c vendor/binutils/dist/bfd/pei-i386.c vendor/binutils/dist/bfd/pei-mcore.c vendor/binutils/dist/bfd/pei-mips.c vendor/binutils/dist/bfd/pei-ppc.c vendor/binutils/dist/bfd/pei-sh.c vendor/binutils/dist/bfd/peicode.h vendor/binutils/dist/bfd/po/BLD-POTFILES.in vendor/binutils/dist/bfd/po/Make-in vendor/binutils/dist/bfd/po/SRC-POTFILES.in vendor/binutils/dist/bfd/po/bfd.pot vendor/binutils/dist/bfd/ppcboot.c vendor/binutils/dist/bfd/ptrace-core.c vendor/binutils/dist/bfd/reloc.c vendor/binutils/dist/bfd/reloc16.c vendor/binutils/dist/bfd/riscix.c vendor/binutils/dist/bfd/rs6000-core.c vendor/binutils/dist/bfd/sco5-core.c vendor/binutils/dist/bfd/section.c vendor/binutils/dist/bfd/simple.c vendor/binutils/dist/bfd/som.c vendor/binutils/dist/bfd/sparclinux.c vendor/binutils/dist/bfd/sparclynx.c vendor/binutils/dist/bfd/srec.c vendor/binutils/dist/bfd/stabs.c vendor/binutils/dist/bfd/sunos.c vendor/binutils/dist/bfd/syms.c vendor/binutils/dist/bfd/sysdep.h vendor/binutils/dist/bfd/targets.c vendor/binutils/dist/bfd/tekhex.c vendor/binutils/dist/bfd/trad-core.c vendor/binutils/dist/bfd/vaxbsd.c vendor/binutils/dist/bfd/versados.c vendor/binutils/dist/bfd/version.h vendor/binutils/dist/bfd/vms-gsd.c vendor/binutils/dist/bfd/vms-hdr.c vendor/binutils/dist/bfd/vms-misc.c vendor/binutils/dist/bfd/vms-tir.c vendor/binutils/dist/bfd/vms.c vendor/binutils/dist/bfd/warning.m4 vendor/binutils/dist/bfd/xcoff-target.h vendor/binutils/dist/bfd/xcofflink.c vendor/binutils/dist/bfd/xsym.c vendor/binutils/dist/bfd/xsym.h vendor/binutils/dist/bfd/xtensa-isa.c vendor/binutils/dist/binutils/ChangeLog vendor/binutils/dist/binutils/MAINTAINERS vendor/binutils/dist/binutils/Makefile.am vendor/binutils/dist/binutils/Makefile.in vendor/binutils/dist/binutils/NEWS vendor/binutils/dist/binutils/aclocal.m4 vendor/binutils/dist/binutils/addr2line.c vendor/binutils/dist/binutils/ar.c vendor/binutils/dist/binutils/arparse.y vendor/binutils/dist/binutils/arsup.c vendor/binutils/dist/binutils/binemul.c vendor/binutils/dist/binutils/binemul.h vendor/binutils/dist/binutils/bucomm.c vendor/binutils/dist/binutils/bucomm.h vendor/binutils/dist/binutils/coffdump.c vendor/binutils/dist/binutils/coffgrok.c vendor/binutils/dist/binutils/config.in vendor/binutils/dist/binutils/configure vendor/binutils/dist/binutils/configure.in vendor/binutils/dist/binutils/cxxfilt.c vendor/binutils/dist/binutils/debug.c vendor/binutils/dist/binutils/defparse.y vendor/binutils/dist/binutils/dlltool.c vendor/binutils/dist/binutils/dllwrap.c vendor/binutils/dist/binutils/doc/Makefile.am vendor/binutils/dist/binutils/doc/Makefile.in vendor/binutils/dist/binutils/doc/binutils.texi vendor/binutils/dist/binutils/dwarf.c vendor/binutils/dist/binutils/dwarf.h vendor/binutils/dist/binutils/emul_aix.c vendor/binutils/dist/binutils/filemode.c vendor/binutils/dist/binutils/ieee.c vendor/binutils/dist/binutils/nlmconv.c vendor/binutils/dist/binutils/nlmheader.y vendor/binutils/dist/binutils/nm.c vendor/binutils/dist/binutils/objcopy.c vendor/binutils/dist/binutils/objdump.c vendor/binutils/dist/binutils/po/Make-in vendor/binutils/dist/binutils/po/POTFILES.in vendor/binutils/dist/binutils/po/binutils.pot vendor/binutils/dist/binutils/prdbg.c vendor/binutils/dist/binutils/rclex.c vendor/binutils/dist/binutils/rcparse.y vendor/binutils/dist/binutils/rdcoff.c vendor/binutils/dist/binutils/rddbg.c vendor/binutils/dist/binutils/readelf.c vendor/binutils/dist/binutils/rename.c vendor/binutils/dist/binutils/resbin.c vendor/binutils/dist/binutils/rescoff.c vendor/binutils/dist/binutils/resrc.c vendor/binutils/dist/binutils/resres.c vendor/binutils/dist/binutils/size.c vendor/binutils/dist/binutils/srconv.c vendor/binutils/dist/binutils/stabs.c vendor/binutils/dist/binutils/strings.c vendor/binutils/dist/binutils/sysdump.c vendor/binutils/dist/binutils/testsuite/ChangeLog vendor/binutils/dist/binutils/testsuite/binutils-all/dlltool.exp vendor/binutils/dist/binutils/testsuite/binutils-all/objcopy.exp vendor/binutils/dist/binutils/testsuite/binutils-all/readelf.exp vendor/binutils/dist/binutils/testsuite/binutils-all/windres/dialogid.rsd vendor/binutils/dist/binutils/testsuite/binutils-all/windres/lang.rc vendor/binutils/dist/binutils/testsuite/binutils-all/windres/strtab1.rc vendor/binutils/dist/binutils/testsuite/binutils-all/windres/windres.exp vendor/binutils/dist/binutils/testsuite/lib/utils-lib.exp vendor/binutils/dist/binutils/version.c vendor/binutils/dist/binutils/windres.c vendor/binutils/dist/binutils/windres.h vendor/binutils/dist/binutils/winduni.c vendor/binutils/dist/binutils/winduni.h vendor/binutils/dist/binutils/wrstabs.c vendor/binutils/dist/config-ml.in vendor/binutils/dist/config.guess vendor/binutils/dist/config.sub vendor/binutils/dist/config/ChangeLog vendor/binutils/dist/config/acx.m4 vendor/binutils/dist/config/depstand.m4 vendor/binutils/dist/config/gettext-sister.m4 vendor/binutils/dist/config/gxx-include-dir.m4 vendor/binutils/dist/config/mh-ppc-aix vendor/binutils/dist/config/mh-ppc-darwin vendor/binutils/dist/config/stdint.m4 vendor/binutils/dist/config/tls.m4 vendor/binutils/dist/config/warnings.m4 vendor/binutils/dist/configure vendor/binutils/dist/cpu/ChangeLog vendor/binutils/dist/cpu/frv.cpu vendor/binutils/dist/cpu/iq2000.cpu vendor/binutils/dist/cpu/m32c.cpu vendor/binutils/dist/cpu/m32r.opc vendor/binutils/dist/cpu/xc16x.cpu vendor/binutils/dist/etc/ChangeLog vendor/binutils/dist/etc/Makefile.in vendor/binutils/dist/etc/texi2pod.pl vendor/binutils/dist/gas/ChangeLog vendor/binutils/dist/gas/Makefile.am vendor/binutils/dist/gas/Makefile.in vendor/binutils/dist/gas/NEWS vendor/binutils/dist/gas/acinclude.m4 vendor/binutils/dist/gas/aclocal.m4 vendor/binutils/dist/gas/app.c vendor/binutils/dist/gas/as.c vendor/binutils/dist/gas/as.h vendor/binutils/dist/gas/atof-generic.c vendor/binutils/dist/gas/cgen.c vendor/binutils/dist/gas/cond.c vendor/binutils/dist/gas/config.in vendor/binutils/dist/gas/config/atof-vax.c vendor/binutils/dist/gas/config/bfin-defs.h vendor/binutils/dist/gas/config/bfin-lex.l vendor/binutils/dist/gas/config/bfin-parse.y vendor/binutils/dist/gas/config/m68k-parse.h vendor/binutils/dist/gas/config/obj-coff.c vendor/binutils/dist/gas/config/obj-coff.h vendor/binutils/dist/gas/config/obj-elf.c vendor/binutils/dist/gas/config/obj-elf.h vendor/binutils/dist/gas/config/obj-som.c vendor/binutils/dist/gas/config/obj-som.h vendor/binutils/dist/gas/config/tc-alpha.c vendor/binutils/dist/gas/config/tc-alpha.h vendor/binutils/dist/gas/config/tc-arc.c vendor/binutils/dist/gas/config/tc-arm.c vendor/binutils/dist/gas/config/tc-arm.h vendor/binutils/dist/gas/config/tc-avr.c vendor/binutils/dist/gas/config/tc-avr.h vendor/binutils/dist/gas/config/tc-bfin.c vendor/binutils/dist/gas/config/tc-bfin.h vendor/binutils/dist/gas/config/tc-cris.c vendor/binutils/dist/gas/config/tc-cris.h vendor/binutils/dist/gas/config/tc-crx.c vendor/binutils/dist/gas/config/tc-d10v.c vendor/binutils/dist/gas/config/tc-d30v.c vendor/binutils/dist/gas/config/tc-dlx.h vendor/binutils/dist/gas/config/tc-fr30.c vendor/binutils/dist/gas/config/tc-frv.c vendor/binutils/dist/gas/config/tc-h8300.c vendor/binutils/dist/gas/config/tc-h8300.h vendor/binutils/dist/gas/config/tc-hppa.c vendor/binutils/dist/gas/config/tc-hppa.h vendor/binutils/dist/gas/config/tc-i370.c vendor/binutils/dist/gas/config/tc-i386.c vendor/binutils/dist/gas/config/tc-i386.h vendor/binutils/dist/gas/config/tc-i860.c vendor/binutils/dist/gas/config/tc-i960.c vendor/binutils/dist/gas/config/tc-i960.h vendor/binutils/dist/gas/config/tc-ia64.c vendor/binutils/dist/gas/config/tc-ia64.h vendor/binutils/dist/gas/config/tc-ip2k.c vendor/binutils/dist/gas/config/tc-iq2000.c vendor/binutils/dist/gas/config/tc-m32c.c vendor/binutils/dist/gas/config/tc-m32c.h vendor/binutils/dist/gas/config/tc-m32r.c vendor/binutils/dist/gas/config/tc-m32r.h vendor/binutils/dist/gas/config/tc-m68hc11.c vendor/binutils/dist/gas/config/tc-m68k.c vendor/binutils/dist/gas/config/tc-m68k.h vendor/binutils/dist/gas/config/tc-maxq.c vendor/binutils/dist/gas/config/tc-maxq.h vendor/binutils/dist/gas/config/tc-mcore.c vendor/binutils/dist/gas/config/tc-mips.c vendor/binutils/dist/gas/config/tc-mips.h vendor/binutils/dist/gas/config/tc-mmix.c vendor/binutils/dist/gas/config/tc-mmix.h vendor/binutils/dist/gas/config/tc-mn10200.c vendor/binutils/dist/gas/config/tc-mn10300.c vendor/binutils/dist/gas/config/tc-mn10300.h vendor/binutils/dist/gas/config/tc-msp430.c vendor/binutils/dist/gas/config/tc-mt.c vendor/binutils/dist/gas/config/tc-ns32k.c vendor/binutils/dist/gas/config/tc-openrisc.c vendor/binutils/dist/gas/config/tc-or32.c vendor/binutils/dist/gas/config/tc-ppc.c vendor/binutils/dist/gas/config/tc-ppc.h vendor/binutils/dist/gas/config/tc-s390.c vendor/binutils/dist/gas/config/tc-s390.h vendor/binutils/dist/gas/config/tc-sh.c vendor/binutils/dist/gas/config/tc-sh.h vendor/binutils/dist/gas/config/tc-sh64.c vendor/binutils/dist/gas/config/tc-sh64.h vendor/binutils/dist/gas/config/tc-sparc.c vendor/binutils/dist/gas/config/tc-sparc.h vendor/binutils/dist/gas/config/tc-tic30.c vendor/binutils/dist/gas/config/tc-tic4x.c vendor/binutils/dist/gas/config/tc-tic54x.c vendor/binutils/dist/gas/config/tc-v850.c vendor/binutils/dist/gas/config/tc-vax.c vendor/binutils/dist/gas/config/tc-vax.h vendor/binutils/dist/gas/config/tc-xc16x.c vendor/binutils/dist/gas/config/tc-xc16x.h vendor/binutils/dist/gas/config/tc-xstormy16.c vendor/binutils/dist/gas/config/tc-xstormy16.h vendor/binutils/dist/gas/config/tc-xtensa.c vendor/binutils/dist/gas/config/tc-xtensa.h vendor/binutils/dist/gas/config/tc-z80.c vendor/binutils/dist/gas/config/tc-z8k.c vendor/binutils/dist/gas/config/xtensa-istack.h vendor/binutils/dist/gas/config/xtensa-relax.c vendor/binutils/dist/gas/config/xtensa-relax.h vendor/binutils/dist/gas/configure vendor/binutils/dist/gas/configure.in vendor/binutils/dist/gas/configure.tgt vendor/binutils/dist/gas/debug.c vendor/binutils/dist/gas/dep-in.sed vendor/binutils/dist/gas/doc/Makefile.am vendor/binutils/dist/gas/doc/Makefile.in vendor/binutils/dist/gas/doc/all.texi vendor/binutils/dist/gas/doc/as.texinfo vendor/binutils/dist/gas/doc/c-arc.texi vendor/binutils/dist/gas/doc/c-arm.texi vendor/binutils/dist/gas/doc/c-bfin.texi vendor/binutils/dist/gas/doc/c-i386.texi vendor/binutils/dist/gas/doc/c-i960.texi vendor/binutils/dist/gas/doc/c-m32r.texi vendor/binutils/dist/gas/doc/c-m68hc11.texi vendor/binutils/dist/gas/doc/c-m68k.texi vendor/binutils/dist/gas/doc/c-mips.texi vendor/binutils/dist/gas/doc/c-mmix.texi vendor/binutils/dist/gas/doc/c-pdp11.texi vendor/binutils/dist/gas/doc/c-ppc.texi vendor/binutils/dist/gas/doc/c-tic54x.texi vendor/binutils/dist/gas/doc/c-v850.texi vendor/binutils/dist/gas/doc/c-xtensa.texi vendor/binutils/dist/gas/doc/c-z80.texi vendor/binutils/dist/gas/doc/internals.texi vendor/binutils/dist/gas/dw2gencfi.c vendor/binutils/dist/gas/dwarf2dbg.c vendor/binutils/dist/gas/ecoff.c vendor/binutils/dist/gas/expr.c vendor/binutils/dist/gas/frags.c vendor/binutils/dist/gas/frags.h vendor/binutils/dist/gas/gdbinit.in vendor/binutils/dist/gas/input-file.c vendor/binutils/dist/gas/input-file.h vendor/binutils/dist/gas/input-scrub.c vendor/binutils/dist/gas/itbl-lex.l vendor/binutils/dist/gas/itbl-ops.c vendor/binutils/dist/gas/itbl-ops.h vendor/binutils/dist/gas/itbl-parse.y vendor/binutils/dist/gas/listing.c vendor/binutils/dist/gas/macro.c vendor/binutils/dist/gas/macro.h vendor/binutils/dist/gas/messages.c vendor/binutils/dist/gas/output-file.c vendor/binutils/dist/gas/po/Make-in vendor/binutils/dist/gas/po/POTFILES.in vendor/binutils/dist/gas/po/gas.pot vendor/binutils/dist/gas/read.c vendor/binutils/dist/gas/read.h vendor/binutils/dist/gas/sb.c vendor/binutils/dist/gas/sb.h vendor/binutils/dist/gas/subsegs.c vendor/binutils/dist/gas/subsegs.h vendor/binutils/dist/gas/symbols.c vendor/binutils/dist/gas/symbols.h vendor/binutils/dist/gas/testsuite/ChangeLog vendor/binutils/dist/gas/testsuite/gas/all/gas.exp vendor/binutils/dist/gas/testsuite/gas/alpha/alpha.exp vendor/binutils/dist/gas/testsuite/gas/arm/arch4t.d vendor/binutils/dist/gas/testsuite/gas/arm/arch7.d vendor/binutils/dist/gas/testsuite/gas/arm/archv6.d vendor/binutils/dist/gas/testsuite/gas/arm/archv6.s vendor/binutils/dist/gas/testsuite/gas/arm/archv6t2.d vendor/binutils/dist/gas/testsuite/gas/arm/arm3.d vendor/binutils/dist/gas/testsuite/gas/arm/arm7dm.d vendor/binutils/dist/gas/testsuite/gas/arm/arm7t.d vendor/binutils/dist/gas/testsuite/gas/arm/armv1.d vendor/binutils/dist/gas/testsuite/gas/arm/copro.d vendor/binutils/dist/gas/testsuite/gas/arm/copro.s vendor/binutils/dist/gas/testsuite/gas/arm/inst.d vendor/binutils/dist/gas/testsuite/gas/arm/iwmmxt-bad.l vendor/binutils/dist/gas/testsuite/gas/arm/iwmmxt-bad.s vendor/binutils/dist/gas/testsuite/gas/arm/iwmmxt.d vendor/binutils/dist/gas/testsuite/gas/arm/iwmmxt.s vendor/binutils/dist/gas/testsuite/gas/arm/macro1.d vendor/binutils/dist/gas/testsuite/gas/arm/svc.d vendor/binutils/dist/gas/testsuite/gas/arm/tcompat.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb2_bcond.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb2_it_bad.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb2_pool.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb2_relax.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb32.d vendor/binutils/dist/gas/testsuite/gas/arm/thumb32.s vendor/binutils/dist/gas/testsuite/gas/arm/tls.d vendor/binutils/dist/gas/testsuite/gas/arm/undefined.d vendor/binutils/dist/gas/testsuite/gas/arm/undefined_coff.d vendor/binutils/dist/gas/testsuite/gas/arm/unwind.d vendor/binutils/dist/gas/testsuite/gas/arm/unwind.s vendor/binutils/dist/gas/testsuite/gas/arm/unwind_vxworks.d vendor/binutils/dist/gas/testsuite/gas/arm/vfp1.d vendor/binutils/dist/gas/testsuite/gas/arm/vfp1_t2.d vendor/binutils/dist/gas/testsuite/gas/arm/vfp1xD.d vendor/binutils/dist/gas/testsuite/gas/arm/vfp1xD.s vendor/binutils/dist/gas/testsuite/gas/arm/vfp1xD_t2.d vendor/binutils/dist/gas/testsuite/gas/arm/vfp1xD_t2.s vendor/binutils/dist/gas/testsuite/gas/arm/vfp2.d vendor/binutils/dist/gas/testsuite/gas/arm/vfp2_t2.d vendor/binutils/dist/gas/testsuite/gas/arm/wince_inst.d vendor/binutils/dist/gas/testsuite/gas/arm/xscale.d vendor/binutils/dist/gas/testsuite/gas/bfin/bfin.exp vendor/binutils/dist/gas/testsuite/gas/bfin/load.d vendor/binutils/dist/gas/testsuite/gas/bfin/load.s vendor/binutils/dist/gas/testsuite/gas/bfin/vector2.d vendor/binutils/dist/gas/testsuite/gas/bfin/vector2.s vendor/binutils/dist/gas/testsuite/gas/cfi/cfi-x86_64.d vendor/binutils/dist/gas/testsuite/gas/cfi/cfi-x86_64.s vendor/binutils/dist/gas/testsuite/gas/cfi/cfi.exp vendor/binutils/dist/gas/testsuite/gas/crx/allinsn.exp vendor/binutils/dist/gas/testsuite/gas/d10v/address-002.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-003.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-004.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-005.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-006.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-007.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-008.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-009.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-010.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-011.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-012.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-013.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-014.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-015.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-016.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-017.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-018.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-019.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-020.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-021.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-022.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-023.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-024.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-025.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-026.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-027.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-030.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-031.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-032.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-033.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-034.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-035.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-036.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-037.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-038.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-039.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-040.l vendor/binutils/dist/gas/testsuite/gas/d10v/address-041.l vendor/binutils/dist/gas/testsuite/gas/d10v/d10v.exp vendor/binutils/dist/gas/testsuite/gas/d30v/d30.exp vendor/binutils/dist/gas/testsuite/gas/elf/elf.exp vendor/binutils/dist/gas/testsuite/gas/elf/section2.e-armeabi vendor/binutils/dist/gas/testsuite/gas/frv/allinsn.exp vendor/binutils/dist/gas/testsuite/gas/i386/amd.d vendor/binutils/dist/gas/testsuite/gas/i386/gotpc.d vendor/binutils/dist/gas/testsuite/gas/i386/gotpc.s vendor/binutils/dist/gas/testsuite/gas/i386/i386.exp vendor/binutils/dist/gas/testsuite/gas/i386/immed32.d vendor/binutils/dist/gas/testsuite/gas/i386/immed64.d vendor/binutils/dist/gas/testsuite/gas/i386/intel.d vendor/binutils/dist/gas/testsuite/gas/i386/intel.s vendor/binutils/dist/gas/testsuite/gas/i386/intel16.d vendor/binutils/dist/gas/testsuite/gas/i386/intelok.d vendor/binutils/dist/gas/testsuite/gas/i386/inval.l vendor/binutils/dist/gas/testsuite/gas/i386/inval.s vendor/binutils/dist/gas/testsuite/gas/i386/jump16.d vendor/binutils/dist/gas/testsuite/gas/i386/merom.d vendor/binutils/dist/gas/testsuite/gas/i386/naked.d vendor/binutils/dist/gas/testsuite/gas/i386/opcode.d vendor/binutils/dist/gas/testsuite/gas/i386/opcode.s vendor/binutils/dist/gas/testsuite/gas/i386/prefix.d vendor/binutils/dist/gas/testsuite/gas/i386/prescott.d vendor/binutils/dist/gas/testsuite/gas/i386/reloc64.d vendor/binutils/dist/gas/testsuite/gas/i386/reloc64.s vendor/binutils/dist/gas/testsuite/gas/i386/rep-suffix.d vendor/binutils/dist/gas/testsuite/gas/i386/rep.d vendor/binutils/dist/gas/testsuite/gas/i386/rex.d vendor/binutils/dist/gas/testsuite/gas/i386/rex.s vendor/binutils/dist/gas/testsuite/gas/i386/secrel.d vendor/binutils/dist/gas/testsuite/gas/i386/sse2.d vendor/binutils/dist/gas/testsuite/gas/i386/sse2.s vendor/binutils/dist/gas/testsuite/gas/i386/ssemmx2.d vendor/binutils/dist/gas/testsuite/gas/i386/tlsd.d vendor/binutils/dist/gas/testsuite/gas/i386/tlspic.d vendor/binutils/dist/gas/testsuite/gas/i386/white.l vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-addr32.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-addr32.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-branch.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-crx-suffix.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-crx.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-drx-suffix.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-drx.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-inval.l vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-inval.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-merom.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-opcode.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-opcode.s vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-pcrel.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-prescott.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-rep-suffix.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-rep.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-rip.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-stack-intel.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-stack-suffix.d vendor/binutils/dist/gas/testsuite/gas/i386/x86-64-stack.d vendor/binutils/dist/gas/testsuite/gas/i386/x86_64.d vendor/binutils/dist/gas/testsuite/gas/i386/x86_64.s vendor/binutils/dist/gas/testsuite/gas/i860/i860.exp vendor/binutils/dist/gas/testsuite/gas/ia64/ia64.exp vendor/binutils/dist/gas/testsuite/gas/lns/lns.exp vendor/binutils/dist/gas/testsuite/gas/m68k/all.exp vendor/binutils/dist/gas/testsuite/gas/m68k/mcf-fpu.d vendor/binutils/dist/gas/testsuite/gas/m68k/mcf-fpu.s vendor/binutils/dist/gas/testsuite/gas/macros/macros.exp vendor/binutils/dist/gas/testsuite/gas/maxq10/maxq10.exp vendor/binutils/dist/gas/testsuite/gas/maxq20/maxq20.exp vendor/binutils/dist/gas/testsuite/gas/mcore/allinsn.d vendor/binutils/dist/gas/testsuite/gas/mcore/allinsn.s vendor/binutils/dist/gas/testsuite/gas/mips/cp0sel-names-mips32r2.d vendor/binutils/dist/gas/testsuite/gas/mips/cp0sel-names-mips64r2.d vendor/binutils/dist/gas/testsuite/gas/mips/e32-rel2.d vendor/binutils/dist/gas/testsuite/gas/mips/e32-rel4.d vendor/binutils/dist/gas/testsuite/gas/mips/elf-rel6.d vendor/binutils/dist/gas/testsuite/gas/mips/elf-rel6.s vendor/binutils/dist/gas/testsuite/gas/mips/mips-gp32-fp64-pic.d vendor/binutils/dist/gas/testsuite/gas/mips/mips-gp32-fp64.d vendor/binutils/dist/gas/testsuite/gas/mips/mips-gp64-fp32-pic.d vendor/binutils/dist/gas/testsuite/gas/mips/mips-gp64-fp32.l vendor/binutils/dist/gas/testsuite/gas/mips/mips-gp64-fp64.d vendor/binutils/dist/gas/testsuite/gas/mips/mips.exp vendor/binutils/dist/gas/testsuite/gas/mips/mips16e-save.d vendor/binutils/dist/gas/testsuite/gas/mips/mips32-dsp.d vendor/binutils/dist/gas/testsuite/gas/mips/mips32-dsp.s vendor/binutils/dist/gas/testsuite/gas/mips/mips32-mt.d vendor/binutils/dist/gas/testsuite/gas/mips/mips32-mt.s vendor/binutils/dist/gas/testsuite/gas/mips/mips32.d vendor/binutils/dist/gas/testsuite/gas/mips/mips32.s vendor/binutils/dist/gas/testsuite/gas/mips/mips4.d vendor/binutils/dist/gas/testsuite/gas/mips/mips4.s vendor/binutils/dist/gas/testsuite/gas/mips/set-arch.d vendor/binutils/dist/gas/testsuite/gas/mmix/bspec-1.d vendor/binutils/dist/gas/testsuite/gas/mmix/bspec-2.d vendor/binutils/dist/gas/testsuite/gas/mmix/comment-1.d vendor/binutils/dist/gas/testsuite/gas/mmix/mmix-list.exp vendor/binutils/dist/gas/testsuite/gas/mn10300/basic.exp vendor/binutils/dist/gas/testsuite/gas/msp430/msp430.exp vendor/binutils/dist/gas/testsuite/gas/pdp11/pdp11.exp vendor/binutils/dist/gas/testsuite/gas/ppc/booke.d vendor/binutils/dist/gas/testsuite/gas/ppc/booke.s vendor/binutils/dist/gas/testsuite/gas/ppc/ppc.exp vendor/binutils/dist/gas/testsuite/gas/s390/esa-g5.d vendor/binutils/dist/gas/testsuite/gas/s390/esa-g5.s vendor/binutils/dist/gas/testsuite/gas/s390/s390.exp vendor/binutils/dist/gas/testsuite/gas/s390/zarch-z900.d vendor/binutils/dist/gas/testsuite/gas/s390/zarch-z900.s vendor/binutils/dist/gas/testsuite/gas/sh/basic.exp vendor/binutils/dist/gas/testsuite/gas/sh/pcrel-coff.d vendor/binutils/dist/gas/testsuite/gas/sh/pcrel-hms.d vendor/binutils/dist/gas/testsuite/gas/sh/pcrel.d vendor/binutils/dist/gas/testsuite/gas/sh/pcrel2.d vendor/binutils/dist/gas/testsuite/gas/sh/pic.d vendor/binutils/dist/gas/testsuite/gas/sh/sh64/syntax-1.d vendor/binutils/dist/gas/testsuite/gas/sh/tlsd.d vendor/binutils/dist/gas/testsuite/gas/sh/tlsnopic.d vendor/binutils/dist/gas/testsuite/gas/sh/tlspic.d vendor/binutils/dist/gas/testsuite/gas/sparc/sparc.exp vendor/binutils/dist/gas/testsuite/gas/v850/v850e1.d vendor/binutils/dist/gas/testsuite/gas/z8k/calr.d vendor/binutils/dist/gas/testsuite/gas/z8k/ctrl-names.d vendor/binutils/dist/gas/testsuite/gas/z8k/djnz.d vendor/binutils/dist/gas/testsuite/gas/z8k/inout.d vendor/binutils/dist/gas/testsuite/gas/z8k/jmp-cc.d vendor/binutils/dist/gas/testsuite/gas/z8k/jr-back.d vendor/binutils/dist/gas/testsuite/gas/z8k/jr-forw.d vendor/binutils/dist/gas/testsuite/gas/z8k/ret-cc.d vendor/binutils/dist/gas/testsuite/gas/z8k/z8k.exp vendor/binutils/dist/gas/testsuite/lib/gas-defs.exp vendor/binutils/dist/gas/testsuite/lib/gas-dg.exp vendor/binutils/dist/gas/write.c vendor/binutils/dist/gas/write.h vendor/binutils/dist/gprof/ChangeLog vendor/binutils/dist/gprof/Makefile.am vendor/binutils/dist/gprof/Makefile.in vendor/binutils/dist/gprof/aclocal.m4 vendor/binutils/dist/gprof/alpha.c vendor/binutils/dist/gprof/configure vendor/binutils/dist/gprof/configure.in vendor/binutils/dist/gprof/corefile.c vendor/binutils/dist/gprof/gconfig.in vendor/binutils/dist/gprof/gmon_io.c vendor/binutils/dist/gprof/gprof.c vendor/binutils/dist/gprof/gprof.h vendor/binutils/dist/gprof/gprof.texi vendor/binutils/dist/gprof/hist.c vendor/binutils/dist/gprof/hist.h vendor/binutils/dist/gprof/i386.c vendor/binutils/dist/gprof/mips.c vendor/binutils/dist/gprof/po/Make-in vendor/binutils/dist/gprof/po/gprof.pot vendor/binutils/dist/gprof/sparc.c vendor/binutils/dist/gprof/sym_ids.c vendor/binutils/dist/gprof/tahoe.c vendor/binutils/dist/gprof/utils.c vendor/binutils/dist/gprof/vax.c vendor/binutils/dist/include/ChangeLog vendor/binutils/dist/include/ansidecl.h vendor/binutils/dist/include/bfdlink.h vendor/binutils/dist/include/coff/ChangeLog vendor/binutils/dist/include/coff/external.h vendor/binutils/dist/include/coff/internal.h vendor/binutils/dist/include/coff/pe.h vendor/binutils/dist/include/coff/rs6000.h vendor/binutils/dist/include/demangle.h vendor/binutils/dist/include/dis-asm.h vendor/binutils/dist/include/elf/ChangeLog vendor/binutils/dist/include/elf/arm.h vendor/binutils/dist/include/elf/avr.h vendor/binutils/dist/include/elf/common.h vendor/binutils/dist/include/elf/dwarf2.h vendor/binutils/dist/include/elf/external.h vendor/binutils/dist/include/elf/hppa.h vendor/binutils/dist/include/elf/internal.h vendor/binutils/dist/include/elf/m68k.h vendor/binutils/dist/include/elf/mips.h vendor/binutils/dist/include/elf/ppc.h vendor/binutils/dist/include/elf/reloc-macros.h vendor/binutils/dist/include/elf/v850.h vendor/binutils/dist/include/elf/xtensa.h vendor/binutils/dist/include/filenames.h vendor/binutils/dist/include/gdb/ChangeLog vendor/binutils/dist/include/gdb/callback.h vendor/binutils/dist/include/gdb/fileio.h vendor/binutils/dist/include/gdb/remote-sim.h vendor/binutils/dist/include/gdb/signals.h vendor/binutils/dist/include/gdb/sim-arm.h vendor/binutils/dist/include/gdb/sim-d10v.h vendor/binutils/dist/include/gdb/sim-frv.h vendor/binutils/dist/include/gdb/sim-h8300.h vendor/binutils/dist/include/gdb/sim-m32c.h vendor/binutils/dist/include/gdb/sim-ppc.h vendor/binutils/dist/include/gdb/sim-sh.h vendor/binutils/dist/include/libiberty.h vendor/binutils/dist/include/opcode/ChangeLog vendor/binutils/dist/include/opcode/arm.h vendor/binutils/dist/include/opcode/i386.h vendor/binutils/dist/include/opcode/m68k.h vendor/binutils/dist/include/opcode/mips.h vendor/binutils/dist/include/opcode/ppc.h vendor/binutils/dist/include/opcode/s390.h vendor/binutils/dist/include/xtensa-config.h vendor/binutils/dist/include/xtensa-isa.h vendor/binutils/dist/intl/ChangeLog vendor/binutils/dist/intl/Makefile.in vendor/binutils/dist/intl/aclocal.m4 vendor/binutils/dist/intl/bindtextdom.c vendor/binutils/dist/intl/configure vendor/binutils/dist/intl/dcgettext.c vendor/binutils/dist/intl/dgettext.c vendor/binutils/dist/intl/explodename.c vendor/binutils/dist/intl/finddomain.c vendor/binutils/dist/intl/gettext.c vendor/binutils/dist/intl/gettextP.h vendor/binutils/dist/intl/hash-string.h vendor/binutils/dist/intl/intl-compat.c vendor/binutils/dist/intl/l10nflist.c vendor/binutils/dist/intl/loadinfo.h vendor/binutils/dist/intl/loadmsgcat.c vendor/binutils/dist/intl/localealias.c vendor/binutils/dist/intl/textdomain.c vendor/binutils/dist/ld/ChangeLog vendor/binutils/dist/ld/Makefile.am vendor/binutils/dist/ld/Makefile.in vendor/binutils/dist/ld/NEWS vendor/binutils/dist/ld/aclocal.m4 vendor/binutils/dist/ld/config.in vendor/binutils/dist/ld/configure vendor/binutils/dist/ld/configure.host vendor/binutils/dist/ld/configure.in vendor/binutils/dist/ld/configure.tgt vendor/binutils/dist/ld/deffilep.y vendor/binutils/dist/ld/emulparams/arcelf.sh vendor/binutils/dist/ld/emulparams/armelf.sh vendor/binutils/dist/ld/emulparams/armelf_linux.sh vendor/binutils/dist/ld/emulparams/armelf_nbsd.sh vendor/binutils/dist/ld/emulparams/armelf_vxworks.sh vendor/binutils/dist/ld/emulparams/armnto.sh vendor/binutils/dist/ld/emulparams/armsymbian.sh vendor/binutils/dist/ld/emulparams/avr1.sh vendor/binutils/dist/ld/emulparams/avr2.sh vendor/binutils/dist/ld/emulparams/avr3.sh vendor/binutils/dist/ld/emulparams/avr4.sh vendor/binutils/dist/ld/emulparams/avr5.sh vendor/binutils/dist/ld/emulparams/bfin.sh vendor/binutils/dist/ld/emulparams/criself.sh vendor/binutils/dist/ld/emulparams/crislinux.sh vendor/binutils/dist/ld/emulparams/d30v_e.sh vendor/binutils/dist/ld/emulparams/d30v_o.sh vendor/binutils/dist/ld/emulparams/d30velf.sh vendor/binutils/dist/ld/emulparams/elf32_dlx.sh vendor/binutils/dist/ld/emulparams/elf32_i860.sh vendor/binutils/dist/ld/emulparams/elf32_i960.sh vendor/binutils/dist/ld/emulparams/elf32_sparc.sh vendor/binutils/dist/ld/emulparams/elf32am33lin.sh vendor/binutils/dist/ld/emulparams/elf32bfinfd.sh vendor/binutils/dist/ld/emulparams/elf32bmip.sh vendor/binutils/dist/ld/emulparams/elf32bmipn32-defs.sh vendor/binutils/dist/ld/emulparams/elf32bmipn32.sh vendor/binutils/dist/ld/emulparams/elf32btsmipn32.sh vendor/binutils/dist/ld/emulparams/elf32ebmipvxworks.sh vendor/binutils/dist/ld/emulparams/elf32fr30.sh vendor/binutils/dist/ld/emulparams/elf32frv.sh vendor/binutils/dist/ld/emulparams/elf32frvfd.sh vendor/binutils/dist/ld/emulparams/elf32i370.sh vendor/binutils/dist/ld/emulparams/elf32iq10.sh vendor/binutils/dist/ld/emulparams/elf32iq2000.sh vendor/binutils/dist/ld/emulparams/elf32lppcnto.sh vendor/binutils/dist/ld/emulparams/elf32mcore.sh vendor/binutils/dist/ld/emulparams/elf32mt.sh vendor/binutils/dist/ld/emulparams/elf32openrisc.sh vendor/binutils/dist/ld/emulparams/elf32ppc.sh vendor/binutils/dist/ld/emulparams/elf32ppccommon.sh vendor/binutils/dist/ld/emulparams/elf32ppcnto.sh vendor/binutils/dist/ld/emulparams/elf32ppcwindiss.sh vendor/binutils/dist/ld/emulparams/elf32vax.sh vendor/binutils/dist/ld/emulparams/elf32xc16x.sh vendor/binutils/dist/ld/emulparams/elf32xc16xl.sh vendor/binutils/dist/ld/emulparams/elf32xc16xs.sh vendor/binutils/dist/ld/emulparams/elf32xtensa.sh vendor/binutils/dist/ld/emulparams/elf64_aix.sh vendor/binutils/dist/ld/emulparams/elf64_ia64.sh vendor/binutils/dist/ld/emulparams/elf64_s390.sh vendor/binutils/dist/ld/emulparams/elf64_sparc.sh vendor/binutils/dist/ld/emulparams/elf64_sparc_fbsd.sh vendor/binutils/dist/ld/emulparams/elf64alpha.sh vendor/binutils/dist/ld/emulparams/elf64bmip.sh vendor/binutils/dist/ld/emulparams/elf64btsmip.sh vendor/binutils/dist/ld/emulparams/elf64hppa.sh vendor/binutils/dist/ld/emulparams/elf64mmix.sh vendor/binutils/dist/ld/emulparams/elf64ppc.sh vendor/binutils/dist/ld/emulparams/elf_i386.sh vendor/binutils/dist/ld/emulparams/elf_i386_be.sh vendor/binutils/dist/ld/emulparams/elf_i386_chaos.sh vendor/binutils/dist/ld/emulparams/elf_i386_ldso.sh vendor/binutils/dist/ld/emulparams/elf_i386_vxworks.sh vendor/binutils/dist/ld/emulparams/elf_s390.sh vendor/binutils/dist/ld/emulparams/elf_x86_64.sh vendor/binutils/dist/ld/emulparams/elf_x86_64_fbsd.sh vendor/binutils/dist/ld/emulparams/h8300.sh vendor/binutils/dist/ld/emulparams/h8300elf.sh vendor/binutils/dist/ld/emulparams/h8300sxelf.sh vendor/binutils/dist/ld/emulparams/hppa64linux.sh vendor/binutils/dist/ld/emulparams/hppalinux.sh vendor/binutils/dist/ld/emulparams/hppaobsd.sh vendor/binutils/dist/ld/emulparams/i386lynx.sh vendor/binutils/dist/ld/emulparams/i386moss.sh vendor/binutils/dist/ld/emulparams/i386nto.sh vendor/binutils/dist/ld/emulparams/i386nw.sh vendor/binutils/dist/ld/emulparams/m32relf_linux.sh vendor/binutils/dist/ld/emulparams/m68kelf.sh vendor/binutils/dist/ld/emulparams/m68kpsos.sh vendor/binutils/dist/ld/emulparams/mn10200.sh vendor/binutils/dist/ld/emulparams/mn10300.sh vendor/binutils/dist/ld/emulparams/msp430all.sh vendor/binutils/dist/ld/emulparams/or32.sh vendor/binutils/dist/ld/emulparams/or32elf.sh vendor/binutils/dist/ld/emulparams/pjelf.sh vendor/binutils/dist/ld/emulparams/pjlelf.sh vendor/binutils/dist/ld/emulparams/ppclynx.sh vendor/binutils/dist/ld/emulparams/ppcnw.sh vendor/binutils/dist/ld/emulparams/shelf32.sh vendor/binutils/dist/ld/emulparams/shelf32_nbsd.sh vendor/binutils/dist/ld/emulparams/shelf64.sh vendor/binutils/dist/ld/emulparams/shelf_nbsd.sh vendor/binutils/dist/ld/emulparams/shelf_nto.sh vendor/binutils/dist/ld/emulparams/shlelf32_linux.sh vendor/binutils/dist/ld/emulparams/shlelf_linux.sh vendor/binutils/dist/ld/emulparams/shlelf_nto.sh vendor/binutils/dist/ld/emulparams/vxworks.sh vendor/binutils/dist/ld/emultempl/aix.em vendor/binutils/dist/ld/emultempl/armcoff.em vendor/binutils/dist/ld/emultempl/armelf.em vendor/binutils/dist/ld/emultempl/beos.em vendor/binutils/dist/ld/emultempl/elf32.em vendor/binutils/dist/ld/emultempl/generic.em vendor/binutils/dist/ld/emultempl/gld960.em vendor/binutils/dist/ld/emultempl/gld960c.em vendor/binutils/dist/ld/emultempl/hppaelf.em vendor/binutils/dist/ld/emultempl/irix.em vendor/binutils/dist/ld/emultempl/linux.em vendor/binutils/dist/ld/emultempl/lnk960.em vendor/binutils/dist/ld/emultempl/m68kcoff.em vendor/binutils/dist/ld/emultempl/mmixelf.em vendor/binutils/dist/ld/emultempl/mmo.em vendor/binutils/dist/ld/emultempl/pe.em vendor/binutils/dist/ld/emultempl/ppc32elf.em vendor/binutils/dist/ld/emultempl/ppc64elf.em vendor/binutils/dist/ld/emultempl/sunos.em vendor/binutils/dist/ld/emultempl/ticoff.em vendor/binutils/dist/ld/emultempl/vanilla.em vendor/binutils/dist/ld/emultempl/vxworks.em vendor/binutils/dist/ld/emultempl/xtensaelf.em vendor/binutils/dist/ld/gen-doc.texi vendor/binutils/dist/ld/genscripts.sh vendor/binutils/dist/ld/ld.h vendor/binutils/dist/ld/ld.texinfo vendor/binutils/dist/ld/ldcref.c vendor/binutils/dist/ld/ldctor.c vendor/binutils/dist/ld/ldemul.c vendor/binutils/dist/ld/ldexp.c vendor/binutils/dist/ld/ldexp.h vendor/binutils/dist/ld/ldfile.c vendor/binutils/dist/ld/ldgram.y vendor/binutils/dist/ld/ldint.texinfo vendor/binutils/dist/ld/ldlang.c vendor/binutils/dist/ld/ldlang.h vendor/binutils/dist/ld/ldlex.h vendor/binutils/dist/ld/ldlex.l vendor/binutils/dist/ld/ldmain.c vendor/binutils/dist/ld/ldmisc.c vendor/binutils/dist/ld/ldmisc.h vendor/binutils/dist/ld/ldver.c vendor/binutils/dist/ld/ldwrite.c vendor/binutils/dist/ld/lexsup.c vendor/binutils/dist/ld/mri.c vendor/binutils/dist/ld/pe-dll.c vendor/binutils/dist/ld/pe-dll.h vendor/binutils/dist/ld/po/Make-in vendor/binutils/dist/ld/po/POTFILES.in vendor/binutils/dist/ld/po/ld.pot vendor/binutils/dist/ld/scripttempl/armbpabi.sc vendor/binutils/dist/ld/scripttempl/avr.sc vendor/binutils/dist/ld/scripttempl/crisaout.sc vendor/binutils/dist/ld/scripttempl/elf.sc vendor/binutils/dist/ld/scripttempl/elf32crx.sc vendor/binutils/dist/ld/scripttempl/elf32sh-symbian.sc vendor/binutils/dist/ld/scripttempl/elf_chaos.sc vendor/binutils/dist/ld/scripttempl/elfd10v.sc vendor/binutils/dist/ld/scripttempl/elfd30v.sc vendor/binutils/dist/ld/scripttempl/elfi370.sc vendor/binutils/dist/ld/scripttempl/elfxtensa.sc vendor/binutils/dist/ld/scripttempl/iq2000.sc vendor/binutils/dist/ld/scripttempl/mmo.sc vendor/binutils/dist/ld/scripttempl/xstormy16.sc vendor/binutils/dist/ld/testsuite/ChangeLog vendor/binutils/dist/ld/testsuite/ld-alpha/tlsbin.rd vendor/binutils/dist/ld/testsuite/ld-alpha/tlsbinr.rd vendor/binutils/dist/ld/testsuite/ld-alpha/tlspic.rd vendor/binutils/dist/ld/testsuite/ld-arm/arm-app-abs32.d vendor/binutils/dist/ld/testsuite/ld-arm/arm-app.d vendor/binutils/dist/ld/testsuite/ld-arm/arm-call.d vendor/binutils/dist/ld/testsuite/ld-arm/arm-dyn.ld vendor/binutils/dist/ld/testsuite/ld-arm/arm-elf.exp vendor/binutils/dist/ld/testsuite/ld-arm/arm-lib-plt32.d vendor/binutils/dist/ld/testsuite/ld-arm/arm-lib.d vendor/binutils/dist/ld/testsuite/ld-arm/arm-lib.ld vendor/binutils/dist/ld/testsuite/ld-arm/arm-static-app.d vendor/binutils/dist/ld/testsuite/ld-arm/arm.ld vendor/binutils/dist/ld/testsuite/ld-arm/mixed-app-v5.d vendor/binutils/dist/ld/testsuite/ld-arm/mixed-app.d vendor/binutils/dist/ld/testsuite/ld-arm/mixed-app.sym vendor/binutils/dist/ld/testsuite/ld-arm/mixed-lib.d vendor/binutils/dist/ld/testsuite/ld-arm/mixed-lib.sym vendor/binutils/dist/ld/testsuite/ld-arm/tls-app.d vendor/binutils/dist/ld/testsuite/ld-arm/tls-lib.d vendor/binutils/dist/ld/testsuite/ld-arm/vxworks1-lib.dd vendor/binutils/dist/ld/testsuite/ld-arm/vxworks1-lib.rd vendor/binutils/dist/ld/testsuite/ld-arm/vxworks1.dd vendor/binutils/dist/ld/testsuite/ld-arm/vxworks1.ld vendor/binutils/dist/ld/testsuite/ld-bootstrap/bootstrap.exp vendor/binutils/dist/ld/testsuite/ld-cris/hiddef1.d vendor/binutils/dist/ld/testsuite/ld-cris/ldsym1.d vendor/binutils/dist/ld/testsuite/ld-cris/libdso-12.d vendor/binutils/dist/ld/testsuite/ld-cris/libdso-2.d vendor/binutils/dist/ld/testsuite/ld-cris/v32-ba-1.d vendor/binutils/dist/ld/testsuite/ld-elf/eh1.d vendor/binutils/dist/ld/testsuite/ld-elf/eh2.d vendor/binutils/dist/ld/testsuite/ld-elf/eh3.d vendor/binutils/dist/ld/testsuite/ld-elf/elf.exp vendor/binutils/dist/ld/testsuite/ld-elf/group.ld vendor/binutils/dist/ld/testsuite/ld-elf/merge.d vendor/binutils/dist/ld/testsuite/ld-elf/orphan.d vendor/binutils/dist/ld/testsuite/ld-elf/orphan2.d vendor/binutils/dist/ld/testsuite/ld-elf/sec64k.exp vendor/binutils/dist/ld/testsuite/ld-elf/start.s vendor/binutils/dist/ld/testsuite/ld-elf/symbol1ref.s vendor/binutils/dist/ld/testsuite/ld-elfcomm/elfcomm.exp vendor/binutils/dist/ld/testsuite/ld-elfvers/vers.exp vendor/binutils/dist/ld/testsuite/ld-elfvers/vers1.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers15.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers16a.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers17.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers18.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers2.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers20.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers20a.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers21.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers22a.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers22b.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers23a.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers23b.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers23c.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers25a.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers26a.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers27a.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers27d.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers28b.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers29.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers30.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers31.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers4a.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers7a.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers8.ver vendor/binutils/dist/ld/testsuite/ld-elfvers/vers9.ver vendor/binutils/dist/ld/testsuite/ld-elfvsb/elfvsb.exp vendor/binutils/dist/ld/testsuite/ld-elfvsb/sh1.c vendor/binutils/dist/ld/testsuite/ld-elfvsb/sh2.c vendor/binutils/dist/ld/testsuite/ld-fastcall/fastcall.exp vendor/binutils/dist/ld/testsuite/ld-frv/fdpic-shared-6.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-dynamic-1.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-dynamic-2.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-dynamic-3.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-initial-shared-2.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-pie-1.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-pie-3.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-dynamic-1.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-dynamic-2.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-dynamic-3.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-initial-shared-2.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-pie-1.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-pie-3.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-shared-1.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-shared-2.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-shared-3.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-relax-static-3.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-shared-1.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-shared-2.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-shared-3.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-static-1.d vendor/binutils/dist/ld/testsuite/ld-frv/tls-static-3.d vendor/binutils/dist/ld/testsuite/ld-i386/combreloc.d vendor/binutils/dist/ld/testsuite/ld-i386/i386.exp vendor/binutils/dist/ld/testsuite/ld-i386/reloc.d vendor/binutils/dist/ld/testsuite/ld-i386/tlsbin.dd vendor/binutils/dist/ld/testsuite/ld-i386/tlsbin.rd vendor/binutils/dist/ld/testsuite/ld-i386/tlsbindesc.dd vendor/binutils/dist/ld/testsuite/ld-i386/tlsbindesc.rd vendor/binutils/dist/ld/testsuite/ld-i386/tlsdesc.dd vendor/binutils/dist/ld/testsuite/ld-i386/tlsdesc.rd vendor/binutils/dist/ld/testsuite/ld-i386/tlsdesc.sd vendor/binutils/dist/ld/testsuite/ld-i386/tlsgdesc.dd vendor/binutils/dist/ld/testsuite/ld-i386/tlsgdesc.rd vendor/binutils/dist/ld/testsuite/ld-i386/tlsnopic.dd vendor/binutils/dist/ld/testsuite/ld-i386/tlsnopic.rd vendor/binutils/dist/ld/testsuite/ld-i386/tlspic.dd vendor/binutils/dist/ld/testsuite/ld-i386/tlspic.rd vendor/binutils/dist/ld/testsuite/ld-i386/vxworks1-lib.rd vendor/binutils/dist/ld/testsuite/ld-i386/vxworks1.ld vendor/binutils/dist/ld/testsuite/ld-ia64/tlsbin.dd vendor/binutils/dist/ld/testsuite/ld-ia64/tlsbin.rd vendor/binutils/dist/ld/testsuite/ld-ia64/tlsbin.sd vendor/binutils/dist/ld/testsuite/ld-ia64/tlspic.rd vendor/binutils/dist/ld/testsuite/ld-linkonce/x.s vendor/binutils/dist/ld/testsuite/ld-linkonce/y.s vendor/binutils/dist/ld/testsuite/ld-linkonce/zeroeh.ld vendor/binutils/dist/ld/testsuite/ld-linkonce/zeroehl32.d vendor/binutils/dist/ld/testsuite/ld-m68k/m68k.exp vendor/binutils/dist/ld/testsuite/ld-m68k/merge-error-1a.d vendor/binutils/dist/ld/testsuite/ld-m68k/merge-error-1b.d vendor/binutils/dist/ld/testsuite/ld-m68k/merge-error-1c.d vendor/binutils/dist/ld/testsuite/ld-m68k/merge-error-1d.d vendor/binutils/dist/ld/testsuite/ld-m68k/merge-error-1e.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/branch-misc-1.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/eh-frame1-n32.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/eh-frame1-n64.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/eh-frame2-n32.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/eh-frame2-n64.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/elf-rel-got-n32.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/elf-rel-got-n64-linux.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/elf-rel-xgot-n32.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/elf-rel-xgot-n64-linux.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/jalbal.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/jaloverflow-2.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/mips-elf.exp vendor/binutils/dist/ld/testsuite/ld-mips-elf/multi-got-1.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/multi-got-no-shared.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/rel32-n32.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/rel32-o32.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/rel64.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/reloc-1-n64.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/textrel-1.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/tls-hidden3.r vendor/binutils/dist/ld/testsuite/ld-mips-elf/tls-hidden4.r vendor/binutils/dist/ld/testsuite/ld-mips-elf/tls-multi-got-1.got vendor/binutils/dist/ld/testsuite/ld-mips-elf/tls-multi-got-1.r vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.got vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlsdyn-o32.d vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlsdyn-o32.got vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlslib-o32-hidden.got vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlslib-o32-ver.got vendor/binutils/dist/ld/testsuite/ld-mips-elf/tlslib-o32.got vendor/binutils/dist/ld/testsuite/ld-mips-elf/vxworks1-lib.rd vendor/binutils/dist/ld/testsuite/ld-mips-elf/vxworks1.ld vendor/binutils/dist/ld/testsuite/ld-mips-elf/vxworks1.rd vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-1.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-10.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-11.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-14.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-16.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-17.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-18.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-19.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-2.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-22.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-3.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-4.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-5.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-6.d vendor/binutils/dist/ld/testsuite/ld-mmix/bpo-9.d vendor/binutils/dist/ld/testsuite/ld-mmix/bspec1.d vendor/binutils/dist/ld/testsuite/ld-mmix/bspec2.d vendor/binutils/dist/ld/testsuite/ld-mmix/greg-1.d vendor/binutils/dist/ld/testsuite/ld-mmix/greg-19.d vendor/binutils/dist/ld/testsuite/ld-mmix/greg-2.d vendor/binutils/dist/ld/testsuite/ld-mmix/greg-3.d vendor/binutils/dist/ld/testsuite/ld-mmix/greg-4.d vendor/binutils/dist/ld/testsuite/ld-mmix/greg-5.d vendor/binutils/dist/ld/testsuite/ld-mmix/greg-5s.d vendor/binutils/dist/ld/testsuite/ld-mmix/greg-6.d vendor/binutils/dist/ld/testsuite/ld-mmix/greg-7.d vendor/binutils/dist/ld/testsuite/ld-mmix/loc1.d vendor/binutils/dist/ld/testsuite/ld-mmix/loc2.d vendor/binutils/dist/ld/testsuite/ld-mmix/loc3.d vendor/binutils/dist/ld/testsuite/ld-mmix/loc4.d vendor/binutils/dist/ld/testsuite/ld-mmix/loc6.d vendor/binutils/dist/ld/testsuite/ld-mmix/local1.d vendor/binutils/dist/ld/testsuite/ld-mmix/local3.d vendor/binutils/dist/ld/testsuite/ld-mmix/local5.d vendor/binutils/dist/ld/testsuite/ld-mmix/local7.d vendor/binutils/dist/ld/testsuite/ld-mmix/locdo-1.d vendor/binutils/dist/ld/testsuite/ld-mmix/loct-1.d vendor/binutils/dist/ld/testsuite/ld-mmix/locto-1.d vendor/binutils/dist/ld/testsuite/ld-mmix/start-1.d vendor/binutils/dist/ld/testsuite/ld-mmix/undef-3.d vendor/binutils/dist/ld/testsuite/ld-pe/pe.exp vendor/binutils/dist/ld/testsuite/ld-pe/secrel.d vendor/binutils/dist/ld/testsuite/ld-powerpc/powerpc.exp vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsexe.d vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsexe.r vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsexe32.r vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsexetoc.d vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsexetoc.r vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsso.d vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsso.g vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsso.r vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsso32.d vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsso32.g vendor/binutils/dist/ld/testsuite/ld-powerpc/tlsso32.r vendor/binutils/dist/ld/testsuite/ld-powerpc/tlstocso.d vendor/binutils/dist/ld/testsuite/ld-powerpc/tlstocso.g vendor/binutils/dist/ld/testsuite/ld-powerpc/tlstocso.r vendor/binutils/dist/ld/testsuite/ld-powerpc/vxworks1-lib.rd vendor/binutils/dist/ld/testsuite/ld-powerpc/vxworks1.ld vendor/binutils/dist/ld/testsuite/ld-s390/tlsbin.rd vendor/binutils/dist/ld/testsuite/ld-s390/tlsbin_64.rd vendor/binutils/dist/ld/testsuite/ld-s390/tlspic.rd vendor/binutils/dist/ld/testsuite/ld-s390/tlspic_64.rd vendor/binutils/dist/ld/testsuite/ld-scripts/align.exp vendor/binutils/dist/ld/testsuite/ld-scripts/align2a.d vendor/binutils/dist/ld/testsuite/ld-scripts/assert.t vendor/binutils/dist/ld/testsuite/ld-scripts/cross3.t vendor/binutils/dist/ld/testsuite/ld-scripts/defined.exp vendor/binutils/dist/ld/testsuite/ld-scripts/empty-orphan.exp vendor/binutils/dist/ld/testsuite/ld-scripts/empty-orphan.t vendor/binutils/dist/ld/testsuite/ld-scripts/overlay-size.t vendor/binutils/dist/ld/testsuite/ld-scripts/phdrs.exp vendor/binutils/dist/ld/testsuite/ld-scripts/phdrs2.exp vendor/binutils/dist/ld/testsuite/ld-scripts/provide.exp vendor/binutils/dist/ld/testsuite/ld-scripts/script.exp vendor/binutils/dist/ld/testsuite/ld-scripts/weak.exp vendor/binutils/dist/ld/testsuite/ld-selective/selective.exp vendor/binutils/dist/ld/testsuite/ld-sh/arch/arch.exp vendor/binutils/dist/ld/testsuite/ld-sh/ld-r-1.d vendor/binutils/dist/ld/testsuite/ld-sh/rd-sh.exp vendor/binutils/dist/ld/testsuite/ld-sh/sh.exp vendor/binutils/dist/ld/testsuite/ld-sh/sh64/abi32.xd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/abi64.xd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/cmpct1.xd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/crange1.rd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/crange2.rd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/crange3-cmpct.rd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/crange3-media.rd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/crange3.rd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/crangerel1.rd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/crangerel2.rd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/mix1.xd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/mix2.xd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/rel32.xd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/rel64.xd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/reldl32.rd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/reldl64.rd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/shdl32.xd vendor/binutils/dist/ld/testsuite/ld-sh/sh64/shdl64.xd vendor/binutils/dist/ld/testsuite/ld-sh/shared-1.d vendor/binutils/dist/ld/testsuite/ld-sh/tlsbin-1.d vendor/binutils/dist/ld/testsuite/ld-sh/tlspic-1.d vendor/binutils/dist/ld/testsuite/ld-sh/tlspic-2.d vendor/binutils/dist/ld/testsuite/ld-sh/tlstpoff-1.d vendor/binutils/dist/ld/testsuite/ld-sparc/sparc.exp vendor/binutils/dist/ld/testsuite/ld-sparc/tlssunbin32.rd vendor/binutils/dist/ld/testsuite/ld-sparc/tlssunbin64.rd vendor/binutils/dist/ld/testsuite/ld-sparc/tlssunnopic32.rd vendor/binutils/dist/ld/testsuite/ld-sparc/tlssunnopic64.rd vendor/binutils/dist/ld/testsuite/ld-sparc/tlssunpic32.rd vendor/binutils/dist/ld/testsuite/ld-sparc/tlssunpic64.rd vendor/binutils/dist/ld/testsuite/ld-sparc/vxworks1-lib.rd vendor/binutils/dist/ld/testsuite/ld-sparc/vxworks1.ld vendor/binutils/dist/ld/testsuite/ld-srec/srec.exp vendor/binutils/dist/ld/testsuite/ld-undefined/undefined.exp vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsbin.dd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsbin.rd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsbin.sd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsbin.td vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsbindesc.dd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsbindesc.rd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsbindesc.sd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsbindesc.td vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsdesc.dd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsdesc.pd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsdesc.rd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsdesc.sd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsdesc.td vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsgdesc.dd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlsgdesc.rd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlspic.dd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlspic.rd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlspic.sd vendor/binutils/dist/ld/testsuite/ld-x86-64/tlspic.td vendor/binutils/dist/ld/testsuite/lib/ld-lib.exp vendor/binutils/dist/libiberty/ChangeLog vendor/binutils/dist/libiberty/Makefile.in vendor/binutils/dist/libiberty/aclocal.m4 vendor/binutils/dist/libiberty/argv.c vendor/binutils/dist/libiberty/bcopy.c vendor/binutils/dist/libiberty/choose-temp.c vendor/binutils/dist/libiberty/configure vendor/binutils/dist/libiberty/configure.ac vendor/binutils/dist/libiberty/cp-demangle.c vendor/binutils/dist/libiberty/cp-demangle.h vendor/binutils/dist/libiberty/cplus-dem.c vendor/binutils/dist/libiberty/floatformat.c vendor/binutils/dist/libiberty/functions.texi vendor/binutils/dist/libiberty/hashtab.c vendor/binutils/dist/libiberty/hex.c vendor/binutils/dist/libiberty/make-relative-prefix.c vendor/binutils/dist/libiberty/mkstemps.c vendor/binutils/dist/libiberty/pex-common.c vendor/binutils/dist/libiberty/pex-common.h vendor/binutils/dist/libiberty/pex-djgpp.c vendor/binutils/dist/libiberty/pex-msdos.c vendor/binutils/dist/libiberty/pex-unix.c vendor/binutils/dist/libiberty/pex-win32.c vendor/binutils/dist/libiberty/pexecute.txh vendor/binutils/dist/libiberty/strsignal.c vendor/binutils/dist/libiberty/testsuite/Makefile.in vendor/binutils/dist/libiberty/testsuite/demangle-expected vendor/binutils/dist/libiberty/testsuite/test-demangle.c vendor/binutils/dist/libtool.m4 vendor/binutils/dist/ltmain.sh vendor/binutils/dist/opcodes/ChangeLog vendor/binutils/dist/opcodes/Makefile.am vendor/binutils/dist/opcodes/Makefile.in vendor/binutils/dist/opcodes/aclocal.m4 vendor/binutils/dist/opcodes/arm-dis.c vendor/binutils/dist/opcodes/avr-dis.c vendor/binutils/dist/opcodes/cgen-types.h vendor/binutils/dist/opcodes/config.in vendor/binutils/dist/opcodes/configure vendor/binutils/dist/opcodes/configure.in vendor/binutils/dist/opcodes/cris-dis.c vendor/binutils/dist/opcodes/disassemble.c vendor/binutils/dist/opcodes/fr30-asm.c vendor/binutils/dist/opcodes/frv-asm.c vendor/binutils/dist/opcodes/frv-desc.c vendor/binutils/dist/opcodes/frv-desc.h vendor/binutils/dist/opcodes/h8300-dis.c vendor/binutils/dist/opcodes/i386-dis.c vendor/binutils/dist/opcodes/ia64-gen.c vendor/binutils/dist/opcodes/ip2k-asm.c vendor/binutils/dist/opcodes/iq2000-asm.c vendor/binutils/dist/opcodes/m32c-asm.c vendor/binutils/dist/opcodes/m32c-desc.c vendor/binutils/dist/opcodes/m32c-desc.h vendor/binutils/dist/opcodes/m32c-dis.c vendor/binutils/dist/opcodes/m32c-ibld.c vendor/binutils/dist/opcodes/m32c-opc.c vendor/binutils/dist/opcodes/m32c-opc.h vendor/binutils/dist/opcodes/m32r-asm.c vendor/binutils/dist/opcodes/m32r-dis.c vendor/binutils/dist/opcodes/m68hc11-dis.c vendor/binutils/dist/opcodes/m68k-dis.c vendor/binutils/dist/opcodes/m68k-opc.c vendor/binutils/dist/opcodes/mips-dis.c vendor/binutils/dist/opcodes/mips-opc.c vendor/binutils/dist/opcodes/mips16-opc.c vendor/binutils/dist/opcodes/mt-asm.c vendor/binutils/dist/opcodes/mt-ibld.c vendor/binutils/dist/opcodes/mt-opc.c vendor/binutils/dist/opcodes/ns32k-dis.c vendor/binutils/dist/opcodes/openrisc-asm.c vendor/binutils/dist/opcodes/po/Make-in vendor/binutils/dist/opcodes/po/POTFILES.in vendor/binutils/dist/opcodes/po/opcodes.pot vendor/binutils/dist/opcodes/ppc-dis.c vendor/binutils/dist/opcodes/ppc-opc.c vendor/binutils/dist/opcodes/s390-mkopc.c vendor/binutils/dist/opcodes/s390-opc.c vendor/binutils/dist/opcodes/s390-opc.txt vendor/binutils/dist/opcodes/sh-dis.c vendor/binutils/dist/opcodes/xc16x-asm.c vendor/binutils/dist/opcodes/xstormy16-asm.c vendor/binutils/dist/src-release Modified: vendor/binutils/dist/.cvsignore ============================================================================== --- vendor/binutils/dist/.cvsignore Sat Oct 30 23:01:11 2010 (r214570) +++ vendor/binutils/dist/.cvsignore Sat Oct 30 23:02:32 2010 (r214571) @@ -30,3 +30,4 @@ Makefile lost+found update.out update.sourceware +autom4te.cache Modified: vendor/binutils/dist/COPYING.LIBGLOSS ============================================================================== --- vendor/binutils/dist/COPYING.LIBGLOSS Sat Oct 30 23:01:11 2010 (r214570) +++ vendor/binutils/dist/COPYING.LIBGLOSS Sat Oct 30 23:02:32 2010 (r214571) @@ -1,101 +1,52 @@ The libgloss subdirectory is a collection of software from several sources. -Each have their own copyrights embedded in each file that they concern. -(1) University of California, Berkeley +Each file may have its own copyright/license that is embedded in the source +file. Unless otherwise noted in the body of the source file(s), the following copyright +notices will apply to the contents of the libgloss subdirectory: + +(1) Red Hat Incorporated + +Copyright (c) 1994-2006 Red Hat, Inc. All rights reserved. + +This copyrighted material is made available to anyone wishing to use, modify, +copy, or redistribute it subject to the terms and conditions of the BSD +License. This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties +of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license +is available at http://www.opensource.org/licenses. Any Red Hat trademarks that +are incorporated in the source code or documentation are not subject to the BSD +License and may only be used or replicated with the express permission of +Red Hat, Inc. -[1a] +(2) University of California, Berkeley -Copyright (c) 1990 The Regents of the University of California. +Copyright (c) 1981-2000 The Regents of the University of California. All rights reserved. -Redistribution and use in source and binary forms are permitted -provided that the above copyright notice and this paragraph are -duplicated in all such forms and that any documentation, -and other materials related to such distribution and use -acknowledge that the software was developed -by the University of California, Berkeley. The name of the -University may not be used to endorse or promote products derived -from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -[1b] - -Copyright (c) 1991, 2000 The Regents of the University of California. -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. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - -[1c] - -Copyright (c) 1991, 1998, 2001 The Regents of the University of California. -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. [rescinded 22 July 1999] -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * 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. + * Neither the name of the University nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - -------------------------------------------------------------- - Please note that in some of the above alternate licenses, there is a - statement regarding that acknowledgement must be made in any - advertising materials for products using the code. This restriction - no longer applies due to the following license change: - - ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change - - In some cases the defunct clause has been removed in modified newlib code and - in some cases, the clause has been left as-is. -------------------------------------------------------------- +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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. -(2) DJ Delorie +(3) DJ Delorie Copyright (C) 1993 DJ Delorie All rights reserved. @@ -107,7 +58,7 @@ duplicated in all such forms. This file is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -(3) GPL (fr30 directory only) +(4) GPL (fr30 directory only) Copyright (C) 1998 Free Software Foundation, Inc. Contributed by Cygnus Solutions. @@ -129,7 +80,7 @@ along with GNU CC; see the file COPYING. the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -(4) Advanced Micro Devices +(5) Advanced Micro Devices Copyright 1989, 1990 Advanced Micro Devices, Inc. @@ -155,7 +106,7 @@ Mail Stop 573 Austin, TX 78741 800-292-9263 -(5) Array Technology Corporation and MIPS (mips/lsi33k-stub.h) +(6) Array Technology Corporation and MIPS (mips/lsi33k-stub.h) COPYRIGHT (C) 1991, 1992 ARRAY TECHNOLOGY CORPORATION All Rights Reserved @@ -166,9 +117,8 @@ disclosure is subject to the terms of a Copyright 1985 by MIPS Computer Systems, Inc. -(6) University of Utah and the Computer Systems Laboratory (CSL) - [applies only to hppa*-*-pro* targets] - +(7) University of Utah and the Computer Systems Laboratory (CSL) + [applies only to hppa*-*-pro* targets] Copyright (c) 1990,1994 The University of Utah and the Computer Systems Laboratory (CSL). All rights reserved. @@ -187,22 +137,22 @@ ANY KIND FOR ANY DAMAGES WHATSOEVER RESU CSL requests users of this software to return to csl-dist@cs.utah.edu any improvements that they make and grant CSL redistribution rights. -(7) Sun Microsystems +(8) Sun Microsystems Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. +software is freely granted, provided that this notice is preserved. -(8) Hewlett Packard +(9) Hewlett Packard (c) Copyright 1986 HEWLETT-PACKARD COMPANY To anyone who acknowledges that this file is provided "AS IS" without any express or implied warranty: - permission to use, copy, modify, and distribute this file + +permission to use, copy, modify, and distribute this file for any purpose is hereby granted without fee, provided that the above copyright notice and this notice appears in all copies, and that the name of Hewlett-Packard Company not be @@ -211,7 +161,7 @@ of the software without specific, writte Hewlett-Packard Company makes no representations about the suitability of this software for any purpose. -(9) Hans-Peter Nilsson +(10) Hans-Peter Nilsson Copyright (C) 2001 Hans-Peter Nilsson @@ -224,74 +174,33 @@ IMPLIED WARRANTIES, INCLUDING, WITHOUT L WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -(10) No Copyright - -THIS SOFTWARE IS NOT COPYRIGHTED - -(11) Cygnus Support / Cygnus Solutions +(11) IBM Corp. spu processor (only spu-* targets) -Copyright (c) 1995, 1996, 1997, 1998, 1999 Cygnus Support +(C) Copyright IBM Corp. 2005, 2006 -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - ---------------------------------------------------------------- - Please note that the copyright above may be used with the name - Cygnus Solutions instead of Cygnus Support. Both names should - be considered interchangeable. These copyrights are now owned - by Red Hat Incorporated. ---------------------------------------------------------------- - -(12) Red Hat Incorporated - -Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -(13) Default copyright - -Unless otherwise stated in each remaining libgloss file, the remaining -files in the libgloss subdirectory are governed by the following copyright. - -Copyright (c) 1994, 1997, 2001, 2002 Red Hat Incorporated. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + * 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. + * Neither the name of IBM nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. - 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. - - The name of Red Hat Incorporated may not be used to endorse - or promote products derived from this software without specific - prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 RED HAT INCORPORATED 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. Modified: vendor/binutils/dist/COPYING.NEWLIB ============================================================================== --- vendor/binutils/dist/COPYING.NEWLIB Sat Oct 30 23:01:11 2010 (r214570) +++ vendor/binutils/dist/COPYING.NEWLIB Sat Oct 30 23:02:32 2010 (r214571) @@ -1,197 +1,53 @@ The newlib subdirectory is a collection of software from several sources. -Each file may have its own copyright/license that is embedded in the source -file. - -This list documents those licenses which are more restrictive than -a BSD-like license or require the copyright notice -to be duplicated in documentation and/or other materials associated with -the distribution. Certain licenses documented here only apply to -specific targets. Certain clauses only apply if you are building the -code as part of your binary. - -Note that this list may omit certain licenses that -only pertain to the copying/modifying of the individual source code. -If you are distributing the source code, then you do not need to -worry about these omitted licenses, so long as you do not modify the -copyright information already in place. - -(1) University of California, Berkeley - -[1a] - -Copyright (c) 1990 The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms are permitted -provided that the above copyright notice and this paragraph are -duplicated in all such forms and that any documentation, -and other materials related to such distribution and use -acknowledge that the software was developed -by the University of California, Berkeley. The name of the -University may not be used to endorse or promote products derived -from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -[1b] - -Copyright (c) 1990 The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms are permitted -provided that the above copyright notice and this paragraph are -duplicated in all such forms and that any documentation, -advertising materials, and other materials related to such -distribution and use acknowledge that the software was developed -by the University of California, Berkeley. The name of the -University may not be used to endorse or promote products derived -from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -[1c] - -Copyright (c) 1981, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 -The Regents of the University of California. -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. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - -[1d] - -Copyright (c) 1988, 1990, 1993 Regents of the University of California. -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 University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - -[1e] - -Copyright (c) 1982, 1986, 1989, 1991, 1993, 1994 -The Regents of the University of California. All rights reserved. -(c) UNIX System Laboratories, Inc. -All or some portions of this file are derived from material licensed -to the University of California by American Telephone and Telegraph -Co. or Unix System Laboratories, Inc. and are reproduced herein with -the permission of UNIX System Laboratories, Inc. - -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. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - -[1f] - -Copyright (c) 1987, 1988, 2000 Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms are permitted -provided that: (1) source distributions retain this entire copyright -notice and comment, and (2) distributions including binaries display -the following acknowledgement: ``This product includes software -developed by the University of California, Berkeley and its contributors'' -in the documentation or other materials provided with the distribution -and in all advertising materials mentioning features or use of this -software. Neither the name of the University nor the names of its -contributors may be used to endorse or promote products derived -from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -------------------------------------------------------------- - Please note that in some of the above alternate licenses, there is a - statement regarding that acknowledgement must be made in any - advertising materials for products using the code. This restriction - no longer applies due to the following license change: - - ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change +Each file may have its own copyright/license that is embedded in the source +file. Unless otherwise noted in the body of the source file(s), the following copyright +notices will apply to the contents of the newlib subdirectory: - In some cases the defunct clause has been removed in modified newlib code and - in some cases, the clause has been left as-is. -------------------------------------------------------------- +(1) Red Hat Incorporated -(2) Cygwin (cygwin targets only) +Copyright (c) 1994-2006 Red Hat, Inc. All rights reserved. -Copyright 2001 Red Hat, Inc. +This copyrighted material is made available to anyone wishing to use, +modify, copy, or redistribute it subject to the terms and conditions +of the BSD License. This program is distributed in the hope that +it will be useful, but WITHOUT ANY WARRANTY expressed or implied, +including the implied warranties of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. A copy of this license is available at +http://www.opensource.org/licenses. Any Red Hat trademarks that are +incorporated in the source code or documentation are not subject to +the BSD License and may only be used or replicated with the express +permission of Red Hat, Inc. + +(2) University of California, Berkeley + +Copyright (c) 1981-2000 The Regents of the University of California. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * 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. + * Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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. -(3) David M. Gay at AT&T +(3) David M. Gay (AT&T 1991, Lucent 1998) The author of this software is David M. Gay. @@ -208,6 +64,33 @@ WARRANTY. IN PARTICULAR, NEITHER THE AU REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. +------------------------------------------------------------------- + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + + (4) Advanced Micro Devices Copyright 1989, 1990 Advanced Micro Devices, Inc. @@ -253,8 +136,7 @@ Copyright (C) 1993 by Sun Microsystems, Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. +software is freely granted, provided that this notice is preserved. (8) Hewlett Packard @@ -335,7 +217,7 @@ provided this notice is not removed or a reserved by SuperH. SUPERH MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO -THIS SOFTWARE. IN NO EVENT SHALL SUPERH BE LIABLE FOR INDIRECT, SPECIAL, +THIS SOFTWARE. IN NO EVENT SHALL SUPERH BE LIABLE FOR INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR USE OF THIS SOFTWARE. @@ -351,7 +233,7 @@ USA (13) Royal Institute of Technology -Copyright (c) 1999 Kungliga Tekniska Högskolan +Copyright (c) 1999 Kungliga Tekniska Högskolan (Royal Institute of Technology, Stockholm, Sweden). All rights reserved. @@ -530,8 +412,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, O OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -(20) DJ Delorie (i386) - +(20) DJ Delorie (i386) Copyright (C) 1991 DJ Delorie All rights reserved. @@ -544,8 +425,7 @@ warranty of MERCHANTABILITY or FITNESS F (21) Free Software Foundation LGPL License (*-linux* targets only) - Copyright (C) 1990-1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright (C) 1990-1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. @@ -572,7 +452,7 @@ This program is free software; you can r modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -698,7 +578,7 @@ SUCH DAMAGE. iconv (Charset Conversion Library) v2.0 -(27) Artem Bityuckiy (--enable-newlib-iconv) +(28) Artem Bityuckiy (--enable-newlib-iconv) Copyright (c) 2003, Artem B. Bityuckiy, SoftMine Corporation. Rights transferred to Franklin Electronic Publishers. @@ -724,37 +604,37 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -(28) Red Hat Incorporated - -Unless otherwise stated in each remaining newlib file, the remaining -files in the newlib subdirectory default to the following copyright. -It should be noted that Red Hat Incorporated now owns copyrights -belonging to Cygnus Solutions and Cygnus Support. - -Copyright (c) 1994, 1997, 2001, 2002, 2003, 2004, 2005 Red Hat Incorporated. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +(29) IBM, Sony, Toshiba (only spu-* targets) - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + (C) Copyright 2001,2006, + International Business Machines Corporation, + Sony Computer Entertainment, Incorporated, + Toshiba Corporation, + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * 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. + * Neither the names of the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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. - 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. - - The name of Red Hat Incorporated may not be used to endorse - or promote products derived from this software without specific - prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 RED HAT INCORPORATED 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. Modified: vendor/binutils/dist/ChangeLog ============================================================================== --- vendor/binutils/dist/ChangeLog Sat Oct 30 23:01:11 2010 (r214570) +++ vendor/binutils/dist/ChangeLog Sat Oct 30 23:02:32 2010 (r214571) @@ -1,8 +1,691 @@ +2007-06-29 Bernd Schmidt + + * configure.ac: Don't add target-libmudflap to noconfigdirs for + uclinux and linux-uclibc targets. + * configure: Regenerate. + +2007-06-28 DJ Delorie + + * configure.ac (arm*-*-linux-gnueabi): Don't build libgloss if we're + not building newlib. + * configure: Regenerated. + +2007-06-22 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Correct typos. + +2007-06-18 Daniel Jacobowitz + + * Makefile.def: Add dependency from configure-gdb to all-bfd. + * Makefile.in: Regenerated. + +2007-06-14 Paolo Bonzini + + * Makefile.tpl (cleanstrap): Don't delete the toplevel Makefile. + (distclean-stage[+id+]): Possibly delete stage_last. + * Makefile.in: Regenerate. + +2007-06-07 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2007-06-07 Ben Elliston + + * Makefile.tpl: Fix spelling error. + * Makefile.in: Regenerate. + +2007-06-04 Paolo Bonzini + + Sync with gcc: + 2007-05-30 Jakub Jelinek + + PR bootstrap/29382 + * configure.ac: Don't use -fkeep-inline-functions for GCC < 3.3.1. + * configure: Rebuilt. + +2007-06-01 Steve Ellcey + + * libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set + lt_cv_sys_max_cmd_len. + +2007-05-31 Paolo Bonzini + + * ltgcc.m4: Update from GCC. + +2007-05-25 Andreas Tobler + + * ltmain.sh: Fix Darwin verstring, remove ${wl}. + +2007-05-24 Steve Ellcey + + * ltmain.sh: Update from GCC. + * libtool.m4: Update from GCC. + * ltsugar.m4: New. Update from GCC. + * ltversion.m4: New. Update from GCC. + * ltoptions.m4: New. Update from GCC. + * ltconfig: Remove. + * ltcf-c.sh: Remove. + * ltcf-cxx.sh: Remove. + * ltcf-gcj.sh: Remove. + * src-release: Update with new libtool file list. + +2007-05-16 Paolo Bonzini + + * Makefile.def (bootstrap_stage): Replace stage_make_flags with + stage_cflags. + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS, POSTSTAGE1_FLAGS_TO_PASS): + Remove CFLAGS/LIBCFLAGS. + (configure-stage[+id+]-[+prefix+][+module+], + all-stage[+id+]-[+prefix+][+module+]): Pass it from [+stage_cflags+]. + * Makefile.in: Regenerate. + +2007-04-14 Steve Ellcey + + * config-ml.in: Update from GCC. + +2007-04-09 Daniel Jacobowitz + + * src-release (do-proto-toplev): Process the support directories before + the tool directory. + +2007-03-21 Richard Sandiford + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix m4 quoting + of glob. Quote arguments with single quotes too. + * configure: Regenerate. + +2007-03-12 Brooks Moses + + * Makefile.def (fixincludes): Remove unneeded "missing" lines. + * Makefile.in: Regenerate + +2007-03-07 Andreas Schwab + + * configure: Regenerate. + +2007-03-01 Brooks Moses + + * configure.ac: Add "--with-pdfdir" configure option, + which defines pdfdir variable. + * Makefile.def (target=fixincludes): Add install-pdf to + missing targets. + (recursive_targets): Add install-pdf target. + (flags_to_pass): Add pdfdir. + * Makefile.tpl: Add pdfdir handling, add do-install-pdf + target. + * configure: Regenerate + * Makefile.in: Regenerate + +2007-02-28 Eric Christopher + + Revert: + 2006-12-07 Mike Stump + + * Makefile.def (dependencies): Add dependency for + install-target-libssp and install-target-libgomp on + install-gcc. + * Makefile.in: Regenerate. + +2007-02-27 Matt Kraai + + * configure: Regenerate. + * configure.ac: Move statements after variable declarations. + +2007-02-19 Joseph Myers + + * configure.ac: Adjust for loop syntax. + * configure: Regenerate. + +2007-02-18 Alexandre Oliva + + * configure: Rebuilt. + +2007-02-18 Alexandre Oliva + + * configure.ac: Drop multiple occurrences of --enable-languages, + and fix its quoting. + * configure: Rebuilt. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix quoting. + * configure: Regenerate. + +2007-02-13 Daniel Jacobowitz + + * configure.ac (target_libraries): Move libgcc before libiberty. + * configure: Regenerated. + +2007-02-13 Paolo Bonzini + + * configure: Regenerate again? + +2007-02-13 Paolo Bonzini + + * configure: Reapply PR30748 fix which was lost in the previous commit. + +2007-02-13 Daniel Jacobowitz + Paolo Bonzini + + PR bootstrap/30753 + * configure.ac: Remove obsolete build / host tests. Use AC_PROG_CC + unconditionally. Use AC_PROG_CXX. Use ACX_TOOL_DIRS to find $prefix. + * configure: Regenerated. + +2007-02-10 Paolo Bonzini + + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + PR bootstrap/30748 + * configure.ac: Correct syntax for Solaris ksh. + * configure: Regenerated. + +2007-02-09 Paolo Bonzini + + * Makefile.def: Sync with GCC. + * Makefile.tpl: Sync with GCC. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + * Makefile.tpl (build_alias, host_alias, target_alias): Use + noncanonical equivalents. + * configure.in: Rename to... + * configure.ac: ...this. Update AC_PREREQ. Prevent error for + AS_FOR_TARGET. Set build_noncanonical, host_noncanonical, and + target_noncanonical. Use them. Rewrite removal of configure + arguments for autoconf 2.59. Discard variable settings. Force + program_transform_name for native tools. + + * Makefile.in: Regenerated. + * configure: Regenerated with autoconf 2.59. + + * src-release (DEVO_SUPPORT, do-proto-toplev): Expect configure.ac. + +2007-02-08 Jeff Johnston + + * COPYING.LIBGLOSS: Reformat default Red Hat + license to fit within 80 columns. + * COPYING.NEWLIB: Ditto. + +2007-02-05 Dave Brolley + + * Contribute the following changes: + 2006-11-28 DJ Delorie + + * configure.in: Fix typo for mep's target_makefile_frag. + * configure: Regenerated. + + 2005-04-22 Richard Sandiford + + * configure.in (mep*): Add -mlibrary to FLAGS_FOR_TARGET. + * configure: Regenerate. + + 2001-09-19 DJ Delorie + + * configure.in (target_makefile_frag): use mt-mep + + 2001-06-12 Don Howard + + * configure.in: Remove gdb from MeP skip list. + + 2001-04-05 DJ Delorie + + * configure.in (noconfigdirs): Remove gcc from MeP skip list. + + 2001-03-20 Ben Elliston + + * configure.in (noconfigdirs): Add gcc and gdb for MeP. + + 2001-03-19 Ben Elliston + + * config.sub (mep, mep-*): Add. + +2007-01-31 Andreas Schwab + + * Makefile.tpl (LDFLAGS): Substitute it. + * Makefile.in: Regenerate. + +2007-01-11 Paolo Bonzini + + * configure.in: Change == to = in test command. + * configure: Regenerate. + +2007-01-11 Paolo Bonzini *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Oct 30 23:03: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 6E8CD1065670; Sat, 30 Oct 2010 23:03:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 430E98FC12; Sat, 30 Oct 2010 23:03: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 o9UN3XI1029474; Sat, 30 Oct 2010 23:03:33 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UN3XrI029472; Sat, 30 Oct 2010 23:03:33 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010302303.o9UN3XrI029472@svn.freebsd.org> From: Dimitry Andric Date: Sat, 30 Oct 2010 23:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214572 - svnadmin/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: Sat, 30 Oct 2010 23:03:33 -0000 Author: dim Date: Sat Oct 30 23:03:32 2010 New Revision: 214572 URL: http://svn.freebsd.org/changeset/base/214572 Log: Back down to normal limit. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sat Oct 30 23:02:32 2010 (r214571) +++ svnadmin/conf/sizelimit.conf Sat Oct 30 23:03:32 2010 (r214572) @@ -32,4 +32,3 @@ gonzo kmacy jb jeff -dim From owner-svn-src-all@FreeBSD.ORG Sat Oct 30 23:04: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 122B61065672; Sat, 30 Oct 2010 23:04:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA4B78FC16; Sat, 30 Oct 2010 23:04: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 o9UN4sxe029568; Sat, 30 Oct 2010 23:04:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UN4s9P029567; Sat, 30 Oct 2010 23:04:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010302304.o9UN4s9P029567@svn.freebsd.org> From: Dimitry Andric Date: Sat, 30 Oct 2010 23:04:54 +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: r214573 - vendor/binutils/binutils-master-20070703-075419 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2010 23:04:55 -0000 Author: dim Date: Sat Oct 30 23:04:54 2010 New Revision: 214573 URL: http://svn.freebsd.org/changeset/base/214573 Log: Tag the binutils master branch from the sourceware CVS repository, exactly as it was on Tue, 3 Jul 2007 07:54:19 +0000. Corresponds to git commit 397a64b350470350c8e0adb2af84439ea0f89272, which was the last commit before switching to GPLv3. Added: vendor/binutils/binutils-master-20070703-075419/ - copied from r214572, vendor/binutils/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Oct 30 23:07: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 9A753106564A; Sat, 30 Oct 2010 23:07:30 +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 8733E8FC15; Sat, 30 Oct 2010 23:07: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 o9UN7UhA029766; Sat, 30 Oct 2010 23:07:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UN7U2u029753; Sat, 30 Oct 2010 23:07:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010302307.o9UN7U2u029753@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 30 Oct 2010 23:07: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: r214574 - in head/sys/powerpc: aim include 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: Sat, 30 Oct 2010 23:07:30 -0000 Author: nwhitehorn Date: Sat Oct 30 23:07:30 2010 New Revision: 214574 URL: http://svn.freebsd.org/changeset/base/214574 Log: Restructure the way the copyin/copyout segment is stored to prevent a concurrency bug. Since all SLB/SR entries were invalidated during an exception, a decrementer exception could cause the user segment to be invalidated during a copyin()/copyout() without a thread switch that would cause it to be restored from the PCB, potentially causing the operation to continue on invalid memory. This is now handled by explicit restoration of segment 12 from the PCB on 32-bit systems and a check in the Data Segment Exception handler on 64-bit. While here, cause copyin()/copyout() to check whether the requested user segment is already installed, saving some pipeline flushes, and fix the synchronization primitives around the mtsr and slbmte instructions to prevent accessing stale segments. MFC after: 2 weeks Modified: head/sys/powerpc/aim/copyinout.c head/sys/powerpc/aim/slb.c head/sys/powerpc/aim/swtch64.S head/sys/powerpc/aim/trap.c head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/aim/vm_machdep.c head/sys/powerpc/include/pcb.h head/sys/powerpc/include/slb.h head/sys/powerpc/include/sr.h head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/genassym.c Modified: head/sys/powerpc/aim/copyinout.c ============================================================================== --- head/sys/powerpc/aim/copyinout.c Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/aim/copyinout.c Sat Oct 30 23:07:30 2010 (r214574) @@ -81,9 +81,7 @@ static __inline void set_user_sr(pmap_t pm, const void *addr) { struct slb *slb; - register_t esid, vsid, slb1, slb2; - - esid = USER_ADDR >> ADDR_SR_SHFT; + register_t slbv; /* Try lockless look-up first */ slb = user_va_to_slb_entry(pm, (vm_offset_t)addr); @@ -91,20 +89,21 @@ set_user_sr(pmap_t pm, const void *addr) if (slb == NULL) { /* If it isn't there, we need to pre-fault the VSID */ PMAP_LOCK(pm); - vsid = va_to_vsid(pm, (vm_offset_t)addr); + slbv = va_to_vsid(pm, (vm_offset_t)addr) << SLBV_VSID_SHIFT; PMAP_UNLOCK(pm); } else { - vsid = slb->slbv >> SLBV_VSID_SHIFT; + slbv = slb->slbv; } - slb1 = vsid << SLBV_VSID_SHIFT; - slb2 = (esid << SLBE_ESID_SHIFT) | SLBE_VALID | USER_SR; + /* If we have already set this VSID, we can just return */ + if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == slbv) + return; + __asm __volatile ("isync; slbie %0; slbmte %1, %2; isync" :: + "r"(USER_ADDR), "r"(slbv), "r"(USER_SLB_SLBE)); curthread->td_pcb->pcb_cpu.aim.usr_segm = (uintptr_t)addr >> ADDR_SR_SHFT; - __asm __volatile ("slbie %0; slbmte %1, %2" :: "r"(esid << 28), - "r"(slb1), "r"(slb2)); - isync(); + curthread->td_pcb->pcb_cpu.aim.usr_vsid = slbv; } #else static __inline void @@ -114,9 +113,13 @@ set_user_sr(pmap_t pm, const void *addr) vsid = va_to_vsid(pm, (vm_offset_t)addr); - isync(); - __asm __volatile ("mtsr %0,%1" :: "n"(USER_SR), "r"(vsid)); - isync(); + /* If we have already set this VSID, we can just return */ + if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == vsid) + return; + + __asm __volatile ("sync; mtsr %0,%1; sync; isync" :: "n"(USER_SR), + "r"(vsid)); + curthread->td_pcb->pcb_cpu.aim.usr_vsid = vsid; } #endif Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/aim/slb.c Sat Oct 30 23:07:30 2010 (r214574) @@ -200,7 +200,7 @@ kernel_va_to_slbv(vm_offset_t va) esid = (uintptr_t)va >> ADDR_SR_SHFT; /* Set kernel VSID to deterministic value */ - slbv = va_to_vsid(kernel_pmap, va) << SLBV_VSID_SHIFT; + slbv = (KERNEL_VSID((uintptr_t)va >> ADDR_SR_SHFT)) << SLBV_VSID_SHIFT; /* Figure out if this is a large-page mapping */ if (hw_direct_map && va < VM_MIN_KERNEL_ADDRESS) { @@ -421,19 +421,19 @@ slb_insert_kernel(uint64_t slbe, uint64_ slbcache = PCPU_GET(slb); - /* Check for an unused slot, abusing the USER_SR slot as a full flag */ - if (slbcache[USER_SR].slbe == 0) { - for (i = 0; i < USER_SR; i++) { + /* Check for an unused slot, abusing the user slot as a full flag */ + if (slbcache[USER_SLB_SLOT].slbe == 0) { + for (i = 0; i < USER_SLB_SLOT; i++) { if (!(slbcache[i].slbe & SLBE_VALID)) goto fillkernslb; } - if (i == USER_SR) - slbcache[USER_SR].slbe = 1; + if (i == USER_SLB_SLOT) + slbcache[USER_SLB_SLOT].slbe = 1; } for (i = mftb() % 64, j = 0; j < 64; j++, i = (i+1) % 64) { - if (i == USER_SR) + if (i == USER_SLB_SLOT) continue; if (SLB_SPILLABLE(slbcache[i].slbe)) Modified: head/sys/powerpc/aim/swtch64.S ============================================================================== --- head/sys/powerpc/aim/swtch64.S Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/aim/swtch64.S Sat Oct 30 23:07:30 2010 (r214574) @@ -110,13 +110,10 @@ ENTRY(cpu_switch) std %r1,PCB_SP(%r6) /* Save the stack pointer */ std %r2,PCB_TOC(%r6) /* Save the TOC pointer */ - li %r14,0 /* Save USER_SR for copyin/out */ - li %r15,0 - li %r16,USER_SR - slbmfee %r14, %r16 + li %r15,0 /* Save user segment for copyin/out */ + li %r16,USER_SLB_SLOT slbmfev %r15, %r16 isync - std %r14,PCB_AIM_USR_ESID(%r6) std %r15,PCB_AIM_USR_VSID(%r6) mr %r14,%r3 /* Copy the old thread ptr... */ @@ -221,14 +218,17 @@ blocked_loop: ld %r1,PCB_SP(%r3) /* Load the stack pointer */ ld %r2,PCB_TOC(%r3) /* Load the TOC pointer */ - lis %r5,USER_ADDR@highesta /* Load the USER_SR segment reg */ + lis %r5,USER_ADDR@highesta /* Load the copyin/out segment reg */ ori %r5,%r5,USER_ADDR@highera sldi %r5,%r5,32 oris %r5,%r5,USER_ADDR@ha slbie %r5 + lis %r6,USER_SLB_SLBE@highesta + ori %r6,%r6,USER_SLB_SLBE@highera + sldi %r6,%r6,32 + oris %r6,%r6,USER_SLB_SLBE@ha + ori %r6,%r6,USER_SLB_SLBE@l ld %r5,PCB_AIM_USR_VSID(%r3) - ld %r6,PCB_AIM_USR_ESID(%r3) - ori %r6,%r6,USER_SR slbmte %r5,%r6 isync Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/aim/trap.c Sat Oct 30 23:07:30 2010 (r214574) @@ -249,8 +249,16 @@ trap(struct trapframe *frame) return; break; #ifdef __powerpc64__ - case EXC_ISE: case EXC_DSE: + if ((frame->cpu.aim.dar & SEGMENT_MASK) == USER_ADDR) { + __asm __volatile ("slbmte %0, %1" :: + "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), + "r"(USER_SLB_SLBE)); + return; + } + + /* FALLTHROUGH */ + case EXC_ISE: if (handle_slb_spill(kernel_pmap, (type == EXC_ISE) ? frame->srr0 : frame->cpu.aim.dar) != 0) Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/aim/trap_subr32.S Sat Oct 30 23:07:30 2010 (r214574) @@ -54,7 +54,7 @@ lwz sr,9*4(pmap); mtsr 9,sr; \ lwz sr,10*4(pmap); mtsr 10,sr; \ lwz sr,11*4(pmap); mtsr 11,sr; \ - lwz sr,12*4(pmap); mtsr 12,sr; \ + /* Skip segment 12 (USER_SR), which is restored differently */ \ lwz sr,13*4(pmap); mtsr 13,sr; \ lwz sr,14*4(pmap); mtsr 14,sr; \ lwz sr,15*4(pmap); mtsr 15,sr; isync; @@ -66,7 +66,9 @@ GET_CPUINFO(pmap); \ lwz pmap,PC_CURPMAP(pmap); \ lwzu sr,PM_SR(pmap); \ - RESTORE_SRS(pmap,sr) + RESTORE_SRS(pmap,sr) \ + /* Restore SR 12 */ \ + lwz sr,12*4(pmap); mtsr 12,sr /* * Kernel SRs are loaded directly from kernel_pmap_ @@ -537,6 +539,11 @@ u_trap: */ k_trap: FRAME_SETUP(PC_TEMPSAVE) + /* Restore USER_SR */ + GET_CPUINFO(%r30) + lwz %r30,PC_CURPCB(%r30) + lwz %r30,PCB_AIM_USR_VSID(%r30) + mtsr USER_SR,%r30; sync; isync /* Call C interrupt dispatcher: */ trapagain: addi %r3,%r1,8 Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/aim/trap_subr64.S Sat Oct 30 23:07:30 2010 (r214574) @@ -99,7 +99,7 @@ instkernslb: addi %r28, %r28, 16; /* Advance pointer */ addi %r29, %r29, 1; - cmpli 0, %r29, USER_SR; /* Repeat if we are not at the end */ + cmpli 0, %r29, USER_SLB_SLOT; /* Repeat if we are not at the end */ blt instkernslb; blr; Modified: head/sys/powerpc/aim/vm_machdep.c ============================================================================== --- head/sys/powerpc/aim/vm_machdep.c Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/aim/vm_machdep.c Sat Oct 30 23:07:30 2010 (r214574) @@ -197,7 +197,6 @@ cpu_fork(struct thread *td1, struct proc pcb->pcb_lr = (register_t)fork_trampoline; #endif pcb->pcb_cpu.aim.usr_vsid = 0; - pcb->pcb_cpu.aim.usr_esid = 0; /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/include/pcb.h Sat Oct 30 23:07:30 2010 (r214574) @@ -67,7 +67,6 @@ struct pcb { union { struct { vm_offset_t usr_segm; /* Base address */ - register_t usr_esid; /* USER_SR segment */ register_t usr_vsid; /* USER_SR segment */ } aim; struct { Modified: head/sys/powerpc/include/slb.h ============================================================================== --- head/sys/powerpc/include/slb.h Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/include/slb.h Sat Oct 30 23:07:30 2010 (r214574) @@ -62,6 +62,13 @@ #define SLBE_ESID_MASK 0xfffffffff0000000UL /* Effective segment ID mask */ #define SLBE_ESID_SHIFT 28 +/* + * User segment for copyin/out + */ +#define USER_SLB_SLOT 63 +#define USER_SLB_SLBE (((USER_ADDR >> ADDR_SR_SHFT) << SLBE_ESID_SHIFT) | \ + SLBE_VALID | USER_SLB_SLOT) + struct slb { uint64_t slbv; uint64_t slbe; Modified: head/sys/powerpc/include/sr.h ============================================================================== --- head/sys/powerpc/include/sr.h Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/include/sr.h Sat Oct 30 23:07:30 2010 (r214574) @@ -42,11 +42,7 @@ #define SR_VSID_MASK 0x00ffffff /* Virtual Segment ID mask */ /* Kernel segment register usage */ -#ifdef __powerpc64__ -#define USER_SR 63 -#else #define USER_SR 12 -#endif #define KERNEL_SR 13 #define KERNEL2_SR 14 #define KERNEL3_SR 15 Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/powerpc/exec_machdep.c Sat Oct 30 23:07:30 2010 (r214574) @@ -986,7 +986,6 @@ cpu_set_upcall(struct thread *td, struct pcb2->pcb_lr = (register_t)fork_trampoline; #endif pcb2->pcb_cpu.aim.usr_vsid = 0; - pcb2->pcb_cpu.aim.usr_esid = 0; /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Sat Oct 30 23:04:54 2010 (r214573) +++ head/sys/powerpc/powerpc/genassym.c Sat Oct 30 23:07:30 2010 (r214574) @@ -103,13 +103,15 @@ ASSYM(TLBSAVE_BOOKE_R31, TLBSAVE_BOOKE_R ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock)); #if defined(AIM) -ASSYM(USER_SR, USER_SR); ASSYM(USER_ADDR, USER_ADDR); #ifdef __powerpc64__ ASSYM(PC_KERNSLB, offsetof(struct pcpu, pc_slb)); ASSYM(PC_USERSLB, offsetof(struct pcpu, pc_userslb)); +ASSYM(USER_SLB_SLOT, USER_SLB_SLOT); +ASSYM(USER_SLB_SLBE, USER_SLB_SLBE); #else ASSYM(PM_SR, offsetof(struct pmap, pm_sr)); +ASSYM(USER_SR, USER_SR); #endif #elif defined(E500) ASSYM(PM_PDIR, offsetof(struct pmap, pm_pdir)); @@ -187,7 +189,6 @@ ASSYM(PCB_FLAGS, offsetof(struct pcb, pc ASSYM(PCB_FPU, PCB_FPU); ASSYM(PCB_VEC, PCB_VEC); -ASSYM(PCB_AIM_USR_ESID, offsetof(struct pcb, pcb_cpu.aim.usr_esid)); ASSYM(PCB_AIM_USR_VSID, offsetof(struct pcb, pcb_cpu.aim.usr_vsid)); ASSYM(PCB_BOOKE_CTR, offsetof(struct pcb, pcb_cpu.booke.ctr)); ASSYM(PCB_BOOKE_XER, offsetof(struct pcb, pcb_cpu.booke.xer)); From owner-svn-src-all@FreeBSD.ORG Sat Oct 30 23:09: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 7A5E81065673; Sat, 30 Oct 2010 23:09:56 +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 4DFEB8FC14; Sat, 30 Oct 2010 23:09: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 o9UN9uqn029906; Sat, 30 Oct 2010 23:09:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UN9uA7029904; Sat, 30 Oct 2010 23:09:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010302309.o9UN9uA7029904@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 30 Oct 2010 23:09: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: r214575 - 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: Sat, 30 Oct 2010 23:09:56 -0000 Author: nwhitehorn Date: Sat Oct 30 23:09:56 2010 New Revision: 214575 URL: http://svn.freebsd.org/changeset/base/214575 Log: Allow access to the HT I/O port space on the IBM CPC9X5 northbridge chips. MFC after: 2 weeks Modified: head/sys/powerpc/powermac/cpcht.c Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Sat Oct 30 23:07:30 2010 (r214574) +++ head/sys/powerpc/powermac/cpcht.c Sat Oct 30 23:09:56 2010 (r214575) @@ -162,6 +162,7 @@ struct cpcht_softc { vm_offset_t sc_data; uint64_t sc_populated_slots; struct rman sc_mem_rman; + struct rman sc_io_rman; struct cpcht_irq htirq_map[128]; struct mtx htirq_mtx; @@ -177,6 +178,9 @@ static devclass_t cpcht_devclass; DRIVER_MODULE(cpcht, nexus, cpcht_driver, cpcht_devclass, 0, 0); +#define CPCHT_IOPORT_BASE 0xf4000000UL /* Hardwired */ +#define CPCHT_IOPORT_SIZE 0x00400000UL + #define HTAPIC_REQUEST_EOI 0x20 #define HTAPIC_TRIGGER_LEVEL 0x02 #define HTAPIC_MASK 0x01 @@ -236,7 +240,14 @@ cpcht_attach(device_t dev) sc->sc_mem_rman.rm_type = RMAN_ARRAY; sc->sc_mem_rman.rm_descr = "CPCHT Device Memory"; error = rman_init(&sc->sc_mem_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + return (error); + } + sc->sc_io_rman.rm_type = RMAN_ARRAY; + sc->sc_io_rman.rm_descr = "CPCHT I/O Memory"; + error = rman_init(&sc->sc_io_rman); if (error) { device_printf(dev, "rman_init() failed. error = %d\n", error); return (error); @@ -248,6 +259,9 @@ cpcht_attach(device_t dev) * where we get the HT interrupts properties. */ + /* I/O port mappings are usually not in the device tree */ + rman_manage_region(&sc->sc_io_rman, 0, CPCHT_IOPORT_SIZE - 1); + bzero(sc->htirq_map, sizeof(sc->htirq_map)); mtx_init(&sc->htirq_mtx, "cpcht irq", NULL, MTX_DEF); for (i = 0; i < 8; i++) @@ -299,6 +313,9 @@ cpcht_configure_htbridge(device_t dev, p case OFW_PCI_PHYS_HI_SPACE_CONFIG: break; case OFW_PCI_PHYS_HI_SPACE_IO: + rman_manage_region(&sc->sc_io_rman, rp->pci_lo, + rp->pci_lo + rp->size_lo - 1); + break; case OFW_PCI_PHYS_HI_SPACE_MEM32: rman_manage_region(&sc->sc_mem_rman, rp->pci_lo, rp->pci_lo + rp->size_lo - 1); @@ -507,8 +524,9 @@ cpcht_alloc_resource(device_t bus, devic switch (type) { case SYS_RES_IOPORT: end = min(end, start + count); + rm = &sc->sc_io_rman; + break; - /* FALLTHROUGH */ case SYS_RES_MEMORY: rm = &sc->sc_mem_rman; break; @@ -562,6 +580,9 @@ cpcht_activate_resource(device_t bus, de start = (vm_offset_t)rman_get_start(res); + if (type == SYS_RES_IOPORT) + start += CPCHT_IOPORT_BASE; + if (bootverbose) printf("cpcht mapdev: start %zx, len %ld\n", start, rman_get_size(res)); From owner-svn-src-all@FreeBSD.ORG Sat Oct 30 23:49: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 75DE9106564A; Sat, 30 Oct 2010 23:49:37 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 644908FC08; Sat, 30 Oct 2010 23:49: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 o9UNnb4u031858; Sat, 30 Oct 2010 23:49:37 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9UNnbJ8031856; Sat, 30 Oct 2010 23:49:37 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201010302349.o9UNnbJ8031856@svn.freebsd.org> From: Alan Cox Date: Sat, 30 Oct 2010 23:49: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: r214576 - 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: Sat, 30 Oct 2010 23:49:37 -0000 Author: alc Date: Sat Oct 30 23:49:37 2010 New Revision: 214576 URL: http://svn.freebsd.org/changeset/base/214576 Log: Add another safety belt to pmap_demote_DMAP(). Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Oct 30 23:09:56 2010 (r214575) +++ head/sys/amd64/amd64/pmap.c Sat Oct 30 23:49:37 2010 (r214576) @@ -4973,7 +4973,7 @@ pmap_demote_DMAP(vm_paddr_t base, vm_siz KASSERT(powerof2(len), ("pmap_demote_DMAP: len is not a power of 2")); KASSERT((base & (len - 1)) == 0, ("pmap_demote_DMAP: base is not a multiple of len")); - if (len < NBPDP) { + if (len < NBPDP && base < dmaplimit) { va = PHYS_TO_DMAP(base); changed = FALSE; PMAP_LOCK(kernel_pmap);